From 1f6c78669e796004d72410c6d0fb0d12f1224216 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 7 Apr 2019 17:51:25 +0200 Subject: [PATCH 001/355] Generator: API: Add description for the "scripts_painless_context" API (cherry picked from commit 1acc5cd2236c4be0b3dcd6a6fa178a9921582f19) --- internal/cmd/generate/commands/gensource/descriptions.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/cmd/generate/commands/gensource/descriptions.go b/internal/cmd/generate/commands/gensource/descriptions.go index 3307e341f5..ece5cc3732 100755 --- a/internal/cmd/generate/commands/gensource/descriptions.go +++ b/internal/cmd/generate/commands/gensource/descriptions.go @@ -529,6 +529,11 @@ scripts_painless_execute: description: |- Allows an arbitrary script to be executed and a result to be returned +scripts_painless_context: + # https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html + description: |- + Allows to query context information. + scroll: # http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html description: |- From 2b80c2ad88e3ef8371f5b1d6cfef63e4e2646526 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 7 Apr 2019 18:27:46 +0200 Subject: [PATCH 002/355] Generator: Tests: Properly parse timeout values (cherry picked from commit b8a742840f83d74dcdcf86e8d094fe57a09cdaa6) --- internal/cmd/generate/commands/gentests/generator.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/cmd/generate/commands/gentests/generator.go b/internal/cmd/generate/commands/gentests/generator.go index 20d3cec655..8710f87ce6 100755 --- a/internal/cmd/generate/commands/gentests/generator.go +++ b/internal/cmd/generate/commands/gentests/generator.go @@ -13,6 +13,7 @@ import ( "regexp" "strconv" "strings" + "time" "golang.org/x/tools/imports" ) @@ -600,8 +601,13 @@ func (g *Generator) genAction(a Action, skipBody ...bool) { case "[]string": value = `[]string{` + fmt.Sprintf("%q", v) + `}` case "time.Duration": - re := regexp.MustCompile("^(\\d+).*") - value = re.ReplaceAllString(fmt.Sprintf("%s", v), "$1") + // re := regexp.MustCompile("^(\\d+).*") + // value = re.ReplaceAllString(fmt.Sprintf("%s", v), "$1") + dur, err := time.ParseDuration(v.(string)) + if err != nil { + panic(fmt.Sprintf("Cannot parse duration [%s]: %s", v, err)) + } + value = fmt.Sprintf("%d", dur.Nanoseconds()) default: value = fmt.Sprintf("%q", v) } From 9247b7e60f0544402ae9c50e48eacf8405099ea5 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 7 Apr 2019 18:28:15 +0200 Subject: [PATCH 003/355] Generator: Tests: Update the list of skipped tests * "Indices Shrink" APIs * "Indices Split", Copy Settings (cherry picked from commit efa0782a66b6e9c6284f47d890fba41e22aed1b9) --- internal/cmd/generate/commands/gentests/skips.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/cmd/generate/commands/gentests/skips.go b/internal/cmd/generate/commands/gentests/skips.go index 98d9562e9e..4a0962e3e3 100755 --- a/internal/cmd/generate/commands/gentests/skips.go +++ b/internal/cmd/generate/commands/gentests/skips.go @@ -56,6 +56,12 @@ nodes.stats/30_discovery.yml: nodes.discovery/30_discovery.yml: - Discovery stats +# Arbitrary key +indices.shrink/10_basic.yml: +indices.shrink/20_source_mapping.yml: +indices.shrink/30_copy_settings.yml: +indices.split/30_copy_settings.yml: + # Parsed response is YAML: value is map[interface {}]interface {}, not map[string]interface {} cat.aliases/20_headers.yml: - Simple alias with yaml body through Accept header From 11eadd5d2b12ac163b24aafbab743821d2bf8cb6 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 8 Apr 2019 11:15:14 +0200 Subject: [PATCH 004/355] Update the package import path to use a "v7" suffix Using the "Major Branch" approach as per https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher (cherry picked from commit 2215238b014f12a8650935f36d59a1d57335342e) --- Makefile | 4 ++-- README.md | 12 ++++++------ _examples/bulk/bulk.go | 4 ++-- _examples/cloudfunction/function.go | 4 ++-- _examples/cloudfunction/function_test.go | 4 ++-- _examples/cloudfunction/go.mod | 6 +++--- _examples/configuration.go | 2 +- _examples/customization.go | 2 +- _examples/encoding/benchmark_test.go | 2 +- _examples/encoding/easyjson.go | 6 +++--- _examples/encoding/gjson.go | 2 +- _examples/encoding/go.mod | 8 ++++---- _examples/fasthttp/cmd/main.go | 4 ++-- _examples/fasthttp/fasthttp_benchmark_test.go | 4 ++-- _examples/fasthttp/go.mod | 6 +++--- _examples/instrumentation/apmelasticsearch.go | 2 +- _examples/instrumentation/go.mod | 6 ++++-- _examples/instrumentation/opencensus.go | 2 +- _examples/logging/custom.go | 2 +- _examples/logging/default.go | 4 ++-- _examples/logging/go.mod | 6 +++--- _examples/main.go | 4 ++-- _examples/xkcdsearch/cmd/xkcd/commands/index.go | 4 ++-- _examples/xkcdsearch/cmd/xkcd/commands/search.go | 4 ++-- _examples/xkcdsearch/cmd/xkcd/commands/server.go | 4 ++-- _examples/xkcdsearch/cmd/xkcd/main.go | 2 +- _examples/xkcdsearch/go.mod | 6 +++--- _examples/xkcdsearch/store.go | 4 ++-- _examples/xkcdsearch/store_test.go | 4 ++-- _examples/xkcdsearch/xkcd.go | 2 +- elasticsearch.go | 8 ++++---- elasticsearch_benchmark_test.go | 4 ++-- elasticsearch_example_test.go | 6 +++--- elasticsearch_integration_test.go | 6 +++--- elasticsearch_internal_test.go | 2 +- esapi/doc.go | 4 ++-- esapi/esapi.go | 4 ++-- esapi/esapi.response_example_test.go | 2 +- esapi/esapi_benchmark_test.go | 4 ++-- esapi/esapi_integration_test.go | 2 +- esapi/test/go.mod | 6 +++--- estransport/estransport.go | 4 ++-- estransport/estransport_benchmark_test.go | 2 +- estransport/estransport_integration_test.go | 2 +- estransport/logger_benchmark_test.go | 2 +- go.mod | 2 +- internal/cmd/generate/commands/commands.go | 2 +- internal/cmd/generate/commands/gensource/command.go | 4 ++-- internal/cmd/generate/commands/gensource/debug.go | 2 +- .../cmd/generate/commands/gensource/generator.go | 2 +- .../generate/commands/gensource/generator_test.go | 2 +- internal/cmd/generate/commands/gensource/model.go | 2 +- internal/cmd/generate/commands/gentests/command.go | 4 ++-- internal/cmd/generate/commands/gentests/debug.go | 2 +- .../generate/commands/gentests/gen_api_registry.go | 2 +- internal/cmd/generate/commands/gentests/generator.go | 4 ++-- internal/cmd/generate/commands/gentests/model.go | 2 +- internal/cmd/generate/go.mod | 6 +++--- internal/cmd/generate/go.sum | 10 ---------- internal/cmd/generate/main.go | 6 +++--- 60 files changed, 114 insertions(+), 122 deletions(-) diff --git a/Makefile b/Makefile index 1bf6a503ea..76eb6ba761 100755 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ test-integ: ## Run integration tests ifdef race $(eval testintegargs += "-race") endif - $(eval testintegargs += "-cover" "-coverprofile=tmp/integration-client.cov" "-tags='integration'" "-timeout=1h" "github.com/elastic/go-elasticsearch" "github.com/elastic/go-elasticsearch/estransport") + $(eval testintegargs += "-cover" "-coverprofile=tmp/integration-client.cov" "-tags='integration'" "-timeout=1h" "github.com/elastic/go-elasticsearch/v7" "github.com/elastic/go-elasticsearch/v7/estransport") @mkdir -p tmp @if which gotestsum > /dev/null 2>&1 ; then \ echo "gotestsum --format=short-verbose --junitfile=tmp/integration-report.xml --" $(testintegargs); \ @@ -35,7 +35,7 @@ test-api: ## Run generated API integration tests ifdef race $(eval testapiargs += "-race") endif - $(eval testapiargs += "-cover" "-coverpkg=github.com/elastic/go-elasticsearch/esapi" "-coverprofile=$(PWD)/tmp/integration-api.cov" "-tags='integration'" "-timeout=1h" "./...") + $(eval testapiargs += "-cover" "-coverpkg=github.com/elastic/go-elasticsearch/v7/esapi" "-coverprofile=$(PWD)/tmp/integration-api.cov" "-tags='integration'" "-timeout=1h" "./...") @mkdir -p tmp @if which gotestsum > /dev/null 2>&1 ; then \ echo "cd esapi/test && gotestsum --format=short-verbose --junitfile=$(PWD)/tmp/integration-api-report.xml --" $(testapiargs); \ diff --git a/README.md b/README.md index 5fdcd380e1..97daa00f15 100755 --- a/README.md +++ b/README.md @@ -21,11 +21,11 @@ We encourage you to try the package in your projects, just keep these caveats in Install the package with `go get`: - go get -u github.com/elastic/go-elasticsearch + go get -u github.com/elastic/go-elasticsearch@master Or, add the package to your `go.mod` file: - require github.com/elastic/go-elasticsearch master + require github.com/elastic/go-elasticsearch/v7 master Or, clone the repository: @@ -39,7 +39,7 @@ mkdir my-elasticsearch-app && cd my-elasticsearch-app cat > go.mod <<-END module my-elasticsearch-app - require github.com/elastic/go-elasticsearch master + require github.com/elastic/go-elasticsearch/v7 master END cat > main.go <<-END @@ -48,7 +48,7 @@ cat > main.go <<-END import ( "log" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" ) func main() { @@ -144,8 +144,8 @@ import ( "strings" "sync" - "github.com/elastic/go-elasticsearch" - "github.com/elastic/go-elasticsearch/esapi" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" ) func main() { diff --git a/_examples/bulk/bulk.go b/_examples/bulk/bulk.go index ebeca1fc25..2368ba634c 100644 --- a/_examples/bulk/bulk.go +++ b/_examples/bulk/bulk.go @@ -26,8 +26,8 @@ import ( "strings" "time" - "github.com/elastic/go-elasticsearch" - "github.com/elastic/go-elasticsearch/esapi" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" ) type Article struct { diff --git a/_examples/cloudfunction/function.go b/_examples/cloudfunction/function.go index b022d0b501..c69efe76f8 100755 --- a/_examples/cloudfunction/function.go +++ b/_examples/cloudfunction/function.go @@ -14,7 +14,7 @@ // // $ curl https://...cloudfunctions.net/clusterstatus // -package clusterstatus // import "github.com/elastic/go-elasticsearch/_examples/clusterstatus" +package clusterstatus // import "github.com/elastic/go-elasticsearch/v7/_examples/clusterstatus" import ( "encoding/json" @@ -22,7 +22,7 @@ import ( "log" "net/http" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" ) // ES holds a reference to the Elasticsearch client diff --git a/_examples/cloudfunction/function_test.go b/_examples/cloudfunction/function_test.go index b6f3817a94..05d979117e 100755 --- a/_examples/cloudfunction/function_test.go +++ b/_examples/cloudfunction/function_test.go @@ -8,9 +8,9 @@ import ( "strings" "testing" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" - "github.com/elastic/go-elasticsearch/_examples/clusterstatus" + "github.com/elastic/go-elasticsearch/v7/_examples/clusterstatus" ) // Mock transport replaces the HTTP transport for tests diff --git a/_examples/cloudfunction/go.mod b/_examples/cloudfunction/go.mod index f381f50545..0e4dfcf7a3 100644 --- a/_examples/cloudfunction/go.mod +++ b/_examples/cloudfunction/go.mod @@ -1,7 +1,7 @@ -module github.com/elastic/go-elasticsearch/_examples/clusterstatus +module github.com/elastic/go-elasticsearch/v7/_examples/clusterstatus go 1.11 -replace github.com/elastic/go-elasticsearch => ../.. +replace github.com/elastic/go-elasticsearch/v7 => ../.. -require github.com/elastic/go-elasticsearch master +require github.com/elastic/go-elasticsearch/v7 v7.0.0-20190407092644-3fb2a278216b diff --git a/_examples/configuration.go b/_examples/configuration.go index 21a4ab78fa..00602c2092 100755 --- a/_examples/configuration.go +++ b/_examples/configuration.go @@ -9,7 +9,7 @@ import ( "net/http" "time" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" ) func main() { diff --git a/_examples/customization.go b/_examples/customization.go index f0affdaac1..929494ca8a 100755 --- a/_examples/customization.go +++ b/_examples/customization.go @@ -11,7 +11,7 @@ import ( "sync" "sync/atomic" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" ) // This example demonstrates how to provide a custom transport implementation to the client diff --git a/_examples/encoding/benchmark_test.go b/_examples/encoding/benchmark_test.go index 189dc893eb..2990c3e0d2 100644 --- a/_examples/encoding/benchmark_test.go +++ b/_examples/encoding/benchmark_test.go @@ -10,7 +10,7 @@ import ( "github.com/mailru/easyjson" "github.com/tidwall/gjson" - "github.com/elastic/go-elasticsearch/_examples/encoding/model" + "github.com/elastic/go-elasticsearch/v7/_examples/encoding/model" ) func BenchmarkSearchResults(b *testing.B) { diff --git a/_examples/encoding/easyjson.go b/_examples/encoding/easyjson.go index 7e72e55065..8cba078343 100644 --- a/_examples/encoding/easyjson.go +++ b/_examples/encoding/easyjson.go @@ -9,12 +9,12 @@ import ( "strings" "time" - "github.com/elastic/go-elasticsearch" - "github.com/elastic/go-elasticsearch/esapi" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" "github.com/fatih/color" "github.com/mailru/easyjson" - "github.com/elastic/go-elasticsearch/_examples/encoding/model" + "github.com/elastic/go-elasticsearch/v7/_examples/encoding/model" ) var ( diff --git a/_examples/encoding/gjson.go b/_examples/encoding/gjson.go index 3fe0a29f97..eed8cabde6 100644 --- a/_examples/encoding/gjson.go +++ b/_examples/encoding/gjson.go @@ -7,7 +7,7 @@ import ( "log" "strings" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" "github.com/fatih/color" "github.com/tidwall/gjson" ) diff --git a/_examples/encoding/go.mod b/_examples/encoding/go.mod index cfe35921b1..9c686141e0 100644 --- a/_examples/encoding/go.mod +++ b/_examples/encoding/go.mod @@ -1,15 +1,15 @@ -module github.com/elastic/go-elasticsearch/_examples/encoding +module github.com/elastic/go-elasticsearch/v7/_examples/encoding go 1.11 -replace github.com/elastic/go-elasticsearch => ../.. +replace github.com/elastic/go-elasticsearch/v7 => ../.. require ( - github.com/elastic/go-elasticsearch v0.0.1-0.20190316081522-60ea51fd3784 + github.com/elastic/go-elasticsearch/v7 v7.0.0-20190407092644-3fb2a278216b github.com/fatih/color v1.7.0 - github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe + github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983 github.com/mattn/go-colorable v0.1.1 // indirect github.com/mattn/go-isatty v0.0.7 // indirect diff --git a/_examples/fasthttp/cmd/main.go b/_examples/fasthttp/cmd/main.go index 131da81250..76b46d0547 100755 --- a/_examples/fasthttp/cmd/main.go +++ b/_examples/fasthttp/cmd/main.go @@ -7,8 +7,8 @@ import ( "strconv" "time" - "github.com/elastic/go-elasticsearch" - "github.com/elastic/go-elasticsearch/_examples/fasthttp" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/_examples/fasthttp" ) var ( diff --git a/_examples/fasthttp/fasthttp_benchmark_test.go b/_examples/fasthttp/fasthttp_benchmark_test.go index 5be123fe40..be108ae12b 100755 --- a/_examples/fasthttp/fasthttp_benchmark_test.go +++ b/_examples/fasthttp/fasthttp_benchmark_test.go @@ -3,8 +3,8 @@ package fasthttp_test import ( "testing" - "github.com/elastic/go-elasticsearch" - "github.com/elastic/go-elasticsearch/_examples/fasthttp" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/_examples/fasthttp" ) func BenchmarkHTTPClient(b *testing.B) { diff --git a/_examples/fasthttp/go.mod b/_examples/fasthttp/go.mod index e7106dacf9..33f9054246 100644 --- a/_examples/fasthttp/go.mod +++ b/_examples/fasthttp/go.mod @@ -1,10 +1,10 @@ -module github.com/elastic/go-elasticsearch/_examples/fasthttp +module github.com/elastic/go-elasticsearch/v7/_examples/fasthttp go 1.11 -replace github.com/elastic/go-elasticsearch => ../.. +replace github.com/elastic/go-elasticsearch/v7 => ../.. require ( - github.com/elastic/go-elasticsearch master + github.com/elastic/go-elasticsearch/v7 v7.0.0-20190407092644-3fb2a278216b github.com/valyala/fasthttp v1.1.0 ) diff --git a/_examples/instrumentation/apmelasticsearch.go b/_examples/instrumentation/apmelasticsearch.go index 942dab89be..60779d1219 100644 --- a/_examples/instrumentation/apmelasticsearch.go +++ b/_examples/instrumentation/apmelasticsearch.go @@ -18,7 +18,7 @@ import ( "github.com/fatih/color" "golang.org/x/crypto/ssh/terminal" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" "go.elastic.co/apm" "go.elastic.co/apm/module/apmelasticsearch" diff --git a/_examples/instrumentation/go.mod b/_examples/instrumentation/go.mod index fb0e60f4b1..2a7cebcec1 100644 --- a/_examples/instrumentation/go.mod +++ b/_examples/instrumentation/go.mod @@ -1,9 +1,11 @@ -module github.com/elastic/go-elasticsearch/_examples/instrumentation/opencensus +module github.com/elastic/go-elasticsearch/v7/_examples/instrumentation/opencensus go 1.11 +replace github.com/elastic/go-elasticsearch/v7 => ../.. + require ( - github.com/elastic/go-elasticsearch master + github.com/elastic/go-elasticsearch/v7 v7.0.0-20190407092644-3fb2a278216b github.com/fatih/color v1.7.0 github.com/mattn/go-colorable v0.1.0 // indirect diff --git a/_examples/instrumentation/opencensus.go b/_examples/instrumentation/opencensus.go index 5c837cf1df..2e188232c3 100644 --- a/_examples/instrumentation/opencensus.go +++ b/_examples/instrumentation/opencensus.go @@ -14,7 +14,7 @@ import ( "github.com/fatih/color" "golang.org/x/crypto/ssh/terminal" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" "go.opencensus.io/plugin/ochttp" "go.opencensus.io/stats/view" diff --git a/_examples/logging/custom.go b/_examples/logging/custom.go index 3f5820e557..a53f81ca50 100644 --- a/_examples/logging/custom.go +++ b/_examples/logging/custom.go @@ -15,7 +15,7 @@ import ( "github.com/rs/zerolog" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" ) // CustomLogger implements the estransport.Logger interface. diff --git a/_examples/logging/default.go b/_examples/logging/default.go index cfd7d646ef..84035bcbbb 100644 --- a/_examples/logging/default.go +++ b/_examples/logging/default.go @@ -14,8 +14,8 @@ import ( "os" "strings" - "github.com/elastic/go-elasticsearch" - "github.com/elastic/go-elasticsearch/estransport" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/estransport" ) func main() { diff --git a/_examples/logging/go.mod b/_examples/logging/go.mod index 184501b9fe..fce55e5ada 100644 --- a/_examples/logging/go.mod +++ b/_examples/logging/go.mod @@ -1,11 +1,11 @@ -module github.com/elastic/go-elasticsearch/_examples/logging +module github.com/elastic/go-elasticsearch/v7/_examples/logging go 1.11 -replace github.com/elastic/go-elasticsearch => ../.. +replace github.com/elastic/go-elasticsearch/v7 => ../.. require ( - github.com/elastic/go-elasticsearch master + github.com/elastic/go-elasticsearch/v7 v7.0.0-20190407092644-3fb2a278216b github.com/rs/zerolog v1.11.0 ) diff --git a/_examples/main.go b/_examples/main.go index 35e71df648..414ea581ba 100755 --- a/_examples/main.go +++ b/_examples/main.go @@ -15,8 +15,8 @@ import ( "strings" "sync" - "github.com/elastic/go-elasticsearch" - "github.com/elastic/go-elasticsearch/esapi" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" ) func main() { diff --git a/_examples/xkcdsearch/cmd/xkcd/commands/index.go b/_examples/xkcdsearch/cmd/xkcd/commands/index.go index c8024446c8..fda005cb19 100755 --- a/_examples/xkcdsearch/cmd/xkcd/commands/index.go +++ b/_examples/xkcdsearch/cmd/xkcd/commands/index.go @@ -14,9 +14,9 @@ import ( "github.com/rs/zerolog" "github.com/spf13/cobra" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" - "github.com/elastic/go-elasticsearch/_examples/xkcdsearch" + "github.com/elastic/go-elasticsearch/v7/_examples/xkcdsearch" ) var ( diff --git a/_examples/xkcdsearch/cmd/xkcd/commands/search.go b/_examples/xkcdsearch/cmd/xkcd/commands/search.go index 64897334c7..252047d9dd 100755 --- a/_examples/xkcdsearch/cmd/xkcd/commands/search.go +++ b/_examples/xkcdsearch/cmd/xkcd/commands/search.go @@ -9,9 +9,9 @@ import ( "github.com/spf13/cobra" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" - "github.com/elastic/go-elasticsearch/_examples/xkcdsearch" + "github.com/elastic/go-elasticsearch/v7/_examples/xkcdsearch" ) func init() { diff --git a/_examples/xkcdsearch/cmd/xkcd/commands/server.go b/_examples/xkcdsearch/cmd/xkcd/commands/server.go index 9efa0a72bf..0c104a1a32 100755 --- a/_examples/xkcdsearch/cmd/xkcd/commands/server.go +++ b/_examples/xkcdsearch/cmd/xkcd/commands/server.go @@ -7,9 +7,9 @@ import ( "github.com/rs/zerolog" "github.com/spf13/cobra" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" - "github.com/elastic/go-elasticsearch/_examples/xkcdsearch" + "github.com/elastic/go-elasticsearch/v7/_examples/xkcdsearch" ) var ( diff --git a/_examples/xkcdsearch/cmd/xkcd/main.go b/_examples/xkcdsearch/cmd/xkcd/main.go index 430bcb5679..00880bd01b 100755 --- a/_examples/xkcdsearch/cmd/xkcd/main.go +++ b/_examples/xkcdsearch/cmd/xkcd/main.go @@ -1,6 +1,6 @@ package main -import "github.com/elastic/go-elasticsearch/_examples/xkcdsearch/cmd/xkcd/commands" +import "github.com/elastic/go-elasticsearch/v7/_examples/xkcdsearch/cmd/xkcd/commands" func main() { commands.Execute() diff --git a/_examples/xkcdsearch/go.mod b/_examples/xkcdsearch/go.mod index 2bd0aeb586..a7ddaed2af 100644 --- a/_examples/xkcdsearch/go.mod +++ b/_examples/xkcdsearch/go.mod @@ -1,11 +1,11 @@ -module github.com/elastic/go-elasticsearch/_examples/xkcdsearch +module github.com/elastic/go-elasticsearch/v7/_examples/xkcdsearch go 1.11 -replace github.com/elastic/go-elasticsearch => ../.. +replace github.com/elastic/go-elasticsearch/v7 => ../.. require ( - github.com/elastic/go-elasticsearch master + github.com/elastic/go-elasticsearch/v7 v7.0.0-20190407092644-3fb2a278216b github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/rs/zerolog v1.11.0 github.com/spf13/cobra v0.0.3 diff --git a/_examples/xkcdsearch/store.go b/_examples/xkcdsearch/store.go index fdd11d26f1..01f0d0bded 100755 --- a/_examples/xkcdsearch/store.go +++ b/_examples/xkcdsearch/store.go @@ -8,8 +8,8 @@ import ( "io" "strings" - "github.com/elastic/go-elasticsearch" - "github.com/elastic/go-elasticsearch/esapi" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" ) // SearchResults wraps the Elasticsearch search response. diff --git a/_examples/xkcdsearch/store_test.go b/_examples/xkcdsearch/store_test.go index ef6f50d50c..3a427a7c00 100755 --- a/_examples/xkcdsearch/store_test.go +++ b/_examples/xkcdsearch/store_test.go @@ -11,9 +11,9 @@ import ( "strings" "testing" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" - "github.com/elastic/go-elasticsearch/_examples/xkcdsearch" + "github.com/elastic/go-elasticsearch/v7/_examples/xkcdsearch" ) var ( diff --git a/_examples/xkcdsearch/xkcd.go b/_examples/xkcdsearch/xkcd.go index 238b20fa3d..93d6ead9ba 100755 --- a/_examples/xkcdsearch/xkcd.go +++ b/_examples/xkcdsearch/xkcd.go @@ -1,4 +1,4 @@ -package xkcdsearch // import "github.com/elastic/go-elasticsearch/_examples/xkcdsearch" +package xkcdsearch // import "github.com/elastic/go-elasticsearch/v7/_examples/xkcdsearch" import ( "strings" diff --git a/elasticsearch.go b/elasticsearch.go index 6e6cecf3a1..f624f96cd4 100755 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -1,4 +1,4 @@ -package elasticsearch // import "github.com/elastic/go-elasticsearch" +package elasticsearch // import "github.com/elastic/go-elasticsearch/v7" import ( "errors" @@ -8,9 +8,9 @@ import ( "os" "strings" - "github.com/elastic/go-elasticsearch/esapi" - "github.com/elastic/go-elasticsearch/estransport" - "github.com/elastic/go-elasticsearch/internal/version" + "github.com/elastic/go-elasticsearch/v7/esapi" + "github.com/elastic/go-elasticsearch/v7/estransport" + "github.com/elastic/go-elasticsearch/v7/internal/version" ) const ( diff --git a/elasticsearch_benchmark_test.go b/elasticsearch_benchmark_test.go index b5a1701e61..4c4f5cf18c 100755 --- a/elasticsearch_benchmark_test.go +++ b/elasticsearch_benchmark_test.go @@ -10,8 +10,8 @@ import ( "strings" "testing" - "github.com/elastic/go-elasticsearch" - "github.com/elastic/go-elasticsearch/esapi" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" ) var defaultResponse = http.Response{ diff --git a/elasticsearch_example_test.go b/elasticsearch_example_test.go index e05c078079..8a1c9269eb 100755 --- a/elasticsearch_example_test.go +++ b/elasticsearch_example_test.go @@ -10,8 +10,8 @@ import ( "os" "time" - "github.com/elastic/go-elasticsearch" - "github.com/elastic/go-elasticsearch/estransport" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/estransport" ) func init() { @@ -55,7 +55,7 @@ func ExampleNewClient() { } func ExampleNewClient_logger() { - // import "github.com/elastic/go-elasticsearch/estransport" + // import "github.com/elastic/go-elasticsearch/v7/estransport" // Use one of the bundled loggers: // diff --git a/elasticsearch_integration_test.go b/elasticsearch_integration_test.go index 828ff68069..1c79740d98 100755 --- a/elasticsearch_integration_test.go +++ b/elasticsearch_integration_test.go @@ -16,9 +16,9 @@ import ( "testing" "time" - "github.com/elastic/go-elasticsearch" - "github.com/elastic/go-elasticsearch/esapi" - "github.com/elastic/go-elasticsearch/estransport" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" + "github.com/elastic/go-elasticsearch/v7/estransport" ) func TestClientTransport(t *testing.T) { diff --git a/elasticsearch_internal_test.go b/elasticsearch_internal_test.go index 55ddd0c005..7811d90c14 100755 --- a/elasticsearch_internal_test.go +++ b/elasticsearch_internal_test.go @@ -10,7 +10,7 @@ import ( "regexp" "testing" - "github.com/elastic/go-elasticsearch/estransport" + "github.com/elastic/go-elasticsearch/v7/estransport" ) func TestClientConfiguration(t *testing.T) { diff --git a/esapi/doc.go b/esapi/doc.go index 20a976adaf..12d0815e43 100755 --- a/esapi/doc.go +++ b/esapi/doc.go @@ -59,8 +59,8 @@ See the documentation for each API function or struct at https://godoc.org/github.com/elastic/go-elasticsearch, or locally by: - go doc github.com/elastic/go-elasticsearch/esapi Index - go doc github.com/elastic/go-elasticsearch/esapi IndexRequest + go doc github.com/elastic/go-elasticsearch/v7/esapi Index + go doc github.com/elastic/go-elasticsearch/v7/esapi IndexRequest Response diff --git a/esapi/esapi.go b/esapi/esapi.go index 9c97901ce9..f12dad1f27 100755 --- a/esapi/esapi.go +++ b/esapi/esapi.go @@ -1,11 +1,11 @@ -package esapi // import "github.com/elastic/go-elasticsearch/esapi" +package esapi // import "github.com/elastic/go-elasticsearch/v7/esapi" import ( "net/http" "strconv" "time" - "github.com/elastic/go-elasticsearch/internal/version" + "github.com/elastic/go-elasticsearch/v7/internal/version" ) // Version returns the package version as a string. diff --git a/esapi/esapi.response_example_test.go b/esapi/esapi.response_example_test.go index 44f796ff0d..c46f78f38d 100755 --- a/esapi/esapi.response_example_test.go +++ b/esapi/esapi.response_example_test.go @@ -3,7 +3,7 @@ package esapi_test import ( "log" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" ) func ExampleResponse_IsError() { diff --git a/esapi/esapi_benchmark_test.go b/esapi/esapi_benchmark_test.go index 53db966d3e..c1da3208d4 100755 --- a/esapi/esapi_benchmark_test.go +++ b/esapi/esapi_benchmark_test.go @@ -8,8 +8,8 @@ import ( "strings" "testing" - "github.com/elastic/go-elasticsearch" - "github.com/elastic/go-elasticsearch/esapi" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" ) // TODO(karmi): Refactor into a shared mock/testing package diff --git a/esapi/esapi_integration_test.go b/esapi/esapi_integration_test.go index cccae7834e..8b9982f577 100644 --- a/esapi/esapi_integration_test.go +++ b/esapi/esapi_integration_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/elastic/go-elasticsearch" + "github.com/elastic/go-elasticsearch/v7" ) func TestAPI(t *testing.T) { diff --git a/esapi/test/go.mod b/esapi/test/go.mod index 2153e69526..1b8e334e79 100644 --- a/esapi/test/go.mod +++ b/esapi/test/go.mod @@ -1,11 +1,11 @@ -module github.com/elastic/go-elasticsearch/esapi/test +module github.com/elastic/go-elasticsearch/v7/esapi/test go 1.11 -replace github.com/elastic/go-elasticsearch => ../../ +replace github.com/elastic/go-elasticsearch/v7 => ../../ require ( - github.com/elastic/go-elasticsearch master + github.com/elastic/go-elasticsearch/v7 v7.x gopkg.in/yaml.v2 v2.2.2 ) diff --git a/estransport/estransport.go b/estransport/estransport.go index 87266383df..5af6ba91db 100755 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -1,4 +1,4 @@ -package estransport // import "github.com/elastic/go-elasticsearch/estransport" +package estransport // import "github.com/elastic/go-elasticsearch/v7/estransport" import ( "bytes" @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/elastic/go-elasticsearch/internal/version" + "github.com/elastic/go-elasticsearch/v7/internal/version" ) // Version returns the package version as a string. diff --git a/estransport/estransport_benchmark_test.go b/estransport/estransport_benchmark_test.go index e909eacfac..d9ac9091ac 100644 --- a/estransport/estransport_benchmark_test.go +++ b/estransport/estransport_benchmark_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "github.com/elastic/go-elasticsearch/estransport" + "github.com/elastic/go-elasticsearch/v7/estransport" ) var defaultResponse = http.Response{ diff --git a/estransport/estransport_integration_test.go b/estransport/estransport_integration_test.go index b152953ef8..8c446d7c4b 100755 --- a/estransport/estransport_integration_test.go +++ b/estransport/estransport_integration_test.go @@ -9,7 +9,7 @@ import ( "net/url" "testing" - "github.com/elastic/go-elasticsearch/estransport" + "github.com/elastic/go-elasticsearch/v7/estransport" ) var ( diff --git a/estransport/logger_benchmark_test.go b/estransport/logger_benchmark_test.go index 226104fdc3..a21911fd00 100644 --- a/estransport/logger_benchmark_test.go +++ b/estransport/logger_benchmark_test.go @@ -9,7 +9,7 @@ import ( "net/url" "testing" - "github.com/elastic/go-elasticsearch/estransport" + "github.com/elastic/go-elasticsearch/v7/estransport" ) func BenchmarkTransportLogger(b *testing.B) { diff --git a/go.mod b/go.mod index e8f1c42c26..6199ebca43 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/elastic/go-elasticsearch +module github.com/elastic/go-elasticsearch/v7 go 1.11 diff --git a/internal/cmd/generate/commands/commands.go b/internal/cmd/generate/commands/commands.go index ffc3c62bb8..06c007895f 100755 --- a/internal/cmd/generate/commands/commands.go +++ b/internal/cmd/generate/commands/commands.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - "github.com/elastic/go-elasticsearch/internal/cmd/generate/utils" + "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/utils" ) var rootCmd = &cobra.Command{ diff --git a/internal/cmd/generate/commands/gensource/command.go b/internal/cmd/generate/commands/gensource/command.go index 569118833b..6604097c63 100755 --- a/internal/cmd/generate/commands/gensource/command.go +++ b/internal/cmd/generate/commands/gensource/command.go @@ -13,8 +13,8 @@ import ( "github.com/spf13/cobra" - "github.com/elastic/go-elasticsearch/internal/cmd/generate/commands" - "github.com/elastic/go-elasticsearch/internal/cmd/generate/utils" + "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/commands" + "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/utils" ) var ( diff --git a/internal/cmd/generate/commands/gensource/debug.go b/internal/cmd/generate/commands/gensource/debug.go index b1e57f6038..22a7fe9d33 100755 --- a/internal/cmd/generate/commands/gensource/debug.go +++ b/internal/cmd/generate/commands/gensource/debug.go @@ -5,7 +5,7 @@ import ( "strings" "text/tabwriter" - "github.com/elastic/go-elasticsearch/internal/cmd/generate/utils" + "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/utils" ) // DebugInfo returns information about the endpoint as a string. diff --git a/internal/cmd/generate/commands/gensource/generator.go b/internal/cmd/generate/commands/gensource/generator.go index 549ffe4252..4a452c3781 100755 --- a/internal/cmd/generate/commands/gensource/generator.go +++ b/internal/cmd/generate/commands/gensource/generator.go @@ -9,7 +9,7 @@ import ( "golang.org/x/tools/imports" - "github.com/elastic/go-elasticsearch/internal/cmd/generate/utils" + "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/utils" ) // Generator represents the "gensource" generator. diff --git a/internal/cmd/generate/commands/gensource/generator_test.go b/internal/cmd/generate/commands/gensource/generator_test.go index b1abba7f4b..a96153acc3 100755 --- a/internal/cmd/generate/commands/gensource/generator_test.go +++ b/internal/cmd/generate/commands/gensource/generator_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/elastic/go-elasticsearch/internal/cmd/generate/commands/gensource" + "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/commands/gensource" ) func TestGenerator(t *testing.T) { diff --git a/internal/cmd/generate/commands/gensource/model.go b/internal/cmd/generate/commands/gensource/model.go index a4995124d4..82d8ab16ee 100755 --- a/internal/cmd/generate/commands/gensource/model.go +++ b/internal/cmd/generate/commands/gensource/model.go @@ -9,7 +9,7 @@ import ( "gopkg.in/yaml.v2" - "github.com/elastic/go-elasticsearch/internal/cmd/generate/utils" + "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/utils" ) var ( diff --git a/internal/cmd/generate/commands/gentests/command.go b/internal/cmd/generate/commands/gentests/command.go index a8611d4db8..22f902697a 100755 --- a/internal/cmd/generate/commands/gentests/command.go +++ b/internal/cmd/generate/commands/gentests/command.go @@ -15,8 +15,8 @@ import ( "github.com/spf13/cobra" yaml "gopkg.in/yaml.v2" - "github.com/elastic/go-elasticsearch/internal/cmd/generate/commands" - "github.com/elastic/go-elasticsearch/internal/cmd/generate/utils" + "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/commands" + "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/utils" ) var ( diff --git a/internal/cmd/generate/commands/gentests/debug.go b/internal/cmd/generate/commands/gentests/debug.go index 15b5eba62c..b53a8c986a 100755 --- a/internal/cmd/generate/commands/gentests/debug.go +++ b/internal/cmd/generate/commands/gentests/debug.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/elastic/go-elasticsearch/internal/cmd/generate/utils" + "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/utils" ) // DebugInfo returns information about the endpoint as a string. diff --git a/internal/cmd/generate/commands/gentests/gen_api_registry.go b/internal/cmd/generate/commands/gentests/gen_api_registry.go index 6ae2002218..75d8a8d1ae 100755 --- a/internal/cmd/generate/commands/gentests/gen_api_registry.go +++ b/internal/cmd/generate/commands/gentests/gen_api_registry.go @@ -24,7 +24,7 @@ func init() { if pkgNamesEnv := os.Getenv("PACKAGE_NAMES"); pkgNamesEnv != "" { pkgNames = strings.Split(pkgNamesEnv, ",") } else { - pkgNames = []string{"github.com/elastic/go-elasticsearch/esapi"} + pkgNames = []string{"github.com/elastic/go-elasticsearch/v7/esapi"} } if _, ok := os.LookupEnv(""); ok { diff --git a/internal/cmd/generate/commands/gentests/generator.go b/internal/cmd/generate/commands/gentests/generator.go index 8710f87ce6..58b16cba88 100755 --- a/internal/cmd/generate/commands/gentests/generator.go +++ b/internal/cmd/generate/commands/gentests/generator.go @@ -184,8 +184,8 @@ import ( encyaml "gopkg.in/yaml.v2" "testing" - "github.com/elastic/go-elasticsearch" - "github.com/elastic/go-elasticsearch/esapi" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" ) var ( diff --git a/internal/cmd/generate/commands/gentests/model.go b/internal/cmd/generate/commands/gentests/model.go index 52ae596c01..de72adca4e 100755 --- a/internal/cmd/generate/commands/gentests/model.go +++ b/internal/cmd/generate/commands/gentests/model.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/elastic/go-elasticsearch/internal/cmd/generate/utils" + "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/utils" ) var reFilename = regexp.MustCompile(`\d*_?(.+)\.ya?ml`) diff --git a/internal/cmd/generate/go.mod b/internal/cmd/generate/go.mod index 6d139cc800..c0ce452dc5 100644 --- a/internal/cmd/generate/go.mod +++ b/internal/cmd/generate/go.mod @@ -1,12 +1,12 @@ -module github.com/elastic/go-elasticsearch/internal/cmd/generate +module github.com/elastic/go-elasticsearch/v7/internal/cmd/generate go 1.11 -replace github.com/elastic/go-elasticsearch => ../../../ +replace github.com/elastic/go-elasticsearch/v7 => ../../../ require ( github.com/alecthomas/chroma v0.6.3 - github.com/elastic/go-elasticsearch v0.0.0-00010101000000-000000000000 // indirect + github.com/elastic/go-elasticsearch/v7 v7.0.0-20190407092644-3fb2a278216b github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/spf13/cobra v0.0.3 github.com/spf13/pflag v1.0.3 // indirect diff --git a/internal/cmd/generate/go.sum b/internal/cmd/generate/go.sum index fc43c0b526..5ed45fba83 100644 --- a/internal/cmd/generate/go.sum +++ b/internal/cmd/generate/go.sum @@ -1,32 +1,23 @@ -github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U= github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI= github.com/alecthomas/chroma v0.6.3 h1:8H1D0yddf0mvgvO4JDBKnzLd9ERmzzAijBxnZXGV/FA= github.com/alecthomas/chroma v0.6.3/go.mod h1:quT2EpvJNqkuPi6DmBHB+E33FXBgBBPzyH5++Dn1LPc= -github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 h1:JHZL0hZKJ1VENNfmXvHbgYlbUOvpzYzvy2aZU5gXVeo= github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= github.com/alecthomas/kong v0.1.15/go.mod h1:0m2VYms8rH0qbCqVB2gvGHk74bqLIq0HXjCs5bNbNQU= -github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 h1:p9Sln00KOTlrYkxI1zYWl1QLnEqAqEARBEYa8FQnQcY= github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= -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= github.com/dlclark/regexp2 v1.1.6 h1:CqB4MjHw0MFCDj+PHHjiESmHX+N7t0tJzKvC6M97BRg= github.com/dlclark/regexp2 v1.1.6/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI= @@ -38,7 +29,6 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20190330180304-aef51cc3777c h1:hbqcUGBwEHdDbhy8EluQIkbwTIbOvaYedVBif4f2mFQ= golang.org/x/tools v0.0.0-20190330180304-aef51cc3777c/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -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= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/internal/cmd/generate/main.go b/internal/cmd/generate/main.go index 498b6f9166..b2993799d0 100755 --- a/internal/cmd/generate/main.go +++ b/internal/cmd/generate/main.go @@ -1,9 +1,9 @@ package main import ( - "github.com/elastic/go-elasticsearch/internal/cmd/generate/commands" - _ "github.com/elastic/go-elasticsearch/internal/cmd/generate/commands/gensource" - _ "github.com/elastic/go-elasticsearch/internal/cmd/generate/commands/gentests" + "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/commands" + _ "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/commands/gensource" + _ "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/commands/gentests" ) func main() { From 0e5010aca41f5fb769f3257319250fc7712b7bc1 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 8 Apr 2019 10:33:42 +0200 Subject: [PATCH 005/355] Update README with compatibility information (cherry picked from commit e4c5939e5ea5852f6c17eef08e2ee0681158b9be) --- README.md | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 97daa00f15..e05dd366d2 100755 --- a/README.md +++ b/README.md @@ -7,13 +7,31 @@ The official Go client for [Elasticsearch](https://www.elastic.co/products/elast [![Go Report Card](https://goreportcard.com/badge/github.com/elastic/go-elasticsearch)](https://goreportcard.com/report/github.com/elastic/go-elasticsearch) [![codecov.io](https://codecov.io/github/elastic/go-elasticsearch/coverage.svg?branch=master)](https://codecov.io/gh/elastic/go-elasticsearch?branch=master) -## Caveats +## Compatibility -We encourage you to try the package in your projects, just keep these caveats in mind, please: +The client major versions correspond to the compatible Elasticsearch major versions: to connect to Elasticsearch `7.x`, use a [`7.x`](https://github.com/elastic/go-elasticsearch/tree/7.x) version of the client, to connect to Elasticsearch `6.x`, use a [`6.x`](https://github.com/elastic/go-elasticsearch/tree/6.x) version of the client. -* **This is a work in progress.** Not all the planned features, standard in official Elasticsearch clients — retries on failures, auto-discovering nodes, ... — are implemented yet. -* **There are no guarantees on API stability.** Though the public APIs have been designed very carefully, they can change in a backwards-incompatible way depending on further exploration and user feedback. -* **The `master` branch targets Elasticsearch 7.x.** The [6.x](https://github.com/elastic/go-elasticsearch/tree/6.x) and [5.x](https://github.com/elastic/go-elasticsearch/tree/5.x) branches are compatible with the respective major versions of Elasticsearch; proper compatibility matrix and release tags will be added soon. +When using Go modules, include the version in the import path, and specify either an explicit version or a branch: + + require github.com/elastic/go-elasticsearch/v7 v7.0.0-rc1 + require github.com/elastic/go-elasticsearch/v7 v7.x + +It's possible to use multiple versions of the client in a single project: + + // go.mod + github.com/elastic/go-elasticsearch/v6 v6.x + github.com/elastic/go-elasticsearch/v7 v7.x + + // main.go + import ( + elasticsearch6 "github.com/elastic/go-elasticsearch/v6" + elasticsearch7 "github.com/elastic/go-elasticsearch/v7" + ) + // ... + es6, _ := elasticsearch6.NewDefaultClient() + es7, _ := elasticsearch7.NewDefaultClient() + +The `master` branch of the client is compatible with the current `master` branch of Elasticsearch. @@ -129,7 +147,7 @@ See the [`_examples/configuration.go`](_examples/configuration.go) and [`_examples/customization.go`](_examples/customization.go) files for more examples of configuration and customization of the client. -The following example demonstrates a more complex usage. It fetches the Elasticsearch version from the cluster, indexes a couple of documents concurrently, and prints the search results, using a light wrapper around the response body. +The following example demonstrates a more complex usage. It fetches the Elasticsearch version from the cluster, indexes a couple of documents concurrently, and prints the search results, using a lightweight wrapper around the response body. ```golang // $ go run _examples/main.go From 86e3f22e64116b749edf5fe5e3219112e982592a Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 8 Apr 2019 12:15:13 +0200 Subject: [PATCH 006/355] Fix incorrect branch version in README (cherry picked from commit f2f1155708d275385f35efb7cbde22954aa15176) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e05dd366d2..181a61e46f 100755 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ The client major versions correspond to the compatible Elasticsearch major versi When using Go modules, include the version in the import path, and specify either an explicit version or a branch: require github.com/elastic/go-elasticsearch/v7 v7.0.0-rc1 - require github.com/elastic/go-elasticsearch/v7 v7.x + require github.com/elastic/go-elasticsearch/v7 7.x It's possible to use multiple versions of the client in a single project: // go.mod - github.com/elastic/go-elasticsearch/v6 v6.x - github.com/elastic/go-elasticsearch/v7 v7.x + github.com/elastic/go-elasticsearch/v6 6.x + github.com/elastic/go-elasticsearch/v7 7.x // main.go import ( From 953546e1c3e5712e2ee9ad23b563d29a3fa8b7fe Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 8 Apr 2019 12:16:17 +0200 Subject: [PATCH 007/355] Fix incorrect branch version in esapi/test go.mod --- esapi/test/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esapi/test/go.mod b/esapi/test/go.mod index 1b8e334e79..661cfb9b2f 100644 --- a/esapi/test/go.mod +++ b/esapi/test/go.mod @@ -5,7 +5,7 @@ go 1.11 replace github.com/elastic/go-elasticsearch/v7 => ../../ require ( - github.com/elastic/go-elasticsearch/v7 v7.x + github.com/elastic/go-elasticsearch/v7 7.x gopkg.in/yaml.v2 v2.2.2 ) From 7b165189cf929ae5f3a05f159bba5bcd828247a4 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 8 Apr 2019 12:39:11 +0200 Subject: [PATCH 008/355] Update installation instructions in README (cherry picked from commit dce169cd40e61f5eb4107337c6c09953b68f1a10) --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 181a61e46f..2d10eeb703 100755 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ The client major versions correspond to the compatible Elasticsearch major versi When using Go modules, include the version in the import path, and specify either an explicit version or a branch: - require github.com/elastic/go-elasticsearch/v7 v7.0.0-rc1 require github.com/elastic/go-elasticsearch/v7 7.x It's possible to use multiple versions of the client in a single project: From 7260ad563c0ee988d368090891e09f784dc03afb Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 9 Apr 2019 09:12:46 +0200 Subject: [PATCH 009/355] Remove package import comments --- _examples/cloudfunction/function.go | 2 +- _examples/xkcdsearch/xkcd.go | 2 +- elasticsearch.go | 2 +- esapi/esapi.go | 2 +- estransport/estransport.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/_examples/cloudfunction/function.go b/_examples/cloudfunction/function.go index c69efe76f8..6503f3222f 100755 --- a/_examples/cloudfunction/function.go +++ b/_examples/cloudfunction/function.go @@ -14,7 +14,7 @@ // // $ curl https://...cloudfunctions.net/clusterstatus // -package clusterstatus // import "github.com/elastic/go-elasticsearch/v7/_examples/clusterstatus" +package clusterstatus import ( "encoding/json" diff --git a/_examples/xkcdsearch/xkcd.go b/_examples/xkcdsearch/xkcd.go index 93d6ead9ba..42415ef20e 100755 --- a/_examples/xkcdsearch/xkcd.go +++ b/_examples/xkcdsearch/xkcd.go @@ -1,4 +1,4 @@ -package xkcdsearch // import "github.com/elastic/go-elasticsearch/v7/_examples/xkcdsearch" +package xkcdsearch import ( "strings" diff --git a/elasticsearch.go b/elasticsearch.go index f624f96cd4..42e08ab020 100755 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -1,4 +1,4 @@ -package elasticsearch // import "github.com/elastic/go-elasticsearch/v7" +package elasticsearch import ( "errors" diff --git a/esapi/esapi.go b/esapi/esapi.go index f12dad1f27..a621669213 100755 --- a/esapi/esapi.go +++ b/esapi/esapi.go @@ -1,4 +1,4 @@ -package esapi // import "github.com/elastic/go-elasticsearch/v7/esapi" +package esapi import ( "net/http" diff --git a/estransport/estransport.go b/estransport/estransport.go index 5af6ba91db..2c5ee0de25 100755 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -1,4 +1,4 @@ -package estransport // import "github.com/elastic/go-elasticsearch/v7/estransport" +package estransport import ( "bytes" From 0a0caf57f698f5f39d00c80e948abb0cf296df0d Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 11 Apr 2019 11:17:34 +0200 Subject: [PATCH 010/355] API: Update the generated APIs for Elasticsearch 7.x --- esapi/api._.go | 2 +- esapi/api.nodes.stats.go | 2 +- esapi/api.snapshot.delete.go | 2 +- esapi/api.snapshot.restore.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/esapi/api._.go b/esapi/api._.go index d7821d4a25..672fcb9053 100644 --- a/esapi/api._.go +++ b/esapi/api._.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.0.0 (3171bef1d17): DO NOT EDIT +// Code generated from specification version 7.0.0 (42d52c016e4): DO NOT EDIT package esapi diff --git a/esapi/api.nodes.stats.go b/esapi/api.nodes.stats.go index cc5c528dfd..af4e0de3ea 100755 --- a/esapi/api.nodes.stats.go +++ b/esapi/api.nodes.stats.go @@ -30,9 +30,9 @@ type NodesStats func(o ...func(*NodesStatsRequest)) (*Response, error) // NodesStatsRequest configures the Nodes Stats API request. // type NodesStatsRequest struct { + NodeID []string Metric []string IndexMetric []string - NodeID []string CompletionFields []string FielddataFields []string Fields []string diff --git a/esapi/api.snapshot.delete.go b/esapi/api.snapshot.delete.go index 7e85276fae..5f53f6b338 100755 --- a/esapi/api.snapshot.delete.go +++ b/esapi/api.snapshot.delete.go @@ -29,8 +29,8 @@ type SnapshotDelete func(repository string, snapshot string, o ...func(*Snapshot // SnapshotDeleteRequest configures the Snapshot Delete API request. // type SnapshotDeleteRequest struct { - Snapshot string Repository string + Snapshot string MasterTimeout time.Duration Pretty bool diff --git a/esapi/api.snapshot.restore.go b/esapi/api.snapshot.restore.go index 73870d2441..8236fb0053 100755 --- a/esapi/api.snapshot.restore.go +++ b/esapi/api.snapshot.restore.go @@ -33,8 +33,8 @@ type SnapshotRestore func(repository string, snapshot string, o ...func(*Snapsho type SnapshotRestoreRequest struct { Body io.Reader - Repository string Snapshot string + Repository string MasterTimeout time.Duration WaitForCompletion *bool From 41c49bb988ab61d27ad45663783fe48814347c17 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 13 Apr 2019 16:31:47 +0200 Subject: [PATCH 011/355] Examples: Re-arrange the README (cherry picked from commit 9d65ebea2512e6d3e136f478838c23773cb0a98d) --- _examples/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/_examples/README.md b/_examples/README.md index 6f7bf591c0..eaa28dd79b 100755 --- a/_examples/README.md +++ b/_examples/README.md @@ -10,12 +10,21 @@ The [**`logging`**](./logging) directory contains examples for using the default ## Bulk -The [**`bulk`**](./bulk) directory contains a comprehensive example for using the _Bulk_ API. +The [**`bulk`**](./bulk) directory contains a comprehensive example of using the _Bulk_ API. + +## Encoding + +The [**`encoding`**](./encoding) directory contains examples of using third-party packages +for a more efficient encoding and decoding of the request and response bodies. ## Fast HTTP The [**`fasthttp`**](./fasthttp) directory contains a demonstration of replacing the default client transport with an HTTP client from the [`github.com/valyala/fasthttp`](https://godoc.org/github.com/valyala/fasthttp) package. +## Instrumentation + +The [**`instrumentation`**](./instrumentation) directory contains recipes for instrumenting the client with the OpenCensus and Elastic APM packages. + ## Google Cloud Functions The [**`cloudfunction`**](./cloudfunction) directory contains a simple web service for checking Elasticsearch cluster status. @@ -23,12 +32,3 @@ The [**`cloudfunction`**](./cloudfunction) directory contains a simple web servi ## XKCD Search The [**`xkcdsearch`**](./xkcdsearch) directory contains a command-line utility for indexing and searching an archive of [xkcd.com](https://xkcd.com) artworks. - -## Encoding - -The [**`encoding`**](./encoding) directory contains examples of using third-party packages -for a more efficient encoding and decoding request/response JSON payloads. - -## Instrumentation - -The [**`instrumentation`**](./instrumentation) directory contains recipes for instrumenting the client. From 1426601547f13f6813ebedafd126c63d49452cab Mon Sep 17 00:00:00 2001 From: Roman Suvorov Date: Mon, 4 Mar 2019 16:10:40 -0300 Subject: [PATCH 012/355] Remove unnecessary format when printing errors Picked from commit 84c1f36 and subsequent changes. Closes #30 (cherry picked from commit 69abdd47a0b03e0b2a111809429e2aba6250a539) --- elasticsearch_integration_test.go | 3 +-- estransport/estransport_internal_test.go | 5 ++--- internal/cmd/generate/commands/gensource/generator_test.go | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/elasticsearch_integration_test.go b/elasticsearch_integration_test.go index 1c79740d98..77e6c3bca9 100755 --- a/elasticsearch_integration_test.go +++ b/elasticsearch_integration_test.go @@ -57,7 +57,6 @@ func TestClientTransport(t *testing.T) { curTotal = v.HTTP.TotalOpened break } - // log.Printf("total_opened: %d", curTotal) if curTotal < 1 { t.Errorf("Unexpected total_opened: %d", curTotal) @@ -112,7 +111,7 @@ func TestClientTransport(t *testing.T) { res, err := es.Info(es.Info.WithContext(ctx)) if err == nil { res.Body.Close() - t.Fatalf("Expected 'context deadline exceeded' error") + t.Fatal("Expected 'context deadline exceeded' error") } log.Printf("Request cancelled with %T", err) diff --git a/estransport/estransport_internal_test.go b/estransport/estransport_internal_test.go index 7738eebabd..29e0f7724b 100755 --- a/estransport/estransport_internal_test.go +++ b/estransport/estransport_internal_test.go @@ -31,7 +31,7 @@ func TestTransport(t *testing.T) { t.Run("Default", func(t *testing.T) { tp := New(Config{}) if tp.transport == nil { - t.Errorf("Expected the transport to not be nil") + t.Error("Expected the transport to not be nil") } if tp.transport != http.DefaultTransport { t.Errorf("Expected the transport to be http.DefaultTransport, got: %T", tp.transport) @@ -101,7 +101,7 @@ func TestTransportPerform(t *testing.T) { username, password, ok := req.BasicAuth() if !ok { - t.Errorf("Expected the request to have Basic Auth set") + t.Error("Expected the request to have Basic Auth set") } if username != "foo" || password != "bar" { @@ -222,7 +222,6 @@ func TestTransportSelector(t *testing.T) { var expected string for i := 0; i < 11; i++ { u, err := tp.selector.Select() - // fmt.Printf("> %s\n", u) if err != nil { t.Errorf("Unexpected error: %s", err) diff --git a/internal/cmd/generate/commands/gensource/generator_test.go b/internal/cmd/generate/commands/gensource/generator_test.go index a96153acc3..e31608ec20 100755 --- a/internal/cmd/generate/commands/gensource/generator_test.go +++ b/internal/cmd/generate/commands/gensource/generator_test.go @@ -35,7 +35,7 @@ func TestGenerator(t *testing.T) { // t.Logf("\n%s\n", s) if !strings.Contains(string(s), "func newInfoFunc(t Transport) Info {") { - t.Errorf("Incorrect output") + t.Error("Incorrect output") } }) } From e9ddc20e0df91d1b5757614ca5671c25fcd05cb2 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 14 Apr 2019 10:29:45 +0200 Subject: [PATCH 013/355] Generator: API: Update the list of acronyms for utils.NameToGo() (cherry picked from commit 2040d1f0783519f6a32a77fe5fc6837558ce504e) --- internal/cmd/generate/utils/naming.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/internal/cmd/generate/utils/naming.go b/internal/cmd/generate/utils/naming.go index 29fb68712a..73c007b131 100755 --- a/internal/cmd/generate/utils/naming.go +++ b/internal/cmd/generate/utils/naming.go @@ -17,7 +17,17 @@ var ( // NameToGo returns a Go version of name, eg. node_id => NodeID. // func NameToGo(s string) string { - exceptions := map[string]string{"index": "Index", "id": "DocumentID", "type": "DocumentType"} + exceptions := map[string]string{ + "index": "Index", + "id": "DocumentID", + "type": "DocumentType", + } + + acronyms := map[string]string{ + "id": "ID", + "ttl": "TTL", + } + if value, ok := exceptions[s]; ok { return value } @@ -25,8 +35,8 @@ func NameToGo(s string) string { ep := strings.Split(s, "_") ns := make([]string, len(ep)) for _, v := range ep { - if v == "id" { - v = "ID" + if value, ok := acronyms[v]; ok { + v = value } ns = append(ns, strings.Title(v)) } From b1fbba6525f32e6c5e4558a41b1aaa2916175f8f Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 14 Apr 2019 11:01:39 +0200 Subject: [PATCH 014/355] Generator: API: Sort struct fields and improve formatting * Separate special fields, parts and params by a newline * Properly sort parts * Move WithBody() to front (cherry picked from commit d0d43216723788430195f4188aed6e564ef329e0) --- .../generate/commands/gensource/generator.go | 43 ++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/internal/cmd/generate/commands/gensource/generator.go b/internal/cmd/generate/commands/gensource/generator.go index 4a452c3781..95796540a5 100755 --- a/internal/cmd/generate/commands/gensource/generator.go +++ b/internal/cmd/generate/commands/gensource/generator.go @@ -176,6 +176,10 @@ type ` + g.Endpoint.MethodWithNamespace() + `Request struct {`) } } + if len(g.Endpoint.URL.Parts) > 0 { + g.w("\n") + } + if g.Endpoint.Body != nil { g.w("\n\tBody io.Reader") } @@ -184,7 +188,12 @@ type ` + g.Endpoint.MethodWithNamespace() + `Request struct {`) g.w("\n") } - for _, p := range g.Endpoint.URL.Parts { + for _, name := range g.Endpoint.URL.PartNamesSorted { + p, ok := g.Endpoint.URL.Parts[name] + if !ok { + panic(fmt.Sprintf("Part %q not found", name)) + } + skip := false for _, v := range specialFields { if p.Name == v { @@ -196,9 +205,13 @@ type ` + g.Endpoint.MethodWithNamespace() + `Request struct {`) } g.w("\n\t" + p.GoName()) g.w("\t" + p.GoType(true)) + + } + + if len(g.Endpoint.URL.Parts) > 0 { + g.w("\n") } - // TODO: Sort params beginning with underscore correctly for _, name := range g.Endpoint.URL.ParamNamesSorted { p, ok := g.Endpoint.URL.Params[name] if !ok { @@ -311,19 +324,6 @@ func (f ` + g.Endpoint.MethodWithNamespace() + `) WithContext(v context.Context) return b.String() } - // Generate With... methods for parts - for _, pName := range g.Endpoint.URL.PartNamesSorted { - if p, ok := g.Endpoint.URL.Parts[pName]; ok { - if skipRequiredArgs[p.Name] && p.Name != "type" { - continue - } - - g.w(methodBody(g.Endpoint, p)) - } else { - g.w(`// TODO: ` + p.Name) - } - } - // Generate WithBody method if b := g.Endpoint.Body; b != nil { // Do not add the option when body is part of the method signature @@ -340,6 +340,19 @@ func (f ` + g.Endpoint.MethodWithNamespace() + `) WithBody(v io.Reader) func(*` } } + // Generate With... methods for parts + for _, pName := range g.Endpoint.URL.PartNamesSorted { + if p, ok := g.Endpoint.URL.Parts[pName]; ok { + if skipRequiredArgs[p.Name] && p.Name != "type" { + continue + } + + g.w(methodBody(g.Endpoint, p)) + } else { + g.w(`// TODO: ` + p.Name) + } + } + // Generate With... methods for params for _, pName := range g.Endpoint.URL.ParamNamesSorted { if _, ok := g.Endpoint.URL.Parts[pName]; ok { From ce9ed163e722da9187d35d6b5e28f3ba056af970 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 14 Apr 2019 11:21:58 +0200 Subject: [PATCH 015/355] API: Update the generated APIs for Elasticsearch 7.x --- esapi/api.bulk.go | 3 ++- esapi/api.cat.aliases.go | 3 ++- esapi/api.cat.allocation.go | 3 ++- esapi/api.cat.fielddata.go | 3 ++- esapi/api.cat.snapshots.go | 3 ++- esapi/api.cat.templates.go | 3 ++- esapi/api.cat.thread_pool.go | 17 +++++++++-------- esapi/api.clear_scroll.go | 12 ++++++------ esapi/api.cluster.state.go | 3 ++- esapi/api.cluster.stats.go | 3 ++- esapi/api.count.go | 19 ++++++++++--------- esapi/api.create.go | 3 ++- esapi/api.delete_by_query.go | 3 ++- esapi/api.delete_by_query_rethrottle.go | 3 ++- esapi/api.explain.go | 15 ++++++++------- esapi/api.index.go | 3 ++- esapi/api.indices.analyze.go | 15 ++++++++------- esapi/api.indices.create.go | 3 ++- esapi/api.indices.delete_alias.go | 3 ++- esapi/api.indices.delete_template.go | 3 ++- esapi/api.indices.exists_alias.go | 3 ++- esapi/api.indices.exists_template.go | 3 ++- esapi/api.indices.get_alias.go | 3 ++- esapi/api.indices.get_field_mapping.go | 3 ++- esapi/api.indices.get_settings.go | 3 ++- esapi/api.indices.get_template.go | 3 ++- esapi/api.indices.put_alias.go | 6 ++++-- esapi/api.indices.put_mapping.go | 3 ++- esapi/api.indices.put_settings.go | 3 ++- esapi/api.indices.put_template.go | 3 ++- esapi/api.indices.rollover.go | 17 +++++++++-------- esapi/api.indices.shrink.go | 6 ++++-- esapi/api.indices.split.go | 6 ++++-- esapi/api.indices.stats.go | 3 ++- esapi/api.indices.validate_query.go | 19 ++++++++++--------- esapi/api.ingest.put_pipeline.go | 3 ++- esapi/api.ingest.simulate.go | 3 ++- esapi/api.mget.go | 3 ++- esapi/api.msearch.go | 3 ++- esapi/api.msearch_template.go | 3 ++- esapi/api.mtermvectors.go | 19 ++++++++++--------- esapi/api.nodes.hot_threads.go | 3 ++- esapi/api.nodes.info.go | 5 +++-- esapi/api.nodes.reload_secure_settings.go | 3 ++- esapi/api.nodes.stats.go | 7 ++++--- esapi/api.nodes.usage.go | 5 +++-- esapi/api.put_script.go | 4 +++- esapi/api.rank_eval.go | 3 ++- esapi/api.reindex_rethrottle.go | 3 ++- esapi/api.render_search_template.go | 15 ++++++++------- esapi/api.scroll.go | 15 ++++++++------- esapi/api.search.go | 19 ++++++++++--------- esapi/api.search_template.go | 3 ++- esapi/api.snapshot.create.go | 5 +++-- esapi/api.snapshot.create_repository.go | 3 ++- esapi/api.snapshot.delete.go | 5 +++-- esapi/api.snapshot.delete_repository.go | 3 ++- esapi/api.snapshot.get.go | 5 +++-- esapi/api.snapshot.get_repository.go | 3 ++- esapi/api.snapshot.restore.go | 5 +++-- esapi/api.snapshot.status.go | 5 +++-- esapi/api.snapshot.verify_repository.go | 3 ++- esapi/api.tasks.cancel.go | 3 ++- esapi/api.tasks.get.go | 3 ++- esapi/api.termvectors.go | 19 ++++++++++--------- esapi/api.update.go | 3 ++- esapi/api.update_by_query.go | 15 ++++++++------- esapi/api.update_by_query_rethrottle.go | 3 ++- 68 files changed, 240 insertions(+), 169 deletions(-) diff --git a/esapi/api.bulk.go b/esapi/api.bulk.go index af8e0ead07..14a318bc53 100755 --- a/esapi/api.bulk.go +++ b/esapi/api.bulk.go @@ -32,7 +32,8 @@ type Bulk func(body io.Reader, o ...func(*BulkRequest)) (*Response, error) type BulkRequest struct { Index string DocumentType string - Body io.Reader + + Body io.Reader Pipeline string Refresh string diff --git a/esapi/api.cat.aliases.go b/esapi/api.cat.aliases.go index 4b959e642b..c0aa5167d6 100755 --- a/esapi/api.cat.aliases.go +++ b/esapi/api.cat.aliases.go @@ -30,7 +30,8 @@ type CatAliases func(o ...func(*CatAliasesRequest)) (*Response, error) // CatAliasesRequest configures the Cat Aliases API request. // type CatAliasesRequest struct { - Name []string + Name []string + Format string H []string Help *bool diff --git a/esapi/api.cat.allocation.go b/esapi/api.cat.allocation.go index 1425c31c60..ccd773001b 100755 --- a/esapi/api.cat.allocation.go +++ b/esapi/api.cat.allocation.go @@ -30,7 +30,8 @@ type CatAllocation func(o ...func(*CatAllocationRequest)) (*Response, error) // CatAllocationRequest configures the Cat Allocation API request. // type CatAllocationRequest struct { - NodeID []string + NodeID []string + Bytes string Format string H []string diff --git a/esapi/api.cat.fielddata.go b/esapi/api.cat.fielddata.go index f1512a8edb..893f716462 100755 --- a/esapi/api.cat.fielddata.go +++ b/esapi/api.cat.fielddata.go @@ -30,7 +30,8 @@ type CatFielddata func(o ...func(*CatFielddataRequest)) (*Response, error) // CatFielddataRequest configures the Cat Fielddata API request. // type CatFielddataRequest struct { - Fields []string + Fields []string + Bytes string Format string H []string diff --git a/esapi/api.cat.snapshots.go b/esapi/api.cat.snapshots.go index 0015364d85..47074af2d3 100755 --- a/esapi/api.cat.snapshots.go +++ b/esapi/api.cat.snapshots.go @@ -30,7 +30,8 @@ type CatSnapshots func(o ...func(*CatSnapshotsRequest)) (*Response, error) // CatSnapshotsRequest configures the Cat Snapshots API request. // type CatSnapshotsRequest struct { - Repository []string + Repository []string + Format string H []string Help *bool diff --git a/esapi/api.cat.templates.go b/esapi/api.cat.templates.go index f5bc804a49..bd301b33f9 100755 --- a/esapi/api.cat.templates.go +++ b/esapi/api.cat.templates.go @@ -30,7 +30,8 @@ type CatTemplates func(o ...func(*CatTemplatesRequest)) (*Response, error) // CatTemplatesRequest configures the Cat Templates API request. // type CatTemplatesRequest struct { - Name string + Name string + Format string H []string Help *bool diff --git a/esapi/api.cat.thread_pool.go b/esapi/api.cat.thread_pool.go index 1f501d784c..569fa306ac 100755 --- a/esapi/api.cat.thread_pool.go +++ b/esapi/api.cat.thread_pool.go @@ -32,14 +32,15 @@ type CatThreadPool func(o ...func(*CatThreadPoolRequest)) (*Response, error) // type CatThreadPoolRequest struct { ThreadPoolPatterns []string - Format string - H []string - Help *bool - Local *bool - MasterTimeout time.Duration - S []string - Size string - V *bool + + Format string + H []string + Help *bool + Local *bool + MasterTimeout time.Duration + S []string + Size string + V *bool Pretty bool Human bool diff --git a/esapi/api.clear_scroll.go b/esapi/api.clear_scroll.go index 99cedf092b..469704a23a 100755 --- a/esapi/api.clear_scroll.go +++ b/esapi/api.clear_scroll.go @@ -120,19 +120,19 @@ func (f ClearScroll) WithContext(v context.Context) func(*ClearScrollRequest) { } } -// WithScrollID - a list of scroll ids to clear. +// WithBody - A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter. // -func (f ClearScroll) WithScrollID(v ...string) func(*ClearScrollRequest) { +func (f ClearScroll) WithBody(v io.Reader) func(*ClearScrollRequest) { return func(r *ClearScrollRequest) { - r.ScrollID = v + r.Body = v } } -// WithBody - A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter. +// WithScrollID - a list of scroll ids to clear. // -func (f ClearScroll) WithBody(v io.Reader) func(*ClearScrollRequest) { +func (f ClearScroll) WithScrollID(v ...string) func(*ClearScrollRequest) { return func(r *ClearScrollRequest) { - r.Body = v + r.ScrollID = v } } diff --git a/esapi/api.cluster.state.go b/esapi/api.cluster.state.go index f0e2fdfe0e..a9ce547429 100755 --- a/esapi/api.cluster.state.go +++ b/esapi/api.cluster.state.go @@ -32,7 +32,8 @@ type ClusterState func(o ...func(*ClusterStateRequest)) (*Response, error) type ClusterStateRequest struct { Index []string - Metric []string + Metric []string + AllowNoIndices *bool ExpandWildcards string FlatSettings *bool diff --git a/esapi/api.cluster.stats.go b/esapi/api.cluster.stats.go index 3e3407575e..43e19a57ff 100755 --- a/esapi/api.cluster.stats.go +++ b/esapi/api.cluster.stats.go @@ -30,7 +30,8 @@ type ClusterStats func(o ...func(*ClusterStatsRequest)) (*Response, error) // ClusterStatsRequest configures the Cluster Stats API request. // type ClusterStatsRequest struct { - NodeID []string + NodeID []string + FlatSettings *bool Timeout time.Duration diff --git a/esapi/api.count.go b/esapi/api.count.go index 14a0832ed0..54a9fe6d8b 100755 --- a/esapi/api.count.go +++ b/esapi/api.count.go @@ -32,7 +32,8 @@ type Count func(o ...func(*CountRequest)) (*Response, error) type CountRequest struct { Index []string DocumentType []string - Body io.Reader + + Body io.Reader AllowNoIndices *bool Analyzer string @@ -194,6 +195,14 @@ func (f Count) WithContext(v context.Context) func(*CountRequest) { } } +// WithBody - A query to restrict the results specified with the Query DSL (optional). +// +func (f Count) WithBody(v io.Reader) func(*CountRequest) { + return func(r *CountRequest) { + r.Body = v + } +} + // WithIndex - a list of indices to restrict the results. // func (f Count) WithIndex(v ...string) func(*CountRequest) { @@ -210,14 +219,6 @@ func (f Count) WithDocumentType(v ...string) func(*CountRequest) { } } -// WithBody - A query to restrict the results specified with the Query DSL (optional). -// -func (f Count) WithBody(v io.Reader) func(*CountRequest) { - return func(r *CountRequest) { - r.Body = v - } -} - // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). // func (f Count) WithAllowNoIndices(v bool) func(*CountRequest) { diff --git a/esapi/api.create.go b/esapi/api.create.go index d605227da4..de6b081e6a 100755 --- a/esapi/api.create.go +++ b/esapi/api.create.go @@ -36,7 +36,8 @@ type CreateRequest struct { Index string DocumentType string DocumentID string - Body io.Reader + + Body io.Reader Parent string Pipeline string diff --git a/esapi/api.delete_by_query.go b/esapi/api.delete_by_query.go index 32e64a0360..a47b065cf9 100755 --- a/esapi/api.delete_by_query.go +++ b/esapi/api.delete_by_query.go @@ -33,7 +33,8 @@ type DeleteByQuery func(index []string, body io.Reader, o ...func(*DeleteByQuery type DeleteByQueryRequest struct { Index []string DocumentType []string - Body io.Reader + + Body io.Reader AllowNoIndices *bool Analyzer string diff --git a/esapi/api.delete_by_query_rethrottle.go b/esapi/api.delete_by_query_rethrottle.go index 0448290904..d2b9520462 100755 --- a/esapi/api.delete_by_query_rethrottle.go +++ b/esapi/api.delete_by_query_rethrottle.go @@ -29,7 +29,8 @@ type DeleteByQueryRethrottle func(task_id string, requests_per_second *int, o .. // DeleteByQueryRethrottleRequest configures the Delete By Query Rethrottle API request. // type DeleteByQueryRethrottleRequest struct { - TaskID string + TaskID string + RequestsPerSecond *int Pretty bool diff --git a/esapi/api.explain.go b/esapi/api.explain.go index 302b5004a1..d0e8617e6e 100755 --- a/esapi/api.explain.go +++ b/esapi/api.explain.go @@ -33,7 +33,8 @@ type ExplainRequest struct { Index string DocumentType string DocumentID string - Body io.Reader + + Body io.Reader Analyzer string AnalyzeWildcard *bool @@ -194,19 +195,19 @@ func (f Explain) WithContext(v context.Context) func(*ExplainRequest) { } } -// WithDocumentType - the type of the document. +// WithBody - The query definition using the Query DSL. // -func (f Explain) WithDocumentType(v string) func(*ExplainRequest) { +func (f Explain) WithBody(v io.Reader) func(*ExplainRequest) { return func(r *ExplainRequest) { - r.DocumentType = v + r.Body = v } } -// WithBody - The query definition using the Query DSL. +// WithDocumentType - the type of the document. // -func (f Explain) WithBody(v io.Reader) func(*ExplainRequest) { +func (f Explain) WithDocumentType(v string) func(*ExplainRequest) { return func(r *ExplainRequest) { - r.Body = v + r.DocumentType = v } } diff --git a/esapi/api.index.go b/esapi/api.index.go index ccbc1ab204..0dd17fabec 100755 --- a/esapi/api.index.go +++ b/esapi/api.index.go @@ -34,7 +34,8 @@ type IndexRequest struct { Index string DocumentType string DocumentID string - Body io.Reader + + Body io.Reader IfPrimaryTerm *int IfSeqNo *int diff --git a/esapi/api.indices.analyze.go b/esapi/api.indices.analyze.go index d8ce8bb43c..1f1322acfc 100755 --- a/esapi/api.indices.analyze.go +++ b/esapi/api.indices.analyze.go @@ -30,7 +30,8 @@ type IndicesAnalyze func(o ...func(*IndicesAnalyzeRequest)) (*Response, error) // type IndicesAnalyzeRequest struct { Index string - Body io.Reader + + Body io.Reader Pretty bool Human bool @@ -121,19 +122,19 @@ func (f IndicesAnalyze) WithContext(v context.Context) func(*IndicesAnalyzeReque } } -// WithIndex - the name of the index to scope the operation. +// WithBody - Define analyzer/tokenizer parameters and the text on which the analysis should be performed. // -func (f IndicesAnalyze) WithIndex(v string) func(*IndicesAnalyzeRequest) { +func (f IndicesAnalyze) WithBody(v io.Reader) func(*IndicesAnalyzeRequest) { return func(r *IndicesAnalyzeRequest) { - r.Index = v + r.Body = v } } -// WithBody - Define analyzer/tokenizer parameters and the text on which the analysis should be performed. +// WithIndex - the name of the index to scope the operation. // -func (f IndicesAnalyze) WithBody(v io.Reader) func(*IndicesAnalyzeRequest) { +func (f IndicesAnalyze) WithIndex(v string) func(*IndicesAnalyzeRequest) { return func(r *IndicesAnalyzeRequest) { - r.Body = v + r.Index = v } } diff --git a/esapi/api.indices.create.go b/esapi/api.indices.create.go index 5e073fbbbd..e08801c876 100755 --- a/esapi/api.indices.create.go +++ b/esapi/api.indices.create.go @@ -32,7 +32,8 @@ type IndicesCreate func(index string, o ...func(*IndicesCreateRequest)) (*Respon // type IndicesCreateRequest struct { Index string - Body io.Reader + + Body io.Reader IncludeTypeName *bool MasterTimeout time.Duration diff --git a/esapi/api.indices.delete_alias.go b/esapi/api.indices.delete_alias.go index a9032b91b9..2c4791916f 100755 --- a/esapi/api.indices.delete_alias.go +++ b/esapi/api.indices.delete_alias.go @@ -31,7 +31,8 @@ type IndicesDeleteAlias func(index []string, name []string, o ...func(*IndicesDe type IndicesDeleteAliasRequest struct { Index []string - Name []string + Name []string + MasterTimeout time.Duration Timeout time.Duration diff --git a/esapi/api.indices.delete_template.go b/esapi/api.indices.delete_template.go index ebde1db3a6..c452312759 100755 --- a/esapi/api.indices.delete_template.go +++ b/esapi/api.indices.delete_template.go @@ -29,7 +29,8 @@ type IndicesDeleteTemplate func(name string, o ...func(*IndicesDeleteTemplateReq // IndicesDeleteTemplateRequest configures the Indices Delete Template API request. // type IndicesDeleteTemplateRequest struct { - Name string + Name string + MasterTimeout time.Duration Timeout time.Duration diff --git a/esapi/api.indices.exists_alias.go b/esapi/api.indices.exists_alias.go index b3a3fb1e03..5852fbee24 100755 --- a/esapi/api.indices.exists_alias.go +++ b/esapi/api.indices.exists_alias.go @@ -31,7 +31,8 @@ type IndicesExistsAlias func(name []string, o ...func(*IndicesExistsAliasRequest type IndicesExistsAliasRequest struct { Index []string - Name []string + Name []string + AllowNoIndices *bool ExpandWildcards string IgnoreUnavailable *bool diff --git a/esapi/api.indices.exists_template.go b/esapi/api.indices.exists_template.go index 2e1fedcb57..b6cda49c0b 100755 --- a/esapi/api.indices.exists_template.go +++ b/esapi/api.indices.exists_template.go @@ -30,7 +30,8 @@ type IndicesExistsTemplate func(name []string, o ...func(*IndicesExistsTemplateR // IndicesExistsTemplateRequest configures the Indices Exists Template API request. // type IndicesExistsTemplateRequest struct { - Name []string + Name []string + FlatSettings *bool Local *bool MasterTimeout time.Duration diff --git a/esapi/api.indices.get_alias.go b/esapi/api.indices.get_alias.go index 36bd7df573..d37ae7ebcd 100755 --- a/esapi/api.indices.get_alias.go +++ b/esapi/api.indices.get_alias.go @@ -31,7 +31,8 @@ type IndicesGetAlias func(o ...func(*IndicesGetAliasRequest)) (*Response, error) type IndicesGetAliasRequest struct { Index []string - Name []string + Name []string + AllowNoIndices *bool ExpandWildcards string IgnoreUnavailable *bool diff --git a/esapi/api.indices.get_field_mapping.go b/esapi/api.indices.get_field_mapping.go index b4e34084d2..6ec0194ab1 100755 --- a/esapi/api.indices.get_field_mapping.go +++ b/esapi/api.indices.get_field_mapping.go @@ -32,7 +32,8 @@ type IndicesGetFieldMappingRequest struct { Index []string DocumentType []string - Fields []string + Fields []string + AllowNoIndices *bool ExpandWildcards string IgnoreUnavailable *bool diff --git a/esapi/api.indices.get_settings.go b/esapi/api.indices.get_settings.go index 9e0ad75f34..923df5a54b 100755 --- a/esapi/api.indices.get_settings.go +++ b/esapi/api.indices.get_settings.go @@ -32,7 +32,8 @@ type IndicesGetSettings func(o ...func(*IndicesGetSettingsRequest)) (*Response, type IndicesGetSettingsRequest struct { Index []string - Name []string + Name []string + AllowNoIndices *bool ExpandWildcards string FlatSettings *bool diff --git a/esapi/api.indices.get_template.go b/esapi/api.indices.get_template.go index 13c4b263c4..bc42005d5b 100755 --- a/esapi/api.indices.get_template.go +++ b/esapi/api.indices.get_template.go @@ -30,7 +30,8 @@ type IndicesGetTemplate func(o ...func(*IndicesGetTemplateRequest)) (*Response, // IndicesGetTemplateRequest configures the Indices Get Template API request. // type IndicesGetTemplateRequest struct { - Name []string + Name []string + FlatSettings *bool IncludeTypeName *bool Local *bool diff --git a/esapi/api.indices.put_alias.go b/esapi/api.indices.put_alias.go index 419fb9466d..b2cbd3e717 100755 --- a/esapi/api.indices.put_alias.go +++ b/esapi/api.indices.put_alias.go @@ -31,9 +31,11 @@ type IndicesPutAlias func(index []string, name string, o ...func(*IndicesPutAlia // type IndicesPutAliasRequest struct { Index []string - Body io.Reader - Name string + Body io.Reader + + Name string + MasterTimeout time.Duration Timeout time.Duration diff --git a/esapi/api.indices.put_mapping.go b/esapi/api.indices.put_mapping.go index 72745b924f..505cce298f 100755 --- a/esapi/api.indices.put_mapping.go +++ b/esapi/api.indices.put_mapping.go @@ -33,7 +33,8 @@ type IndicesPutMapping func(body io.Reader, o ...func(*IndicesPutMappingRequest) type IndicesPutMappingRequest struct { Index []string DocumentType string - Body io.Reader + + Body io.Reader AllowNoIndices *bool ExpandWildcards string diff --git a/esapi/api.indices.put_settings.go b/esapi/api.indices.put_settings.go index d76769938a..b678831e9f 100755 --- a/esapi/api.indices.put_settings.go +++ b/esapi/api.indices.put_settings.go @@ -32,7 +32,8 @@ type IndicesPutSettings func(body io.Reader, o ...func(*IndicesPutSettingsReques // type IndicesPutSettingsRequest struct { Index []string - Body io.Reader + + Body io.Reader AllowNoIndices *bool ExpandWildcards string diff --git a/esapi/api.indices.put_template.go b/esapi/api.indices.put_template.go index ae6b32b023..eb81319f7b 100755 --- a/esapi/api.indices.put_template.go +++ b/esapi/api.indices.put_template.go @@ -33,7 +33,8 @@ type IndicesPutTemplate func(body io.Reader, name string, o ...func(*IndicesPutT type IndicesPutTemplateRequest struct { Body io.Reader - Name string + Name string + Create *bool FlatSettings *bool IncludeTypeName *bool diff --git a/esapi/api.indices.rollover.go b/esapi/api.indices.rollover.go index 8dcc67570b..54edc162b7 100755 --- a/esapi/api.indices.rollover.go +++ b/esapi/api.indices.rollover.go @@ -34,8 +34,9 @@ type IndicesRollover func(alias string, o ...func(*IndicesRolloverRequest)) (*Re type IndicesRolloverRequest struct { Body io.Reader - Alias string - NewIndex string + Alias string + NewIndex string + DryRun *bool IncludeTypeName *bool MasterTimeout time.Duration @@ -149,19 +150,19 @@ func (f IndicesRollover) WithContext(v context.Context) func(*IndicesRolloverReq } } -// WithNewIndex - the name of the rollover index. +// WithBody - The conditions that needs to be met for executing rollover. // -func (f IndicesRollover) WithNewIndex(v string) func(*IndicesRolloverRequest) { +func (f IndicesRollover) WithBody(v io.Reader) func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { - r.NewIndex = v + r.Body = v } } -// WithBody - The conditions that needs to be met for executing rollover. +// WithNewIndex - the name of the rollover index. // -func (f IndicesRollover) WithBody(v io.Reader) func(*IndicesRolloverRequest) { +func (f IndicesRollover) WithNewIndex(v string) func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { - r.Body = v + r.NewIndex = v } } diff --git a/esapi/api.indices.shrink.go b/esapi/api.indices.shrink.go index 900417870e..9da86dbd75 100755 --- a/esapi/api.indices.shrink.go +++ b/esapi/api.indices.shrink.go @@ -32,9 +32,11 @@ type IndicesShrink func(index string, target string, o ...func(*IndicesShrinkReq // type IndicesShrinkRequest struct { Index string - Body io.Reader - Target string + Body io.Reader + + Target string + CopySettings *bool MasterTimeout time.Duration Timeout time.Duration diff --git a/esapi/api.indices.split.go b/esapi/api.indices.split.go index 53dd5c8095..3196864bcc 100755 --- a/esapi/api.indices.split.go +++ b/esapi/api.indices.split.go @@ -32,9 +32,11 @@ type IndicesSplit func(index string, target string, o ...func(*IndicesSplitReque // type IndicesSplitRequest struct { Index string - Body io.Reader - Target string + Body io.Reader + + Target string + CopySettings *bool MasterTimeout time.Duration Timeout time.Duration diff --git a/esapi/api.indices.stats.go b/esapi/api.indices.stats.go index 813462142f..23df02b1d7 100755 --- a/esapi/api.indices.stats.go +++ b/esapi/api.indices.stats.go @@ -31,7 +31,8 @@ type IndicesStats func(o ...func(*IndicesStatsRequest)) (*Response, error) type IndicesStatsRequest struct { Index []string - Metric []string + Metric []string + CompletionFields []string FielddataFields []string Fields []string diff --git a/esapi/api.indices.validate_query.go b/esapi/api.indices.validate_query.go index c2eef0199e..80ffed90f8 100755 --- a/esapi/api.indices.validate_query.go +++ b/esapi/api.indices.validate_query.go @@ -32,7 +32,8 @@ type IndicesValidateQuery func(o ...func(*IndicesValidateQueryRequest)) (*Respon type IndicesValidateQueryRequest struct { Index []string DocumentType []string - Body io.Reader + + Body io.Reader AllowNoIndices *bool AllShards *bool @@ -186,6 +187,14 @@ func (f IndicesValidateQuery) WithContext(v context.Context) func(*IndicesValida } } +// WithBody - The query definition specified with the Query DSL. +// +func (f IndicesValidateQuery) WithBody(v io.Reader) func(*IndicesValidateQueryRequest) { + return func(r *IndicesValidateQueryRequest) { + r.Body = v + } +} + // WithIndex - a list of index names to restrict the operation; use _all to perform the operation on all indices. // func (f IndicesValidateQuery) WithIndex(v ...string) func(*IndicesValidateQueryRequest) { @@ -202,14 +211,6 @@ func (f IndicesValidateQuery) WithDocumentType(v ...string) func(*IndicesValidat } } -// WithBody - The query definition specified with the Query DSL. -// -func (f IndicesValidateQuery) WithBody(v io.Reader) func(*IndicesValidateQueryRequest) { - return func(r *IndicesValidateQueryRequest) { - r.Body = v - } -} - // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). // func (f IndicesValidateQuery) WithAllowNoIndices(v bool) func(*IndicesValidateQueryRequest) { diff --git a/esapi/api.ingest.put_pipeline.go b/esapi/api.ingest.put_pipeline.go index 87ac91236e..689bc1b28d 100755 --- a/esapi/api.ingest.put_pipeline.go +++ b/esapi/api.ingest.put_pipeline.go @@ -31,7 +31,8 @@ type IngestPutPipeline func(id string, body io.Reader, o ...func(*IngestPutPipel // type IngestPutPipelineRequest struct { DocumentID string - Body io.Reader + + Body io.Reader MasterTimeout time.Duration Timeout time.Duration diff --git a/esapi/api.ingest.simulate.go b/esapi/api.ingest.simulate.go index b2070b5e83..f5fd55d4f3 100755 --- a/esapi/api.ingest.simulate.go +++ b/esapi/api.ingest.simulate.go @@ -31,7 +31,8 @@ type IngestSimulate func(body io.Reader, o ...func(*IngestSimulateRequest)) (*Re // type IngestSimulateRequest struct { DocumentID string - Body io.Reader + + Body io.Reader Verbose *bool diff --git a/esapi/api.mget.go b/esapi/api.mget.go index c51f4632c7..f523d0ac01 100755 --- a/esapi/api.mget.go +++ b/esapi/api.mget.go @@ -32,7 +32,8 @@ type Mget func(body io.Reader, o ...func(*MgetRequest)) (*Response, error) type MgetRequest struct { Index string DocumentType string - Body io.Reader + + Body io.Reader Preference string Realtime *bool diff --git a/esapi/api.msearch.go b/esapi/api.msearch.go index 3858f168b6..4ae20d24a1 100755 --- a/esapi/api.msearch.go +++ b/esapi/api.msearch.go @@ -32,7 +32,8 @@ type Msearch func(body io.Reader, o ...func(*MsearchRequest)) (*Response, error) type MsearchRequest struct { Index []string DocumentType []string - Body io.Reader + + Body io.Reader CcsMinimizeRoundtrips *bool MaxConcurrentSearches *int diff --git a/esapi/api.msearch_template.go b/esapi/api.msearch_template.go index 7ed2c96c54..065c5d23cb 100755 --- a/esapi/api.msearch_template.go +++ b/esapi/api.msearch_template.go @@ -32,7 +32,8 @@ type MsearchTemplate func(body io.Reader, o ...func(*MsearchTemplateRequest)) (* type MsearchTemplateRequest struct { Index []string DocumentType []string - Body io.Reader + + Body io.Reader CcsMinimizeRoundtrips *bool MaxConcurrentSearches *int diff --git a/esapi/api.mtermvectors.go b/esapi/api.mtermvectors.go index 924744d8fa..ac2b1c6c79 100755 --- a/esapi/api.mtermvectors.go +++ b/esapi/api.mtermvectors.go @@ -32,7 +32,8 @@ type Mtermvectors func(o ...func(*MtermvectorsRequest)) (*Response, error) type MtermvectorsRequest struct { Index string DocumentType string - Body io.Reader + + Body io.Reader Fields []string FieldStatistics *bool @@ -189,6 +190,14 @@ func (f Mtermvectors) WithContext(v context.Context) func(*MtermvectorsRequest) } } +// WithBody - Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation.. +// +func (f Mtermvectors) WithBody(v io.Reader) func(*MtermvectorsRequest) { + return func(r *MtermvectorsRequest) { + r.Body = v + } +} + // WithIndex - the index in which the document resides.. // func (f Mtermvectors) WithIndex(v string) func(*MtermvectorsRequest) { @@ -205,14 +214,6 @@ func (f Mtermvectors) WithDocumentType(v string) func(*MtermvectorsRequest) { } } -// WithBody - Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation.. -// -func (f Mtermvectors) WithBody(v io.Reader) func(*MtermvectorsRequest) { - return func(r *MtermvectorsRequest) { - r.Body = v - } -} - // WithFields - a list of fields to return. applies to all returned documents unless otherwise specified in body "params" or "docs".. // func (f Mtermvectors) WithFields(v ...string) func(*MtermvectorsRequest) { diff --git a/esapi/api.nodes.hot_threads.go b/esapi/api.nodes.hot_threads.go index 179a408c96..5a846e64de 100755 --- a/esapi/api.nodes.hot_threads.go +++ b/esapi/api.nodes.hot_threads.go @@ -30,7 +30,8 @@ type NodesHotThreads func(o ...func(*NodesHotThreadsRequest)) (*Response, error) // NodesHotThreadsRequest configures the Nodes Hot Threads API request. // type NodesHotThreadsRequest struct { - NodeID []string + NodeID []string + IgnoreIdleThreads *bool Interval time.Duration Snapshots *int diff --git a/esapi/api.nodes.info.go b/esapi/api.nodes.info.go index d284fc6b30..aa5926af9a 100755 --- a/esapi/api.nodes.info.go +++ b/esapi/api.nodes.info.go @@ -30,8 +30,9 @@ type NodesInfo func(o ...func(*NodesInfoRequest)) (*Response, error) // NodesInfoRequest configures the Nodes Info API request. // type NodesInfoRequest struct { - NodeID []string - Metric []string + Metric []string + NodeID []string + FlatSettings *bool Timeout time.Duration diff --git a/esapi/api.nodes.reload_secure_settings.go b/esapi/api.nodes.reload_secure_settings.go index e698310075..cf0f2d1342 100755 --- a/esapi/api.nodes.reload_secure_settings.go +++ b/esapi/api.nodes.reload_secure_settings.go @@ -29,7 +29,8 @@ type NodesReloadSecureSettings func(o ...func(*NodesReloadSecureSettingsRequest) // NodesReloadSecureSettingsRequest configures the Nodes Reload Secure Settings API request. // type NodesReloadSecureSettingsRequest struct { - NodeID []string + NodeID []string + Timeout time.Duration Pretty bool diff --git a/esapi/api.nodes.stats.go b/esapi/api.nodes.stats.go index af4e0de3ea..800ef88968 100755 --- a/esapi/api.nodes.stats.go +++ b/esapi/api.nodes.stats.go @@ -30,9 +30,10 @@ type NodesStats func(o ...func(*NodesStatsRequest)) (*Response, error) // NodesStatsRequest configures the Nodes Stats API request. // type NodesStatsRequest struct { - NodeID []string - Metric []string - IndexMetric []string + IndexMetric []string + Metric []string + NodeID []string + CompletionFields []string FielddataFields []string Fields []string diff --git a/esapi/api.nodes.usage.go b/esapi/api.nodes.usage.go index 48473bf052..6f0721c47f 100755 --- a/esapi/api.nodes.usage.go +++ b/esapi/api.nodes.usage.go @@ -29,8 +29,9 @@ type NodesUsage func(o ...func(*NodesUsageRequest)) (*Response, error) // NodesUsageRequest configures the Nodes Usage API request. // type NodesUsageRequest struct { - Metric []string - NodeID []string + Metric []string + NodeID []string + Timeout time.Duration Pretty bool diff --git a/esapi/api.put_script.go b/esapi/api.put_script.go index 9bb5c8f64c..9b66dfb001 100755 --- a/esapi/api.put_script.go +++ b/esapi/api.put_script.go @@ -31,9 +31,11 @@ type PutScript func(id string, body io.Reader, o ...func(*PutScriptRequest)) (*R // type PutScriptRequest struct { DocumentID string - Body io.Reader + + Body io.Reader ScriptContext string + MasterTimeout time.Duration Timeout time.Duration diff --git a/esapi/api.rank_eval.go b/esapi/api.rank_eval.go index ed33a98685..dc0635acbc 100755 --- a/esapi/api.rank_eval.go +++ b/esapi/api.rank_eval.go @@ -31,7 +31,8 @@ type RankEval func(body io.Reader, o ...func(*RankEvalRequest)) (*Response, erro // type RankEvalRequest struct { Index []string - Body io.Reader + + Body io.Reader AllowNoIndices *bool ExpandWildcards string diff --git a/esapi/api.reindex_rethrottle.go b/esapi/api.reindex_rethrottle.go index 4d7031e151..68b7d3abee 100755 --- a/esapi/api.reindex_rethrottle.go +++ b/esapi/api.reindex_rethrottle.go @@ -29,7 +29,8 @@ type ReindexRethrottle func(task_id string, requests_per_second *int, o ...func( // ReindexRethrottleRequest configures the Reindex Rethrottle API request. // type ReindexRethrottleRequest struct { - TaskID string + TaskID string + RequestsPerSecond *int Pretty bool diff --git a/esapi/api.render_search_template.go b/esapi/api.render_search_template.go index 905c8cd863..bac060065b 100755 --- a/esapi/api.render_search_template.go +++ b/esapi/api.render_search_template.go @@ -30,7 +30,8 @@ type RenderSearchTemplate func(o ...func(*RenderSearchTemplateRequest)) (*Respon // type RenderSearchTemplateRequest struct { DocumentID string - Body io.Reader + + Body io.Reader Pretty bool Human bool @@ -119,19 +120,19 @@ func (f RenderSearchTemplate) WithContext(v context.Context) func(*RenderSearchT } } -// WithDocumentID - the ID of the stored search template. +// WithBody - The search definition template and its params. // -func (f RenderSearchTemplate) WithDocumentID(v string) func(*RenderSearchTemplateRequest) { +func (f RenderSearchTemplate) WithBody(v io.Reader) func(*RenderSearchTemplateRequest) { return func(r *RenderSearchTemplateRequest) { - r.DocumentID = v + r.Body = v } } -// WithBody - The search definition template and its params. +// WithDocumentID - the ID of the stored search template. // -func (f RenderSearchTemplate) WithBody(v io.Reader) func(*RenderSearchTemplateRequest) { +func (f RenderSearchTemplate) WithDocumentID(v string) func(*RenderSearchTemplateRequest) { return func(r *RenderSearchTemplateRequest) { - r.Body = v + r.DocumentID = v } } diff --git a/esapi/api.scroll.go b/esapi/api.scroll.go index df6890e136..fb03e16a7b 100755 --- a/esapi/api.scroll.go +++ b/esapi/api.scroll.go @@ -33,7 +33,8 @@ type Scroll func(o ...func(*ScrollRequest)) (*Response, error) type ScrollRequest struct { Body io.Reader - ScrollID string + ScrollID string + RestTotalHitsAsInt *bool Scroll time.Duration @@ -136,19 +137,19 @@ func (f Scroll) WithContext(v context.Context) func(*ScrollRequest) { } } -// WithScrollID - the scroll ID. +// WithBody - The scroll ID if not passed by URL or query parameter.. // -func (f Scroll) WithScrollID(v string) func(*ScrollRequest) { +func (f Scroll) WithBody(v io.Reader) func(*ScrollRequest) { return func(r *ScrollRequest) { - r.ScrollID = v + r.Body = v } } -// WithBody - The scroll ID if not passed by URL or query parameter.. +// WithScrollID - the scroll ID. // -func (f Scroll) WithBody(v io.Reader) func(*ScrollRequest) { +func (f Scroll) WithScrollID(v string) func(*ScrollRequest) { return func(r *ScrollRequest) { - r.Body = v + r.ScrollID = v } } diff --git a/esapi/api.search.go b/esapi/api.search.go index 90cad4f74b..411e8f26db 100755 --- a/esapi/api.search.go +++ b/esapi/api.search.go @@ -34,7 +34,8 @@ type Search func(o ...func(*SearchRequest)) (*Response, error) type SearchRequest struct { Index []string DocumentType []string - Body io.Reader + + Body io.Reader AllowNoIndices *bool AllowPartialSearchResults *bool @@ -336,6 +337,14 @@ func (f Search) WithContext(v context.Context) func(*SearchRequest) { } } +// WithBody - The search definition using the Query DSL. +// +func (f Search) WithBody(v io.Reader) func(*SearchRequest) { + return func(r *SearchRequest) { + r.Body = v + } +} + // WithIndex - a list of index names to search; use _all to perform the operation on all indices. // func (f Search) WithIndex(v ...string) func(*SearchRequest) { @@ -352,14 +361,6 @@ func (f Search) WithDocumentType(v ...string) func(*SearchRequest) { } } -// WithBody - The search definition using the Query DSL. -// -func (f Search) WithBody(v io.Reader) func(*SearchRequest) { - return func(r *SearchRequest) { - r.Body = v - } -} - // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). // func (f Search) WithAllowNoIndices(v bool) func(*SearchRequest) { diff --git a/esapi/api.search_template.go b/esapi/api.search_template.go index 491775193f..2b9ce2191d 100755 --- a/esapi/api.search_template.go +++ b/esapi/api.search_template.go @@ -33,7 +33,8 @@ type SearchTemplate func(body io.Reader, o ...func(*SearchTemplateRequest)) (*Re type SearchTemplateRequest struct { Index []string DocumentType []string - Body io.Reader + + Body io.Reader AllowNoIndices *bool CcsMinimizeRoundtrips *bool diff --git a/esapi/api.snapshot.create.go b/esapi/api.snapshot.create.go index 51ccedb72d..5736d3afab 100755 --- a/esapi/api.snapshot.create.go +++ b/esapi/api.snapshot.create.go @@ -33,8 +33,9 @@ type SnapshotCreate func(repository string, snapshot string, o ...func(*Snapshot type SnapshotCreateRequest struct { Body io.Reader - Repository string - Snapshot string + Repository string + Snapshot string + MasterTimeout time.Duration WaitForCompletion *bool diff --git a/esapi/api.snapshot.create_repository.go b/esapi/api.snapshot.create_repository.go index 9ebf374aef..fff7aa21f7 100755 --- a/esapi/api.snapshot.create_repository.go +++ b/esapi/api.snapshot.create_repository.go @@ -33,7 +33,8 @@ type SnapshotCreateRepository func(repository string, body io.Reader, o ...func( type SnapshotCreateRepositoryRequest struct { Body io.Reader - Repository string + Repository string + MasterTimeout time.Duration Timeout time.Duration Verify *bool diff --git a/esapi/api.snapshot.delete.go b/esapi/api.snapshot.delete.go index 5f53f6b338..924196981b 100755 --- a/esapi/api.snapshot.delete.go +++ b/esapi/api.snapshot.delete.go @@ -29,8 +29,9 @@ type SnapshotDelete func(repository string, snapshot string, o ...func(*Snapshot // SnapshotDeleteRequest configures the Snapshot Delete API request. // type SnapshotDeleteRequest struct { - Repository string - Snapshot string + Repository string + Snapshot string + MasterTimeout time.Duration Pretty bool diff --git a/esapi/api.snapshot.delete_repository.go b/esapi/api.snapshot.delete_repository.go index 364623bee1..acfe2c9e13 100755 --- a/esapi/api.snapshot.delete_repository.go +++ b/esapi/api.snapshot.delete_repository.go @@ -29,7 +29,8 @@ type SnapshotDeleteRepository func(repository []string, o ...func(*SnapshotDelet // SnapshotDeleteRepositoryRequest configures the Snapshot Delete Repository API request. // type SnapshotDeleteRepositoryRequest struct { - Repository []string + Repository []string + MasterTimeout time.Duration Timeout time.Duration diff --git a/esapi/api.snapshot.get.go b/esapi/api.snapshot.get.go index c74573c316..0bc4b12969 100755 --- a/esapi/api.snapshot.get.go +++ b/esapi/api.snapshot.get.go @@ -30,8 +30,9 @@ type SnapshotGet func(repository string, snapshot []string, o ...func(*SnapshotG // SnapshotGetRequest configures the Snapshot Get API request. // type SnapshotGetRequest struct { - Repository string - Snapshot []string + Repository string + Snapshot []string + IgnoreUnavailable *bool MasterTimeout time.Duration Verbose *bool diff --git a/esapi/api.snapshot.get_repository.go b/esapi/api.snapshot.get_repository.go index 62cbf5cfc9..f966471aca 100755 --- a/esapi/api.snapshot.get_repository.go +++ b/esapi/api.snapshot.get_repository.go @@ -30,7 +30,8 @@ type SnapshotGetRepository func(o ...func(*SnapshotGetRepositoryRequest)) (*Resp // SnapshotGetRepositoryRequest configures the Snapshot Get Repository API request. // type SnapshotGetRepositoryRequest struct { - Repository []string + Repository []string + Local *bool MasterTimeout time.Duration diff --git a/esapi/api.snapshot.restore.go b/esapi/api.snapshot.restore.go index 8236fb0053..0714d283cc 100755 --- a/esapi/api.snapshot.restore.go +++ b/esapi/api.snapshot.restore.go @@ -33,8 +33,9 @@ type SnapshotRestore func(repository string, snapshot string, o ...func(*Snapsho type SnapshotRestoreRequest struct { Body io.Reader - Snapshot string - Repository string + Repository string + Snapshot string + MasterTimeout time.Duration WaitForCompletion *bool diff --git a/esapi/api.snapshot.status.go b/esapi/api.snapshot.status.go index 0c3cff43ff..4d01416ea3 100755 --- a/esapi/api.snapshot.status.go +++ b/esapi/api.snapshot.status.go @@ -30,8 +30,9 @@ type SnapshotStatus func(o ...func(*SnapshotStatusRequest)) (*Response, error) // SnapshotStatusRequest configures the Snapshot Status API request. // type SnapshotStatusRequest struct { - Repository string - Snapshot []string + Repository string + Snapshot []string + IgnoreUnavailable *bool MasterTimeout time.Duration diff --git a/esapi/api.snapshot.verify_repository.go b/esapi/api.snapshot.verify_repository.go index 1623866ed8..b823e90d2a 100755 --- a/esapi/api.snapshot.verify_repository.go +++ b/esapi/api.snapshot.verify_repository.go @@ -29,7 +29,8 @@ type SnapshotVerifyRepository func(repository string, o ...func(*SnapshotVerifyR // SnapshotVerifyRepositoryRequest configures the Snapshot Verify Repository API request. // type SnapshotVerifyRepositoryRequest struct { - Repository string + Repository string + MasterTimeout time.Duration Timeout time.Duration diff --git a/esapi/api.tasks.cancel.go b/esapi/api.tasks.cancel.go index f1a256b720..56408abe26 100755 --- a/esapi/api.tasks.cancel.go +++ b/esapi/api.tasks.cancel.go @@ -28,7 +28,8 @@ type TasksCancel func(o ...func(*TasksCancelRequest)) (*Response, error) // TasksCancelRequest configures the Tasks Cancel API request. // type TasksCancelRequest struct { - TaskID string + TaskID string + Actions []string Nodes []string ParentTaskID string diff --git a/esapi/api.tasks.get.go b/esapi/api.tasks.get.go index c2d71756c4..5a6f8e5da4 100755 --- a/esapi/api.tasks.get.go +++ b/esapi/api.tasks.get.go @@ -30,7 +30,8 @@ type TasksGet func(task_id string, o ...func(*TasksGetRequest)) (*Response, erro // TasksGetRequest configures the Tasks Get API request. // type TasksGetRequest struct { - TaskID string + TaskID string + Timeout time.Duration WaitForCompletion *bool diff --git a/esapi/api.termvectors.go b/esapi/api.termvectors.go index 51b3d1fe0a..4623a6f5af 100755 --- a/esapi/api.termvectors.go +++ b/esapi/api.termvectors.go @@ -33,7 +33,8 @@ type TermvectorsRequest struct { Index string DocumentType string DocumentID string - Body io.Reader + + Body io.Reader Fields []string FieldStatistics *bool @@ -191,6 +192,14 @@ func (f Termvectors) WithContext(v context.Context) func(*TermvectorsRequest) { } } +// WithBody - Define parameters and or supply a document to get termvectors for. See documentation.. +// +func (f Termvectors) WithBody(v io.Reader) func(*TermvectorsRequest) { + return func(r *TermvectorsRequest) { + r.Body = v + } +} + // WithDocumentID - the ID of the document, when not specified a doc param should be supplied.. // func (f Termvectors) WithDocumentID(v string) func(*TermvectorsRequest) { @@ -207,14 +216,6 @@ func (f Termvectors) WithDocumentType(v string) func(*TermvectorsRequest) { } } -// WithBody - Define parameters and or supply a document to get termvectors for. See documentation.. -// -func (f Termvectors) WithBody(v io.Reader) func(*TermvectorsRequest) { - return func(r *TermvectorsRequest) { - r.Body = v - } -} - // WithFields - a list of fields to return.. // func (f Termvectors) WithFields(v ...string) func(*TermvectorsRequest) { diff --git a/esapi/api.update.go b/esapi/api.update.go index 57441f0bad..ffbc0948c8 100755 --- a/esapi/api.update.go +++ b/esapi/api.update.go @@ -34,7 +34,8 @@ type UpdateRequest struct { Index string DocumentType string DocumentID string - Body io.Reader + + Body io.Reader IfPrimaryTerm *int IfSeqNo *int diff --git a/esapi/api.update_by_query.go b/esapi/api.update_by_query.go index e3952e6575..7238bdd32e 100755 --- a/esapi/api.update_by_query.go +++ b/esapi/api.update_by_query.go @@ -34,7 +34,8 @@ type UpdateByQuery func(index []string, o ...func(*UpdateByQueryRequest)) (*Resp type UpdateByQueryRequest struct { Index []string DocumentType []string - Body io.Reader + + Body io.Reader AllowNoIndices *bool Analyzer string @@ -294,19 +295,19 @@ func (f UpdateByQuery) WithContext(v context.Context) func(*UpdateByQueryRequest } } -// WithDocumentType - a list of document types to search; leave empty to perform the operation on all types. +// WithBody - The search definition using the Query DSL. // -func (f UpdateByQuery) WithDocumentType(v ...string) func(*UpdateByQueryRequest) { +func (f UpdateByQuery) WithBody(v io.Reader) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { - r.DocumentType = v + r.Body = v } } -// WithBody - The search definition using the Query DSL. +// WithDocumentType - a list of document types to search; leave empty to perform the operation on all types. // -func (f UpdateByQuery) WithBody(v io.Reader) func(*UpdateByQueryRequest) { +func (f UpdateByQuery) WithDocumentType(v ...string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { - r.Body = v + r.DocumentType = v } } diff --git a/esapi/api.update_by_query_rethrottle.go b/esapi/api.update_by_query_rethrottle.go index 170db010c7..0290d3b36a 100755 --- a/esapi/api.update_by_query_rethrottle.go +++ b/esapi/api.update_by_query_rethrottle.go @@ -29,7 +29,8 @@ type UpdateByQueryRethrottle func(task_id string, requests_per_second *int, o .. // UpdateByQueryRethrottleRequest configures the Update By Query Rethrottle API request. // type UpdateByQueryRethrottleRequest struct { - TaskID string + TaskID string + RequestsPerSecond *int Pretty bool From 622f193c0005d0dc175ce75e90f8a7c5b6cfb5a4 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 14 Apr 2019 11:51:02 +0200 Subject: [PATCH 016/355] Release 7.0.0 --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index dd00c32edf..e607e0dd1f 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -2,4 +2,4 @@ package version // Client returns the client version as a string. // -const Client = "7.0.0-SNAPSHOT" +const Client = "7.0.0" From 262306fea6add3ab85cb94aab1a296e0f1db90ea Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 14 Apr 2019 12:38:09 +0200 Subject: [PATCH 017/355] Update version to 7.0.0-SNAPSHOT --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index e607e0dd1f..dd00c32edf 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -2,4 +2,4 @@ package version // Client returns the client version as a string. // -const Client = "7.0.0" +const Client = "7.0.0-SNAPSHOT" From 30986995094fb104771264351f0df91fc36217d4 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 14 Apr 2019 12:05:07 +0200 Subject: [PATCH 018/355] Update version instructions in the README (cherry picked from commit c159ca1d1ba192e7f7ee888dcdce26910bf83078) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2d10eeb703..da2f0f41d9 100755 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ The client major versions correspond to the compatible Elasticsearch major versi When using Go modules, include the version in the import path, and specify either an explicit version or a branch: require github.com/elastic/go-elasticsearch/v7 7.x + require github.com/elastic/go-elasticsearch/v7 7.0.0 It's possible to use multiple versions of the client in a single project: From 08f6ba4ab40d86b58c0db680788e176627f98465 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 14 Apr 2019 12:31:58 +0200 Subject: [PATCH 019/355] Update the installation instructions (cherry picked from commit 2c835c5ee7635e2444d72d22adf8091360c13524) --- README.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index da2f0f41d9..a1647704d5 100755 --- a/README.md +++ b/README.md @@ -37,17 +37,13 @@ The `master` branch of the client is compatible with the current `master` branch ## Installation -Install the package with `go get`: +Add the package to your `go.mod` file: - go get -u github.com/elastic/go-elasticsearch@master - -Or, add the package to your `go.mod` file: - - require github.com/elastic/go-elasticsearch/v7 master + require github.com/elastic/go-elasticsearch/v7 7.x Or, clone the repository: - git clone https://github.com/elastic/go-elasticsearch.git && cd go-elasticsearch + git clone --branch 7.x https://github.com/elastic/go-elasticsearch.git $GOPATH/src/github.com/elastic/go-elasticsearch A complete example: @@ -57,7 +53,7 @@ mkdir my-elasticsearch-app && cd my-elasticsearch-app cat > go.mod <<-END module my-elasticsearch-app - require github.com/elastic/go-elasticsearch/v7 master + require github.com/elastic/go-elasticsearch/v7 7.x END cat > main.go <<-END @@ -71,6 +67,7 @@ cat > main.go <<-END func main() { es, _ := elasticsearch.NewDefaultClient() + log.Println(elasticsearch.Version) log.Println(es.Info()) } END From de1652e8e57c696db657d5f1eeb07566b2216be9 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 10 Apr 2019 15:47:25 +0200 Subject: [PATCH 020/355] Examples: Extending the client APIs (cherry picked from commit cf37bafdad560d13819b030460dbec0472d8934f) --- _examples/README.md | 5 ++ _examples/extension/Makefile | 6 +++ _examples/extension/README.md | 17 ++++++ _examples/extension/main.go | 98 +++++++++++++++++++++++++++++++++++ 4 files changed, 126 insertions(+) create mode 100644 _examples/extension/Makefile create mode 100644 _examples/extension/README.md create mode 100644 _examples/extension/main.go diff --git a/_examples/README.md b/_examples/README.md index eaa28dd79b..81a2c3ab44 100755 --- a/_examples/README.md +++ b/_examples/README.md @@ -25,6 +25,11 @@ The [**`fasthttp`**](./fasthttp) directory contains a demonstration of replacing The [**`instrumentation`**](./instrumentation) directory contains recipes for instrumenting the client with the OpenCensus and Elastic APM packages. +## Extension + +The [**`extension`**](./extension) directory contains an example of extending the client APIs, for example +to support custom endpoints installed by a plugin. + ## Google Cloud Functions The [**`cloudfunction`**](./cloudfunction) directory contains a simple web service for checking Elasticsearch cluster status. diff --git a/_examples/extension/Makefile b/_examples/extension/Makefile new file mode 100644 index 0000000000..c3f5e503c2 --- /dev/null +++ b/_examples/extension/Makefile @@ -0,0 +1,6 @@ +GO_TEST_CMD = $(if $(shell which richgo),richgo test,go test) + +test: ## Run tests + go run main.go + +.PHONY: test diff --git a/_examples/extension/README.md b/_examples/extension/README.md new file mode 100644 index 0000000000..c2b99baf70 --- /dev/null +++ b/_examples/extension/README.md @@ -0,0 +1,17 @@ +# Example: Extending the Client + +This example demonstrates how to extend the client, in order to call custom APIs, for example added by a [plugin](https://github.com/elastic/elasticsearch/blob/master/plugins/examples/rest-handler/src/main/java/org/elasticsearch/example/resthandler/ExampleCatAction.java). + +The [`main.go`](main.go) example defines a custom type, which embeds the regular Elasticsearch client, and adds a `Custom` namespace with an `Example()` method. + +To run the example: + +```bash +go run main.go + +# GET http://localhost:9209/_cat/health 200 OK 25ms +# « 1555252476 14:34:36 go-elasticsearch green 1 1 0 0 0 0 0 0 - 100.0% +# +# GET http://localhost:9209/_cat/example 200 OK 0s +# « Hello from Cat Example action +``` diff --git a/_examples/extension/main.go b/_examples/extension/main.go new file mode 100644 index 0000000000..f2a9746f1d --- /dev/null +++ b/_examples/extension/main.go @@ -0,0 +1,98 @@ +// +build ignore + +// This examples demonstrates how extend the API of the client by embedding it inside a custom type. + +package main + +import ( + "io" + "log" + "net" + "net/http" + "net/http/httputil" + "net/url" + "os" + + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" + "github.com/elastic/go-elasticsearch/v7/estransport" +) + +const port = "9209" + +// ExtendedClient allows to call regular and custom APIs. +// +type ExtendedClient struct { + *elasticsearch.Client + Custom *ExtendedAPI +} + +// ExtendedAPI contains custom APIs. +// +type ExtendedAPI struct { + *elasticsearch.Client +} + +// Example calls a custom REST API, "/_cat/example". +// +func (c *ExtendedAPI) Example() (*esapi.Response, error) { + req, _ := http.NewRequest("GET", "/_cat/example", nil) // errcheck exclude + + res, err := c.Perform(req) + if err != nil { + return nil, err + } + + return &esapi.Response{StatusCode: res.StatusCode, Body: res.Body, Header: res.Header}, nil +} + +func main() { + log.SetFlags(0) + + started := make(chan bool) + + // --> Start the proxy server + // + go startServer(started) + + esclient, err := elasticsearch.NewClient(elasticsearch.Config{ + Addresses: []string{"http://localhost:" + port}, + Logger: &estransport.ColorLogger{Output: os.Stdout, EnableRequestBody: true, EnableResponseBody: true}, + }) + if err != nil { + log.Fatalf("Error creating the client: %s", err) + } + + es := ExtendedClient{Client: esclient, Custom: &ExtendedAPI{esclient}} + <-started + + // --> Call a regular Elasticsearch API + // + es.Cat.Health() + + // --> Call a custom API + // + es.Custom.Example() +} + +func startServer(started chan<- bool) { + proxy := httputil.NewSingleHostReverseProxy(&url.URL{Scheme: "http", Host: "localhost:9200"}) + + // Respond with custom content on "GET /_cat/example", proxy to Elasticsearch for other requests + // + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + if r.Method == "GET" && r.URL.Path == "/_cat/example" { + io.WriteString(w, "Hello from Cat Example action") + return + } + proxy.ServeHTTP(w, r) + }) + + ln, err := net.Listen("tcp", "localhost:"+port) + if err != nil { + log.Fatalf("Unable to start server: %s", err) + } + + go http.Serve(ln, nil) + started <- true +} From b2dbbf2d66ef7542573206b8eddb9912103a9c75 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 17 Apr 2019 10:48:01 +0200 Subject: [PATCH 021/355] Examples: Minor tweaks and improvements (cherry picked from commit 321640ebc6646d13860d9221d3582f736f59eeb1) --- _examples/cloudfunction/README.md | 2 +- _examples/customization.go | 6 +++++- _examples/encoding/Makefile | 8 ++++---- _examples/instrumentation/Dockerfile | 6 +++--- _examples/instrumentation/README.md | 4 ++++ _examples/instrumentation/elasticstack.yml | 6 +++--- _examples/main.go | 2 +- 7 files changed, 21 insertions(+), 13 deletions(-) diff --git a/_examples/cloudfunction/README.md b/_examples/cloudfunction/README.md index 993c67eecd..2a197de497 100755 --- a/_examples/cloudfunction/README.md +++ b/_examples/cloudfunction/README.md @@ -23,4 +23,4 @@ Invoke your function over HTTP: $ curl https://...cloudfunctions.net/clusterstatus ``` -See the **[`function.go`](./function.go)** file for implementation. +See the **[`function.go`](./function.go)** file for implementation and the **[`function_test.go`](./function_test.go)** file for the example of implementing a mock transport for testing. diff --git a/_examples/customization.go b/_examples/customization.go index 929494ca8a..33dfc0f078 100755 --- a/_examples/customization.go +++ b/_examples/customization.go @@ -21,7 +21,7 @@ import ( // CountingTransport adds a custom header to the request, logs the information about // the request and response, and counts the number of requests to the client. // -// Since it implements the `http.RoundTripper` interface, so it can be passed +// Since it implements the `http.RoundTripper` interface, it can be passed // to the client as a custom HTTP transport implementation. // type CountingTransport struct { @@ -57,8 +57,12 @@ func (t *CountingTransport) RoundTrip(req *http.Request) (*http.Response, error) func main() { var wg sync.WaitGroup + // Create the custom transport. + // tp := CountingTransport{} + // Pass the custom transport to the client. + // es, _ := elasticsearch.NewClient( elasticsearch.Config{Transport: &tp}, ) diff --git a/_examples/encoding/Makefile b/_examples/encoding/Makefile index 0383a71a7c..9c0e596cd5 100644 --- a/_examples/encoding/Makefile +++ b/_examples/encoding/Makefile @@ -4,6 +4,9 @@ test: clean setup ## Run tests go run gjson.go go run easyjson.go +bench: clean setup # Run benchmarks + go test -run=none -bench=. -benchmem benchmark_test.go + setup: ## Install & Setup @go get -u github.com/mailru/easyjson/... go generate ./model @@ -11,7 +14,4 @@ setup: ## Install & Setup clean: ## Remove artifacts @rm -f model/*_easyjson.go -bench: # Run benchmarks - go test -run=none -bench=. -benchmem benchmark_test.go - -.PHONY: clean setup test +.PHONY: clean bench setup test diff --git a/_examples/instrumentation/Dockerfile b/_examples/instrumentation/Dockerfile index 0e6ccde2bc..948475d1ce 100644 --- a/_examples/instrumentation/Dockerfile +++ b/_examples/instrumentation/Dockerfile @@ -1,13 +1,13 @@ # $ docker build --tag elastic/go-elasticsearch-demo-instrumentation . # $ docker run -it --network instrumentation_elasticstack --rm elastic/go-elasticsearch-demo-instrumentation # -FROM golang:1.11-alpine +FROM golang:1-alpine RUN apk add --no-cache --quiet gcc g++ ca-certificates make curl git jq WORKDIR /go-elasticsearch-demo-instrumentation -COPY ./go.mod ./ +COPY go.mod . RUN go mod download ENV TERM xterm-256color @@ -20,6 +20,6 @@ ENV ELASTIC_APM_METRICS_INTERVAL=5s ENV ELASTIC_APM_LOG_FILE=stderr ENV ELASTIC_APM_LOG_LEVEL=debug -COPY ./apmelasticsearch.go ./opencensus.go ./ +COPY apmelasticsearch.go opencensus.go ./ CMD go run apmelasticsearch.go diff --git a/_examples/instrumentation/README.md b/_examples/instrumentation/README.md index bc03f62940..4cc31bd4a8 100644 --- a/_examples/instrumentation/README.md +++ b/_examples/instrumentation/README.md @@ -17,3 +17,7 @@ The [**`apmelasticsearch.go`**](./apmelasticsearch.go) example demonstrates inst Run the example interactively with Docker and inspect the UI in Kibana: docker-compose --file elasticstack.yml up --build + +To destroy the Docker assets for the example, run: + + docker-compose --file elasticstack.yml down --remove-orphans --volumes diff --git a/_examples/instrumentation/elasticstack.yml b/_examples/instrumentation/elasticstack.yml index 16fd9f4e8d..a252d99634 100644 --- a/_examples/instrumentation/elasticstack.yml +++ b/_examples/instrumentation/elasticstack.yml @@ -16,7 +16,7 @@ services: # --- Elasticsearch --------------------------------------------------------- elasticsearch: - image: docker.elastic.co/elasticsearch/elasticsearch:${VERSION:-7.0.0-beta1} + image: docker.elastic.co/elasticsearch/elasticsearch:${VERSION:-7.0.0} container_name: elasticsearch volumes: - es_data:/usr/share/elasticsearch/data:delegated @@ -39,7 +39,7 @@ services: # --- Kibana ---------------------------------------------------------------- kibana: - image: docker.elastic.co/kibana/kibana:${VERSION:-7.0.0-beta1} + image: docker.elastic.co/kibana/kibana:${VERSION:-7.0.0} container_name: kibana networks: ['elasticstack'] environment: @@ -52,7 +52,7 @@ services: # --- APM Server ------------------------------------------------------------ apm-server: - image: docker.elastic.co/apm/apm-server:${VERSION:-7.0.0-beta1} + image: docker.elastic.co/apm/apm-server:${VERSION:-7.0.0} container_name: apm_server networks: ['elasticstack'] command: > diff --git a/_examples/main.go b/_examples/main.go index 414ea581ba..f8b901ffb7 100755 --- a/_examples/main.go +++ b/_examples/main.go @@ -114,7 +114,7 @@ func main() { if res.IsError() { var e map[string]interface{} if err := json.NewDecoder(res.Body).Decode(&e); err != nil { - log.Fatalf("error parsing the response body: %s", err) + log.Fatalf("Error parsing the response body: %s", err) } else { // Print the response status and error information. log.Fatalf("[%s] %s: %s", From 473dd20bb8cb1a3391b35284b181cf8e6dabab3b Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 26 Apr 2019 13:56:39 +0200 Subject: [PATCH 022/355] Fix formatting issues in tests (cherry picked from commit 36b236c0f9d7508ee34826303a67fba36f38810c) --- estransport/estransport_benchmark_test.go | 2 +- estransport/logger_benchmark_test.go | 8 ++++---- estransport/logger_internal_test.go | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/estransport/estransport_benchmark_test.go b/estransport/estransport_benchmark_test.go index d9ac9091ac..830b883aa9 100644 --- a/estransport/estransport_benchmark_test.go +++ b/estransport/estransport_benchmark_test.go @@ -38,7 +38,7 @@ func BenchmarkTransport(b *testing.B) { b.Run("Defaults", func(b *testing.B) { for i := 0; i < b.N; i++ { tp := estransport.New(estransport.Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newFakeTransport(b), }) diff --git a/estransport/logger_benchmark_test.go b/estransport/logger_benchmark_test.go index a21911fd00..dca7ef553f 100644 --- a/estransport/logger_benchmark_test.go +++ b/estransport/logger_benchmark_test.go @@ -18,7 +18,7 @@ func BenchmarkTransportLogger(b *testing.B) { b.Run("Text", func(b *testing.B) { for i := 0; i < b.N; i++ { tp := estransport.New(estransport.Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newFakeTransport(b), Logger: &estransport.TextLogger{Output: ioutil.Discard}, }) @@ -34,7 +34,7 @@ func BenchmarkTransportLogger(b *testing.B) { b.Run("Text-Body", func(b *testing.B) { for i := 0; i < b.N; i++ { tp := estransport.New(estransport.Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newFakeTransport(b), Logger: &estransport.TextLogger{Output: ioutil.Discard, EnableRequestBody: true, EnableResponseBody: true}, }) @@ -59,7 +59,7 @@ func BenchmarkTransportLogger(b *testing.B) { b.Run("JSON", func(b *testing.B) { for i := 0; i < b.N; i++ { tp := estransport.New(estransport.Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newFakeTransport(b), Logger: &estransport.JSONLogger{Output: ioutil.Discard}, }) @@ -75,7 +75,7 @@ func BenchmarkTransportLogger(b *testing.B) { b.Run("JSON-Body", func(b *testing.B) { for i := 0; i < b.N; i++ { tp := estransport.New(estransport.Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newFakeTransport(b), Logger: &estransport.JSONLogger{Output: ioutil.Discard, EnableRequestBody: true, EnableResponseBody: true}, }) diff --git a/estransport/logger_internal_test.go b/estransport/logger_internal_test.go index fbf0211e25..7b12d8bd0c 100644 --- a/estransport/logger_internal_test.go +++ b/estransport/logger_internal_test.go @@ -42,7 +42,7 @@ func TestTransportLogger(t *testing.T) { var wg sync.WaitGroup tp := New(Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), // Logger: ioutil.Discard, }) @@ -64,7 +64,7 @@ func TestTransportLogger(t *testing.T) { t.Run("Nil", func(t *testing.T) { tp := New(Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: nil, }) @@ -78,7 +78,7 @@ func TestTransportLogger(t *testing.T) { t.Run("No HTTP response", func(t *testing.T) { tp := New(Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: &mockTransp{ RoundTripFunc: func(req *http.Request) (*http.Response, error) { return nil, errors.New("Mock error") @@ -98,7 +98,7 @@ func TestTransportLogger(t *testing.T) { var dst strings.Builder tp := New(Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: &TextLogger{Output: &dst, EnableRequestBody: true, EnableResponseBody: true}, }) @@ -129,7 +129,7 @@ func TestTransportLogger(t *testing.T) { var dst strings.Builder tp := New(Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: &TextLogger{Output: &dst, EnableRequestBody: true, EnableResponseBody: true}, }) @@ -174,7 +174,7 @@ func TestTransportLogger(t *testing.T) { var dst strings.Builder tp := New(Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: &ColorLogger{Output: &dst, EnableRequestBody: true, EnableResponseBody: true}, }) @@ -228,7 +228,7 @@ func TestTransportLogger(t *testing.T) { var dst strings.Builder tp := New(Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: &CurlLogger{Output: &dst, EnableRequestBody: true, EnableResponseBody: true}, }) @@ -265,7 +265,7 @@ func TestTransportLogger(t *testing.T) { var dst strings.Builder tp := New(Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: &JSONLogger{Output: &dst}, }) @@ -302,7 +302,7 @@ func TestTransportLogger(t *testing.T) { var dst strings.Builder tp := New(Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: &JSONLogger{Output: &dst, EnableRequestBody: true}, }) @@ -345,7 +345,7 @@ func TestTransportLogger(t *testing.T) { var dst strings.Builder tp := New(Config{ - URLs: []*url.URL{&url.URL{Scheme: "http", Host: "foo"}}, + URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: &CustomLogger{Output: &dst}, }) From a15ada0282798a9926d4785fc45cc80c8acd2bf2 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 1 May 2019 08:45:06 +0200 Subject: [PATCH 023/355] Update the client User-Agent In order to provide more details about the client in the User-Agent request header, and to be consistent with the other Elasticsearch clients, the value has been updated. Example: User-Agent: go-elasticsearch/8.0.0-SNAPSHOT (darwin amd64; Go 1.12.4) (cherry picked from commit bcbd323c14fa40ab2a1b6fdfefb4acb07a5bf733) --- estransport/estransport.go | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/estransport/estransport.go b/estransport/estransport.go index 2c5ee0de25..f5ec05f6ac 100755 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -6,6 +6,8 @@ import ( "io/ioutil" "net/http" "net/url" + "regexp" + "runtime" "strings" "time" @@ -16,10 +18,13 @@ import ( // const Version = version.Client -var userAgent string +var ( + userAgent string + reGoVersion = regexp.MustCompile(`go(\d+\.\d+\..+)`) +) func init() { - userAgent = strings.Join([]string{"go-elasticsearch", Version}, "/") + userAgent = initUserAgent() } // Interface defines the interface for HTTP client. @@ -165,3 +170,26 @@ func (c *Client) setUserAgent(req *http.Request) *http.Request { req.Header.Set("User-Agent", userAgent) return req } + +func initUserAgent() string { + var b strings.Builder + + b.WriteString("go-elasticsearch") + b.WriteRune('/') + b.WriteString(Version) + b.WriteRune(' ') + b.WriteRune('(') + b.WriteString(runtime.GOOS) + b.WriteRune(' ') + b.WriteString(runtime.GOARCH) + b.WriteString("; ") + b.WriteString("Go ") + if v := reGoVersion.ReplaceAllString(runtime.Version(), "$1"); v != "" { + b.WriteString(v) + } else { + b.WriteString(runtime.Version()) + } + b.WriteRune(')') + + return b.String() +} From 9358bebb98ed1593e7fbef16453bc50d3f374ed4 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 25 Apr 2019 08:36:24 +0200 Subject: [PATCH 024/355] Util: Add the JSONReader helper This patch adds a `JSONReader()` helper method to facilitate passing eg. a `map[string]string` as the body, without requiring the user to manually encode it into JSON and create eg. a `strings.Reader`: res, err = es.Search( es.Search.WithIndex("test"), es.Search.WithBody(esutil.JSONReader(map[string]string{"query": {"match": {"title": "test"}}})), ) The package defines the `JSONEncoder` interface, so it's possible for the outside code to provide an object implementing it, in order to use eg. a third-party JSON package. The default encoder is "encoding/json". The `jsonReader` type implements the `io.WriterTo` interface, for efficient copying where applicable. (cherry picked from commit c5f9efd130bd0c160d1bfe903793faf82f8f0f7c) --- esutil/doc.go | 5 ++ esutil/json_reader.go | 63 +++++++++++++++++++++ esutil/json_reader_benchmark_test.go | 84 ++++++++++++++++++++++++++++ esutil/json_reader_internal_test.go | 64 +++++++++++++++++++++ 4 files changed, 216 insertions(+) create mode 100644 esutil/doc.go create mode 100644 esutil/json_reader.go create mode 100644 esutil/json_reader_benchmark_test.go create mode 100644 esutil/json_reader_internal_test.go diff --git a/esutil/doc.go b/esutil/doc.go new file mode 100644 index 0000000000..b37e7ffcea --- /dev/null +++ b/esutil/doc.go @@ -0,0 +1,5 @@ +/* +Package esutil provides helper utilities to the Go client for Elasticsearch. + +*/ +package esutil diff --git a/esutil/json_reader.go b/esutil/json_reader.go new file mode 100644 index 0000000000..2193515f05 --- /dev/null +++ b/esutil/json_reader.go @@ -0,0 +1,63 @@ +package esutil + +import ( + "bytes" + "encoding/json" + "io" +) + +// JSONReader is an utility function which encodes v into JSON and returns it as a reader. +// +func JSONReader(v interface{}) io.Reader { + return &jsonReader{val: v, buf: nil} +} + +// JSONEncoder defines the interface for custom JSON encoders. +// +type JSONEncoder interface { + EncodeJSON(io.Writer) error +} + +type jsonReader struct { + val interface{} + buf interface { + io.ReadWriter + io.WriterTo + } +} + +func (r *jsonReader) Read(p []byte) (int, error) { + if err := r.initialize(); err != nil { + return 0, err + } + return r.buf.Read(p) +} + +func (r *jsonReader) WriteTo(w io.Writer) (int64, error) { + if err := r.initialize(); err != nil { + return 0, err + } + return r.buf.WriteTo(w) +} + +func (r *jsonReader) initialize() error { + if r.buf == nil { + r.buf = new(bytes.Buffer) + return r.encode() + } + return nil +} + +func (r *jsonReader) encode() error { + var err error + + if e, ok := r.val.(JSONEncoder); ok { + err = e.EncodeJSON(r.buf) + if err != nil { + return err + } + return nil + } + + return json.NewEncoder(r.buf).Encode(r.val) +} diff --git a/esutil/json_reader_benchmark_test.go b/esutil/json_reader_benchmark_test.go new file mode 100644 index 0000000000..3190f76e3e --- /dev/null +++ b/esutil/json_reader_benchmark_test.go @@ -0,0 +1,84 @@ +// +build !integration + +package esutil_test + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "strings" + "testing" + + "github.com/elastic/go-elasticsearch/v8/esutil" +) + +var _ = fmt.Print + +type Foo struct { + Bar string +} + +func (f Foo) EncodeJSON(w io.Writer) error { + var b bytes.Buffer + b.WriteString(`{"bar":"`) + b.WriteString(strings.ToUpper(f.Bar)) + b.WriteString(`"}`) + b.WriteString("\n") + _, err := b.WriteTo(w) + if err != nil { + return err + } + return nil +} + +func BenchmarkJSONReader(b *testing.B) { + b.ReportAllocs() + + b.Run("None", func(b *testing.B) { + b.ResetTimer() + + for i := 0; i < b.N; i++ { + var buf bytes.Buffer + json.NewEncoder(&buf).Encode(map[string]string{"foo": "bar"}) + if string(buf.String()) != `{"foo":"bar"}`+"\n" { + b.Fatalf("Unexpected output: %q", buf.String()) + } + } + }) + + b.Run("Default", func(b *testing.B) { + b.ResetTimer() + + for i := 0; i < b.N; i++ { + out, _ := ioutil.ReadAll(esutil.JSONReader(map[string]string{"foo": "bar"})) + if string(out) != `{"foo":"bar"}`+"\n" { + b.Fatalf("Unexpected output: %q", out) + } + } + }) + + b.Run("Default-Copy", func(b *testing.B) { + b.ResetTimer() + + for i := 0; i < b.N; i++ { + var buf bytes.Buffer + io.Copy(&buf, esutil.JSONReader(map[string]string{"foo": "bar"})) + if buf.String() != `{"foo":"bar"}`+"\n" { + b.Fatalf("Unexpected output: %q", buf.String()) + } + } + }) + + b.Run("Custom", func(b *testing.B) { + b.ResetTimer() + + for i := 0; i < b.N; i++ { + out, _ := ioutil.ReadAll(esutil.JSONReader(Foo{Bar: "baz"})) + if string(out) != `{"bar":"BAZ"}`+"\n" { + b.Fatalf("Unexpected output: %q", out) + } + } + }) +} diff --git a/esutil/json_reader_internal_test.go b/esutil/json_reader_internal_test.go new file mode 100644 index 0000000000..f3dcfa740b --- /dev/null +++ b/esutil/json_reader_internal_test.go @@ -0,0 +1,64 @@ +// +build !integration + +package esutil + +import ( + "bytes" + "errors" + "io" + "io/ioutil" + "strings" + "testing" +) + +type errReader struct{} + +func (errReader) Read(p []byte) (int, error) { return 1, errors.New("MOCK ERROR") } +func (errReader) Write(p []byte) (int, error) { return 0, errors.New("MOCK ERROR") } +func (errReader) WriteTo(w io.Writer) (int64, error) { return 0, errors.New("MOCK ERROR") } + +type Foo struct { + Bar string +} + +func (f Foo) EncodeJSON(w io.Writer) error { + _, err := w.Write([]byte(`{"bar":"` + strings.ToUpper(f.Bar) + `"}` + "\n")) + if err != nil { + return err + } + return nil +} + +func TestJSONReader(t *testing.T) { + t.Run("Default", func(t *testing.T) { + out, _ := ioutil.ReadAll(JSONReader(map[string]string{"foo": "bar"})) + if string(out) != `{"foo":"bar"}`+"\n" { + t.Fatalf("Unexpected output: %s", out) + } + }) + + t.Run("Custom", func(t *testing.T) { + out, _ := ioutil.ReadAll(JSONReader(Foo{Bar: "baz"})) + if string(out) != `{"bar":"BAZ"}`+"\n" { + t.Fatalf("Unexpected output: %s", out) + } + }) + + t.Run("WriteTo", func(t *testing.T) { + b := bytes.NewBuffer([]byte{}) + r := jsonReader{val: map[string]string{"foo": "bar"}} + r.WriteTo(b) + if b.String() != `{"foo":"bar"}`+"\n" { + t.Fatalf("Unexpected output: %s", b.String()) + } + }) + + t.Run("Read error", func(t *testing.T) { + b := []byte{} + r := jsonReader{val: map[string]string{"foo": "bar"}, buf: errReader{}} + _, err := r.Read(b) + if err == nil { + t.Fatalf("Expected error, got: %#v", err) + } + }) +} From 5bce71a1fdf0cff4f8d5b387b22fd5e9fb5c8048 Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Wed, 1 May 2019 09:41:42 +0200 Subject: [PATCH 025/355] Util: Improve the performance of jsonReader.WriteTo() Instead of initializing the buffer, pass the writer to encode() directly, wrapping it in a `countingWriter`. Also, make benchmarks more realistic by moving the buffer declaration out of the `for` loop. Benchmarks: old ns/op new ns/op delta BenchmarkJSONReader/None-4 1056 914 -13.45% BenchmarkJSONReader/Default-4 2027 1924 -5.08% BenchmarkJSONReader/Default-Copy-4 1390 1133 -18.49% BenchmarkJSONReader/Custom-4 1093 1170 +7.04% old allocs new allocs delta BenchmarkJSONReader/None-4 10 8 -20.00% BenchmarkJSONReader/Default-4 13 13 +0.00% BenchmarkJSONReader/Default-Copy-4 13 10 -23.08% BenchmarkJSONReader/Custom-4 8 8 +0.00% old bytes new bytes delta BenchmarkJSONReader/None-4 688 576 -16.28% BenchmarkJSONReader/Default-4 2768 2768 +0.00% BenchmarkJSONReader/Default-Copy-4 832 640 -23.08% BenchmarkJSONReader/Custom-4 2275 2275 +0.00% (cherry picked from commit 0a3aca532f8d441b9c0a2f3b3654f478a745eb25) --- esutil/json_reader.go | 42 +++++++++++++++++----------- esutil/json_reader_benchmark_test.go | 6 ++-- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/esutil/json_reader.go b/esutil/json_reader.go index 2193515f05..3a03567d62 100644 --- a/esutil/json_reader.go +++ b/esutil/json_reader.go @@ -27,37 +27,45 @@ type jsonReader struct { } func (r *jsonReader) Read(p []byte) (int, error) { - if err := r.initialize(); err != nil { - return 0, err + if r.buf == nil { + r.buf = new(bytes.Buffer) + if err := r.encode(r.buf); err != nil { + return 0, err + } } + return r.buf.Read(p) } func (r *jsonReader) WriteTo(w io.Writer) (int64, error) { - if err := r.initialize(); err != nil { - return 0, err - } - return r.buf.WriteTo(w) + cw := countingWriter{Writer: w} + err := r.encode(&cw) + return int64(cw.n), err } -func (r *jsonReader) initialize() error { - if r.buf == nil { - r.buf = new(bytes.Buffer) - return r.encode() - } - return nil -} - -func (r *jsonReader) encode() error { +func (r *jsonReader) encode(w io.Writer) error { var err error if e, ok := r.val.(JSONEncoder); ok { - err = e.EncodeJSON(r.buf) + err = e.EncodeJSON(w) if err != nil { return err } return nil } - return json.NewEncoder(r.buf).Encode(r.val) + return json.NewEncoder(w).Encode(r.val) +} + +type countingWriter struct { + io.Writer + n int +} + +func (cw *countingWriter) Write(p []byte) (int, error) { + n, err := cw.Writer.Write(p) + if n > 0 { + cw.n += n + } + return n, err } diff --git a/esutil/json_reader_benchmark_test.go b/esutil/json_reader_benchmark_test.go index 3190f76e3e..972992bef1 100644 --- a/esutil/json_reader_benchmark_test.go +++ b/esutil/json_reader_benchmark_test.go @@ -39,12 +39,13 @@ func BenchmarkJSONReader(b *testing.B) { b.Run("None", func(b *testing.B) { b.ResetTimer() + var buf bytes.Buffer for i := 0; i < b.N; i++ { - var buf bytes.Buffer json.NewEncoder(&buf).Encode(map[string]string{"foo": "bar"}) if string(buf.String()) != `{"foo":"bar"}`+"\n" { b.Fatalf("Unexpected output: %q", buf.String()) } + buf.Reset() } }) @@ -62,12 +63,13 @@ func BenchmarkJSONReader(b *testing.B) { b.Run("Default-Copy", func(b *testing.B) { b.ResetTimer() + var buf bytes.Buffer for i := 0; i < b.N; i++ { - var buf bytes.Buffer io.Copy(&buf, esutil.JSONReader(map[string]string{"foo": "bar"})) if buf.String() != `{"foo":"bar"}`+"\n" { b.Fatalf("Unexpected output: %q", buf.String()) } + buf.Reset() } }) From c6de8b9b38df7c1ec6cd46fcf1536f058879f997 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 7 May 2019 07:16:17 +0200 Subject: [PATCH 026/355] Examples: Update the main example * Use strings.Builder to define body * Use bytes.Buffer to define body (cherry picked from commit 32a5aa708270b6644c7f46416fa55cad8e3b9fbc) --- README.md | 32 ++++++++++++++++++++++++++------ _examples/main.go | 30 +++++++++++++++++++++++++----- 2 files changed, 51 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index a1647704d5..1cbe576aa5 100755 --- a/README.md +++ b/README.md @@ -152,6 +152,7 @@ The following example demonstrates a more complex usage. It fetches the Elastics package main import ( + "bytes" "context" "encoding/json" "log" @@ -207,11 +208,17 @@ func main() { go func(i int, title string) { defer wg.Done() - // Set up the request object directly. + // Build the request body. + var b strings.Builder + b.WriteString(`{"title" : "`) + b.WriteString(title) + b.WriteString(`"}`) + + // Set up the request object. req := esapi.IndexRequest{ Index: "test", DocumentID: strconv.Itoa(i + 1), - Body: strings.NewReader(`{"title" : "` + title + `"}`), + Body: strings.NewReader(b.String()), Refresh: "true", } @@ -242,23 +249,36 @@ func main() { // 3. Search for the indexed documents // - // Use the helper methods of the client. + // Build the request body. + var buf bytes.Buffer + query := map[string]interface{}{ + "query": map[string]interface{}{ + "match": map[string]interface{}{ + "title": "test", + }, + }, + } + if err := json.NewEncoder(&buf).Encode(query); err != nil { + log.Fatalf("Error encoding query: %s", err) + } + + // Perform the search request. res, err = es.Search( es.Search.WithContext(context.Background()), es.Search.WithIndex("test"), - es.Search.WithBody(strings.NewReader(`{"query" : { "match" : { "title" : "test" } }}`)), + es.Search.WithBody(&buf), es.Search.WithTrackTotalHits(true), es.Search.WithPretty(), ) if err != nil { - log.Fatalf("ERROR: %s", err) + log.Fatalf("Error getting response: %s", err) } defer res.Body.Close() if res.IsError() { var e map[string]interface{} if err := json.NewDecoder(res.Body).Decode(&e); err != nil { - log.Fatalf("error parsing the response body: %s", err) + log.Fatalf("Error parsing the response body: %s", err) } else { // Print the response status and error information. log.Fatalf("[%s] %s: %s", diff --git a/_examples/main.go b/_examples/main.go index f8b901ffb7..1226740080 100755 --- a/_examples/main.go +++ b/_examples/main.go @@ -8,6 +8,7 @@ package main import ( + "bytes" "context" "encoding/json" "log" @@ -63,11 +64,17 @@ func main() { go func(i int, title string) { defer wg.Done() - // Set up the request object directly. + // Build the request body. + var b strings.Builder + b.WriteString(`{"title" : "`) + b.WriteString(title) + b.WriteString(`"}`) + + // Set up the request object. req := esapi.IndexRequest{ Index: "test", DocumentID: strconv.Itoa(i + 1), - Body: strings.NewReader(`{"title" : "` + title + `"}`), + Body: strings.NewReader(b.String()), Refresh: "true", } @@ -98,16 +105,29 @@ func main() { // 3. Search for the indexed documents // - // Use the helper methods of the client. + // Build the request body. + var buf bytes.Buffer + query := map[string]interface{}{ + "query": map[string]interface{}{ + "match": map[string]interface{}{ + "title": "test", + }, + }, + } + if err := json.NewEncoder(&buf).Encode(query); err != nil { + log.Fatalf("Error encoding query: %s", err) + } + + // Perform the search request. res, err = es.Search( es.Search.WithContext(context.Background()), es.Search.WithIndex("test"), - es.Search.WithBody(strings.NewReader(`{"query" : { "match" : { "title" : "test" } }}`)), + es.Search.WithBody(&buf), es.Search.WithTrackTotalHits(true), es.Search.WithPretty(), ) if err != nil { - log.Fatalf("ERROR: %s", err) + log.Fatalf("Error getting response: %s", err) } defer res.Body.Close() From 0b274463de567f81f7e6e456341ec6c59eece492 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 7 May 2019 07:18:33 +0200 Subject: [PATCH 027/355] Examples: Add esutil.JSONReader (cherry picked from commit e09a105a2b0a111aad7774ae521d6981e7e34e3e) --- README.md | 7 ++ _examples/README.md | 2 +- _examples/encoding/README.md | 30 ++++++-- _examples/encoding/benchmark_test.go | 107 +++++++++++++++++++++++---- 4 files changed, 123 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 1cbe576aa5..0625ff52f1 100755 --- a/README.md +++ b/README.md @@ -326,6 +326,13 @@ The `estransport` package handles the transfer of data to and from Elasticsearch +## Helpers + +The `esutil` package provides convenience helpers for working with the client. At the moment, it provides the +`esutil.JSONReader()` helper function. + + + ## Examples The **[`_examples`](./_examples)** folder contains a number of recipes and comprehensive examples to get you started with the client, including configuration and customization of the client, mocking the transport for unit tests, embedding the client in a custom type, building queries, performing requests, and parsing the responses. diff --git a/_examples/README.md b/_examples/README.md index 81a2c3ab44..89de9c5c6f 100755 --- a/_examples/README.md +++ b/_examples/README.md @@ -15,7 +15,7 @@ The [**`bulk`**](./bulk) directory contains a comprehensive example of using the ## Encoding The [**`encoding`**](./encoding) directory contains examples of using third-party packages -for a more efficient encoding and decoding of the request and response bodies. +and client helper methods for a more efficient encoding and decoding of the request and response bodies. ## Fast HTTP diff --git a/_examples/encoding/README.md b/_examples/encoding/README.md index 55f7d9babf..9d48fd4c83 100644 --- a/_examples/encoding/README.md +++ b/_examples/encoding/README.md @@ -1,6 +1,6 @@ # Example: encoding -Examples in this folder demonstrate how to use third-party packages for JSON decoding and encoding. +Examples in this folder demonstrate how to use helper methods and third-party packages for JSON decoding and encoding. ## `tidwall/gjson` @@ -36,6 +36,18 @@ make clean setup go run easyjson.go ``` +## `esutil.JSONReader()` + +The [`esutil.JSONReader()`](../../esutil/json_reader.go) helper method takes a struct, a map, +or any other serializable object, and converts it to JSON wrapped in a reader, for convenient +passing to the `WithBody()` methods: + +```golang +type Document struct{ Title string } +doc := Document{Title: "Test"} +es.Search(es.Search.WithBody(esutil.JSONReader(&doc))) +``` + ----- ### Benchmarks @@ -45,9 +57,15 @@ Both `mailru/easyjson` and `tidwall/gjson` provide significant performance gains You can run the included benchmarks by executing the `make bench` command; example output below. ``` -BenchmarkSearchResults/json 30000 45679 ns/op 8456 B/op 60 allocs/op -BenchmarkSearchResults/easyjson 100000 15612 ns/op 7992 B/op 52 allocs/op -BenchmarkClusterStats/json_-_map 20000 96808 ns/op 31971 B/op 391 allocs/op -BenchmarkClusterStats/json_-_struct 30000 59046 ns/op 15048 B/op 17 allocs/op -BenchmarkClusterStats/gjson 1000000 2119 ns/op 264 B/op 3 allocs/op +BenchmarkEncode/Article_-_json 500000 2969 ns/op 856 B/op 8 allocs/op +BenchmarkEncode/Article_-_JSONReader 500000 2957 ns/op 920 B/op 10 allocs/op +BenchmarkEncode/Article_-_easyjson 1000000 1089 ns/op 736 B/op 5 allocs/op +BenchmarkEncode/map_-_json 1000000 2074 ns/op 720 B/op 18 allocs/op +BenchmarkEncode/map_-_JSONReader 1000000 2168 ns/op 784 B/op 20 allocs/op + +BenchmarkDecode/Search_-_json 50000 38922 ns/op 8456 B/op 60 allocs/op +BenchmarkDecode/Search_-_easyjson 100000 14344 ns/op 7992 B/op 52 allocs/op +BenchmarkDecode/Cluster_-_json_-_map 20000 85742 ns/op 31972 B/op 391 allocs/op +BenchmarkDecode/Cluster_-_json_-_stc 30000 50852 ns/op 15048 B/op 17 allocs/op +BenchmarkDecode/Cluster_-_gjson 1000000 2284 ns/op 264 B/op 3 allocs/op ``` diff --git a/_examples/encoding/benchmark_test.go b/_examples/encoding/benchmark_test.go index 2990c3e0d2..76bcd72b0f 100644 --- a/_examples/encoding/benchmark_test.go +++ b/_examples/encoding/benchmark_test.go @@ -2,59 +2,134 @@ package main_test import ( "bytes" + "io" "io/ioutil" "log" "testing" + "time" "encoding/json" "github.com/mailru/easyjson" "github.com/tidwall/gjson" "github.com/elastic/go-elasticsearch/v7/_examples/encoding/model" + "github.com/elastic/go-elasticsearch/v7/esutil" ) -func BenchmarkSearchResults(b *testing.B) { +func BenchmarkEncode(b *testing.B) { b.ReportAllocs() - input := fixture("testdata/response_search.json") + var ( + buf bytes.Buffer - b.Run("json", func(b *testing.B) { + article = &model.Article{ + ID: 1, + Title: "Test", + Body: "Test", + Published: time.Now(), + Author: &model.Author{ + FirstName: "Alice", + LastName: "Smith", + }, + } + + query = map[string]interface{}{ + "query": map[string]interface{}{ + "match": map[string]interface{}{ + "title": "test", + }, + }, + } + ) + + b.Run("Article - json", func(b *testing.B) { for i := 0; i < b.N; i++ { - var res model.SearchResponse - err := json.NewDecoder(bytes.NewReader(input.Bytes())).Decode(&res) + err := json.NewEncoder(&buf).Encode(article) if err != nil { b.Error(err) } + buf.Reset() } }) - b.Run("easyjson", func(b *testing.B) { + b.Run("Article - JSONReader", func(b *testing.B) { for i := 0; i < b.N; i++ { - var res model.SearchResponse - err := easyjson.UnmarshalFromReader(bytes.NewReader(input.Bytes()), &res) + _, err := io.Copy(&buf, esutil.JSONReader(article)) + if err != nil { + b.Error(err) + } + buf.Reset() + } + }) + + b.Run("Article - easyjson", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := easyjson.MarshalToWriter(article, &buf) if err != nil { b.Error(err) } + buf.Reset() + } + }) + + b.Run("map - json", func(b *testing.B) { + for i := 0; i < b.N; i++ { + err := json.NewEncoder(&buf).Encode(query) + if err != nil { + b.Error(err) + } + buf.Reset() + } + }) + + b.Run("map - JSONReader", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := io.Copy(&buf, esutil.JSONReader(query)) + if err != nil { + b.Error(err) + } + buf.Reset() } }) } -func BenchmarkClusterStats(b *testing.B) { +func BenchmarkDecode(b *testing.B) { b.ReportAllocs() - input := fixture("testdata/response_cluster_stats.json") + resSearch := fixture("testdata/response_search.json") + resClusterStats := fixture("testdata/response_cluster_stats.json") + + b.Run("Search - json", func(b *testing.B) { + for i := 0; i < b.N; i++ { + var res model.SearchResponse + err := json.NewDecoder(bytes.NewReader(resSearch.Bytes())).Decode(&res) + if err != nil { + b.Error(err) + } + } + }) + + b.Run("Search - easyjson", func(b *testing.B) { + for i := 0; i < b.N; i++ { + var res model.SearchResponse + err := easyjson.UnmarshalFromReader(bytes.NewReader(resSearch.Bytes()), &res) + if err != nil { + b.Error(err) + } + } + }) - b.Run("json - map", func(b *testing.B) { + b.Run("Cluster - json - map", func(b *testing.B) { for i := 0; i < b.N; i++ { var out = make(map[string]interface{}) - err := json.NewDecoder(bytes.NewReader(input.Bytes())).Decode(&out) + err := json.NewDecoder(bytes.NewReader(resClusterStats.Bytes())).Decode(&out) if err != nil { b.Error(err) } } }) - b.Run("json - struct", func(b *testing.B) { + b.Run("Cluster - json - stc", func(b *testing.B) { type ClusterHealthResponse struct { ClusterName string `json:"cluster_name"` Status string @@ -68,7 +143,7 @@ func BenchmarkClusterStats(b *testing.B) { for i := 0; i < b.N; i++ { var out ClusterHealthResponse - err := json.NewDecoder(bytes.NewReader(input.Bytes())).Decode(&out) + err := json.NewDecoder(bytes.NewReader(resClusterStats.Bytes())).Decode(&out) if err != nil { b.Error(err) } @@ -78,10 +153,10 @@ func BenchmarkClusterStats(b *testing.B) { } }) - b.Run("gjson", func(b *testing.B) { + b.Run("Cluster - gjson", func(b *testing.B) { for i := 0; i < b.N; i++ { var out []gjson.Result - out = gjson.GetManyBytes(input.Bytes(), "cluster_name", "status", "indices.count", "indices.docs.count") + out = gjson.GetManyBytes(resClusterStats.Bytes(), "cluster_name", "status", "indices.count", "indices.docs.count") if len(out[0].String()) < 3 { b.Errorf("Unexpected len(%s)=%d", out[0], len(out[0].String())) } From bd96a5cd178ef53b6072e840361ca12ae8ddb305 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 10 May 2019 08:46:31 +0200 Subject: [PATCH 028/355] Update the Make target for launching a cluster (cherry picked from commit fce6241eaf1475ad3933fa5075b7b0efdfbc64f8) --- Makefile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 76eb6ba761..001d0217c1 100755 --- a/Makefile +++ b/Makefile @@ -141,12 +141,18 @@ endif @docker network inspect elasticsearch > /dev/null || docker network create elasticsearch; @{ \ for n in `seq 1 $(nodes)`; do \ + if [[ -z "$$port" ]]; then \ + hostport=$$((9199+$$n)); \ + else \ + hostport=$$port; \ + fi; \ docker run \ --name "es$$n" \ --network elasticsearch \ --env "node.name=es$$n" \ --env "cluster.name=go-elasticsearch" \ --env "cluster.initial_master_nodes=es1" \ + --env "discovery.seed_hosts=es1" \ --env "cluster.routing.allocation.disk.threshold_enabled=false" \ --env "bootstrap.memory_lock=true" \ --env "node.attr.testattr=test" \ @@ -154,7 +160,7 @@ endif --env "repositories.url.allowed_urls=http://snapshot.test*" \ --env ES_JAVA_OPTS="-Xms1g -Xmx1g" \ --volume `echo $(version) | tr -C "[:alnum:]" '-'`-node-$$n-data:/usr/share/elasticsearch/data \ - --publish $$((9199+$$n)):9200 \ + --publish $$hostport:9200 \ --ulimit nofile=65536:65536 \ --ulimit memlock=-1:-1 \ --detach=$(detached) \ @@ -166,6 +172,12 @@ endif if [[ "$(detached)" == "true" ]]; then \ echo "\033[2m→ Waiting for the cluster...\033[0m"; \ docker run --network elasticsearch --rm appropriate/curl --max-time 120 --retry 120 --retry-delay 1 --retry-connrefused --show-error --silent http://es1:9200; \ + output="\033[2m→ Cluster ready; to remove containers:"; \ + output="$$output docker rm -f"; \ + for n in `seq 1 $(nodes)`; do \ + output="$$output es$$n"; \ + done; \ + echo "$$output\033[0m"; \ fi \ } From 6ca4246a3860cd2bf14d5fd3a9f316685e0f5e66 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 10 May 2019 08:47:06 +0200 Subject: [PATCH 029/355] Update the Make target for running integration tests (cherry picked from commit 04312bb2c9a3451f57ce0836b639647187838923) --- Makefile | 13 +++++++++---- elasticsearch_integration_test.go | 4 +--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 001d0217c1..e86d7f75ce 100755 --- a/Makefile +++ b/Makefile @@ -17,17 +17,22 @@ test: test-unit test-integ: ## Run integration tests @echo "\033[2m→ Running integration tests...\033[0m" + $(eval testintegtags += "integration") +ifdef multinode + $(eval testintegtags += "multinode") +endif ifdef race $(eval testintegargs += "-race") endif - $(eval testintegargs += "-cover" "-coverprofile=tmp/integration-client.cov" "-tags='integration'" "-timeout=1h" "github.com/elastic/go-elasticsearch/v7" "github.com/elastic/go-elasticsearch/v7/estransport") + $(eval testintegargs += "-cover" "-coverprofile=tmp/integration-client.cov" "-tags='$(testintegtags)'" "-timeout=1h") @mkdir -p tmp @if which gotestsum > /dev/null 2>&1 ; then \ echo "gotestsum --format=short-verbose --junitfile=tmp/integration-report.xml --" $(testintegargs); \ - gotestsum --format=short-verbose --junitfile=tmp/integration-report.xml -- $(testintegargs); \ + gotestsum --format=short-verbose --junitfile=tmp/integration-report.xml -- $(testintegargs) "."; \ + gotestsum --format=short-verbose --junitfile=tmp/integration-report.xml -- $(testintegargs) "./estransport" "./esapi" "./esutil"; \ else \ - echo "go test -v" $(testintegargs); \ - go test -v $(testintegargs); \ + echo "go test -v" $(testintegargs) "."; \ + go test -v $(testintegargs) "./estransport" "./esapi" "./esutil"; \ fi; test-api: ## Run generated API integration tests diff --git a/elasticsearch_integration_test.go b/elasticsearch_integration_test.go index 77e6c3bca9..99d79e2a05 100755 --- a/elasticsearch_integration_test.go +++ b/elasticsearch_integration_test.go @@ -22,8 +22,6 @@ import ( ) func TestClientTransport(t *testing.T) { - t.Parallel() - t.Run("Persistent", func(t *testing.T) { es, err := elasticsearch.NewDefaultClient() if err != nil { @@ -62,7 +60,7 @@ func TestClientTransport(t *testing.T) { t.Errorf("Unexpected total_opened: %d", curTotal) } - if total < 1 { + if total == 0 { total = curTotal } From 52dae8d881279b49c217d3c9ca2845d3d6cc661d Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 10 May 2019 08:49:06 +0200 Subject: [PATCH 030/355] Fix JSONReader integration with client This patch updates the esapi.newRequest() function to handle body passed as esutil.JSONReader properly. It makes the esutil.JSONReader exported, and renames the constructor function to esutil.NewJSONReader(). It also adds proper integration tests for esutil.JSONReader. (cherry picked from commit 82fc17d38648bf652241ea16a64ccb8ab85138f6) --- _examples/encoding/jsonreader.go | 55 +++++++++++++++++++++ esapi/esapi.request.go | 2 + esutil/json_reader.go | 21 +++++--- esutil/json_reader_benchmark_test.go | 6 +-- esutil/json_reader_integration_test.go | 68 ++++++++++++++++++++++++++ esutil/json_reader_internal_test.go | 8 +-- 6 files changed, 146 insertions(+), 14 deletions(-) create mode 100644 _examples/encoding/jsonreader.go create mode 100644 esutil/json_reader_integration_test.go diff --git a/_examples/encoding/jsonreader.go b/_examples/encoding/jsonreader.go new file mode 100644 index 0000000000..25ee3b5f6d --- /dev/null +++ b/_examples/encoding/jsonreader.go @@ -0,0 +1,55 @@ +package main + +import ( + "log" + + "github.com/elastic/go-elasticsearch/v8" + "github.com/elastic/go-elasticsearch/v8/esapi" + "github.com/elastic/go-elasticsearch/v8/esutil" +) + +func init() { + log.SetFlags(0) +} + +func main() { + var ( + res *esapi.Response + err error + ) + + es, err := elasticsearch.NewDefaultClient() + if err != nil { + log.Fatalf("Error creating the client: %s", err) + } + + doc := struct { + Title string `json:"title"` + }{Title: "Test"} + + res, err = es.Index("test", esutil.NewJSONReader(&doc), es.Index.WithRefresh("true")) + if err != nil { + log.Fatalf("Error getting response: %s", err) + } + + log.Println(res) + + query := map[string]interface{}{ + "query": map[string]interface{}{ + "match": map[string]interface{}{ + "title": "test", + }, + }, + } + + res, err = es.Search( + es.Search.WithIndex("test"), + es.Search.WithBody(esutil.NewJSONReader(&query)), + es.Search.WithPretty(), + ) + if err != nil { + log.Fatalf("Error getting response: %s", err) + } + + log.Println(res) +} diff --git a/esapi/esapi.request.go b/esapi/esapi.request.go index 79b332eb3e..dbdf517eba 100755 --- a/esapi/esapi.request.go +++ b/esapi/esapi.request.go @@ -47,6 +47,8 @@ func newRequest(method, path string, body io.Reader) (*http.Request, error) { case *strings.Reader: r.Body = ioutil.NopCloser(body) r.ContentLength = int64(b.Len()) + default: + r.Body = ioutil.NopCloser(body) } } diff --git a/esutil/json_reader.go b/esutil/json_reader.go index 3a03567d62..57589fc634 100644 --- a/esutil/json_reader.go +++ b/esutil/json_reader.go @@ -6,10 +6,10 @@ import ( "io" ) -// JSONReader is an utility function which encodes v into JSON and returns it as a reader. +// NewJSONReader encodes v into JSON and returns it as an io.Reader. // -func JSONReader(v interface{}) io.Reader { - return &jsonReader{val: v, buf: nil} +func NewJSONReader(v interface{}) io.Reader { + return &JSONReader{val: v, buf: nil} } // JSONEncoder defines the interface for custom JSON encoders. @@ -18,7 +18,10 @@ type JSONEncoder interface { EncodeJSON(io.Writer) error } -type jsonReader struct { +// JSONReader represents a reader which takes an interface value, +// encodes it into JSON, and wraps it in an io.Reader. +// +type JSONReader struct { val interface{} buf interface { io.ReadWriter @@ -26,7 +29,9 @@ type jsonReader struct { } } -func (r *jsonReader) Read(p []byte) (int, error) { +// Read implements the io.Reader interface. +// +func (r *JSONReader) Read(p []byte) (int, error) { if r.buf == nil { r.buf = new(bytes.Buffer) if err := r.encode(r.buf); err != nil { @@ -37,13 +42,15 @@ func (r *jsonReader) Read(p []byte) (int, error) { return r.buf.Read(p) } -func (r *jsonReader) WriteTo(w io.Writer) (int64, error) { +// WriteTo implements the io.WriterTo interface. +// +func (r *JSONReader) WriteTo(w io.Writer) (int64, error) { cw := countingWriter{Writer: w} err := r.encode(&cw) return int64(cw.n), err } -func (r *jsonReader) encode(w io.Writer) error { +func (r *JSONReader) encode(w io.Writer) error { var err error if e, ok := r.val.(JSONEncoder); ok { diff --git a/esutil/json_reader_benchmark_test.go b/esutil/json_reader_benchmark_test.go index 972992bef1..d02d7ddaa3 100644 --- a/esutil/json_reader_benchmark_test.go +++ b/esutil/json_reader_benchmark_test.go @@ -53,7 +53,7 @@ func BenchmarkJSONReader(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { - out, _ := ioutil.ReadAll(esutil.JSONReader(map[string]string{"foo": "bar"})) + out, _ := ioutil.ReadAll(esutil.NewJSONReader(map[string]string{"foo": "bar"})) if string(out) != `{"foo":"bar"}`+"\n" { b.Fatalf("Unexpected output: %q", out) } @@ -65,7 +65,7 @@ func BenchmarkJSONReader(b *testing.B) { var buf bytes.Buffer for i := 0; i < b.N; i++ { - io.Copy(&buf, esutil.JSONReader(map[string]string{"foo": "bar"})) + io.Copy(&buf, esutil.NewJSONReader(map[string]string{"foo": "bar"})) if buf.String() != `{"foo":"bar"}`+"\n" { b.Fatalf("Unexpected output: %q", buf.String()) } @@ -77,7 +77,7 @@ func BenchmarkJSONReader(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { - out, _ := ioutil.ReadAll(esutil.JSONReader(Foo{Bar: "baz"})) + out, _ := ioutil.ReadAll(esutil.NewJSONReader(Foo{Bar: "baz"})) if string(out) != `{"bar":"BAZ"}`+"\n" { b.Fatalf("Unexpected output: %q", out) } diff --git a/esutil/json_reader_integration_test.go b/esutil/json_reader_integration_test.go new file mode 100644 index 0000000000..d3ef2a2f3e --- /dev/null +++ b/esutil/json_reader_integration_test.go @@ -0,0 +1,68 @@ +// +build integration + +package esutil_test + +import ( + "strings" + "testing" + + "github.com/elastic/go-elasticsearch/v8" + "github.com/elastic/go-elasticsearch/v8/esapi" + "github.com/elastic/go-elasticsearch/v8/esutil" +) + +func TestJSONReaderIntegration(t *testing.T) { + t.Run("Index and search", func(t *testing.T) { + var ( + res *esapi.Response + err error + ) + + es, err := elasticsearch.NewDefaultClient() + if err != nil { + t.Fatalf("Error creating the client: %s\n", err) + } + + es.Indices.Delete([]string{"test"}) + + doc := struct { + Title string `json:"title"` + }{Title: "Foo Bar"} + + res, err = es.Index("test", esutil.NewJSONReader(&doc), es.Index.WithRefresh("true")) + if err != nil { + t.Fatalf("Error getting response: %s", err) + } + defer res.Body.Close() + + if res.IsError() { + t.Fatalf("Error response: %s", res.String()) + } + + query := map[string]interface{}{ + "query": map[string]interface{}{ + "match": map[string]interface{}{ + "title": "foo", + }, + }, + } + + res, err = es.Search( + es.Search.WithIndex("test"), + es.Search.WithBody(esutil.NewJSONReader(&query)), + es.Search.WithPretty(), + ) + if err != nil { + t.Fatalf("Error getting response: %s", err) + } + defer res.Body.Close() + + if res.IsError() { + t.Errorf("Error response: %s", res) + } + + if !strings.Contains(res.String(), "Foo Bar") { + t.Errorf("Unexpected response: %s", res) + } + }) +} diff --git a/esutil/json_reader_internal_test.go b/esutil/json_reader_internal_test.go index f3dcfa740b..3459ec8b90 100644 --- a/esutil/json_reader_internal_test.go +++ b/esutil/json_reader_internal_test.go @@ -31,14 +31,14 @@ func (f Foo) EncodeJSON(w io.Writer) error { func TestJSONReader(t *testing.T) { t.Run("Default", func(t *testing.T) { - out, _ := ioutil.ReadAll(JSONReader(map[string]string{"foo": "bar"})) + out, _ := ioutil.ReadAll(NewJSONReader(map[string]string{"foo": "bar"})) if string(out) != `{"foo":"bar"}`+"\n" { t.Fatalf("Unexpected output: %s", out) } }) t.Run("Custom", func(t *testing.T) { - out, _ := ioutil.ReadAll(JSONReader(Foo{Bar: "baz"})) + out, _ := ioutil.ReadAll(NewJSONReader(Foo{Bar: "baz"})) if string(out) != `{"bar":"BAZ"}`+"\n" { t.Fatalf("Unexpected output: %s", out) } @@ -46,7 +46,7 @@ func TestJSONReader(t *testing.T) { t.Run("WriteTo", func(t *testing.T) { b := bytes.NewBuffer([]byte{}) - r := jsonReader{val: map[string]string{"foo": "bar"}} + r := JSONReader{val: map[string]string{"foo": "bar"}} r.WriteTo(b) if b.String() != `{"foo":"bar"}`+"\n" { t.Fatalf("Unexpected output: %s", b.String()) @@ -55,7 +55,7 @@ func TestJSONReader(t *testing.T) { t.Run("Read error", func(t *testing.T) { b := []byte{} - r := jsonReader{val: map[string]string{"foo": "bar"}, buf: errReader{}} + r := JSONReader{val: map[string]string{"foo": "bar"}, buf: errReader{}} _, err := r.Read(b) if err == nil { t.Fatalf("Expected error, got: %#v", err) From d9f3e4e92cf8403a64bd131034ccd568b96f035e Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 10 May 2019 10:32:23 +0200 Subject: [PATCH 031/355] Examples: Fix benchmarks for esutil.JSONReader Related: 82fc17d (cherry picked from commit a30a816423ad91fdae29671a8794a20befde10fd) --- _examples/encoding/benchmark_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_examples/encoding/benchmark_test.go b/_examples/encoding/benchmark_test.go index 76bcd72b0f..5a589287b6 100644 --- a/_examples/encoding/benchmark_test.go +++ b/_examples/encoding/benchmark_test.go @@ -54,7 +54,7 @@ func BenchmarkEncode(b *testing.B) { b.Run("Article - JSONReader", func(b *testing.B) { for i := 0; i < b.N; i++ { - _, err := io.Copy(&buf, esutil.JSONReader(article)) + _, err := io.Copy(&buf, esutil.NewJSONReader(article)) if err != nil { b.Error(err) } @@ -84,7 +84,7 @@ func BenchmarkEncode(b *testing.B) { b.Run("map - JSONReader", func(b *testing.B) { for i := 0; i < b.N; i++ { - _, err := io.Copy(&buf, esutil.JSONReader(query)) + _, err := io.Copy(&buf, esutil.NewJSONReader(query)) if err != nil { b.Error(err) } From b4103ce75b13d86d2730ba09bc704c5bee2189b9 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 21 May 2019 08:57:40 +0200 Subject: [PATCH 032/355] Generator: API: Fix URL for the Scroll API This patch adds an override for the Scroll API, which removes the `scroll_id` parameter from the URL path, and keeps it only as a URL parameter. Related: #51 (cherry picked from commit 1d510df0d82e060788817f5b4956aac0d513504f) --- internal/cmd/generate/commands/gensource/overrides.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/cmd/generate/commands/gensource/overrides.go b/internal/cmd/generate/commands/gensource/overrides.go index 021b1d07a0..d3bce29930 100755 --- a/internal/cmd/generate/commands/gensource/overrides.go +++ b/internal/cmd/generate/commands/gensource/overrides.go @@ -92,6 +92,15 @@ func init() { path.WriteString("/") path.WriteString(r.DocumentType) } +` + }, + }, + { + Matching: []string{"scroll"}, + Func: func(*Endpoint, ...interface{}) string { + return ` + path.Grow(len("/_search/scroll")) + path.WriteString("/_search/scroll") ` }, }, From 1f1c46082c7d36cd09ab052b2c1283a83aa754ff Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 21 May 2019 08:59:02 +0200 Subject: [PATCH 033/355] API: Fix the Scroll URL path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch fixes the URL path for the "Scroll" API — previously, the `scroll_id` was set both in the URL path (which is now deprecated) and in the URL parameters; it is not set only as a URL parameter. Note, that passing the `scroll_id` in the body is imperative in most production scenarios, since the URL length limit prohibits large values. Closes: #51 (cherry picked from commit c52248add650870f0f74b099c67ca50ce034c25c) --- esapi/api.scroll.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/esapi/api.scroll.go b/esapi/api.scroll.go index fb03e16a7b..e4e5a5e3ed 100755 --- a/esapi/api.scroll.go +++ b/esapi/api.scroll.go @@ -57,15 +57,8 @@ func (r ScrollRequest) Do(ctx context.Context, transport Transport) (*Response, method = "GET" - path.Grow(1 + len("_search") + 1 + len("scroll") + 1 + len(r.ScrollID)) - path.WriteString("/") - path.WriteString("_search") - path.WriteString("/") - path.WriteString("scroll") - if r.ScrollID != "" { - path.WriteString("/") - path.WriteString(r.ScrollID) - } + path.Grow(len("/_search/scroll")) + path.WriteString("/_search/scroll") params = make(map[string]string) From f3e4039e4c67b650094ac8c95baf15ec11f39bbb Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 22 May 2019 14:29:46 +0200 Subject: [PATCH 034/355] Release 7.1.1 --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index dd00c32edf..c21bd3b42a 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -2,4 +2,4 @@ package version // Client returns the client version as a string. // -const Client = "7.0.0-SNAPSHOT" +const Client = "7.1.0" From fccb01b0236643c42c22549fb89b671eecc5cd1d Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 22 May 2019 14:32:45 +0200 Subject: [PATCH 035/355] Update version to 7.0.0-SNAPSHOT --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index c21bd3b42a..dd00c32edf 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -2,4 +2,4 @@ package version // Client returns the client version as a string. // -const Client = "7.1.0" +const Client = "7.0.0-SNAPSHOT" From c28353a27e669ec86b20cbc7429f605eab8f76f3 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 22 May 2019 14:46:48 +0200 Subject: [PATCH 036/355] Update version to 7.1.1-SNAPSHOT --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index dd00c32edf..f218ddcd1c 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -2,4 +2,4 @@ package version // Client returns the client version as a string. // -const Client = "7.0.0-SNAPSHOT" +const Client = "7.1.1-SNAPSHOT" From 709f5bfb5561498c647ac7061a4e32a6091a2079 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 22 May 2019 14:47:10 +0200 Subject: [PATCH 037/355] Update the Elasticsearch version in "cluster" Make target --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e86d7f75ce..cadf9e4531 100755 --- a/Makefile +++ b/Makefile @@ -133,7 +133,7 @@ godoc: ## Display documentation for the package GOROOT=/tmp/tmpgoroot/ GOPATH=/tmp/tmpgopath/ godoc -http=localhost:6060 -play cluster: ## Launch an Elasticsearch cluster with Docker - $(eval version ?= "elasticsearch-oss:7.0.0-SNAPSHOT") + $(eval version ?= "elasticsearch-oss:7.1-SNAPSHOT") ifeq ($(origin nodes), undefined) $(eval nodes = 1) endif @@ -187,7 +187,7 @@ endif } cluster-update: ## Update the Docker image - $(eval version ?= "elasticsearch-oss:7.0.0-SNAPSHOT") + $(eval version ?= "elasticsearch-oss:7.1-SNAPSHOT") @echo "\033[2m→ Updating the Docker image...\033[0m" @docker pull docker.elastic.co/elasticsearch/$(version); From 123349a24c29d273c4306ac97b2827603f091243 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 23 Jun 2019 16:42:28 +0200 Subject: [PATCH 038/355] Util: Fix incorrect version in JSONReader Fixes #55 --- _examples/encoding/jsonreader.go | 6 +++--- esutil/json_reader_benchmark_test.go | 2 +- esutil/json_reader_integration_test.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/_examples/encoding/jsonreader.go b/_examples/encoding/jsonreader.go index 25ee3b5f6d..b6b2b74526 100644 --- a/_examples/encoding/jsonreader.go +++ b/_examples/encoding/jsonreader.go @@ -3,9 +3,9 @@ package main import ( "log" - "github.com/elastic/go-elasticsearch/v8" - "github.com/elastic/go-elasticsearch/v8/esapi" - "github.com/elastic/go-elasticsearch/v8/esutil" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" + "github.com/elastic/go-elasticsearch/v7/esutil" ) func init() { diff --git a/esutil/json_reader_benchmark_test.go b/esutil/json_reader_benchmark_test.go index d02d7ddaa3..89137546c4 100644 --- a/esutil/json_reader_benchmark_test.go +++ b/esutil/json_reader_benchmark_test.go @@ -11,7 +11,7 @@ import ( "strings" "testing" - "github.com/elastic/go-elasticsearch/v8/esutil" + "github.com/elastic/go-elasticsearch/v7/esutil" ) var _ = fmt.Print diff --git a/esutil/json_reader_integration_test.go b/esutil/json_reader_integration_test.go index d3ef2a2f3e..0bed4fbf20 100644 --- a/esutil/json_reader_integration_test.go +++ b/esutil/json_reader_integration_test.go @@ -6,9 +6,9 @@ import ( "strings" "testing" - "github.com/elastic/go-elasticsearch/v8" - "github.com/elastic/go-elasticsearch/v8/esapi" - "github.com/elastic/go-elasticsearch/v8/esutil" + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" + "github.com/elastic/go-elasticsearch/v7/esutil" ) func TestJSONReaderIntegration(t *testing.T) { From b00327e0a7720c66c26e65e0d2290f1b0fc99dbe Mon Sep 17 00:00:00 2001 From: Alexander Menzhinsky Date: Fri, 21 Jun 2019 14:11:05 +0300 Subject: [PATCH 039/355] Prevent panic on connection refused when ResponseBodyEnabled for logger Closes #60 (cherry picked from commit 2870f808ff8548e1ac9d29ff91510eebba15dd3f) --- estransport/estransport.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/estransport/estransport.go b/estransport/estransport.go index f5ec05f6ac..a5233b58a9 100755 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -113,7 +113,7 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { } } if c.logger.ResponseBodyEnabled() { - if res.Body != nil && res.Body != http.NoBody { + if res != nil && res.Body != nil && res.Body != http.NoBody { b1, b2, _ := duplicateBody(res.Body) dupRes.Body = b1 res.Body = b2 From fb33a9968a365ab35d3964bd4a9b167aa83e8803 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 29 Jun 2019 19:01:27 +0200 Subject: [PATCH 040/355] CI: Add certificates for Elasticsearch running with TLS (cherry picked from commit 5e00ee76f0e62d60ab532b089c47bd7182bfd774) --- .jenkins/certs/ca.crt | 20 ++++++++++++++++++++ .jenkins/certs/testnode.crt | 19 +++++++++++++++++++ .jenkins/certs/testnode.key | 27 +++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100755 .jenkins/certs/ca.crt create mode 100755 .jenkins/certs/testnode.crt create mode 100755 .jenkins/certs/testnode.key diff --git a/.jenkins/certs/ca.crt b/.jenkins/certs/ca.crt new file mode 100755 index 0000000000..6402874d50 --- /dev/null +++ b/.jenkins/certs/ca.crt @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDSTCCAjGgAwIBAgIUIwN+0zglsexRKwE1RGHvlCcmrdwwDQYJKoZIhvcNAQEL +BQAwNDEyMDAGA1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5l +cmF0ZWQgQ0EwHhcNMTkwMjEzMDcyMjQwWhcNMjIwMjEyMDcyMjQwWjA0MTIwMAYD +VQQDEylFbGFzdGljIENlcnRpZmljYXRlIFRvb2wgQXV0b2dlbmVyYXRlZCBDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANILs0JO0e7x29zeVx21qalK +XKdX+AMlGJPH75wWO/Jq6YHtxt1wYIg762krOBXfG6JsFSOIwIv5VrzGGRGjSPt9 +OXQyXrDDiQvsBT3rpzLNdDs7KMl2tZswwv7w9ujgud0cYnS1MOpn81rfPc73DvMg +xuhplofDx6fn3++PjVRU2FNiIVWyEoaxRjCeGPMBubKZYaYbQA6vYM4Z+ByG727B +AyAER3t7xmvYti/EoO2hv2HQk5zgcj/Oq3AJKhnt8LH8fnfm3TnYNM1htvXqhN05 +vsvhvm2PHfnA5qLlSr/3W0aI/U/PqfsFDCgyRV097sMIaKkmavb0Ue7aQ7lgtp0C +AwEAAaNTMFEwHQYDVR0OBBYEFDRKlCMowWR1rwxE0d1lTEQe5O71MB8GA1UdIwQY +MBaAFDRKlCMowWR1rwxE0d1lTEQe5O71MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI +hvcNAQELBQADggEBAKbCJ95EBpeuvF70KEt6QU70k/SH1NRvM9YzKryV0D975Jvu +HOSm9HgSTULeAUFZIa4oYyf3QUfVoI+2T/aQrfXA3gfrJWsHURkyNmiHOFAbYHqi +xA6i249G2GTEjc1+le/M2N2CcDKAmurW6vSGK4upXQbPd6KmnhHREX74zkWjnOa+ ++tibbSSOCT4Tmja2DbBxAPuivU9IB1g/hIUmbYQqKffQrBJA0658tz6w63a/Q7xN +pCvvbSgiMZ6qcVIcJkBT2IooYie+ax45pQECHthgIUcQAzfmIfqlU0Qfl8rDgAmn +0c1o6HQjKGU2aVGgSRuaaiHaSZjbPIZVS51sOoI= +-----END CERTIFICATE----- diff --git a/.jenkins/certs/testnode.crt b/.jenkins/certs/testnode.crt new file mode 100755 index 0000000000..ff3bcb37f3 --- /dev/null +++ b/.jenkins/certs/testnode.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDIjCCAgqgAwIBAgIUI4QU6jA1dYSCbdIA6oAb2TBEluowDQYJKoZIhvcNAQEL +BQAwNDEyMDAGA1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5l +cmF0ZWQgQ0EwHhcNMTkwMjEzMDcyMzEzWhcNMjIwMjEyMDcyMzEzWjATMREwDwYD +VQQDEwhpbnN0YW5jZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJeT +yOy6EAScZxrULKjHePciiz38grivCrhFFV+dThaRCcl3DhDzb9Eny5q5iEw3WvLQ +Rqmf01jncNIhaocTt66VqveXaMubbE8O0LcG6e4kpFO+JtnVF8JTARTc+ux/1uD6 +hO1VG/HItM7WQrQxh4hfB2u1AX2YQtoqEtXXEC+UHWfl4QzuzXjBnKCkO/L9/6Tf +yNFQWXxKnIiTs8Xm9sEhhSCBJPlLTQu+MX4vR2Uwj5XZmflDUr+ZTenl9qYxL6b3 +SWhh/qEl4GAj1+tS7ZZOxE0237mUh3IIFYSWSaMm8K2m/BYHkLNWL5B1dMic0lsv +osSoYrQuCef4HQMCitsCAwEAAaNNMEswHQYDVR0OBBYEFFMg4l1GLW8lYbwASY+r +YeWYRzIiMB8GA1UdIwQYMBaAFDRKlCMowWR1rwxE0d1lTEQe5O71MAkGA1UdEwQC +MAAwDQYJKoZIhvcNAQELBQADggEBAEQrgh1xALpumQTzsjxFRGque/vlKTgRs5Kh +xtgapr6wjIbdq7dagee+4yNOKzS5lGVXCgwrJlHESv9qY0uumT/33vK2uduJ7NAd +fR2ZzyBnhMX+mkYhmGrGYCTUMUIwOIQYa4Evis4W+LHmCIDG03l7gLHfdIBe9VMO +pDZum8f6ng0MM49s8/rXODNYKw8kFyUhnfChqMi/2yggb1uUIfKlJJIchkgYjE13 +zuC+fjo029Pq1jeMIdxugLf/7I/8NiW1Yj9aCXevUXG1qzHFEuKAinBXYOZO/vWS +LaEqOhwrzNynwgGpYAr7Rfgv4AflltYIIav4PZT03P7fbyAAf8s= +-----END CERTIFICATE----- diff --git a/.jenkins/certs/testnode.key b/.jenkins/certs/testnode.key new file mode 100755 index 0000000000..c35b4bc839 --- /dev/null +++ b/.jenkins/certs/testnode.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEAl5PI7LoQBJxnGtQsqMd49yKLPfyCuK8KuEUVX51OFpEJyXcO +EPNv0SfLmrmITDda8tBGqZ/TWOdw0iFqhxO3rpWq95doy5tsTw7Qtwbp7iSkU74m +2dUXwlMBFNz67H/W4PqE7VUb8ci0ztZCtDGHiF8Ha7UBfZhC2ioS1dcQL5QdZ+Xh +DO7NeMGcoKQ78v3/pN/I0VBZfEqciJOzxeb2wSGFIIEk+UtNC74xfi9HZTCPldmZ ++UNSv5lN6eX2pjEvpvdJaGH+oSXgYCPX61Ltlk7ETTbfuZSHcggVhJZJoybwrab8 +FgeQs1YvkHV0yJzSWy+ixKhitC4J5/gdAwKK2wIDAQABAoIBAQCRFTJna/xy/WUu +59FLR4qAOj8++JgCwACpue4oU7/vl6nffSYokWoAr2+RzG4qTX2vFi3cpA8+dGCn +sLZvTi8tWzKGxBTZdg2oakzaMzLr74SeZ052iCGyrZJGbvF6Ny7srr1XEXSq6+os +ZCb6pMHOhO7saBdiKMAsY8MdjTl/33AduuE6ztqv+L92xTr2g4QlbT1KvWlEgppU +k4Gy7zdETkPBTSH/17ZwyGJoJICIAhbL4IpmOM4dPIg8nFkVPPpy6p0z4uGjtgnK +nreZ2EKMzCafBaHn7A77gpi0OrQdl6pe0fsGqv/323YjCJPbwwl5TsoNq44DzwiX +3M7XiVJxAoGBAOCne56vdN4uZmCgLVGT2JSUNVPOu4bfjrxWH6cslzrPT2Zhp3lO +M4axZ3gmcervV252YEZXntXDHHCSfrECllRN1WFD63XmyQ/CkhuvZkkeRHfzL1TE +EdqHOTqs4sRETZ7+RITFC81DZQkWWOKeyXMjyPBqd7RnThQHijB1c8Y5AoGBAKy6 +CVKBx+zz5crVD0tz4UhOmz1wRNN0CL0l+FXRuFSgbzMIvwpfiqe25crgeLHe2M2/ +TogdWbjZ2nUZQTzoRsSkQ6cKHpj+G/gWurp/UcHHXFVwgLSPF7c3KHDtiYq7Vqw0 +bvmhM03LI6+ZIPRV7hLBr7WP7UmpAiREMF7tTnmzAoGBAIkx3w3WywFQxtblmyeB +qbd7F2IaE23XoxyjX+tBEQ4qQqwcoSE0v8TXHIBEwjceeX+NLVhn9ClJYVniLRq+ +oL3VVqVyzB4RleJZCc98e3PV1yyFx/b1Uo3pHOsXX9lKeTjKwV9v0rhFGzPEgP3M +yOvXA8TG0FnM6OLUg/D6GX0JAoGAMuHS4TVOGeV3ahr9mHKYiN5vKNgrzka+VEod +L9rJ/FQOrfADpyCiDen5I5ygsXU+VM3oanyK88NpcVlxOGoMft0M+OYoQVWKE7lO +ZKYhBX6fGqQ7pfUJPXXIOgwfmni5fZ0sm+j63g3bg10OsiumKGxaQJgXhL1+3gQg +Y7ZwibUCgYEAlZoFFvkMLjpOSaHk1z5ZZnt19X0QUIultBwkumSqMPm+Ks7+uDrx +thGUCoz4ecr/ci4bIUY7mB+zfAbqnBOMxreJqCRbAIuRypo1IlWkTp8DywoDOfMW +NfzjVmzJ7EJu44nGmVAi1jw4Pbseivvi1ujMCoPgaE8I1uSh144bwN8= +-----END RSA PRIVATE KEY----- From 2936aad343c011b588d0b8f4bdbeb4ae3c5b2f3f Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 29 Jun 2019 19:02:37 +0200 Subject: [PATCH 041/355] Makefile: Add support for launching the default distribution cluster $ make cluster-clean cluster version=elasticsearch:8.0.0-SNAPSHOT (cherry picked from commit f16d6bc7ed6c7f56d9d93f72e739c01f74b8b7a9) --- Makefile | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cadf9e4531..b81e959914 100755 --- a/Makefile +++ b/Makefile @@ -143,7 +143,27 @@ ifeq ($(shell test $(nodes) && test $(nodes) -gt 1; echo $$?),0) else $(eval detached ?= "false") endif - @docker network inspect elasticsearch > /dev/null || docker network create elasticsearch; +ifdef version +ifneq (,$(findstring oss,$(version))) +else + $(eval xpack_env += --env "ELASTIC_PASSWORD=elastic") + $(eval xpack_env += --env "xpack.license.self_generated.type=trial") + $(eval xpack_env += --env "xpack.security.enabled=true") + $(eval xpack_env += --env "xpack.security.http.ssl.enabled=true") + $(eval xpack_env += --env "xpack.security.http.ssl.verification_mode=certificate") + $(eval xpack_env += --env "xpack.security.http.ssl.key=certs/testnode.key") + $(eval xpack_env += --env "xpack.security.http.ssl.certificate=certs/testnode.crt") + $(eval xpack_env += --env "xpack.security.http.ssl.certificate_authorities=certs/ca.crt") + $(eval xpack_env += --env "xpack.security.transport.ssl.enabled=true") + $(eval xpack_env += --env "xpack.security.transport.ssl.key=certs/testnode.key") + $(eval xpack_env += --env "xpack.security.transport.ssl.certificate=certs/testnode.crt") + $(eval xpack_env += --env "xpack.security.transport.ssl.certificate_authorities=certs/ca.crt") + $(eval xpack_volumes += --volume "$(PWD)/.jenkins/certs/testnode.crt:/usr/share/elasticsearch/config/certs/testnode.crt") + $(eval xpack_volumes += --volume "$(PWD)/.jenkins/certs/testnode.key:/usr/share/elasticsearch/config/certs/testnode.key") + $(eval xpack_volumes += --volume "$(PWD)/.jenkins/certs/ca.crt:/usr/share/elasticsearch/config/certs/ca.crt") +endif +endif + @docker network inspect elasticsearch > /dev/null 2>&1 || docker network create elasticsearch; @{ \ for n in `seq 1 $(nodes)`; do \ if [[ -z "$$port" ]]; then \ @@ -164,7 +184,9 @@ endif --env "path.repo=/tmp" \ --env "repositories.url.allowed_urls=http://snapshot.test*" \ --env ES_JAVA_OPTS="-Xms1g -Xmx1g" \ + $(xpack_env) \ --volume `echo $(version) | tr -C "[:alnum:]" '-'`-node-$$n-data:/usr/share/elasticsearch/data \ + $(xpack_volumes) \ --publish $$hostport:9200 \ --ulimit nofile=65536:65536 \ --ulimit memlock=-1:-1 \ From e3613ccbdf120105a603e3f05c5e0327f0ee54e3 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 29 Jun 2019 19:27:01 +0200 Subject: [PATCH 042/355] Dockerfile: Install unzip and tree (cherry picked from commit 373c2febcbcf61fa4f142bc426ae7cda41a6a74f) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 92d2934ab0..312159c61e 100755 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ ARG VERSION=1-alpine FROM golang:${VERSION} -RUN apk add --no-cache --quiet make curl git jq && \ +RUN apk add --no-cache --quiet make curl git jq unzip tree && \ go get -u golang.org/x/lint/golint && \ curl -sSL --retry 3 --retry-connrefused https://github.com/gotestyourself/gotestsum/releases/download/v0.3.2/gotestsum_0.3.2_linux_amd64.tar.gz | tar -xz -C /usr/local/bin gotestsum From bc9d9ac76ea658704de4fdb6ccded7c7f1808d65 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 29 Jun 2019 19:28:34 +0200 Subject: [PATCH 043/355] CI: Add script for running the X-Pack tests (cherry picked from commit 7759b4dbeaed15f17d3fb1ffae44b88f815e2dff) --- .jenkins/tests-xpack.sh | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .jenkins/tests-xpack.sh diff --git a/.jenkins/tests-xpack.sh b/.jenkins/tests-xpack.sh new file mode 100644 index 0000000000..c07028a1c9 --- /dev/null +++ b/.jenkins/tests-xpack.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +set -euo pipefail + +TIMEFORMAT="(Duration: %0lR)" + +docker exec go-elasticsearch /bin/sh -c "rm -rf esapi/test/*_test.go" +docker exec go-elasticsearch /bin/sh -c "rm -rf rm -rf esapi/test/ml*" + +docker exec --workdir=/go-elasticsearch/internal/cmd/generate go-elasticsearch go generate ./... + +time docker exec --tty --workdir=/go-elasticsearch/internal/cmd/generate go-elasticsearch go run main.go apitests --output '/go-elasticsearch/esapi/test/xpack' --input '/elasticsearch-source/elasticsearch/x-pack/plugin/src/test/resources/rest-api-spec/test/**/*.yml' + +time docker exec --tty --workdir=/go-elasticsearch/internal/cmd/generate go-elasticsearch go run main.go apitests --output '/go-elasticsearch/esapi/test/xpack' --input '/elasticsearch-source/elasticsearch/x-pack/plugin/src/test/resources/rest-api-spec/test/**/**/*.yml' + +docker exec go-elasticsearch mkdir -p esapi/test/xpack/ml +docker exec go-elasticsearch mkdir -p esapi/test/xpack/ml-crud + +docker exec go-elasticsearch /bin/sh -c "mv esapi/test/xpack/xpack_ml* esapi/test/xpack/ml/" +docker exec go-elasticsearch mv esapi/test/xpack/ml/xpack_ml__jobs_crud_test.go esapi/test/xpack/ml-crud/ + +# ----- + +echo -e "\033[1m>>>>> XPACK >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" + +time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c "gotestsum --format=short-verbose -- --tags='integration' --timeout=1h -v xpack/*_test.go" +status1=$? + +docker container rm --force --volumes es1 > /dev/null 2>&1 +make cluster-clean cluster version=elasticsearch:8.0.0-SNAPSHOT detached=true + +echo -e "\033[1m>>>>> XPACK ML >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" + +time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c "gotestsum --format=short-verbose -- --tags='integration' --timeout=1h -v ./xpack/ml/*_test.go" +status2=$? + +docker container rm --force --volumes es1 > /dev/null 2>&1 +make cluster-clean cluster version=elasticsearch:8.0.0-SNAPSHOT detached=true + +echo -e "\033[1m>>>>> XPACK ML CRUD >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" + +time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c "gotestsum --format=short-verbose -- --tags='integration' --timeout=1h -v ./xpack/ml-crud/*_test.go" +status3=$? + +if [[ $status1 == 0 && $status2 == 0 || $status3 == 0 ]]; then + exit 0 +else + exit 0 +fi From 89ed9c26ae0953a43fd3bd7cded6268ae76e3be8 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 29 Jun 2019 19:29:09 +0200 Subject: [PATCH 044/355] CI: Add the "TEST_SUITE" variable to the matrix (cherry picked from commit a4ecb2b6f0fbbd9a1bab6c10f9c2ddbef603f072) --- .jenkins/jobs/defaults.yml | 4 ++++ .jenkins/test-matrix.yml | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.jenkins/jobs/defaults.yml b/.jenkins/jobs/defaults.yml index 1f38d82487..b2bb8f1c01 100755 --- a/.jenkins/jobs/defaults.yml +++ b/.jenkins/jobs/defaults.yml @@ -51,6 +51,10 @@ type: yaml filename: .jenkins/test-matrix.yml name: GO_VERSION + - axis: + type: yaml + filename: .jenkins/test-matrix.yml + name: TEST_SUITE yaml-strategy: exclude-key: exclude filename: .jenkins/test-matrix.yml diff --git a/.jenkins/test-matrix.yml b/.jenkins/test-matrix.yml index 7a979a5f0d..63b3012d18 100755 --- a/.jenkins/test-matrix.yml +++ b/.jenkins/test-matrix.yml @@ -1,8 +1,13 @@ --- + ELASTICSEARCH_VERSION: - 7.0.0-SNAPSHOT GO_VERSION: -- 1-alpine + - 1-alpine + +TEST_SUITE: + - core + - xpack exclude: ~ From c59f002fe25181f3fd36ea3efd6d000a2f12e915 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 29 Jun 2019 19:29:41 +0200 Subject: [PATCH 045/355] CI: Update the main runner script * Allow running both core and X-Pack tests * Download the Elasticsearch source code and store it in a helper container volume * Mount the helper container colume, "elasticsearch-source", into the main container * This allows to simplify the core runner script in future (cherry picked from commit ce9c79240c750bedf550efd816faa4d01303167b) --- .jenkins/run-tests | 79 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 69 insertions(+), 10 deletions(-) diff --git a/.jenkins/run-tests b/.jenkins/run-tests index e660d76733..b826f49f7b 100755 --- a/.jenkins/run-tests +++ b/.jenkins/run-tests @@ -2,40 +2,99 @@ set -eo pipefail +if [[ -z $TEST_SUITE ]]; then + echo -e "\033[31;1mERROR:\033[0m Required environment variable [TEST_SUITE] not set\033[0m" + exit 1 +fi + +if [[ $TEST_SUITE != "core" && $TEST_SUITE != "xpack" ]]; then + echo -e "\033[31;1mERROR:\033[0m Unknown value [$TEST_SUITE] for [TEST_SUITE]\033[0m" + exit 1 +fi + +if [[ $TEST_SUITE == "core" ]]; then + elasticsearch_image=elasticsearch-oss:8.0.0-SNAPSHOT + elasticsearch_url=http://es1:9200 +fi + +if [[ $TEST_SUITE == "xpack" ]]; then + elasticsearch_image=elasticsearch:8.0.0-SNAPSHOT + elasticsearch_url=https://elastic:elastic@es1:9200 +fi + function cleanup { docker container rm --force --volumes es1 > /dev/null 2>&1 || true + docker container rm --force --volumes elasticsearch-source > /dev/null 2>&1 || true docker container rm --force --volumes go-elasticsearch > /dev/null 2>&1 || true } trap cleanup EXIT -echo -e "\033[1m>>>>> SETUP >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" +TIMEFORMAT="(Duration: %0lR)" + +echo -e "\033[1m>>>>> SETUP [$TEST_SUITE] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" # Build the go-elasticsearch image docker build --file Dockerfile --tag elastic/go-elasticsearch . # Launch a single Elasticsearch node -(make cluster detached=true) +(make cluster detached=true version=$elasticsearch_image) -# Prepare the container +# Store the Elasticsearch version and build hash +ELASTICSEARCH_VERSION=$(docker run --network elasticsearch --rm appropriate/curl -sSk $elasticsearch_url | docker run -i --rm stedolan/jq -r '.version.number') +ELASTICSEARCH_BUILD_HASH=$(docker run --network elasticsearch --rm appropriate/curl -sSk $elasticsearch_url | docker run -i --rm stedolan/jq -r '.version.build_hash') + +# Download Elasticsearch source code at ELASTICSEARCH_BUILD_HASH and store it in a container +echo -e ">>>>> Downloading Elasticsearch repository @ $ELASTICSEARCH_BUILD_HASH..." +time docker run --rm appropriate/curl --retry 3 -sSL https://github.com/elastic/elasticsearch/archive/$ELASTICSEARCH_BUILD_HASH.zip > /tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip +echo -e ">>>>> Extracting and storing to [elasticsearch-source:/elasticsearch-source]..." +time docker run --volume=/tmp:/tmp --workdir=/tmp --rm elastic/go-elasticsearch unzip -q -o elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip '*.properties' '*.json' '*.y*ml' +rm -rf /tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip +rm -rf /tmp/elasticsearch/ +mv /tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH* /tmp/elasticsearch/ +docker create --name elasticsearch-source --volume /elasticsearch-source --name elasticsearch-source alpine /bin/true +docker cp /tmp/elasticsearch elasticsearch-source:/elasticsearch-source + +# Launch the container; actual commands are called with "docker exec" docker run \ --name go-elasticsearch \ --network elasticsearch \ - --env ELASTICSEARCH_URL=http://es1:9200 \ - --env WORKSPACE=${WORKSPACE:-/workspace} \ - --volume ${WORKSPACE:-workspace}:${WORKSPACE:-/workspace} \ + --env "ELASTICSEARCH_URL=$elasticsearch_url" \ + --env "ELASTICSEARCH_VERSION=$ELASTICSEARCH_VERSION" \ + --env "ELASTICSEARCH_BUILD_HASH=$ELASTICSEARCH_BUILD_HASH" \ + --env "WORKSPACE=${WORKSPACE:-/workspace}" \ + --volume "/go-elasticsearch" \ + --volume "${WORKSPACE:-workspace}:${WORKSPACE:-/workspace}" \ + --volumes-from "elasticsearch-source" \ --rm \ --detach \ elastic/go-elasticsearch sleep 3600 -docker cp .jenkins/tests.sh go-elasticsearch:/go-elasticsearch/tests.sh # Run the tests -cmd="docker exec --tty go-elasticsearch /bin/sh /go-elasticsearch/tests.sh" +# NOTE: Conditions needed to prevent early exit due to the 'set -e' option +status=100 +case $TEST_SUITE in + "core" ) + if docker exec --tty go-elasticsearch /bin/sh /go-elasticsearch/.jenkins/tests.sh; then + status=$? + else + status=$? + fi + ;; + "xpack" ) + if time bash .jenkins/tests-xpack.sh; then + status=$? + else + status=$? + fi + ;; +esac -if $cmd; then +# Report status and exit +if [[ $status == "0" ]]; then echo -e "\n\033[32;1mSUCCESS\033[0m" exit 0 else echo -e "\n\033[31;1mFAILURE\033[0m" - exit 1 + exit $status fi From afe98c952e51967501a51a874913c148d18da9de Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 29 Jun 2019 20:10:40 +0200 Subject: [PATCH 046/355] CI: Added Jenkins job for the "xpack" branch (cherry picked from commit 160c2d803e893344a7686380c30bf78468099373) --- .../jobs/elastic+go-elasticsearch+master-xpack.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .jenkins/jobs/elastic+go-elasticsearch+master-xpack.yml diff --git a/.jenkins/jobs/elastic+go-elasticsearch+master-xpack.yml b/.jenkins/jobs/elastic+go-elasticsearch+master-xpack.yml new file mode 100644 index 0000000000..53b8e73a7a --- /dev/null +++ b/.jenkins/jobs/elastic+go-elasticsearch+master-xpack.yml @@ -0,0 +1,14 @@ +--- +- job: + name: elastic+go-elasticsearch+master-xpack + display-name: 'elastic / go-elasticsearch # master-xpack' + description: Testing the go-elasticsearch master branch with XPack. + junit_results: "*-junit.xml" + parameters: + - string: + name: branch_specifier + default: refs/heads/xpack + description: The Git branch specifier to build + triggers: + - github + - timed: '@daily' From fa85d42f32bd6e150c80a603c5f6426dec072db9 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 29 Jun 2019 21:47:59 +0200 Subject: [PATCH 047/355] Makefile: Use "ifdef" instead of shell condition in the "cluster" target This appears to break Jenkins with `/bin/sh: 2: [[: not found` error. (cherry picked from commit d568a91bbc6901186da718373f619164a41e0ac2) --- Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index b81e959914..ea73eec63a 100755 --- a/Makefile +++ b/Makefile @@ -195,18 +195,18 @@ endif docker.elastic.co/elasticsearch/$(version); \ done \ } +ifdef detached @{ \ - if [[ "$(detached)" == "true" ]]; then \ - echo "\033[2m→ Waiting for the cluster...\033[0m"; \ - docker run --network elasticsearch --rm appropriate/curl --max-time 120 --retry 120 --retry-delay 1 --retry-connrefused --show-error --silent http://es1:9200; \ - output="\033[2m→ Cluster ready; to remove containers:"; \ - output="$$output docker rm -f"; \ - for n in `seq 1 $(nodes)`; do \ - output="$$output es$$n"; \ - done; \ - echo "$$output\033[0m"; \ - fi \ + echo "\033[2m→ Waiting for the cluster...\033[0m"; \ + docker run --network elasticsearch --rm appropriate/curl --max-time 120 --retry 120 --retry-delay 1 --retry-connrefused --show-error --silent http://es1:9200; \ + output="\033[2m→ Cluster ready; to remove containers:"; \ + output="$$output docker rm -f"; \ + for n in `seq 1 $(nodes)`; do \ + output="$$output es$$n"; \ + done; \ + echo "$$output\033[0m"; \ } +endif cluster-update: ## Update the Docker image $(eval version ?= "elasticsearch-oss:7.1-SNAPSHOT") From 22fc776fc86a307718ccb3f186a401885d456dcb Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 29 Jun 2019 22:21:10 +0200 Subject: [PATCH 048/355] CI: Use "docker run" for file manipulation, to prevent permission errors Because the ZIP file has been created and unzipped with docker, manipulating it directly with system commands fails with permission error: mv: cannot move '/tmp/elasticsearch-c108b093b5a7da9b042d25969fd7339b86adc19f' to '/tmp/elasticsearch/': Operation not permitted (cherry picked from commit dfe749d71adf1993da36a4bee8a575081e514cd4) --- .jenkins/run-tests | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.jenkins/run-tests b/.jenkins/run-tests index b826f49f7b..2d3af60314 100755 --- a/.jenkins/run-tests +++ b/.jenkins/run-tests @@ -46,12 +46,14 @@ ELASTICSEARCH_BUILD_HASH=$(docker run --network elasticsearch --rm appropriate/c # Download Elasticsearch source code at ELASTICSEARCH_BUILD_HASH and store it in a container echo -e ">>>>> Downloading Elasticsearch repository @ $ELASTICSEARCH_BUILD_HASH..." -time docker run --rm appropriate/curl --retry 3 -sSL https://github.com/elastic/elasticsearch/archive/$ELASTICSEARCH_BUILD_HASH.zip > /tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip -echo -e ">>>>> Extracting and storing to [elasticsearch-source:/elasticsearch-source]..." -time docker run --volume=/tmp:/tmp --workdir=/tmp --rm elastic/go-elasticsearch unzip -q -o elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip '*.properties' '*.json' '*.y*ml' -rm -rf /tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip -rm -rf /tmp/elasticsearch/ -mv /tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH* /tmp/elasticsearch/ +time docker run --rm appropriate/curl --retry 3 -sSL "https://github.com/elastic/elasticsearch/archive/$ELASTICSEARCH_BUILD_HASH.zip" > "/tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip" +echo -e ">>>>> Extracting and storing to [elasticsearch-source] container..." +time docker run --volume=/tmp:/tmp --workdir=/tmp --rm elastic/go-elasticsearch unzip -q -o "elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip" '*.properties' '*.json' '*.y*ml' +docker run --volume=/tmp:/tmp --workdir=/tmp --rm elastic/go-elasticsearch /bin/sh -c " + rm -rf /tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip + rm -rf /tmp/elasticsearch/ + mv /tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH* /tmp/elasticsearch/ +" docker create --name elasticsearch-source --volume /elasticsearch-source --name elasticsearch-source alpine /bin/true docker cp /tmp/elasticsearch elasticsearch-source:/elasticsearch-source From b5d229039a2893ac573eb192ac50476f4a57932c Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 30 Jun 2019 08:40:10 +0200 Subject: [PATCH 049/355] CI: Skip XPack tests on "master", and skip Core tests on "xpack" (temporary) (cherry picked from commit f769b67519bdd6e703c87e613afd4e9b5aaf3861) --- .jenkins/run-tests | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.jenkins/run-tests b/.jenkins/run-tests index 2d3af60314..9fca5dd3f8 100755 --- a/.jenkins/run-tests +++ b/.jenkins/run-tests @@ -12,6 +12,12 @@ if [[ $TEST_SUITE != "core" && $TEST_SUITE != "xpack" ]]; then exit 1 fi +# Do not run XPack tests on "master" branch, and do not run Core tests on "xpack" branch +if [[ ($branch_specifier == "refs/heads/master" && $TEST_SUITE == "xpack") || ($branch_specifier == "refs/heads/xpack" && $TEST_SUITE == "core") ]]; then + echo -e "\033[33;1mSkipping [$TEST_SUITE] tests on the [$branch_specifier] branch.\033[0m" + exit 0 +fi + if [[ $TEST_SUITE == "core" ]]; then elasticsearch_image=elasticsearch-oss:8.0.0-SNAPSHOT elasticsearch_url=http://es1:9200 From 42ee05729c56fca00d38ab8838860ac9fc67b9f0 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 30 Jun 2019 09:42:46 +0200 Subject: [PATCH 050/355] CI: Add publishing JUnit results to the XPack test runner script (cherry picked from commit 4290e0eb130643c01c9d90f1f73b0fe5650e14f2) --- .jenkins/tests-xpack.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.jenkins/tests-xpack.sh b/.jenkins/tests-xpack.sh index c07028a1c9..ae3248a03d 100644 --- a/.jenkins/tests-xpack.sh +++ b/.jenkins/tests-xpack.sh @@ -23,7 +23,7 @@ docker exec go-elasticsearch mv esapi/test/xpack/ml/xpack_ml__jobs_crud_test.go echo -e "\033[1m>>>>> XPACK >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" -time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c "gotestsum --format=short-verbose -- --tags='integration' --timeout=1h -v xpack/*_test.go" +time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c 'gotestsum --format=short-verbose --junitfile=$WORKSPACE/TEST-integration-api-xpack-junit.xml -- --tags=integration --timeout=1h -v xpack/*_test.go' status1=$? docker container rm --force --volumes es1 > /dev/null 2>&1 @@ -31,7 +31,7 @@ make cluster-clean cluster version=elasticsearch:8.0.0-SNAPSHOT detached=true echo -e "\033[1m>>>>> XPACK ML >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" -time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c "gotestsum --format=short-verbose -- --tags='integration' --timeout=1h -v ./xpack/ml/*_test.go" +time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c 'gotestsum --format=short-verbose --junitfile=$WORKSPACE/TEST-integration-api-xpack-ml-junit.xml -- --tags=integration --timeout=1h -v ./xpack/ml/*_test.go' status2=$? docker container rm --force --volumes es1 > /dev/null 2>&1 @@ -39,7 +39,7 @@ make cluster-clean cluster version=elasticsearch:8.0.0-SNAPSHOT detached=true echo -e "\033[1m>>>>> XPACK ML CRUD >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" -time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c "gotestsum --format=short-verbose -- --tags='integration' --timeout=1h -v ./xpack/ml-crud/*_test.go" +time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c 'gotestsum --format=short-verbose --junitfile=$WORKSPACE/TEST-integration-api-xpack-ml-crud-junit.xml -- --tags=integration --timeout=1h -v ./xpack/ml-crud/*_test.go' status3=$? if [[ $status1 == 0 && $status2 == 0 || $status3 == 0 ]]; then From 589694b5b27ce5f6550a2bfb5724f58996dea08b Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 30 Jun 2019 10:42:32 +0200 Subject: [PATCH 051/355] CI: Refactor and clean up the test runner for "core" tests Use the same pattern as in the `tests-xpack.sh` runner, ie. run the file directly on host, and execute commands with `docker exec`. Also, clean up a little bit the `tests-xpack.sh` runner, removing double quotes to prevent unwanted shell expansion, and passing the `PACKAGE_PATH` environment variable. (cherry picked from commit 4fbc97dde0789515583faf0595ac0dd3bb48356e) --- .jenkins/run-tests | 4 ++-- .jenkins/tests-core.sh | 25 +++++++++++++++++++++++++ .jenkins/tests-xpack.sh | 22 +++++++++++++--------- .jenkins/tests.sh | 24 ------------------------ 4 files changed, 40 insertions(+), 35 deletions(-) create mode 100755 .jenkins/tests-core.sh delete mode 100755 .jenkins/tests.sh diff --git a/.jenkins/run-tests b/.jenkins/run-tests index 9fca5dd3f8..4e2b1f52b4 100755 --- a/.jenkins/run-tests +++ b/.jenkins/run-tests @@ -83,14 +83,14 @@ docker run \ status=100 case $TEST_SUITE in "core" ) - if docker exec --tty go-elasticsearch /bin/sh /go-elasticsearch/.jenkins/tests.sh; then + if bash .jenkins/tests-core.sh; then status=$? else status=$? fi ;; "xpack" ) - if time bash .jenkins/tests-xpack.sh; then + if bash .jenkins/tests-xpack.sh; then status=$? else status=$? diff --git a/.jenkins/tests-core.sh b/.jenkins/tests-core.sh new file mode 100755 index 0000000000..2bc2982319 --- /dev/null +++ b/.jenkins/tests-core.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -euo pipefail + +TIMEFORMAT="(Duration: %0lR)" + +echo -e "\033[1m>>>>> Cleaning up test files\033[0m" + +docker exec go-elasticsearch /bin/sh -c 'rm -rf esapi/test/*_test.go' +docker exec go-elasticsearch /bin/sh -c 'rm -rf esapi/test/xpack' + +echo -e "\033[1m>>>>> Generating the API registry\033[0m" + +docker exec --workdir=/go-elasticsearch/internal/cmd/generate --env PACKAGE_PATH=/go-elasticsearch/esapi go-elasticsearch go generate ./... + +echo -e "\033[1m>>>>> Generating the test files\033[0m" + +time docker exec --tty --workdir=/go-elasticsearch/internal/cmd/generate go-elasticsearch go run main.go tests --output '/go-elasticsearch/esapi/test' --input '/elasticsearch-source/elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/test/**/*.y*ml' + +echo -e "\033[1m>>>>> Running the tests\033[0m" + +time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c 'gotestsum --format=short-verbose --junitfile=$WORKSPACE/TEST-integration-api-junit.xml -- -tags=integration -timeout=1h ./...' +status=$? + +exit $status diff --git a/.jenkins/tests-xpack.sh b/.jenkins/tests-xpack.sh index ae3248a03d..64ba4e8302 100644 --- a/.jenkins/tests-xpack.sh +++ b/.jenkins/tests-xpack.sh @@ -4,10 +4,16 @@ set -euo pipefail TIMEFORMAT="(Duration: %0lR)" -docker exec go-elasticsearch /bin/sh -c "rm -rf esapi/test/*_test.go" -docker exec go-elasticsearch /bin/sh -c "rm -rf rm -rf esapi/test/ml*" +echo -e "\033[1m>>>>> Cleaning up test files\033[0m" -docker exec --workdir=/go-elasticsearch/internal/cmd/generate go-elasticsearch go generate ./... +docker exec go-elasticsearch /bin/sh -c 'rm -rf esapi/test/*_test.go' +docker exec go-elasticsearch /bin/sh -c 'rm -rf rm -rf esapi/test/ml*' + +echo -e "\033[1m>>>>> Generating the API registry\033[0m" + +docker exec --workdir=/go-elasticsearch/internal/cmd/generate --env PACKAGE_PATH=/go-elasticsearch/esapi go-elasticsearch go generate ./... + +echo -e "\033[1m>>>>> Generating the test files\033[0m" time docker exec --tty --workdir=/go-elasticsearch/internal/cmd/generate go-elasticsearch go run main.go apitests --output '/go-elasticsearch/esapi/test/xpack' --input '/elasticsearch-source/elasticsearch/x-pack/plugin/src/test/resources/rest-api-spec/test/**/*.yml' @@ -16,12 +22,10 @@ time docker exec --tty --workdir=/go-elasticsearch/internal/cmd/generate go-elas docker exec go-elasticsearch mkdir -p esapi/test/xpack/ml docker exec go-elasticsearch mkdir -p esapi/test/xpack/ml-crud -docker exec go-elasticsearch /bin/sh -c "mv esapi/test/xpack/xpack_ml* esapi/test/xpack/ml/" +docker exec go-elasticsearch /bin/sh -c 'mv esapi/test/xpack/xpack_ml* esapi/test/xpack/ml/' docker exec go-elasticsearch mv esapi/test/xpack/ml/xpack_ml__jobs_crud_test.go esapi/test/xpack/ml-crud/ -# ----- - -echo -e "\033[1m>>>>> XPACK >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" +echo -e "\033[1m>>>>> Running tests: XPACK >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c 'gotestsum --format=short-verbose --junitfile=$WORKSPACE/TEST-integration-api-xpack-junit.xml -- --tags=integration --timeout=1h -v xpack/*_test.go' status1=$? @@ -29,7 +33,7 @@ status1=$? docker container rm --force --volumes es1 > /dev/null 2>&1 make cluster-clean cluster version=elasticsearch:8.0.0-SNAPSHOT detached=true -echo -e "\033[1m>>>>> XPACK ML >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" +echo -e "\033[1m>>>>> Running tests: XPACK ML >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c 'gotestsum --format=short-verbose --junitfile=$WORKSPACE/TEST-integration-api-xpack-ml-junit.xml -- --tags=integration --timeout=1h -v ./xpack/ml/*_test.go' status2=$? @@ -37,7 +41,7 @@ status2=$? docker container rm --force --volumes es1 > /dev/null 2>&1 make cluster-clean cluster version=elasticsearch:8.0.0-SNAPSHOT detached=true -echo -e "\033[1m>>>>> XPACK ML CRUD >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" +echo -e "\033[1m>>>>> Running tests: XPACK ML CRUD >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c 'gotestsum --format=short-verbose --junitfile=$WORKSPACE/TEST-integration-api-xpack-ml-crud-junit.xml -- --tags=integration --timeout=1h -v ./xpack/ml-crud/*_test.go' status3=$? diff --git a/.jenkins/tests.sh b/.jenkins/tests.sh deleted file mode 100755 index 9eb6c8d6b4..0000000000 --- a/.jenkins/tests.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env sh - -set -eo pipefail - -echo -e "\033[1m>>>>> CI >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" && \ -echo -e "\033[1m>>>>> Waiting for Elasticsearch on $ELASTICSEARCH_URL...\033[0m" && \ -curl --max-time 120 --retry 120 --retry-delay 1 --retry-connrefused --show-error --silent --fail $ELASTICSEARCH_URL && \ -curl -s $ELASTICSEARCH_URL | jq -r '.version.build_hash' > .elasticsearch_build_hash && \ -export ES_BUILD_HASH=$(cat .elasticsearch_build_hash) && \ -echo -e "\033[1m>>>>> Downloading Elasticsearch repository @ $ES_BUILD_HASH...\033[0m" && \ -echo "curl -sSL -o elasticsearch-$ES_BUILD_HASH.zip https://github.com/elastic/elasticsearch/archive/$ES_BUILD_HASH.zip" && \ -(rm -rf tmp/elasticsearch) || true && (mkdir -p tmp || true) && \ -curl --retry 3 -sSL -o elasticsearch-$ES_BUILD_HASH.zip https://github.com/elastic/elasticsearch/archive/$ES_BUILD_HASH.zip && \ -unzip -q -o elasticsearch-$ES_BUILD_HASH.zip '*.properties' '*.json' '*.y*ml' -d tmp && \ -mv tmp/elasticsearch-$ES_BUILD_HASH* tmp/elasticsearch && \ -echo -e "\033[1m>>>>> Generating the API registry\033[0m" && \ -(cd internal/cmd/generate && ELASTICSEARCH_BUILD_HASH=$ES_BUILD_HASH PACKAGE_PATH=$PWD/../../../esapi go generate -v ./... 2> /dev/null) && \ -echo -e "\033[1m>>>>> Generating the test files\033[0m" && \ -(cd internal/cmd/generate && ELASTICSEARCH_BUILD_HASH=$ES_BUILD_HASH go run main.go tests --input "$PWD/../../../tmp/elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/test/**/*.y*ml" --output="$PWD/../../../esapi/test") && \ -echo -e "\033[1m>>>>> Running the tests\033[0m" && \ -(cd esapi/test && gotestsum --format=short-verbose --junitfile="$WORKSPACE/TEST-integration-api-junit.xml" -- -tags='integration' -timeout=1h ./...) ; exitstatus=$? ; \ -echo -e "\n\033[1m<<<<< Finished API integration tests for $ES_BUILD_HASH\033[0m" ; \ -echo -e "Junit Report: $(ls $WORKSPACE/TEST-integration-api-junit.xml)" && \ -exit $exitstatus From 4bceffe798993bd759a8674a00fe11c1ff7255d8 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 30 Jun 2019 12:42:40 +0200 Subject: [PATCH 052/355] Generator: API: Handle empty endpoint path If the endpoint.URL.Path is empty, use the first path from endpoint.URL.Paths. Related: https://github.com/elastic/elasticsearch/pull/41452 (cherry picked from commit 234280dbf7f936f9cb587fe309c98be38c467995) --- internal/cmd/generate/commands/gensource/model.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal/cmd/generate/commands/gensource/model.go b/internal/cmd/generate/commands/gensource/model.go index 82d8ab16ee..77b7092cfd 100755 --- a/internal/cmd/generate/commands/gensource/model.go +++ b/internal/cmd/generate/commands/gensource/model.go @@ -36,6 +36,17 @@ func NewEndpoint(f io.Reader) (*Endpoint, error) { endpoint = e endpoint.Name = name } + + // Join "deprecated_paths" with paths + for _, p := range endpoint.URL.DeprecatedPaths { + endpoint.URL.Paths = append(endpoint.URL.Paths, p.Path) + } + + // Add Path when it's empty + if endpoint.URL.Path == "" { + endpoint.URL.Path = endpoint.URL.Paths[0] + } + for partName, p := range endpoint.URL.Parts { p.Endpoint = &endpoint p.Name = partName From 07ebd0deaf7fcc407a00866de49b719c279025fd Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 2 Jul 2019 14:40:24 +0200 Subject: [PATCH 053/355] CI: Update the "xpack" test suite short-circuiting in run script (cherry picked from commit 4620535526a4d5a8c31ce7c291fab4aff3ffded2) --- .jenkins/run-tests | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.jenkins/run-tests b/.jenkins/run-tests index 4e2b1f52b4..cefa7dee67 100755 --- a/.jenkins/run-tests +++ b/.jenkins/run-tests @@ -12,8 +12,8 @@ if [[ $TEST_SUITE != "core" && $TEST_SUITE != "xpack" ]]; then exit 1 fi -# Do not run XPack tests on "master" branch, and do not run Core tests on "xpack" branch -if [[ ($branch_specifier == "refs/heads/master" && $TEST_SUITE == "xpack") || ($branch_specifier == "refs/heads/xpack" && $TEST_SUITE == "core") ]]; then +# Run X-Pack tests only on the "xpack" branch, and skip Core tests on the "xpack" branch +if [[ ($branch_specifier != "refs/heads/xpack" && $TEST_SUITE == "xpack") || ($branch_specifier == "refs/heads/xpack" && $TEST_SUITE == "core") ]]; then echo -e "\033[33;1mSkipping [$TEST_SUITE] tests on the [$branch_specifier] branch.\033[0m" exit 0 fi From 53e61f7906aaa3bdfb98b4a2fb327db2389102ab Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 2 Jul 2019 14:43:32 +0200 Subject: [PATCH 054/355] Transport: Do not set the "Authorization" HTTP header when it's set already (cherry picked from commit 26e5b3d5a554c1d6f96eb823bcc1a05a21f95ae9) --- estransport/estransport.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/estransport/estransport.go b/estransport/estransport.go index a5233b58a9..59de2da046 100755 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -86,9 +86,12 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { } c.setURL(u, req) - c.setBasicAuth(u, req) c.setUserAgent(req) + if _, ok := req.Header["Authorization"]; !ok { + c.setBasicAuth(u, req) + } + var dupReqBody *bytes.Buffer if c.logger != nil && c.logger.RequestBodyEnabled() { if req.Body != nil && req.Body != http.NoBody { From 4933f5756bfbcb2198d10c2e3969b5f191cc9043 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 2 Jul 2019 14:47:22 +0200 Subject: [PATCH 055/355] Generator: API: Add support for the `Header` field and the `WithHeader()` helper method (cherry picked from commit 7f951bad8e941b7addda5d4e276e7530bb507f5c) --- .../generate/commands/gensource/generator.go | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/internal/cmd/generate/commands/gensource/generator.go b/internal/cmd/generate/commands/gensource/generator.go index 95796540a5..eb0582e98e 100755 --- a/internal/cmd/generate/commands/gensource/generator.go +++ b/internal/cmd/generate/commands/gensource/generator.go @@ -231,6 +231,8 @@ type ` + g.Endpoint.MethodWithNamespace() + `Request struct {`) g.w("\n\tErrorTrace\tbool") g.w("\n\tFilterPath\t[]string\n") + g.w("\n\n\tHeader\thttp.Header\n") + g.w("\n\tctx context.Context\n}\n") } @@ -406,6 +408,22 @@ func (f ` + g.Endpoint.MethodWithNamespace() + `) WithFilterPath(v ...string) fu r.FilterPath = v } } +`) + + // Generate methods for HTTP headers + g.w(` +// WithHeader adds the headers to the HTTP request. +// +func (f ` + g.Endpoint.MethodWithNamespace() + `) WithHeader(h map[string]string) func(*` + g.Endpoint.MethodWithNamespace() + `Request) { + return func(r *` + g.Endpoint.MethodWithNamespace() + `Request) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} `) } @@ -692,6 +710,18 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(ctx context.Context, }` + "\n\n") } + g.w(`if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + }` + "\n\n") + g.w(`if ctx != nil { req = req.WithContext(ctx) }` + "\n\n") From 44c81be99eba373bfb049efb4f56b480c6cdb887 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 2 Jul 2019 14:48:00 +0200 Subject: [PATCH 056/355] API: Add integration test for the custom request headers (cherry picked from commit 844bced0393b158381246c3d4ef793ecfd438dc1) --- esapi/esapi_integration_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/esapi/esapi_integration_test.go b/esapi/esapi_integration_test.go index 8b9982f577..a15706f079 100644 --- a/esapi/esapi_integration_test.go +++ b/esapi/esapi_integration_test.go @@ -5,6 +5,7 @@ package esapi_test import ( "encoding/json" "fmt" + "strings" "testing" "time" @@ -18,6 +19,7 @@ func TestAPI(t *testing.T) { t.Fatalf("Error creating the client: %s\n", err) } + es.Cluster.Health(es.Cluster.Health.WithWaitForStatus("yellow")) res, err := es.Search(es.Search.WithTimeout(500 * time.Millisecond)) if err != nil { t.Fatalf("Error getting the response: %s\n", err) @@ -35,4 +37,25 @@ func TestAPI(t *testing.T) { } fmt.Printf("took=%vms\n", d["took"]) }) + + t.Run("Headers", func(t *testing.T) { + es, err := elasticsearch.NewDefaultClient() + if err != nil { + t.Fatalf("Error creating the client: %s\n", err) + } + + res, err := es.Info(es.Info.WithHeader(map[string]string{"Accept": "application/yaml"})) + if err != nil { + t.Fatalf("Error getting the response: %s\n", err) + } + defer res.Body.Close() + + if res.IsError() { + t.Fatalf("Error response: %s", res.String()) + } + + if !strings.HasPrefix(res.String(), "[200 OK] ---") { + t.Errorf("Unexpected response body: doesn't start with '[200 OK] ---'; %s", res.String()) + } + }) } From d476800b20eeba80c1bd1effbe6a36f67172d552 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 4 Jul 2019 16:30:36 +0200 Subject: [PATCH 057/355] Generator: Utils: Update the `EsVersion()` function to read value from environment first (cherry picked from commit 89e04e4d7eaa7a26e53249d833514c318dd34efd) --- internal/cmd/generate/utils/metadata.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/cmd/generate/utils/metadata.go b/internal/cmd/generate/utils/metadata.go index cb1520cc3e..d11b74745e 100755 --- a/internal/cmd/generate/utils/metadata.go +++ b/internal/cmd/generate/utils/metadata.go @@ -14,9 +14,13 @@ var ( reEsVersion = regexp.MustCompile(`elasticsearch\s+=\s+(\d+\.\d+\.\d+)`) ) -// EsVersion returns the Elasticsearch from Java property file, or an error. +// EsVersion returns the Elasticsearch from environment variable, Java property file, or an error. // func EsVersion(fpath string) (string, error) { + if envEsVersion := os.Getenv("ELASTICSEARCH_VERSION"); envEsVersion != "" { + return envEsVersion, nil + } + basePath, err := basePathFromFilepath(fpath) if err != nil { return "", fmt.Errorf("EsVersion: %s", err) @@ -34,7 +38,7 @@ func EsVersion(fpath string) (string, error) { return string(m[1]), nil } -// GitCommit returns the Git commit for fpath, or an error. +// GitCommit returns the Git commit from environment variable or parsing information from fpath, or an error. // func GitCommit(fpath string) (string, error) { if gitCommitEnv := os.Getenv("ELASTICSEARCH_BUILD_HASH"); gitCommitEnv != "" { From 745be915564a105e65bfa365deb13201b69ca825 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 4 Jul 2019 16:32:24 +0200 Subject: [PATCH 058/355] Generator: Utils: Update mapping for numbers and acronyms (cherry picked from commit d474af0e7b8f127272556d5b374459b6b47dfb16) --- internal/cmd/generate/utils/naming.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/cmd/generate/utils/naming.go b/internal/cmd/generate/utils/naming.go index 73c007b131..1a4c767220 100755 --- a/internal/cmd/generate/utils/naming.go +++ b/internal/cmd/generate/utils/naming.go @@ -9,6 +9,8 @@ var ( "enum": "string", // TODO: Custom "enum" type "list": "[]string", "number": "*int", + "int": "*int", + "long": "*int", "string": "string", "time": "time.Duration", } @@ -26,6 +28,14 @@ func NameToGo(s string) string { acronyms := map[string]string{ "id": "ID", "ttl": "TTL", + + "api": "API", + "ccr": "CCR", + "ilm": "ILM", + "ml": "ML", + "sql": "SQL", + "ssl": "SSL", + "xpack": "XPack", } if value, ok := exceptions[s]; ok { From 27f38387fbb8375a068b47666bde78a60ec15111 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 4 Jul 2019 16:32:56 +0200 Subject: [PATCH 059/355] Generator: API: Updates, fixes and improvements * Rename the command to "apisource" * Remove the `processAPIConstructor()` function, will be extracted into command * Add support for the endpoint `Type` in generator * Properly handle `int` and `long` in model * Add `Type` field into model to separate Core APIs from X-Pack APIs * Fix handling of test naming * Update the list of `prominentArgs` (cherry picked from commit 238ed3dc1c9cb7adeacd47662a2a70c0b1ed1235) --- .../generate/commands/gensource/command.go | 175 +++--------------- .../cmd/generate/commands/gensource/debug.go | 2 +- .../generate/commands/gensource/generator.go | 42 +++-- .../cmd/generate/commands/gensource/model.go | 35 +++- 4 files changed, 84 insertions(+), 170 deletions(-) diff --git a/internal/cmd/generate/commands/gensource/command.go b/internal/cmd/generate/commands/gensource/command.go index 6604097c63..a6f3f4f6c8 100755 --- a/internal/cmd/generate/commands/gensource/command.go +++ b/internal/cmd/generate/commands/gensource/command.go @@ -9,8 +9,6 @@ import ( "strings" "time" - "golang.org/x/tools/imports" - "github.com/spf13/cobra" "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/commands" @@ -24,8 +22,6 @@ var ( color *bool debug *bool info *bool - - skipAPIRegistry *bool ) var ( @@ -38,7 +34,6 @@ func init() { input = gensourceCmd.Flags().StringP("input", "i", "", "Path to a folder or files with Elasticsearch REST API specification") output = gensourceCmd.Flags().StringP("output", "o", "", "Path to a folder for generated output") gofmt = gensourceCmd.Flags().BoolP("gofmt", "f", true, "Format generated output with 'gofmt'") - skipAPIRegistry = gensourceCmd.Flags().BoolP("skip-registry", "s", false, "Skip generating the API registry (api._.go)") color = gensourceCmd.Flags().BoolP("color", "c", true, "Syntax highlight the debug output") debug = gensourceCmd.Flags().BoolP("debug", "d", false, "Print the generated source to terminal") info = gensourceCmd.Flags().Bool("info", false, "Print the API details to terminal") @@ -51,17 +46,16 @@ func init() { } var gensourceCmd = &cobra.Command{ - Use: "source", - Short: "Generate Go API from Elasticsearch REST API spec", + Use: "apisource", + Short: "Generate the Go APIs from the Elasticsearch REST API specification", Run: func(cmd *cobra.Command, args []string) { command := &Command{ - Input: *input, - Output: *output, - Gofmt: *gofmt, - DebugInfo: *info, - DebugSource: *debug, - ColorizeSource: *color, - SkipAPIRegistry: *skipAPIRegistry, + Input: *input, + Output: *output, + Gofmt: *gofmt, + DebugInfo: *info, + DebugSource: *debug, + ColorizeSource: *color, } err := command.Execute() if err != nil { @@ -74,13 +68,12 @@ var gensourceCmd = &cobra.Command{ // Command represents the "gensource" command. // type Command struct { - Input string - Output string - Gofmt bool - DebugInfo bool - DebugSource bool - ColorizeSource bool - SkipAPIRegistry bool + Input string + Output string + Gofmt bool + DebugInfo bool + DebugSource bool + ColorizeSource bool } // Execute runs the command. @@ -160,12 +153,6 @@ func (cmd *Command) Execute() (err error) { stats.n++ } - if cmd.Output != "-" && !cmd.SkipAPIRegistry { - if err := cmd.processAPIConstructor(endpoints); err != nil { - return fmt.Errorf("error handling API constructor: %s", err) - } - } - if utils.IsTTY() { fmt.Fprint(os.Stderr, "\x1b[2m") } @@ -265,7 +252,13 @@ func (cmd *Command) processFile(f *os.File) (err error) { return fmt.Errorf("error creating directory: %s", err) } - fName := filepath.Join(cmd.Output, "api."+gen.Endpoint.Name+".go") + var fName string + if gen.Endpoint.Type == "core" { + fName = filepath.Join(cmd.Output, "api."+gen.Endpoint.Name+".go") + } else { + fName = filepath.Join(cmd.Output, "api."+gen.Endpoint.Type+"."+gen.Endpoint.Name+".go") + } + f, err := os.OpenFile(fName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0755) if err != nil { return fmt.Errorf("error creating file: %s", err) @@ -281,129 +274,3 @@ func (cmd *Command) processFile(f *os.File) (err error) { return nil } - -func (cmd *Command) processAPIConstructor(endpoints []*Endpoint) (err error) { - var b bytes.Buffer - - var namespaces = []string{"Cat", "Cluster", "Indices", "Ingest", "Nodes", "Remote", "Snapshot", "Tasks"} - - b.WriteString("// Code generated") - if EsVersion != "" || GitCommit != "" || GitTag != "" { - b.WriteString(fmt.Sprintf(" from specification version %s", EsVersion)) - if GitCommit != "" { - b.WriteString(fmt.Sprintf(" (%s", GitCommit)) - if GitTag != "" { - b.WriteString(fmt.Sprintf("|%s", GitTag)) - } - b.WriteString(")") - } - } - b.WriteString(": DO NOT EDIT\n") - b.WriteString("\n") - - b.WriteString(`package esapi - -// API contains the Elasticsearch APIs -// -type API struct { -`) - for _, n := range namespaces { - b.WriteString(fmt.Sprintf("\t%[1]s *%[1]s\n", n)) - } - - b.WriteString("\n") - - for _, e := range endpoints { - skip := false - name := e.MethodWithNamespace() - - for _, n := range namespaces { - if strings.HasPrefix(name, n) { - skip = true - } - } - if !skip { - b.WriteString(fmt.Sprintf("\t%[1]s %[1]s\n", name)) - } - } - - b.WriteString(`}` + "\n\n") - - for _, n := range namespaces { - b.WriteString(`// ` + n + ` contains the ` + n + ` APIs` + "\n") - b.WriteString(`type ` + n + ` struct {` + "\n") - for _, e := range endpoints { - ns := e.Namespace() - if ns == n { - b.WriteString(fmt.Sprintf("\t%s %s\n", e.MethodName(), e.MethodWithNamespace())) - } - } - b.WriteString("}\n\n") - } - - b.WriteString(`// New creates new API -// -func New(t Transport) *API { - return &API{ -`) - - for _, e := range endpoints { - skip := false - name := e.MethodWithNamespace() - - for _, n := range namespaces { - if strings.HasPrefix(name, n) { - skip = true - } - } - if !skip { - b.WriteString(fmt.Sprintf("\t\t%[1]s: new%[1]sFunc(t),\n", name)) - } - } - - for _, n := range namespaces { - b.WriteString(fmt.Sprintf("\t\t%[1]s: &%[1]s{\n", n)) - for _, e := range endpoints { - ns := e.Namespace() - if ns == n { - b.WriteString(fmt.Sprintf("\t\t\t%s: new%sFunc(t),\n", e.MethodName(), e.MethodWithNamespace())) - } - } - b.WriteString("\t\t},\n") - } - - b.WriteString(` } -} -`) - - if cmd.Gofmt { - out, err := imports.Process( - "esapi/api._.go", - b.Bytes(), - &imports.Options{ - AllErrors: true, - Comments: true, - FormatOnly: false, - TabIndent: true, - TabWidth: 1, - }) - if err != nil { - return err - } - b = *bytes.NewBuffer(out) - } - - fname := filepath.Join(cmd.Output, "api._.go") - f, err := os.OpenFile(fname, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0755) - if err != nil { - return fmt.Errorf("error creating file: %s", err) - } - _, err = io.Copy(f, &b) - if err != nil { - return fmt.Errorf("error copying output: %s", err) - } - if err := f.Close(); err != nil { - return fmt.Errorf("error closing file: %s", err) - } - return nil -} diff --git a/internal/cmd/generate/commands/gensource/debug.go b/internal/cmd/generate/commands/gensource/debug.go index 22a7fe9d33..ef4a22ecc6 100755 --- a/internal/cmd/generate/commands/gensource/debug.go +++ b/internal/cmd/generate/commands/gensource/debug.go @@ -15,7 +15,7 @@ func (e *Endpoint) DebugInfo() string { w := tabwriter.NewWriter(&out, 0, 0, 1, ' ', 0) fmt.Fprintln(&out, strings.Repeat("─", utils.TerminalWidth())) - fmt.Fprintf(&out, "API: %s (%s)\n", e.MethodWithNamespace(), e.Name) + fmt.Fprintf(&out, "API: %s (%s:%s)\n", e.MethodWithNamespace(), e.Type, e.Name) // fmt.Fprintf(&out, "<%s>\n", e.Documentation) fmt.Fprintln(&out, strings.Repeat("─", utils.TerminalWidth())) diff --git a/internal/cmd/generate/commands/gensource/generator.go b/internal/cmd/generate/commands/gensource/generator.go index eb0582e98e..0874eac3ea 100755 --- a/internal/cmd/generate/commands/gensource/generator.go +++ b/internal/cmd/generate/commands/gensource/generator.go @@ -114,20 +114,25 @@ func new` + g.Endpoint.MethodWithNamespace() + `Func(t Transport) ` + g.Endpoint func (g *Generator) genMethodDefinition() { g.w("\n// ----- API Definition -------------------------------------------------------\n\n") - if g.Endpoint.Description != "" { - words := strings.Split(g.Endpoint.Description, " ") - initial := strings.ToLower(words[0:1][0]) - description := initial + " " + strings.Join(words[1:], " ") - lines := strings.Split(description, "\n") - - g.w(`// ` + g.Endpoint.MethodWithNamespace() + " " + lines[0:1][0]) - for _, line := range lines[1:] { - g.w("\n// " + line) + if g.Endpoint.Type == "xpack" { + g.w(`// ` + g.Endpoint.MethodWithNamespace() + " - " + g.Endpoint.Documentation) + } else { + if g.Endpoint.Description != "" { + words := strings.Split(g.Endpoint.Description, " ") + initial := strings.ToLower(words[0:1][0]) + description := initial + " " + strings.Join(words[1:], " ") + lines := strings.Split(description, "\n") + + g.w(`// ` + g.Endpoint.MethodWithNamespace() + " " + lines[0:1][0]) + for _, line := range lines[1:] { + g.w("\n// " + line) + } + g.w("\n") } - } - if g.Endpoint.Documentation != "" { - g.w("\n//\n" + `// See full documentation at ` + g.Endpoint.Documentation + ".") + if g.Endpoint.Documentation != "" { + g.w("//\n" + `// See full documentation at ` + g.Endpoint.Documentation + ".") + } } g.w(` @@ -568,6 +573,13 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(ctx context.Context, pathContent.WriteString(` path.WriteString("/")` + "\n") pathContent.WriteString(` path.WriteString(strings.Join(r.` + p + `, ","))` + "\n") pathContent.WriteString(` }` + "\n") + case "int", "long": + pathContent.WriteString(` if r.` + p + ` != nil {` + "\n") + pathContent.WriteString(` value := strconv.FormatInt(int64(*r.` + p + `), 10)` + "\n") + pathContent.WriteString(` path.Grow(1 + len(value))` + "\n") + pathContent.WriteString(` path.WriteString("/")` + "\n") + pathContent.WriteString(` path.WriteString(value)` + "\n") + pathContent.WriteString(` }` + "\n") default: panic(fmt.Sprintf("FAIL: %q: unexpected type %q for URL part %q\n", g.Endpoint.Name, a.Type, a.Name)) } @@ -644,6 +656,12 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(ctx context.Context, case "*int": fieldCondition = `r.` + fieldName + ` != nil` fieldValue = `strconv.FormatInt(int64(*r.` + fieldName + `), 10)` + case "uint": + fieldCondition = `r.` + fieldName + ` != 0` + fieldValue = `strconv.FormatUint(uint64(r.` + fieldName + `), 10)` + case "*uint": + fieldCondition = `r.` + fieldName + ` != 0` + fieldValue = `strconv.FormatUint(uint64(*r.` + fieldName + `), 10)` case "[]string": fieldCondition = ` len(r.` + fieldName + `) > 0` fieldValue = `strings.Join(r.` + fieldName + `, ",")` diff --git a/internal/cmd/generate/commands/gensource/model.go b/internal/cmd/generate/commands/gensource/model.go index 77b7092cfd..a45c99ce99 100755 --- a/internal/cmd/generate/commands/gensource/model.go +++ b/internal/cmd/generate/commands/gensource/model.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "io" + "os" "sort" "strings" @@ -32,11 +33,26 @@ func NewEndpoint(f io.Reader) (*Endpoint, error) { if err := json.NewDecoder(f).Decode(&spec); err != nil { return nil, err } + for name, e := range spec { endpoint = e endpoint.Name = name } + if fpath, ok := f.(*os.File); ok { + if strings.Contains(fpath.Name(), "x-pack") { + endpoint.Type = "xpack" + } + } + if endpoint.Type == "" { + endpoint.Type = "core" + } + + // Add Path when it's empty + if endpoint.URL.Path == "" { + endpoint.URL.Path = endpoint.URL.Paths[0] + } + // Join "deprecated_paths" with paths for _, p := range endpoint.URL.DeprecatedPaths { endpoint.URL.Paths = append(endpoint.URL.Paths, p.Path) @@ -93,6 +109,7 @@ func NewEndpoint(f io.Reader) (*Endpoint, error) { // type Endpoint struct { Name string `json:"-"` + Type string `json:"-"` Description string `json:"-"` Documentation string `json:"documentation"` @@ -169,7 +186,7 @@ type MethodArgument struct { // func (e *Endpoint) Namespace() string { ep := strings.Split(e.Name, ".") - return strings.Title(ep[0]) + return utils.NameToGo(ep[0]) } // MethodName returns the API endpoint method name. @@ -198,7 +215,8 @@ func (e *Endpoint) MethodWithNamespace() string { m := strings.Split(v, "_") mn := make([]string, len(m)) for _, vv := range m { - mn = append(mn, strings.Title(vv)) + // mn = append(mn, strings.Title(vv)) + mn = append(mn, utils.NameToGo(vv)) } ns = append(ns, strings.Join(mn, "")) } @@ -225,7 +243,18 @@ func (e *Endpoint) HumanMethodWithNamespace() string { // func (e *Endpoint) RequiredArguments() []MethodArgument { var args = make([]MethodArgument, 0) - var prominentArgs = []string{"index", "type", "id", "repository", "snapshot"} + var prominentArgs = []string{ + "index", + "type", + "id", + "repository", + "snapshot", + "snapshot_id", + "calendar_id", + "job_id", + "username", + "name", + } var contains = func(s string) bool { for _, v := range args { From 2533b053f7d265928c8ff6d03b4b78c81f3e499d Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 4 Jul 2019 16:40:18 +0200 Subject: [PATCH 060/355] Generator: Tests: Updates, fixes and improvements * Rename the command to "apitests" * Add support for the X-Pack API type * Add support for running the tests against a cluster with SSL and authentication * Fix the incorrect setup/teardown functions (pass the *testing.T pointer) * Add stacktrace to error response log * Update the Core test setup * Add the X-Pack test setup * Add support for "transform_and_set" clause in REST tests * Fix incorrect values for duration * Fix incorrect Test.BaseFilename() * Update the list of skipped tests (cherry picked from commit f9f9e32a04ac7c495a5dbcf7f14c7ee5d5fc4f59) --- .../cmd/generate/commands/gentests/command.go | 6 +- .../commands/gentests/gen_api_registry.go | 4 +- .../generate/commands/gentests/generator.go | 464 ++++++++++++++++-- .../cmd/generate/commands/gentests/model.go | 49 +- .../cmd/generate/commands/gentests/skips.go | 88 ++++ 5 files changed, 551 insertions(+), 60 deletions(-) diff --git a/internal/cmd/generate/commands/gentests/command.go b/internal/cmd/generate/commands/gentests/command.go index 22f902697a..003d1e688e 100755 --- a/internal/cmd/generate/commands/gentests/command.go +++ b/internal/cmd/generate/commands/gentests/command.go @@ -52,8 +52,8 @@ func init() { } var gentestsCmd = &cobra.Command{ - Use: "tests", - Short: "Generate Go integration tests from Elasticsearch common test suite", + Use: "apitests", + Short: "Generate the Go integration tests from the Elasticsearch common test suite", Run: func(cmd *cobra.Command, args []string) { command := &Command{ Input: *input, @@ -274,7 +274,7 @@ func (cmd *Command) processFile(fpath string) (err error) { return fmt.Errorf("error creating directory: %s", err) } - fName := filepath.Join(cmd.Output, gen.TestSuite.Filename()+"__test.go") + fName := filepath.Join(cmd.Output, gen.TestSuite.Filename()+"_test.go") f, err := os.OpenFile(fName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0755) if err != nil { return fmt.Errorf("error creating file: %s", err) diff --git a/internal/cmd/generate/commands/gentests/gen_api_registry.go b/internal/cmd/generate/commands/gentests/gen_api_registry.go index 75d8a8d1ae..42b53e1041 100755 --- a/internal/cmd/generate/commands/gentests/gen_api_registry.go +++ b/internal/cmd/generate/commands/gentests/gen_api_registry.go @@ -24,7 +24,9 @@ func init() { if pkgNamesEnv := os.Getenv("PACKAGE_NAMES"); pkgNamesEnv != "" { pkgNames = strings.Split(pkgNamesEnv, ",") } else { - pkgNames = []string{"github.com/elastic/go-elasticsearch/v7/esapi"} + pkgNames = []string{ + "github.com/elastic/go-elasticsearch/v7/esapi", + } } if _, ok := os.LookupEnv(""); ok { diff --git a/internal/cmd/generate/commands/gentests/generator.go b/internal/cmd/generate/commands/gentests/generator.go index 58b16cba88..8074daf2ca 100755 --- a/internal/cmd/generate/commands/gentests/generator.go +++ b/internal/cmd/generate/commands/gentests/generator.go @@ -37,11 +37,19 @@ type Generator struct { // Output returns the generator output. // func (g *Generator) Output() (io.Reader, error) { + name := g.TestSuite.Name() + if g.TestSuite.Type == "xpack" { + name = "XPack_" + name + } + g.genFileHeader() - g.w("func Test" + g.TestSuite.Name() + "(t *testing.T) {\n") + g.w("func Test" + name + "(t *testing.T) {\n") g.genInitializeClient() g.genHelpers() g.genCommonSetup() + if g.TestSuite.Type == "xpack" { + g.genXPackSetup() + } if len(g.TestSuite.Setup) > 0 { g.w("// ----- Test Suite Setup --------------------------------------------------------\n") g.w("testSuiteSetup := func() {\n") @@ -52,9 +60,9 @@ func (g *Generator) Output() (io.Reader, error) { } if len(g.TestSuite.Teardown) > 0 { g.w("\t// Teardown\n") - g.w("\tdefer func() {\n") + g.w("\tdefer func(t *testing.T) {\n") g.genSetupTeardown(g.TestSuite.Teardown) - g.w("\t}()\n") + g.w("\t}(t)\n") } for i, t := range g.TestSuite.Tests { g.w("\n") @@ -63,6 +71,9 @@ func (g *Generator) Output() (io.Reader, error) { g.genSkip(t) g.w("\tdefer recoverPanic(t)\n") g.w("\tcommonSetup()\n") + if g.TestSuite.Type == "xpack" { + g.w("\txpackSetup()\n") + } if len(g.TestSuite.Setup) > 0 { g.w("\ttestSuiteSetup()\n") } @@ -73,9 +84,9 @@ func (g *Generator) Output() (io.Reader, error) { } if len(t.Teardown) > 0 { g.w("\t// Test teardown\n") - g.w("\tdefer func() {\n") + g.w("\tdefer func(t) {\n") g.genSetupTeardown(t.Teardown) - g.w("\t}()\n") + g.w("\t}(t *testing.T)\n") } if len(t.Setup) > 0 || len(t.Teardown) > 0 { g.w("\n") @@ -182,7 +193,10 @@ func (g *Generator) genFileHeader() { import ( encjson "encoding/json" encyaml "gopkg.in/yaml.v2" + "context" + "crypto/tls" "testing" + "time" "github.com/elastic/go-elasticsearch/v7" "github.com/elastic/go-elasticsearch/v7/esapi" @@ -192,17 +206,40 @@ var ( // Prevent compilation errors for unused packages _ = encjson.NewDecoder _ = encyaml.NewDecoder + _ = tls.Certificate{} _ = fmt.Printf )` + "\n") } func (g *Generator) genInitializeClient() { - g.w(` es, eserr := elasticsearch.NewDefaultClient() + if g.TestSuite.Type == "xpack" { + g.w(` + cfg := elasticsearch.Config{ + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{ + InsecureSkipVerify: true, + }, + }, + // Logger: &estransport.TextLogger{ + // Output: os.Stdout, + // // EnableRequestBody: true, + // // EnableResponseBody: true, + // }, + } + es, eserr := elasticsearch.NewClient(cfg) if eserr != nil { t.Fatalf("Error creating the client: %s\n", eserr) } `) + } else { + g.w(` es, eserr := elasticsearch.NewDefaultClient() + if eserr != nil { + t.Fatalf("Error creating the client: %s\n", eserr) + } + +`) + } } func (g *Generator) genHelpers() { @@ -222,17 +259,19 @@ func (g *Generator) genHelpers() { } ` + "\n") - g.w(`debug := func(v interface{}) { - if os.Getenv("DEBUG") != "" { - t.Logf("%s", v) - } - } -`) g.w(` handleResponseError := func(t *testing.T, res *esapi.Response) { if res.IsError() { - t.Logf("Response error: %s", res) - // t.Fatalf("Response error: %s", res.Status()) + reLocation := regexp.MustCompile("(.*_test.go:\\d+).*") + var loc string + s := strings.Split(string(debug.Stack()), "\n") + for i := len(s) - 1; i >= 0; i-- { + if reLocation.MatchString(s[i]) { + loc = strings.TrimSpace(s[i]) + break + } + } + t.Logf("Response error: %s in %s", res, reLocation.ReplaceAllString(loc, "$1")) } } _ = handleResponseError @@ -240,37 +279,321 @@ func (g *Generator) genHelpers() { g.w("\n\n") } +// Reference: https://github.com/elastic/elasticsearch/blob/master/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java +// func (g *Generator) genCommonSetup() { - // TODO: Full setup - // https://github.com/elastic/elasticsearch-ruby/blob/master/elasticsearch-api/test/integration/yaml_test_runner.rb g.w(` // ----- Common Setup ------------------------------------------------------------- commonSetup := func() { var res *esapi.Response - res, _ = es.Indices.Delete([]string{"_all"}) - res.Body.Close() - - res, _ = es.Indices.DeleteTemplate("*") - res.Body.Close() - - res, _ = es.Indices.DeleteAlias([]string{"_all"}, []string{"_all"}) - res.Body.Close() - - res, _ = es.Snapshot.Delete("test_repo_create_1", "test_snapshot") - res.Body.Close() - res, _ = es.Snapshot.Delete("test_repo_restore_1", "test_snapshot") - res.Body.Close() - res, _ = es.Snapshot.Delete("test_cat_snapshots_1", "snap1") - res.Body.Close() - res, _ = es.Snapshot.Delete("test_cat_snapshots_1", "snap2") - res.Body.Close() - for _, n := range []string{"test_repo_create_1", "test_repo_restore_1", "test_repo_get_1", "test_repo_get_2", "test_repo_status_1", "test_cat_repo_1", "test_cat_repo_2", "test_cat_snapshots_1"} { - res, _ = es.Snapshot.DeleteRepository([]string{n}) - res.Body.Close() + + { + res, _ = es.Cluster.Health(es.Cluster.Health.WithWaitForNoInitializingShards(true)) + if res != nil && res.Body != nil { + defer res.Body.Close() + } + } + + { + res, _ = es.Indices.Delete([]string{"_all"}) + if res != nil && res.Body != nil { defer res.Body.Close() } + } + + { + var r map[string]interface{} + res, _ = es.Indices.GetTemplate() + if res != nil && res.Body != nil { + defer res.Body.Close() + json.NewDecoder(res.Body).Decode(&r) + for templateName, _ := range r { + if strings.HasPrefix(templateName, ".") { + continue + } + if templateName == "security_audit_log" { + continue + } + if templateName == "logstash-index-template" { + continue + } + es.Indices.DeleteTemplate(templateName) + } + } + } + + { + res, _ = es.Indices.DeleteAlias([]string{"_all"}, []string{"_all"}) + if res != nil && res.Body != nil { defer res.Body.Close() } + } + + { + var r map[string]interface{} + res, _ = es.Snapshot.GetRepository() + if res != nil && res.Body != nil { + defer res.Body.Close() + json.NewDecoder(res.Body).Decode(&r) + for repositoryID, _ := range r { + var r map[string]interface{} + res, _ = es.Snapshot.Get(repositoryID, []string{"_all"}) + json.NewDecoder(res.Body).Decode(&r) + for _, vv := range r["responses"].([]interface{}) { + for _, v := range vv.(map[string]interface{})["snapshots"].([]interface{}) { + snapshotID, ok := v.(map[string]interface{})["snapshot"] + if !ok { + continue + } + es.Snapshot.Delete(repositoryID, fmt.Sprintf("%s", snapshotID)) + } + } + es.Snapshot.DeleteRepository([]string{fmt.Sprintf("%s", repositoryID)}) + } + } + } + + { + res, _ = es.Cluster.Health(es.Cluster.Health.WithWaitForStatus("yellow")) + if res != nil && res.Body != nil { + defer res.Body.Close() + } } } - commonSetup() - // -------------------------------------------------------------------------------- + + `) +} + +// Reference: https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/src/test/java/org/elasticsearch/xpack/test/rest/XPackRestIT.java +// Reference: https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/integration/MlRestTestStateCleaner.java +// +func (g *Generator) genXPackSetup() { + g.w(` + // ----- XPack Setup ------------------------------------------------------------- + xpackSetup := func() { + var res *esapi.Response + + { + var r map[string]interface{} + res, _ = es.Indices.GetTemplate() + if res != nil && res.Body != nil { + defer res.Body.Close() + json.NewDecoder(res.Body).Decode(&r) + for templateName, _ := range r { + if strings.HasPrefix(templateName, ".") { + continue + } + es.Indices.DeleteTemplate(templateName) + } + } + } + + { + res, _ = es.Watcher.DeleteWatch("my_watch") + if res != nil && res.Body != nil { + defer res.Body.Close() + } + } + + { + var r map[string]interface{} + res, _ = es.Security.GetRole(es.Security.GetRole.WithPretty()) + if res != nil && res.Body != nil { + defer res.Body.Close() + json.NewDecoder(res.Body).Decode(&r) + for k, v := range r { + reserved, ok := v.(map[string]interface{})["metadata"].(map[string]interface{})["_reserved"].(bool) + if ok && reserved { + continue + } + es.Security.DeleteRole(k) + } + } + } + + { + var r map[string]interface{} + res, _ = es.Security.GetUser(es.Security.GetUser.WithPretty()) + if res != nil && res.Body != nil { + defer res.Body.Close() + json.NewDecoder(res.Body).Decode(&r) + for k, v := range r { + reserved, ok := v.(map[string]interface{})["metadata"].(map[string]interface{})["_reserved"].(bool) + if ok && reserved { + continue + } + es.Security.DeleteUser(k) + } + } + } + + { + var r map[string]interface{} + res, _ = es.Security.GetPrivileges(es.Security.GetPrivileges.WithPretty()) + if res != nil && res.Body != nil { + defer res.Body.Close() + json.NewDecoder(res.Body).Decode(&r) + for k, v := range r { + reserved, ok := v.(map[string]interface{})["metadata"].(map[string]interface{})["_reserved"].(bool) + if ok && reserved { + continue + } + es.Security.DeletePrivileges(k, "_all") + } + } + } + + { + var r map[string]interface{} + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + es.ML.StopDatafeed("_all", es.ML.StopDatafeed.WithContext(ctx)) + res, _ = es.ML.GetDatafeeds() + if res != nil && res.Body != nil { + defer res.Body.Close() + json.NewDecoder(res.Body).Decode(&r) + for _, v := range r["datafeeds"].([]interface{}) { + datafeedID, ok := v.(map[string]interface{})["datafeed_id"] + if !ok { + continue + } + es.ML.DeleteDatafeed(datafeedID.(string)) + } + } + } + + { + var r map[string]interface{} + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + es.ML.CloseJob("_all", es.ML.CloseJob.WithContext(ctx)) + res, _ = es.ML.GetJobs() + if res != nil && res.Body != nil { + defer res.Body.Close() + json.NewDecoder(res.Body).Decode(&r) + for _, v := range r["jobs"].([]interface{}) { + jobID, ok := v.(map[string]interface{})["job_id"] + if !ok { + continue + } + es.ML.DeleteJob(jobID.(string)) + } + } + } + + { + var r map[string]interface{} + res, _ = es.Rollup.GetJobs(es.Rollup.GetJobs.WithDocumentID("_all")) + if res != nil && res.Body != nil { + defer res.Body.Close() + json.NewDecoder(res.Body).Decode(&r) + for _, v := range r["jobs"].([]interface{}) { + jobID, ok := v.(map[string]interface{})["config"].(map[string]interface{})["id"] + if !ok { + continue + } + es.Rollup.StopJob(jobID.(string), es.Rollup.StopJob.WithWaitForCompletion(true)) + es.Rollup.DeleteJob(jobID.(string)) + } + } + } + + { + var r map[string]interface{} + res, _ = es.Tasks.List() + if res != nil && res.Body != nil { + defer res.Body.Close() + json.NewDecoder(res.Body).Decode(&r) + for _, vv := range r["nodes"].(map[string]interface{}) { + for _, v := range vv.(map[string]interface{})["tasks"].(map[string]interface{}) { + cancellable, ok := v.(map[string]interface{})["cancellable"] + if !ok || !cancellable.(bool) { + continue + } + taskID := fmt.Sprintf("%v:%v", v.(map[string]interface{})["node"], v.(map[string]interface{})["id"]) + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + es.Tasks.Cancel(es.Tasks.Cancel.WithTaskID(taskID), es.Tasks.Cancel.WithContext(ctx)) + } + } + } + } + + { + var r map[string]interface{} + res, _ = es.Snapshot.GetRepository() + if res != nil && res.Body != nil { + defer res.Body.Close() + json.NewDecoder(res.Body).Decode(&r) + for repositoryID, _ := range r { + var r map[string]interface{} + res, _ = es.Snapshot.Get(repositoryID, []string{"_all"}) + json.NewDecoder(res.Body).Decode(&r) + for _, vv := range r["responses"].([]interface{}) { + for _, v := range vv.(map[string]interface{})["snapshots"].([]interface{}) { + snapshotID, ok := v.(map[string]interface{})["snapshot"] + if !ok { + continue + } + es.Snapshot.Delete(repositoryID, fmt.Sprintf("%s", snapshotID)) + } + } + es.Snapshot.DeleteRepository([]string{fmt.Sprintf("%s", repositoryID)}) + } + } + } + + { + res, _ = es.ILM.RemovePolicy(es.ILM.RemovePolicy.WithIndex("_all")) + if res != nil && res.Body != nil { + defer res.Body.Close() + } + } + + { + res, _ = es.Cluster.Health(es.Cluster.Health.WithWaitForStatus("yellow")) + if res != nil && res.Body != nil { + defer res.Body.Close() + } + } + + { + res, _ = es.Security.PutUser("x_pack_rest_user", strings.NewReader(` + "`" + `{"password":"x-pack-test-password", "roles":["superuser"]}` + "`" + `), es.Security.PutUser.WithPretty()) + if res != nil && res.Body != nil { + defer res.Body.Close() + } + } + + { + res, _ = es.Indices.Refresh(es.Indices.Refresh.WithIndex("_all")) + if res != nil && res.Body != nil { + defer res.Body.Close() + } + } + + { + res, _ = es.Cluster.Health(es.Cluster.Health.WithWaitForStatus("yellow")) + if res != nil && res.Body != nil { + defer res.Body.Close() + } + } + + { + var i int + for { + i++ + var r map[string]interface{} + res, _ = es.Cluster.PendingTasks() + if res != nil && res.Body != nil { + defer res.Body.Close() + json.NewDecoder(res.Body).Decode(&r) + if len(r["tasks"].([]interface{})) < 1 { + break + } + } + if i > 30 { + break + } + time.Sleep(time.Second) + } + } + } `) } @@ -424,7 +747,7 @@ func (g *Generator) genVarSection(t Test, skipBody ...bool) { g.w("\t\t_ = mapi\n") g.w("\t\t_ = slic\n") g.w("\n") - g.w(`handleResponseBody := func(res *esapi.Response) { + g.w(`handleResponseBody := func(t *testing.T, res *esapi.Response) { // Reset deserialized structures mapi = make(map[string]interface{}) slic = make([]interface{}, 0) @@ -546,6 +869,8 @@ func (g *Generator) genAction(a Action, skipBody ...bool) { g.w("\t\t\t" + k + ": ") // TODO: Handle comma separated strings as lists + // fmt.Printf("%s: %#v\n", a.Request(), apiRegistry[a.Request()]) + // fmt.Printf("%s: %#v\n", k, apiRegistry[a.Request()][k]) typ, ok := apiRegistry[a.Request()][k] if !ok { panic(fmt.Sprintf("%s.%s: field not found", a.Request(), k)) @@ -603,7 +928,18 @@ func (g *Generator) genAction(a Action, skipBody ...bool) { case "time.Duration": // re := regexp.MustCompile("^(\\d+).*") // value = re.ReplaceAllString(fmt.Sprintf("%s", v), "$1") - dur, err := time.ParseDuration(v.(string)) + inputValue := v.(string) + if strings.HasSuffix(inputValue, "d") { + inputValue = inputValue[:len(inputValue)-1] + numericValue, err := strconv.Atoi(inputValue) + if err != nil { + panic(fmt.Sprintf("Cannot convert duration [%s]: %s", inputValue, err)) + } + // Convert to hours + inputValue = fmt.Sprintf("%dh", numericValue*24) + } + + dur, err := time.ParseDuration(inputValue) if err != nil { panic(fmt.Sprintf("Cannot parse duration [%s]: %s", v, err)) } @@ -636,7 +972,7 @@ func (g *Generator) genAction(a Action, skipBody ...bool) { case "*int": g.w(`esapi.IntPtr(` + fmt.Sprintf("%d", v) + `)`) default: - value = fmt.Sprintf("%d", v) + value = fmt.Sprintf("%v", v) } g.w(value) g.w(",\n") @@ -721,8 +1057,23 @@ func (g *Generator) genAction(a Action, skipBody ...bool) { } } - if len(a.headers) > 0 && strings.Contains(a.headers["Accept"], "yaml") && strings.HasPrefix(a.Request(), "Cat") { - g.w("\t\t" + `Format: "yaml",` + "\n") + if len(a.headers) > 0 { + if strings.Contains(a.headers["Accept"], "yaml") && strings.HasPrefix(a.Request(), "Cat") { + g.w("\t\t" + `Format: "yaml",` + "\n") + } + if auth_header, ok := a.headers["Authorization"]; ok { + auth_fields := strings.Split(auth_header, " ") + auth_name := auth_fields[0] + auth_value := auth_fields[1] + if strings.HasPrefix(auth_value, "$") { + auth_value = `fmt.Sprintf("%s", stash["` + strings.ReplaceAll(strings.ReplaceAll(auth_value, "{", ""), "}", "") + `"])` + } else { + auth_value = `"` + auth_value + `"` + } + g.w("\t\t" + `Header: http.Header{` + "\n") + g.w("\t\t\t" + `"Authorization": []string{"` + auth_name + ` " + ` + auth_value + `},` + "\n") + g.w("\t\t" + `},` + "\n") + } } g.w("\t\t}\n\n") @@ -734,7 +1085,6 @@ func (g *Generator) genAction(a Action, skipBody ...bool) { t.Fatalf("ERROR: %s", err) } defer res.Body.Close() - debug(res) `) g.w("\n\n") @@ -748,7 +1098,7 @@ func (g *Generator) genAction(a Action, skipBody ...bool) { if len(skipBody) < 1 || (len(skipBody) > 0 && skipBody[0] == false) { // Read and parse the body - g.w(` handleResponseBody(res)` + "\n") + g.w(` handleResponseBody(t, res)` + "\n") } } @@ -760,7 +1110,29 @@ func (g *Generator) genAssertion(a Assertion) { func (g *Generator) genStashSet(s Stash) { g.w(fmt.Sprintf("// Set %q\n", s.Key())) - g.w(fmt.Sprintf("stash[%q] = %s\n", s.Key(), s.Value())) + + value := s.Value() + if strings.HasPrefix(value, `mapi["#`) { + switch { + case strings.HasPrefix(value, `mapi["#base64EncodeCredentials`): + i, j := strings.Index(value, "("), strings.Index(value, ")") + values := strings.Split(value[i+1:j], ",") + value = `base64.StdEncoding.EncodeToString([]byte(` + value += `strings.Join([]string{` + for n, v := range values { + value += `mapi["` + v + `"].(string)` + if n < len(values)-1 { + value += "," + } + } + value += `}, ":")` + value += `))` + default: + panic(fmt.Sprintf("Unknown transformation: %s", value)) + } + } + + g.w(fmt.Sprintf("stash[%q] = %s\n", s.Key(), value)) } func convert(i interface{}) interface{} { diff --git a/internal/cmd/generate/commands/gentests/model.go b/internal/cmd/generate/commands/gentests/model.go index de72adca4e..558f40712a 100755 --- a/internal/cmd/generate/commands/gentests/model.go +++ b/internal/cmd/generate/commands/gentests/model.go @@ -29,6 +29,7 @@ type TestSuite struct { Filepath string Skip bool SkipInfo string + Type string Setup []Action Teardown []Action @@ -92,6 +93,13 @@ func NewTestSuite(fpath string, payloads []TestPayload) TestSuite { Filepath: fpath, } + if strings.Contains(fpath, "x-pack") { + ts.Type = "xpack" + } + if ts.Type == "" { + ts.Type = "core" + } + for _, payload := range payloads { sec_keys := utils.MapKeys(payload.Payload) switch { @@ -161,6 +169,16 @@ func NewTestSuite(fpath string, payloads []TestPayload) TestSuite { for _, vvv := range vv.(map[interface{}]interface{}) { steps = append(steps, NewStash(vvv)) } + case "transform_and_set": + for _, vvv := range vv.(map[interface{}]interface{}) { + // NOTE: `set_and_transform` has flipped ordering of key and value, compared to `set` + key := utils.MapValues(vvv)[0] + val := utils.MapKeys(vvv)[0] + payload := make(map[interface{}]interface{}) + payload[key] = val + // fmt.Println(payload) + steps = append(steps, NewStash(payload)) + } case "do": for _, vvv := range vv.(map[interface{}]interface{}) { steps = append(steps, NewAction(vvv)) @@ -174,7 +192,7 @@ func NewTestSuite(fpath string, payloads []TestPayload) TestSuite { } if !ts.Skip { - t.Name = strings.Replace(k.(string), `"`, `'`, -1) + t.Name = strings.ReplaceAll(k.(string), `"`, `'`) t.Filepath = payload.Filepath t.OrigName = k.(string) t.Steps = steps @@ -245,13 +263,18 @@ func (ts TestSuite) Name() string { for _, v := range strings.Split(bname, "_") { b.WriteString(strings.Title(v)) } - return b.String() + return strings.ReplaceAll(b.String(), "-", "") } // Filename returns a suitable filename for the test suite. // func (ts TestSuite) Filename() string { var b strings.Builder + + if ts.Type == "xpack" { + b.WriteString("xpack_") + } + b.WriteString(strings.ToLower(strings.Replace(ts.Dir, ".", "_", -1))) b.WriteString("__") @@ -267,14 +290,14 @@ func (ts TestSuite) SkipEsVersion(minmax string) bool { return skipVersion(minmax) } -// BaseFilename returns the original filename in form of `foo/10_bar.yml`. +// BaseFilename extracts and returns the test filename in form of `foo/bar/10_qux.yml`. // func (t Test) BaseFilename() string { - parts := strings.Split(t.Filepath, string(filepath.Separator)) - if len(parts) < 2 { - return "" + parts := strings.Split(t.Filepath, "rest-api-spec/test") + if len(parts) < 1 { + panic(fmt.Sprintf("Unexpected parts for path [%s]: %s", t.Filepath, parts)) } - return strings.Join(parts[len(parts)-2:], string(filepath.Separator)) + return strings.TrimPrefix(parts[1], string(filepath.Separator)) } // SkipEsVersion returns true if the test should be skipped. @@ -340,13 +363,18 @@ func (s Steps) ContainsStash(keys ...string) bool { // Method returns the API method name for the action. // func (a Action) Method() string { - return strings.Title(a.method) + return utils.NameToGo(a.method) } // Request returns the API request name for the action. // func (a Action) Request() string { - return utils.NameToGo(strings.Replace(strings.Title(a.method), ".", "", -1)) + "Request" + var rParts []string + parts := strings.Split(a.method, ".") + for _, p := range parts { + rParts = append(rParts, utils.NameToGo(p)) + } + return strings.Join(rParts, "") + "Request" } // Params returns a map of parameters for the action. @@ -640,7 +668,7 @@ default: // -------------------------------------------------------------------------------- case map[interface{}]interface{}, map[string]interface{}: expectedPayload := fmt.Sprintf("%#v", val) - expectedPayload = strings.Replace(expectedPayload, "map[interface {}]interface {}", "map[string]interface {}", -1) + expectedPayload = strings.ReplaceAll(expectedPayload, "map[interface {}]interface {}", "map[string]interface {}") output = ` actual, _ = encjson.Marshal(` + escape(subject) + `) expected, _ = encjson.Marshal(` + expectedPayload + `) if fmt.Sprintf("%s", actual) != fmt.Sprintf("%s", expected) {` + "\n" @@ -648,6 +676,7 @@ default: // -------------------------------------------------------------------------------- case []interface{}: expectedPayload := fmt.Sprintf("%#v", val) + expectedPayload = strings.ReplaceAll(expectedPayload, "map[interface {}]interface {}", "map[string]interface {}") output = ` actual, _ = encjson.Marshal(` + escape(subject) + `) expected, _ = encjson.Marshal(` + expectedPayload + `) if fmt.Sprintf("%s", actual) != fmt.Sprintf("%s", expected) {` + "\n" diff --git a/internal/cmd/generate/commands/gentests/skips.go b/internal/cmd/generate/commands/gentests/skips.go index 4a0962e3e3..7d04066b5c 100755 --- a/internal/cmd/generate/commands/gentests/skips.go +++ b/internal/cmd/generate/commands/gentests/skips.go @@ -19,6 +19,14 @@ func init() { var skipFiles = []string{ "update/85_fields_meta.yml", // Uses non-existing API property "update/86_fields_meta_with_types.yml", // --||-- + + "ml/jobs_get_result_buckets.yml", // Passes string value to int variable + "ml/jobs_get_result_categories.yml", // --||-- + "ml/set_upgrade_mode.yml", // --||-- + + "ml/evaluate_data_frame.yml", // Floats as map keys + + "watcher/stats/10_basic.yml", // Sets "emit_stacktraces" as string ("true"), not bool } // TODO: Comments into descriptions for `Skip()` @@ -82,4 +90,84 @@ search/issue9606.yml: bulk/80_cas.yml: bulk/81_cas_with_types.yml: +# ----- X-Pack ---------------------------------------------------------------- + +# Stash in body +api_key/10_basic.yml: + - Test invalidate api key + +# Changing password locks out tests +change_password/10_basic.yml: + - Test user changing their own password + +# Missing refreshes in the test +data_frame/transforms_start_stop.yml: +ml/index_layout.yml: + +# More QA tests than API tests +data_frame/transforms_stats.yml: + - Test get multiple transform stats + - Test get transform stats on missing transform + - Test get multiple transform stats where one does not have a task + +# Invalid license makes subsequent tests fail +license/20_put_license.yml: + +# Test tries to match on map from body, but Go keys are not sorted +ml/jobs_crud.yml: + - Test job with rules + +# Test gets stuck every time +ml/jobs_get_stats.yml: + +# # status_exception, Cannot process data because job [post-data-job] does not have a corresponding autodetect process +# # resource_already_exists_exception, task with id {job-post-data-job} already exist +# ml/post_data.yml: + +# Possible bad test setup, Cannot open job [start-stop-datafeed-job] because it has already been opened +# resource_already_exists_exception, task with id {job-start-stop-datafeed-job-foo-2} already exist +ml/start_stop_datafeed.yml: + - Test start datafeed when persistent task allocation disabled + +# Indexing step doesn't appear to work (getting total.hits=0) +monitoring/bulk/10_basic.yml: + - Bulk indexing of monitoring data on closed indices should throw an export exception +# Indexing step doesn't appear to work (getting total.hits=0) +monitoring/bulk/20_privileges.yml: + - Monitoring Bulk API + +# Test tries to match on whole body, but map keys are unstable in Go +rollup/security_tests.yml: + +# TEMPORARY: Missing 'body: { indices: "test_index" }' payload, TODO: PR +snapshot/10_basic.yml: + - Create a source only snapshot and then restore it + +# illegal_argument_exception: Provided password hash uses [NOOP] but the configured hashing algorithm is [BCRYPT] +users/10_basic.yml: + - Test put user with password hash + +# Slash in index name is not escaped (BUG) +security/authz/13_index_datemath.yml: + - Test indexing documents with datemath, when permitted + +# Test looks for "testnode.crt", but "ca.crt" is returned first +ssl/10_basic.yml: + - Test get SSL certificates + +# class org.elasticsearch.xpack.vectors.query.VectorScriptDocValues$DenseVectorScriptDocValues cannot be cast to class org.elasticsearch.xpack.vectors.query.VectorScriptDocValues$SparseVectorScriptDocValues ... +vectors/30_sparse_vector_basic.yml: + - Dot Product +# java.lang.IllegalArgumentException: No field found for [my_dense_vector] in mapping +vectors/40_sparse_vector_special_cases.yml: + - Vectors of different dimensions and data types + - Dimensions can be sorted differently + - Distance functions for documents missing vector field should return 0 + +# Cannot connect to Docker IP +watcher/execute_watch/60_http_input.yml: + +# Test tries to match on "tagline", which requires "human=false", which doesn't work in the Go API. +# Also test does too much within a single test, so has to be disabled as whole, unfortunately. +xpack/15_basic.yml: ` From d036a8c4ae38d67db20d24f78b4a4abfab590417 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 4 Jul 2019 16:46:46 +0200 Subject: [PATCH 061/355] Generator: API: Add the "apistruct" command This command replaces the `processAPIConstructor()` function. It is extracted into a command, so the APIs for Core and X-Pack can be generated first, and the API constructor file (`api._.go`) can be generated afterwards. (cherry picked from commit 856afd0daff04a6cfac5e43e2ae9c31617c2b96b) --- .../generate/commands/genstruct/command.go | 338 ++++++++++++++++++ internal/cmd/generate/main.go | 1 + 2 files changed, 339 insertions(+) create mode 100644 internal/cmd/generate/commands/genstruct/command.go diff --git a/internal/cmd/generate/commands/genstruct/command.go b/internal/cmd/generate/commands/genstruct/command.go new file mode 100644 index 0000000000..b533f82cc4 --- /dev/null +++ b/internal/cmd/generate/commands/genstruct/command.go @@ -0,0 +1,338 @@ +package genstruct + +import ( + "bytes" + "fmt" + "go/types" + "io" + "os" + "path/filepath" + "strings" + + "golang.org/x/tools/go/packages" + "golang.org/x/tools/imports" + + "github.com/spf13/cobra" + + "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/commands" + "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/utils" +) + +var ( + GitCommit string + GitTag string + EsVersion string +) + +var ( + output *string + gofmt *bool + color *bool + debug *bool + info *bool + + pkgNames []string +) + +func init() { + if pkgNamesEnv := os.Getenv("PACKAGE_NAMES"); pkgNamesEnv != "" { + pkgNames = strings.Split(pkgNamesEnv, ",") + } else { + pkgNames = []string{ + "github.com/elastic/go-elasticsearch/v7/esapi", + } + } + + output = genapiCmd.Flags().StringP("output", "o", "", "Path to a folder for generated output") + gofmt = genapiCmd.Flags().BoolP("gofmt", "f", true, "Format generated output with 'gofmt'") + color = genapiCmd.Flags().BoolP("color", "c", true, "Syntax highlight the debug output") + debug = genapiCmd.Flags().BoolP("debug", "d", false, "Print the generated source to terminal") + info = genapiCmd.Flags().Bool("info", false, "Print the API details to terminal") + genapiCmd.Flags().SortFlags = false + + commands.RegisterCmd(genapiCmd) +} + +var genapiCmd = &cobra.Command{ + Use: "apistruct", + Short: "Generate the main Go API struct and constructor", + Run: func(cmd *cobra.Command, args []string) { + command := &Command{ + Output: *output, + Gofmt: *gofmt, + DebugSource: *debug, + ColorizeSource: *color, + } + err := command.Execute() + if err != nil { + utils.PrintErr(err) + os.Exit(1) + } + }, +} + +// Command represents the "genapi" command. +// +type Command struct { + Output string + Gofmt bool + DebugSource bool + ColorizeSource bool +} + +// Execute runs the command. +// +func (cmd *Command) Execute() (err error) { + EsVersion, err = utils.EsVersion("") + if err != nil { + return err + } + GitCommit, err = utils.GitCommit("") + if err != nil { + return err + } + GitTag, err = utils.GitTag("") + if err != nil { + return err + } + return cmd.processAPIConstructor() +} + +func (cmd *Command) processAPIConstructor() (err error) { + var ( + namespaces []string + endpoints []*types.TypeName + + b bytes.Buffer + i int + n int + m int + ) + + namespaces = []string{ + // Core APIs + // + "Cat", + "Cluster", + "Indices", + "Ingest", + "Nodes", + "Remote", + "Snapshot", + "Tasks", + + // XPack APIs + // + "CCR", + "ILM", + "License", + "Migration", + "ML", + "Monitoring", + "Rollup", + "Security", + "SQL", + "SSL", + "Watcher", + "XPack", + } + + lpkgs, err := packages.Load(&packages.Config{Mode: packages.LoadTypes}, pkgNames...) + if err != nil { + fmt.Printf("Error loading packages: %s\n", err) + return err + } + + for _, lpkg := range lpkgs { + n++ + + if cmd.DebugSource { + fmt.Println(lpkg.Types) + } + + scope := lpkg.Types.Scope() + for _, name := range scope.Names() { + m++ + obj := scope.Lookup(name) + // Skip unexported objects + if !obj.Exported() { + continue + } + + // Skip non-structs + structObj, ok := obj.Type().Underlying().(*types.Struct) + if !ok { + continue + } + + // Skip non-request objects + if !strings.HasSuffix(obj.Name(), "Request") { + continue + } + + // Append API struct to endpoints + endpoints = append(endpoints, obj.(*types.TypeName)) + + i++ + fmt.Printf("%-3d | %s{}\n", i, obj.Name()) + for j := 0; j < structObj.NumFields(); j++ { + field := structObj.Field(j) + if cmd.DebugSource { + fmt.Printf(" %s %s\n", field.Name(), field.Type()) + } + } + } + } + + b.WriteString("// Code generated") + if EsVersion != "" || GitCommit != "" || GitTag != "" { + b.WriteString(fmt.Sprintf(" from specification version %s", EsVersion)) + if GitCommit != "" { + b.WriteString(fmt.Sprintf(" (%s", GitCommit)) + if GitTag != "" { + b.WriteString(fmt.Sprintf("|%s", GitTag)) + } + b.WriteString(")") + } + } + b.WriteString(": DO NOT EDIT\n") + b.WriteString("\n") + + b.WriteString(`package esapi + +// API contains the Elasticsearch APIs +// +type API struct { +`) + for _, n := range namespaces { + b.WriteString(fmt.Sprintf("\t%[1]s *%[1]s\n", n)) + } + + b.WriteString("\n") + + for _, e := range endpoints { + skip := false + name := strings.ReplaceAll(e.Name(), "Request", "") + + // Skip APIs in namespace + for _, n := range namespaces { + if strings.HasPrefix(strings.ToLower(name), strings.ToLower(n)) { + skip = true + } + } + if !skip { + b.WriteString(fmt.Sprintf("\t%[1]s %[1]s\n", name)) + } + } + + b.WriteString(`}` + "\n\n") + + for _, n := range namespaces { + b.WriteString(`// ` + n + ` contains the ` + n + ` APIs` + "\n") + b.WriteString(`type ` + n + ` struct {` + "\n") + for _, e := range endpoints { + name := strings.ReplaceAll(e.Name(), "Request", "") + if strings.HasPrefix(strings.ToLower(name), strings.ToLower(n)) { + methodName := strings.ReplaceAll(name, n, "") + b.WriteString(fmt.Sprintf("\t%s %s\n", methodName, name)) + } + } + b.WriteString("}\n\n") + } + + b.WriteString(`// New creates new API +// +func New(t Transport) *API { + return &API{ +`) + + for _, e := range endpoints { + skip := false + name := strings.ReplaceAll(e.Name(), "Request", "") + + for _, n := range namespaces { + if strings.HasPrefix(strings.ToLower(name), strings.ToLower(n)) { + skip = true + } + } + if !skip { + b.WriteString(fmt.Sprintf("\t\t%[1]s: new%[1]sFunc(t),\n", name)) + } + } + + for _, n := range namespaces { + b.WriteString(fmt.Sprintf("\t\t%[1]s: &%[1]s{\n", n)) + for _, e := range endpoints { + name := strings.ReplaceAll(e.Name(), "Request", "") + if strings.HasPrefix(strings.ToLower(name), strings.ToLower(n)) { + methodName := strings.ReplaceAll(name, n, "") + b.WriteString(fmt.Sprintf("\t\t\t%s: new%sFunc(t),\n", methodName, name)) + } + } + b.WriteString("\t\t},\n") + } + + b.WriteString(` } +} +`) + + if cmd.Gofmt { + out, err := imports.Process( + "esapi/api._.go", + b.Bytes(), + &imports.Options{ + AllErrors: true, + Comments: true, + FormatOnly: false, + TabIndent: true, + TabWidth: 1, + }) + if err != nil { + return err + } + b = *bytes.NewBuffer(out) + } + + if cmd.DebugSource { + var src io.Reader + var buf bytes.Buffer + tee := io.TeeReader(bytes.NewReader(b.Bytes()), &buf) + + if utils.IsTTY() { + fmt.Fprint(os.Stderr, "\x1b[2m") + } + fmt.Fprintln(os.Stderr, strings.Repeat("━", utils.TerminalWidth())) + if utils.IsTTY() { + fmt.Fprint(os.Stderr, "\x1b[0m") + } + if cmd.ColorizeSource { + src, err = utils.Chromatize(tee) + if err != nil { + return fmt.Errorf("error syntax highligting the output: %s", err) + } + } else { + src = bytes.NewReader(b.Bytes()) + } + + _, err = io.Copy(os.Stderr, src) + if err != nil { + return fmt.Errorf("error copying output: %s", err) + } + + fmt.Fprintf(os.Stderr, "\n\n") + } + + fname := filepath.Join(cmd.Output, "api._.go") + f, err := os.OpenFile(fname, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0755) + if err != nil { + return fmt.Errorf("error creating file: %s", err) + } + _, err = io.Copy(f, &b) + if err != nil { + return fmt.Errorf("error copying output: %s", err) + } + if err := f.Close(); err != nil { + return fmt.Errorf("error closing file: %s", err) + } + return nil +} diff --git a/internal/cmd/generate/main.go b/internal/cmd/generate/main.go index b2993799d0..a1373bc009 100755 --- a/internal/cmd/generate/main.go +++ b/internal/cmd/generate/main.go @@ -3,6 +3,7 @@ package main import ( "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/commands" _ "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/commands/gensource" + _ "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/commands/genstruct" _ "github.com/elastic/go-elasticsearch/v7/internal/cmd/generate/commands/gentests" ) From 41757535713524e107fb42a1c50ff4e01b885330 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 4 Jul 2019 16:48:54 +0200 Subject: [PATCH 062/355] Makefile: Update the targets for generating the API and running tests * The `gen-api` and `gen-tests` targets generate both the Core and X-Pack APIs * The `test-api` target runs the Core APIs by default, and the X-Pack APIs when the `flavor=xpack` variable is set (cherry picked from commit f7bd2becf37b71927a613a4c22db3e3178da467d) --- Makefile | 99 +++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 80 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index ea73eec63a..998d9eda25 100755 --- a/Makefile +++ b/Makefile @@ -36,19 +36,43 @@ endif fi; test-api: ## Run generated API integration tests - @echo "\033[2m→ Running API integration tests...\033[0m" + @mkdir -p tmp ifdef race $(eval testapiargs += "-race") endif - $(eval testapiargs += "-cover" "-coverpkg=github.com/elastic/go-elasticsearch/v7/esapi" "-coverprofile=$(PWD)/tmp/integration-api.cov" "-tags='integration'" "-timeout=1h" "./...") - @mkdir -p tmp - @if which gotestsum > /dev/null 2>&1 ; then \ - echo "cd esapi/test && gotestsum --format=short-verbose --junitfile=$(PWD)/tmp/integration-api-report.xml --" $(testapiargs); \ - cd esapi/test && gotestsum --format=short-verbose --junitfile=$(PWD)/tmp/integration-api-report.xml -- $(testapiargs); \ - else \ - echo "go test -v" $(testapiargs); \ - cd esapi/test && go test -v $(testapiargs); \ - fi; + $(eval testapiargs += "-cover" "-coverpkg=github.com/elastic/go-elasticsearch/v7/esapi" "-coverprofile=$(PWD)/tmp/integration-api.cov" "-tags='integration'" "-timeout=1h") +ifdef flavor +else + $(eval flavor='core') +endif + @echo "\033[2m→ Running API integration tests for [$(flavor)]...\033[0m" +ifeq ($(flavor), xpack) + @{ \ + export ELASTICSEARCH_URL='https://elastic:elastic@localhost:9200' && \ + if which gotestsum > /dev/null 2>&1 ; then \ + cd esapi/test && \ + gotestsum --format=short-verbose --junitfile=$(PWD)/tmp/integration-api-report.xml -- $(testapiargs) $(PWD)/esapi/test/xpack/*_test.go && \ + gotestsum --format=short-verbose --junitfile=$(PWD)/tmp/integration-api-report.xml -- $(testapiargs) $(PWD)/esapi/test/xpack/ml/*_test.go && \ + gotestsum --format=short-verbose --junitfile=$(PWD)/tmp/integration-api-report.xml -- $(testapiargs) $(PWD)/esapi/test/xpack/ml-crud/*_test.go; \ + else \ + echo "go test -v" $(testapiargs); \ + cd esapi/test && \ + go test -v $(testapiargs) $(PWD)/esapi/test/xpack/*_test.go && \ + go test -v $(testapiargs) $(PWD)/esapi/test/xpack/ml/*_test.go && \ + go test -v $(testapiargs) $(PWD)/esapi/test/xpack/ml-crud/*_test.go; \ + fi; \ + } +else + $(eval testapiargs += $(PWD)/esapi/test/*_test.go) + @{ \ + if which gotestsum > /dev/null 2>&1 ; then \ + cd esapi/test && gotestsum --format=short-verbose --junitfile=$(PWD)/tmp/integration-api-report.xml -- $(testapiargs); \ + else \ + echo "go test -v" $(testapiargs); \ + cd esapi/test && go test -v $(testapiargs); \ + fi; \ + } +endif test-bench: ## Run benchmarks @echo "\033[2m→ Running benchmarks...\033[0m" @@ -224,26 +248,63 @@ docker: ## Build the Docker image and run it ##@ Generator gen-api: ## Generate the API package from the JSON specification - @echo "\033[2m→ Generating API package from specification...\033[0m" - $(eval input ?= tmp/elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/api/*.json) + $(eval input ?= tmp/elasticsearch) $(eval output ?= esapi) ifdef debug $(eval args += --debug) endif -ifdef skip-registry - $(eval args += --skip-registry) +ifdef ELASTICSEARCH_VERSION + $(eval version = $(ELASTICSEARCH_VERSION)) +else + $(eval version = $(shell cat "$(input)/buildSrc/version.properties" | grep 'elasticsearch' | cut -d '=' -f 2 | tr -d ' ')) endif - cd internal/cmd/generate && go run main.go source --input '$(PWD)/$(input)' --output '$(PWD)/$(output)' $(args) +ifdef ELASTICSEARCH_BUILD_HASH + $(eval build_hash = $(ELASTICSEARCH_BUILD_HASH)) +else + $(eval build_hash = $(shell git --git-dir='$(input)/.git' rev-parse --short HEAD)) +endif + @echo "\033[2m→ Generating API package from specification ($(version):$(build_hash))...\033[0m" + @{ \ + export ELASTICSEARCH_VERSION=$(version) && \ + export ELASTICSEARCH_BUILD_HASH=$(build_hash) && \ + cd internal/cmd/generate && \ + go run main.go apisource --input '$(PWD)/$(input)/rest-api-spec/src/main/resources/rest-api-spec/api/*.json' --output '$(PWD)/$(output)' $(args) && \ + go run main.go apisource --input '$(PWD)/$(input)/x-pack/plugin/src/test/resources/rest-api-spec/api/*.json' --output '$(PWD)/$(output)' $(args) && \ + go run main.go apistruct --output '$(PWD)/$(output)'; \ + } gen-tests: ## Generate the API tests from the YAML specification - @echo "\033[2m→ Generating API tests from specification...\033[0m" - $(eval input ?= tmp/elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/test/**/*.y*ml) + $(eval input ?= tmp/elasticsearch) $(eval output ?= esapi/test) ifdef debug $(eval args += --debug) endif - rm -rf esapi/test/*_test.go - cd internal/cmd/generate && go generate ./... && go run main.go tests --input '$(PWD)/$(input)' --output '$(PWD)/$(output)' $(args) +ifdef ELASTICSEARCH_VERSION + $(eval version = $(ELASTICSEARCH_VERSION)) +else + $(eval version = $(shell cat "$(input)/buildSrc/version.properties" | grep 'elasticsearch' | cut -d '=' -f 2 | tr -d ' ')) +endif +ifdef ELASTICSEARCH_BUILD_HASH + $(eval build_hash = $(ELASTICSEARCH_BUILD_HASH)) +else + $(eval build_hash = $(shell git --git-dir='$(input)/.git' rev-parse --short HEAD)) +endif + @echo "\033[2m→ Generating API tests from specification ($(version):$(build_hash))...\033[0m" + @{ \ + export ELASTICSEARCH_VERSION=$(version) && \ + export ELASTICSEARCH_BUILD_HASH=$(build_hash) && \ + rm -rf $(output)/*_test.go && \ + rm -rf $(output)/xpack && \ + cd internal/cmd/generate && \ + go generate ./... && \ + go run main.go apitests --input '$(PWD)/$(input)/rest-api-spec/src/main/resources/rest-api-spec/test/**/*.y*ml' --output '$(PWD)/$(output)' $(args) && \ + go run main.go apitests --input '$(PWD)/$(input)/x-pack/plugin/src/test/resources/rest-api-spec/test/**/*.yml' --output '$(PWD)/$(output)/xpack' $(args) && \ + go run main.go apitests --input '$(PWD)/$(input)/x-pack/plugin/src/test/resources/rest-api-spec/test/**/**/*.yml' --output '$(PWD)/$(output)/xpack' $(args) && \ + mkdir -p '$(PWD)/esapi/test/xpack/ml' && \ + mkdir -p '$(PWD)/esapi/test/xpack/ml-crud' && \ + mv $(PWD)/esapi/test/xpack/xpack_ml* $(PWD)/esapi/test/xpack/ml/ && \ + mv $(PWD)/esapi/test/xpack/ml/xpack_ml__jobs_crud_test.go $(PWD)/esapi/test/xpack/ml-crud/; \ + } ##@ Other #------------------------------------------------------------------------------ From 9544678732adaa368f8f73c5f8ffeb2df5428f62 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 4 Jul 2019 17:31:31 +0200 Subject: [PATCH 063/355] CI: Add running the Core and X-Pack tests on the "master" branch (cherry picked from commit fc0c996d649241a5b5bc9642c2be62482d2c3164) --- .jenkins/run-tests | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.jenkins/run-tests b/.jenkins/run-tests index cefa7dee67..d474524ddd 100755 --- a/.jenkins/run-tests +++ b/.jenkins/run-tests @@ -12,8 +12,8 @@ if [[ $TEST_SUITE != "core" && $TEST_SUITE != "xpack" ]]; then exit 1 fi -# Run X-Pack tests only on the "xpack" branch, and skip Core tests on the "xpack" branch -if [[ ($branch_specifier != "refs/heads/xpack" && $TEST_SUITE == "xpack") || ($branch_specifier == "refs/heads/xpack" && $TEST_SUITE == "core") ]]; then +# Run X-Pack tests only on the "master" and "xpack" branches, and skip Core tests on the "xpack" branch +if [[ (($branch_specifier != "refs/heads/xpack" && $branch_specifier != "refs/heads/master") && $TEST_SUITE == "xpack") || ($branch_specifier == "refs/heads/xpack" && $TEST_SUITE == "core") ]]; then echo -e "\033[33;1mSkipping [$TEST_SUITE] tests on the [$branch_specifier] branch.\033[0m" exit 0 fi From e1f29a98f33fd1846859b20013ef0412c079399d Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 4 Jul 2019 17:33:19 +0200 Subject: [PATCH 064/355] CI: Remove the "master-xpack" Jenkins job (cherry picked from commit 459ba74ef658059a3458a36ac75cb9bc23be63f2) --- .../jobs/elastic+go-elasticsearch+master-xpack.yml | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .jenkins/jobs/elastic+go-elasticsearch+master-xpack.yml diff --git a/.jenkins/jobs/elastic+go-elasticsearch+master-xpack.yml b/.jenkins/jobs/elastic+go-elasticsearch+master-xpack.yml deleted file mode 100644 index 53b8e73a7a..0000000000 --- a/.jenkins/jobs/elastic+go-elasticsearch+master-xpack.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- job: - name: elastic+go-elasticsearch+master-xpack - display-name: 'elastic / go-elasticsearch # master-xpack' - description: Testing the go-elasticsearch master branch with XPack. - junit_results: "*-junit.xml" - parameters: - - string: - name: branch_specifier - default: refs/heads/xpack - description: The Git branch specifier to build - triggers: - - github - - timed: '@daily' From 091b2a535043b986ea7afedd5044b9746f085429 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 4 Jul 2019 18:51:12 +0200 Subject: [PATCH 065/355] CI: Update the "core" test runner (cherry picked from commit 0e2ee8d7ae49759f2cf949a2b1dc07ba1da6c766) --- .jenkins/tests-core.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.jenkins/tests-core.sh b/.jenkins/tests-core.sh index 2bc2982319..34d4300d47 100755 --- a/.jenkins/tests-core.sh +++ b/.jenkins/tests-core.sh @@ -15,11 +15,11 @@ docker exec --workdir=/go-elasticsearch/internal/cmd/generate --env PACKAGE_PATH echo -e "\033[1m>>>>> Generating the test files\033[0m" -time docker exec --tty --workdir=/go-elasticsearch/internal/cmd/generate go-elasticsearch go run main.go tests --output '/go-elasticsearch/esapi/test' --input '/elasticsearch-source/elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/test/**/*.y*ml' +time docker exec --tty --workdir=/go-elasticsearch/internal/cmd/generate go-elasticsearch go run main.go apitests --output '/go-elasticsearch/esapi/test' --input '/elasticsearch-source/elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/test/**/*.y*ml' echo -e "\033[1m>>>>> Running the tests\033[0m" -time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c 'gotestsum --format=short-verbose --junitfile=$WORKSPACE/TEST-integration-api-junit.xml -- -tags=integration -timeout=1h ./...' +time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c 'gotestsum --format=short-verbose --junitfile=$WORKSPACE/TEST-integration-api-junit.xml -- -tags=integration -timeout=1h *_test.go' status=$? exit $status From f31d1fc98966927bf01a24e8e30c52d723f39dba Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 4 Jul 2019 19:25:28 +0200 Subject: [PATCH 066/355] CI: Update the Travis runner for API integration tests (cherry picked from commit a9754309e40aac0e8848aa867fe00a37dd886a05) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6f25e45523..20f6694fdc 100755 --- a/.travis.yml +++ b/.travis.yml @@ -155,7 +155,7 @@ matrix: - echo -en 'travis_fold:end:script.gen_api_reg' # ------ Generate Go test files ----------------------------------------------------------- - echo -e "\e[33;1mGenerate Go test files\e[0m" && echo -en 'travis_fold:start:script.gen_test_files\\r' - - cd ${TRAVIS_HOME}/gopath/src/github.com/elastic/go-elasticsearch/internal/cmd/generate && ELASTICSEARCH_BUILD_HASH=$(cat ../../../.elasticsearch_build_hash) go run main.go tests --input '/tmp/elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/test/**/*.yml' --output=../../../esapi/test + - cd ${TRAVIS_HOME}/gopath/src/github.com/elastic/go-elasticsearch/internal/cmd/generate && ELASTICSEARCH_BUILD_HASH=$(cat ../../../.elasticsearch_build_hash) go run main.go apitests --input '/tmp/elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/test/**/*.yml' --output=../../../esapi/test - echo -en 'travis_fold:end:script.gen_test_files' # ------ Run tests ----------------------------------------------------------------------- - cd ${TRAVIS_HOME}/gopath/src/github.com/elastic/go-elasticsearch/esapi/test && time gotestsum --format=short-verbose --junitfile=/tmp/integration-api-report.xml -- -coverpkg=github.com/elastic/go-elasticsearch/esapi -coverprofile=/tmp/integration-api.cov -tags='integration' -timeout=1h ./... From 3058a00eae044bd5ff8a92cd16fbc1e110ccd648 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 5 Jul 2019 12:21:14 +0200 Subject: [PATCH 067/355] Makefile: Update the default Elasticsearch version to 7.3-SNAPSHOT --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 998d9eda25..3494c47f16 100755 --- a/Makefile +++ b/Makefile @@ -157,7 +157,7 @@ godoc: ## Display documentation for the package GOROOT=/tmp/tmpgoroot/ GOPATH=/tmp/tmpgopath/ godoc -http=localhost:6060 -play cluster: ## Launch an Elasticsearch cluster with Docker - $(eval version ?= "elasticsearch-oss:7.1-SNAPSHOT") + $(eval version ?= "elasticsearch-oss:7.3-SNAPSHOT") ifeq ($(origin nodes), undefined) $(eval nodes = 1) endif @@ -233,7 +233,7 @@ ifdef detached endif cluster-update: ## Update the Docker image - $(eval version ?= "elasticsearch-oss:7.1-SNAPSHOT") + $(eval version ?= "elasticsearch-oss:7.3-SNAPSHOT") @echo "\033[2m→ Updating the Docker image...\033[0m" @docker pull docker.elastic.co/elasticsearch/$(version); From 8cae9784711d16afd6c8f8cfaf9f1328b0c01527 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 24 May 2019 12:53:36 +0200 Subject: [PATCH 068/355] Generator: API: Add support for "deprecated_paths" in the spec (cherry picked from commit 6725c6b7bb7c0a5b93ce868d4db530401ffe0ee0) --- internal/cmd/generate/commands/gensource/model.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/cmd/generate/commands/gensource/model.go b/internal/cmd/generate/commands/gensource/model.go index a45c99ce99..4de236ae1f 100755 --- a/internal/cmd/generate/commands/gensource/model.go +++ b/internal/cmd/generate/commands/gensource/model.go @@ -123,8 +123,13 @@ type Endpoint struct { type URL struct { Endpoint *Endpoint `json:"-"` - Path string `json:"path"` - Paths []string `json:"paths"` + Path string `json:"path"` + Paths []string `json:"paths"` + DeprecatedPaths []struct { + Path string `json:"path"` + Version string `json:"version"` + Description string `json:"description"` + } `json:"deprecated_paths"` Parts map[string]*Part `json:"parts"` Params map[string]*Param `json:"params"` From 17249bbad1bfb9a6112df152db0d1e5fd0824dda Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 5 Jul 2019 15:34:46 +0200 Subject: [PATCH 069/355] Generator: Tests: Fix the Core test common setup (cherry picked from commit 2ba64f0e5dd5411e2273fca6355e129afc8b1777) --- .../cmd/generate/commands/gentests/generator.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/cmd/generate/commands/gentests/generator.go b/internal/cmd/generate/commands/gentests/generator.go index 8074daf2ca..5d25111ac0 100755 --- a/internal/cmd/generate/commands/gentests/generator.go +++ b/internal/cmd/generate/commands/gentests/generator.go @@ -335,13 +335,15 @@ func (g *Generator) genCommonSetup() { var r map[string]interface{} res, _ = es.Snapshot.Get(repositoryID, []string{"_all"}) json.NewDecoder(res.Body).Decode(&r) - for _, vv := range r["responses"].([]interface{}) { - for _, v := range vv.(map[string]interface{})["snapshots"].([]interface{}) { - snapshotID, ok := v.(map[string]interface{})["snapshot"] - if !ok { - continue + if r["responses"] != nil { + for _, vv := range r["responses"].([]interface{}) { + for _, v := range vv.(map[string]interface{})["snapshots"].([]interface{}) { + snapshotID, ok := v.(map[string]interface{})["snapshot"] + if !ok { + continue + } + es.Snapshot.Delete(repositoryID, fmt.Sprintf("%s", snapshotID)) } - es.Snapshot.Delete(repositoryID, fmt.Sprintf("%s", snapshotID)) } } es.Snapshot.DeleteRepository([]string{fmt.Sprintf("%s", repositoryID)}) From 656b032bbff23c1f8b8625fa91e608d63d99345a Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 5 Jul 2019 15:37:31 +0200 Subject: [PATCH 070/355] API: Update the Core APIs for Elasticsearch 7.x (cff607cbd83) --- esapi/api.bulk.go | 30 +++++++- esapi/api.cat.aliases.go | 30 +++++++- esapi/api.cat.allocation.go | 30 +++++++- esapi/api.cat.count.go | 30 +++++++- esapi/api.cat.fielddata.go | 30 +++++++- esapi/api.cat.health.go | 30 +++++++- esapi/api.cat.help.go | 30 +++++++- esapi/api.cat.indices.go | 63 ++++++++++++++--- esapi/api.cat.master.go | 30 +++++++- esapi/api.cat.nodeattrs.go | 30 +++++++- esapi/api.cat.nodes.go | 30 +++++++- esapi/api.cat.pending_tasks.go | 30 +++++++- esapi/api.cat.plugins.go | 30 +++++++- esapi/api.cat.recovery.go | 30 +++++++- esapi/api.cat.repositories.go | 30 +++++++- esapi/api.cat.segments.go | 30 +++++++- esapi/api.cat.shards.go | 30 +++++++- esapi/api.cat.snapshots.go | 30 +++++++- esapi/api.cat.tasks.go | 30 +++++++- esapi/api.cat.templates.go | 30 +++++++- esapi/api.cat.thread_pool.go | 30 +++++++- esapi/api.clear_scroll.go | 30 +++++++- esapi/api.cluster.allocation_explain.go | 30 +++++++- esapi/api.cluster.get_settings.go | 30 +++++++- esapi/api.cluster.health.go | 43 +++++++++++- esapi/api.cluster.pending_tasks.go | 30 +++++++- esapi/api.cluster.put_settings.go | 30 +++++++- esapi/api.cluster.remote_info.go | 30 +++++++- esapi/api.cluster.reroute.go | 30 +++++++- esapi/api.cluster.state.go | 30 +++++++- esapi/api.cluster.stats.go | 30 +++++++- esapi/api.count.go | 30 +++++++- esapi/api.create.go | 43 ++++++++---- esapi/api.delete.go | 43 ++++++++---- esapi/api.delete_by_query.go | 45 +++++++++++- esapi/api.delete_by_query_rethrottle.go | 30 +++++++- esapi/api.delete_script.go | 30 +++++++- esapi/api.exists.go | 43 ++++++++---- esapi/api.exists_source.go | 43 ++++++++---- esapi/api.explain.go | 43 ++++++++---- esapi/api.field_caps.go | 43 +++++++++++- esapi/api.get.go | 69 ++++++++---------- esapi/api.get_script.go | 30 +++++++- esapi/api.get_source.go | 43 ++++++++---- esapi/api.index.go | 43 ++++++++---- esapi/api.indices.analyze.go | 30 +++++++- esapi/api.indices.clear_cache.go | 30 +++++++- esapi/api.indices.close.go | 53 ++++++++++++-- esapi/api.indices.create.go | 30 +++++++- esapi/api.indices.delete.go | 30 +++++++- esapi/api.indices.delete_alias.go | 30 +++++++- esapi/api.indices.delete_template.go | 30 +++++++- esapi/api.indices.exists.go | 30 +++++++- esapi/api.indices.exists_alias.go | 30 +++++++- esapi/api.indices.exists_template.go | 30 +++++++- esapi/api.indices.exists_type.go | 86 +++++++++++++++-------- esapi/api.indices.flush.go | 30 +++++++- esapi/api.indices.flush_synced.go | 30 +++++++- esapi/api.indices.forcemerge.go | 30 +++++++- esapi/api.indices.get.go | 30 +++++++- esapi/api.indices.get_alias.go | 30 +++++++- esapi/api.indices.get_field_mapping.go | 30 +++++++- esapi/api.indices.get_mapping.go | 30 +++++++- esapi/api.indices.get_settings.go | 30 +++++++- esapi/api.indices.get_template.go | 30 +++++++- esapi/api.indices.get_upgrade.go | 30 +++++++- esapi/api.indices.open.go | 30 +++++++- esapi/api.indices.put_alias.go | 30 +++++++- esapi/api.indices.put_mapping.go | 30 +++++++- esapi/api.indices.put_settings.go | 30 +++++++- esapi/api.indices.put_template.go | 36 ++++++++-- esapi/api.indices.recovery.go | 30 +++++++- esapi/api.indices.refresh.go | 30 +++++++- esapi/api.indices.rollover.go | 30 +++++++- esapi/api.indices.segments.go | 30 +++++++- esapi/api.indices.shard_stores.go | 30 +++++++- esapi/api.indices.shrink.go | 30 +++++++- esapi/api.indices.split.go | 30 +++++++- esapi/api.indices.stats.go | 69 +++++++++++++++++- esapi/api.indices.update_aliases.go | 30 +++++++- esapi/api.indices.upgrade.go | 30 +++++++- esapi/api.indices.validate_query.go | 30 +++++++- esapi/api.info.go | 30 +++++++- esapi/api.ingest.delete_pipeline.go | 32 ++++++++- esapi/api.ingest.get_pipeline.go | 32 ++++++++- esapi/api.ingest.processor_grok.go | 32 ++++++++- esapi/api.ingest.put_pipeline.go | 32 ++++++++- esapi/api.ingest.simulate.go | 32 ++++++++- esapi/api.mget.go | 30 +++++++- esapi/api.msearch.go | 32 ++++++++- esapi/api.msearch_template.go | 30 +++++++- esapi/api.mtermvectors.go | 43 ++++++++---- esapi/api.nodes.hot_threads.go | 30 +++++++- esapi/api.nodes.info.go | 30 +++++++- esapi/api.nodes.reload_secure_settings.go | 30 +++++++- esapi/api.nodes.stats.go | 30 +++++++- esapi/api.nodes.usage.go | 30 +++++++- esapi/api.ping.go | 30 +++++++- esapi/api.put_script.go | 30 +++++++- esapi/api.rank_eval.go | 30 +++++++- esapi/api.reindex.go | 43 +++++++++++- esapi/api.reindex_rethrottle.go | 30 +++++++- esapi/api.render_search_template.go | 30 +++++++- esapi/api.scripts_painless_execute.go | 30 +++++++- esapi/api.scroll.go | 30 +++++++- esapi/api.search.go | 30 +++++++- esapi/api.search_shards.go | 30 +++++++- esapi/api.search_template.go | 30 +++++++- esapi/api.snapshot.create.go | 30 +++++++- esapi/api.snapshot.create_repository.go | 30 +++++++- esapi/api.snapshot.delete.go | 30 +++++++- esapi/api.snapshot.delete_repository.go | 30 +++++++- esapi/api.snapshot.get.go | 30 +++++++- esapi/api.snapshot.get_repository.go | 30 +++++++- esapi/api.snapshot.restore.go | 30 +++++++- esapi/api.snapshot.status.go | 30 +++++++- esapi/api.snapshot.verify_repository.go | 30 +++++++- esapi/api.tasks.cancel.go | 30 +++++++- esapi/api.tasks.get.go | 30 +++++++- esapi/api.tasks.list.go | 30 +++++++- esapi/api.termvectors.go | 43 ++++++++---- esapi/api.update.go | 43 ++++++++---- esapi/api.update_by_query.go | 45 +++++++++++- esapi/api.update_by_query_rethrottle.go | 30 +++++++- 124 files changed, 3780 insertions(+), 347 deletions(-) diff --git a/esapi/api.bulk.go b/esapi/api.bulk.go index 14a318bc53..88e839ed50 100755 --- a/esapi/api.bulk.go +++ b/esapi/api.bulk.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strings" "time" ) @@ -49,6 +50,8 @@ type BulkRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -143,6 +146,18 @@ func (r BulkRequest) Do(ctx context.Context, transport Transport) (*Response, er req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -280,3 +295,16 @@ func (f Bulk) WithFilterPath(v ...string) func(*BulkRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Bulk) WithHeader(h map[string]string) func(*BulkRequest) { + return func(r *BulkRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.aliases.go b/esapi/api.cat.aliases.go index c0aa5167d6..97d81bf8aa 100755 --- a/esapi/api.cat.aliases.go +++ b/esapi/api.cat.aliases.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -45,6 +46,8 @@ type CatAliasesRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -125,6 +128,18 @@ func (r CatAliasesRequest) Do(ctx context.Context, transport Transport) (*Respon req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -246,3 +261,16 @@ func (f CatAliases) WithFilterPath(v ...string) func(*CatAliasesRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatAliases) WithHeader(h map[string]string) func(*CatAliasesRequest) { + return func(r *CatAliasesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.allocation.go b/esapi/api.cat.allocation.go index ccd773001b..b9b6189499 100755 --- a/esapi/api.cat.allocation.go +++ b/esapi/api.cat.allocation.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -46,6 +47,8 @@ type CatAllocationRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -130,6 +133,18 @@ func (r CatAllocationRequest) Do(ctx context.Context, transport Transport) (*Res req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -259,3 +274,16 @@ func (f CatAllocation) WithFilterPath(v ...string) func(*CatAllocationRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatAllocation) WithHeader(h map[string]string) func(*CatAllocationRequest) { + return func(r *CatAllocationRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.count.go b/esapi/api.cat.count.go index e16d084ece..11a6a7ae64 100755 --- a/esapi/api.cat.count.go +++ b/esapi/api.cat.count.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -45,6 +46,8 @@ type CatCountRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -125,6 +128,18 @@ func (r CatCountRequest) Do(ctx context.Context, transport Transport) (*Response req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -246,3 +261,16 @@ func (f CatCount) WithFilterPath(v ...string) func(*CatCountRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatCount) WithHeader(h map[string]string) func(*CatCountRequest) { + return func(r *CatCountRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.fielddata.go b/esapi/api.cat.fielddata.go index 893f716462..2eabd078f0 100755 --- a/esapi/api.cat.fielddata.go +++ b/esapi/api.cat.fielddata.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -46,6 +47,8 @@ type CatFielddataRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -134,6 +137,18 @@ func (r CatFielddataRequest) Do(ctx context.Context, transport Transport) (*Resp req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -263,3 +278,16 @@ func (f CatFielddata) WithFilterPath(v ...string) func(*CatFielddataRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatFielddata) WithHeader(h map[string]string) func(*CatFielddataRequest) { + return func(r *CatFielddataRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.health.go b/esapi/api.cat.health.go index 6c9dea466c..1bcad6d87b 100755 --- a/esapi/api.cat.health.go +++ b/esapi/api.cat.health.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -44,6 +45,8 @@ type CatHealthRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -121,6 +124,18 @@ func (r CatHealthRequest) Do(ctx context.Context, transport Transport) (*Respons req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -242,3 +257,16 @@ func (f CatHealth) WithFilterPath(v ...string) func(*CatHealthRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatHealth) WithHeader(h map[string]string) func(*CatHealthRequest) { + return func(r *CatHealthRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.help.go b/esapi/api.cat.help.go index 042aa14266..787498e532 100755 --- a/esapi/api.cat.help.go +++ b/esapi/api.cat.help.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -37,6 +38,8 @@ type CatHelpRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -90,6 +93,18 @@ func (r CatHelpRequest) Do(ctx context.Context, transport Transport) (*Response, req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -163,3 +178,16 @@ func (f CatHelp) WithFilterPath(v ...string) func(*CatHelpRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatHelp) WithHeader(h map[string]string) func(*CatHelpRequest) { + return func(r *CatHelpRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.indices.go b/esapi/api.cat.indices.go index 80876b06a0..da0430cffe 100755 --- a/esapi/api.cat.indices.go +++ b/esapi/api.cat.indices.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -32,22 +33,25 @@ type CatIndices func(o ...func(*CatIndicesRequest)) (*Response, error) type CatIndicesRequest struct { Index []string - Bytes string - Format string - H []string - Health string - Help *bool - Local *bool - MasterTimeout time.Duration - Pri *bool - S []string - V *bool + Bytes string + Format string + H []string + Health string + Help *bool + IncludeUnloadedSegments *bool + Local *bool + MasterTimeout time.Duration + Pri *bool + S []string + V *bool Pretty bool Human bool ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -94,6 +98,10 @@ func (r CatIndicesRequest) Do(ctx context.Context, transport Transport) (*Respon params["help"] = strconv.FormatBool(*r.Help) } + if r.IncludeUnloadedSegments != nil { + params["include_unloaded_segments"] = strconv.FormatBool(*r.IncludeUnloadedSegments) + } + if r.Local != nil { params["local"] = strconv.FormatBool(*r.Local) } @@ -140,6 +148,18 @@ func (r CatIndicesRequest) Do(ctx context.Context, transport Transport) (*Respon req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -214,6 +234,14 @@ func (f CatIndices) WithHelp(v bool) func(*CatIndicesRequest) { } } +// WithIncludeUnloadedSegments - if set to true segment stats will include stats for segments that are not currently loaded into memory. +// +func (f CatIndices) WithIncludeUnloadedSegments(v bool) func(*CatIndicesRequest) { + return func(r *CatIndicesRequest) { + r.IncludeUnloadedSegments = &v + } +} + // WithLocal - return local information, do not retrieve the state from master node (default: false). // func (f CatIndices) WithLocal(v bool) func(*CatIndicesRequest) { @@ -285,3 +313,16 @@ func (f CatIndices) WithFilterPath(v ...string) func(*CatIndicesRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatIndices) WithHeader(h map[string]string) func(*CatIndicesRequest) { + return func(r *CatIndicesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.master.go b/esapi/api.cat.master.go index 10a9e0ab66..2b8078b3a0 100755 --- a/esapi/api.cat.master.go +++ b/esapi/api.cat.master.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -43,6 +44,8 @@ type CatMasterRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -116,6 +119,18 @@ func (r CatMasterRequest) Do(ctx context.Context, transport Transport) (*Respons req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -229,3 +244,16 @@ func (f CatMaster) WithFilterPath(v ...string) func(*CatMasterRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatMaster) WithHeader(h map[string]string) func(*CatMasterRequest) { + return func(r *CatMasterRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.nodeattrs.go b/esapi/api.cat.nodeattrs.go index 3b35c71737..2d1961a50e 100755 --- a/esapi/api.cat.nodeattrs.go +++ b/esapi/api.cat.nodeattrs.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -43,6 +44,8 @@ type CatNodeattrsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -116,6 +119,18 @@ func (r CatNodeattrsRequest) Do(ctx context.Context, transport Transport) (*Resp req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -229,3 +244,16 @@ func (f CatNodeattrs) WithFilterPath(v ...string) func(*CatNodeattrsRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatNodeattrs) WithHeader(h map[string]string) func(*CatNodeattrsRequest) { + return func(r *CatNodeattrsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.nodes.go b/esapi/api.cat.nodes.go index 8cea2f9b22..56ddd23de3 100755 --- a/esapi/api.cat.nodes.go +++ b/esapi/api.cat.nodes.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -44,6 +45,8 @@ type CatNodesRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -121,6 +124,18 @@ func (r CatNodesRequest) Do(ctx context.Context, transport Transport) (*Response req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -242,3 +257,16 @@ func (f CatNodes) WithFilterPath(v ...string) func(*CatNodesRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatNodes) WithHeader(h map[string]string) func(*CatNodesRequest) { + return func(r *CatNodesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.pending_tasks.go b/esapi/api.cat.pending_tasks.go index 2ee059c048..615b1f7053 100755 --- a/esapi/api.cat.pending_tasks.go +++ b/esapi/api.cat.pending_tasks.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -43,6 +44,8 @@ type CatPendingTasksRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -116,6 +119,18 @@ func (r CatPendingTasksRequest) Do(ctx context.Context, transport Transport) (*R req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -229,3 +244,16 @@ func (f CatPendingTasks) WithFilterPath(v ...string) func(*CatPendingTasksReques r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatPendingTasks) WithHeader(h map[string]string) func(*CatPendingTasksRequest) { + return func(r *CatPendingTasksRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.plugins.go b/esapi/api.cat.plugins.go index b4c7f37809..9d68b8b2de 100755 --- a/esapi/api.cat.plugins.go +++ b/esapi/api.cat.plugins.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -43,6 +44,8 @@ type CatPluginsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -116,6 +119,18 @@ func (r CatPluginsRequest) Do(ctx context.Context, transport Transport) (*Respon req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -229,3 +244,16 @@ func (f CatPlugins) WithFilterPath(v ...string) func(*CatPluginsRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatPlugins) WithHeader(h map[string]string) func(*CatPluginsRequest) { + return func(r *CatPluginsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.recovery.go b/esapi/api.cat.recovery.go index 5abfafef1b..1953ffad3c 100755 --- a/esapi/api.cat.recovery.go +++ b/esapi/api.cat.recovery.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -45,6 +46,8 @@ type CatRecoveryRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -125,6 +128,18 @@ func (r CatRecoveryRequest) Do(ctx context.Context, transport Transport) (*Respo req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -246,3 +261,16 @@ func (f CatRecovery) WithFilterPath(v ...string) func(*CatRecoveryRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatRecovery) WithHeader(h map[string]string) func(*CatRecoveryRequest) { + return func(r *CatRecoveryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.repositories.go b/esapi/api.cat.repositories.go index 10ac6e330d..f13b8a5fa6 100755 --- a/esapi/api.cat.repositories.go +++ b/esapi/api.cat.repositories.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -43,6 +44,8 @@ type CatRepositoriesRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -116,6 +119,18 @@ func (r CatRepositoriesRequest) Do(ctx context.Context, transport Transport) (*R req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -229,3 +244,16 @@ func (f CatRepositories) WithFilterPath(v ...string) func(*CatRepositoriesReques r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatRepositories) WithHeader(h map[string]string) func(*CatRepositoriesRequest) { + return func(r *CatRepositoriesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.segments.go b/esapi/api.cat.segments.go index 255fb8ff4c..a535adae1b 100755 --- a/esapi/api.cat.segments.go +++ b/esapi/api.cat.segments.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -43,6 +44,8 @@ type CatSegmentsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -119,6 +122,18 @@ func (r CatSegmentsRequest) Do(ctx context.Context, transport Transport) (*Respo req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -232,3 +247,16 @@ func (f CatSegments) WithFilterPath(v ...string) func(*CatSegmentsRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatSegments) WithHeader(h map[string]string) func(*CatSegmentsRequest) { + return func(r *CatSegmentsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.shards.go b/esapi/api.cat.shards.go index c96c852a22..4d2fe658a0 100755 --- a/esapi/api.cat.shards.go +++ b/esapi/api.cat.shards.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -46,6 +47,8 @@ type CatShardsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -130,6 +133,18 @@ func (r CatShardsRequest) Do(ctx context.Context, transport Transport) (*Respons req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -259,3 +274,16 @@ func (f CatShards) WithFilterPath(v ...string) func(*CatShardsRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatShards) WithHeader(h map[string]string) func(*CatShardsRequest) { + return func(r *CatShardsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.snapshots.go b/esapi/api.cat.snapshots.go index 47074af2d3..c59a736a34 100755 --- a/esapi/api.cat.snapshots.go +++ b/esapi/api.cat.snapshots.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -45,6 +46,8 @@ type CatSnapshotsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -125,6 +128,18 @@ func (r CatSnapshotsRequest) Do(ctx context.Context, transport Transport) (*Resp req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -246,3 +261,16 @@ func (f CatSnapshots) WithFilterPath(v ...string) func(*CatSnapshotsRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatSnapshots) WithHeader(h map[string]string) func(*CatSnapshotsRequest) { + return func(r *CatSnapshotsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.tasks.go b/esapi/api.cat.tasks.go index 933db86044..af27a07953 100755 --- a/esapi/api.cat.tasks.go +++ b/esapi/api.cat.tasks.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -44,6 +45,8 @@ type CatTasksRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -125,6 +128,18 @@ func (r CatTasksRequest) Do(ctx context.Context, transport Transport) (*Response req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -254,3 +269,16 @@ func (f CatTasks) WithFilterPath(v ...string) func(*CatTasksRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatTasks) WithHeader(h map[string]string) func(*CatTasksRequest) { + return func(r *CatTasksRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.templates.go b/esapi/api.cat.templates.go index bd301b33f9..8ff7684cc2 100755 --- a/esapi/api.cat.templates.go +++ b/esapi/api.cat.templates.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -45,6 +46,8 @@ type CatTemplatesRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -125,6 +128,18 @@ func (r CatTemplatesRequest) Do(ctx context.Context, transport Transport) (*Resp req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -246,3 +261,16 @@ func (f CatTemplates) WithFilterPath(v ...string) func(*CatTemplatesRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatTemplates) WithHeader(h map[string]string) func(*CatTemplatesRequest) { + return func(r *CatTemplatesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cat.thread_pool.go b/esapi/api.cat.thread_pool.go index 569fa306ac..3f5eea66b2 100755 --- a/esapi/api.cat.thread_pool.go +++ b/esapi/api.cat.thread_pool.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -47,6 +48,8 @@ type CatThreadPoolRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -131,6 +134,18 @@ func (r CatThreadPoolRequest) Do(ctx context.Context, transport Transport) (*Res req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -260,3 +275,16 @@ func (f CatThreadPool) WithFilterPath(v ...string) func(*CatThreadPoolRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f CatThreadPool) WithHeader(h map[string]string) func(*CatThreadPoolRequest) { + return func(r *CatThreadPoolRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.clear_scroll.go b/esapi/api.clear_scroll.go index 469704a23a..a035da603f 100755 --- a/esapi/api.clear_scroll.go +++ b/esapi/api.clear_scroll.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strings" ) @@ -38,6 +39,8 @@ type ClearScrollRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -94,6 +97,18 @@ func (r ClearScrollRequest) Do(ctx context.Context, transport Transport) (*Respo req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -167,3 +182,16 @@ func (f ClearScroll) WithFilterPath(v ...string) func(*ClearScrollRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f ClearScroll) WithHeader(h map[string]string) func(*ClearScrollRequest) { + return func(r *ClearScrollRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cluster.allocation_explain.go b/esapi/api.cluster.allocation_explain.go index 4fdd4d1acd..d95805ff3e 100755 --- a/esapi/api.cluster.allocation_explain.go +++ b/esapi/api.cluster.allocation_explain.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" ) @@ -40,6 +41,8 @@ type ClusterAllocationExplainRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -97,6 +100,18 @@ func (r ClusterAllocationExplainRequest) Do(ctx context.Context, transport Trans req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -178,3 +193,16 @@ func (f ClusterAllocationExplain) WithFilterPath(v ...string) func(*ClusterAlloc r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f ClusterAllocationExplain) WithHeader(h map[string]string) func(*ClusterAllocationExplainRequest) { + return func(r *ClusterAllocationExplainRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cluster.get_settings.go b/esapi/api.cluster.get_settings.go index cfdcb5c397..0e268ae1d9 100755 --- a/esapi/api.cluster.get_settings.go +++ b/esapi/api.cluster.get_settings.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -40,6 +41,8 @@ type ClusterGetSettingsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -101,6 +104,18 @@ func (r ClusterGetSettingsRequest) Do(ctx context.Context, transport Transport) req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -190,3 +205,16 @@ func (f ClusterGetSettings) WithFilterPath(v ...string) func(*ClusterGetSettings r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f ClusterGetSettings) WithHeader(h map[string]string) func(*ClusterGetSettingsRequest) { + return func(r *ClusterGetSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cluster.health.go b/esapi/api.cluster.health.go index ce940ec753..ee5aabf162 100755 --- a/esapi/api.cluster.health.go +++ b/esapi/api.cluster.health.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -32,6 +33,7 @@ type ClusterHealth func(o ...func(*ClusterHealthRequest)) (*Response, error) type ClusterHealthRequest struct { Index []string + ExpandWildcards string Level string Local *bool MasterTimeout time.Duration @@ -48,6 +50,8 @@ type ClusterHealthRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -74,6 +78,10 @@ func (r ClusterHealthRequest) Do(ctx context.Context, transport Transport) (*Res params = make(map[string]string) + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + if r.Level != "" { params["level"] = r.Level } @@ -140,6 +148,18 @@ func (r ClusterHealthRequest) Do(ctx context.Context, transport Transport) (*Res req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -174,6 +194,14 @@ func (f ClusterHealth) WithIndex(v ...string) func(*ClusterHealthRequest) { } } +// WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// +func (f ClusterHealth) WithExpandWildcards(v string) func(*ClusterHealthRequest) { + return func(r *ClusterHealthRequest) { + r.ExpandWildcards = v + } +} + // WithLevel - specify the level of detail for returned information. // func (f ClusterHealth) WithLevel(v string) func(*ClusterHealthRequest) { @@ -285,3 +313,16 @@ func (f ClusterHealth) WithFilterPath(v ...string) func(*ClusterHealthRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f ClusterHealth) WithHeader(h map[string]string) func(*ClusterHealthRequest) { + return func(r *ClusterHealthRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cluster.pending_tasks.go b/esapi/api.cluster.pending_tasks.go index c1c56fe693..6d2ce2700d 100755 --- a/esapi/api.cluster.pending_tasks.go +++ b/esapi/api.cluster.pending_tasks.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -39,6 +40,8 @@ type ClusterPendingTasksRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -92,6 +95,18 @@ func (r ClusterPendingTasksRequest) Do(ctx context.Context, transport Transport) req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -165,3 +180,16 @@ func (f ClusterPendingTasks) WithFilterPath(v ...string) func(*ClusterPendingTas r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f ClusterPendingTasks) WithHeader(h map[string]string) func(*ClusterPendingTasksRequest) { + return func(r *ClusterPendingTasksRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cluster.put_settings.go b/esapi/api.cluster.put_settings.go index 4fbc95c045..1bf4d4a72c 100755 --- a/esapi/api.cluster.put_settings.go +++ b/esapi/api.cluster.put_settings.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -42,6 +43,8 @@ type ClusterPutSettingsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -103,6 +106,18 @@ func (r ClusterPutSettingsRequest) Do(ctx context.Context, transport Transport) req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -184,3 +199,16 @@ func (f ClusterPutSettings) WithFilterPath(v ...string) func(*ClusterPutSettings r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f ClusterPutSettings) WithHeader(h map[string]string) func(*ClusterPutSettingsRequest) { + return func(r *ClusterPutSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cluster.remote_info.go b/esapi/api.cluster.remote_info.go index 4e6b47e9b0..776abbba16 100755 --- a/esapi/api.cluster.remote_info.go +++ b/esapi/api.cluster.remote_info.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" ) @@ -33,6 +34,8 @@ type ClusterRemoteInfoRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -78,6 +81,18 @@ func (r ClusterRemoteInfoRequest) Do(ctx context.Context, transport Transport) ( req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -135,3 +150,16 @@ func (f ClusterRemoteInfo) WithFilterPath(v ...string) func(*ClusterRemoteInfoRe r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f ClusterRemoteInfo) WithHeader(h map[string]string) func(*ClusterRemoteInfoRequest) { + return func(r *ClusterRemoteInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cluster.reroute.go b/esapi/api.cluster.reroute.go index 702dcf2d89..858042ec14 100755 --- a/esapi/api.cluster.reroute.go +++ b/esapi/api.cluster.reroute.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -45,6 +46,8 @@ type ClusterRerouteRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -118,6 +121,18 @@ func (r ClusterRerouteRequest) Do(ctx context.Context, transport Transport) (*Re req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -231,3 +246,16 @@ func (f ClusterReroute) WithFilterPath(v ...string) func(*ClusterRerouteRequest) r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f ClusterReroute) WithHeader(h map[string]string) func(*ClusterRerouteRequest) { + return func(r *ClusterRerouteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cluster.state.go b/esapi/api.cluster.state.go index a9ce547429..ac00afc01e 100755 --- a/esapi/api.cluster.state.go +++ b/esapi/api.cluster.state.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -48,6 +49,8 @@ type ClusterStateRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -136,6 +139,18 @@ func (r ClusterStateRequest) Do(ctx context.Context, transport Transport) (*Resp req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -273,3 +288,16 @@ func (f ClusterState) WithFilterPath(v ...string) func(*ClusterStateRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f ClusterState) WithHeader(h map[string]string) func(*ClusterStateRequest) { + return func(r *ClusterStateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.cluster.stats.go b/esapi/api.cluster.stats.go index 43e19a57ff..88fe9413c2 100755 --- a/esapi/api.cluster.stats.go +++ b/esapi/api.cluster.stats.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -40,6 +41,8 @@ type ClusterStatsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -102,6 +105,18 @@ func (r ClusterStatsRequest) Do(ctx context.Context, transport Transport) (*Resp req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -183,3 +198,16 @@ func (f ClusterStats) WithFilterPath(v ...string) func(*ClusterStatsRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f ClusterStats) WithHeader(h map[string]string) func(*ClusterStatsRequest) { + return func(r *ClusterStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.count.go b/esapi/api.count.go index 54a9fe6d8b..0ce54a5883 100755 --- a/esapi/api.count.go +++ b/esapi/api.count.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" ) @@ -55,6 +56,8 @@ type CountRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -169,6 +172,18 @@ func (r CountRequest) Do(ctx context.Context, transport Transport) (*Response, e req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -362,3 +377,16 @@ func (f Count) WithFilterPath(v ...string) func(*CountRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Count) WithHeader(h map[string]string) func(*CountRequest) { + return func(r *CountRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.create.go b/esapi/api.create.go index de6b081e6a..74d13ef341 100755 --- a/esapi/api.create.go +++ b/esapi/api.create.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -39,7 +40,6 @@ type CreateRequest struct { Body io.Reader - Parent string Pipeline string Refresh string Routing string @@ -53,6 +53,8 @@ type CreateRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -83,10 +85,6 @@ func (r CreateRequest) Do(ctx context.Context, transport Transport) (*Response, params = make(map[string]string) - if r.Parent != "" { - params["parent"] = r.Parent - } - if r.Pipeline != "" { params["pipeline"] = r.Pipeline } @@ -145,6 +143,18 @@ func (r CreateRequest) Do(ctx context.Context, transport Transport) (*Response, req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -179,14 +189,6 @@ func (f Create) WithDocumentType(v string) func(*CreateRequest) { } } -// WithParent - ID of the parent document. -// -func (f Create) WithParent(v string) func(*CreateRequest) { - return func(r *CreateRequest) { - r.Parent = v - } -} - // WithPipeline - the pipeline ID to preprocess incoming documents with. // func (f Create) WithPipeline(v string) func(*CreateRequest) { @@ -274,3 +276,16 @@ func (f Create) WithFilterPath(v ...string) func(*CreateRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Create) WithHeader(h map[string]string) func(*CreateRequest) { + return func(r *CreateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.delete.go b/esapi/api.delete.go index a1d90d89e2..b21c1be807 100755 --- a/esapi/api.delete.go +++ b/esapi/api.delete.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -36,7 +37,6 @@ type DeleteRequest struct { IfPrimaryTerm *int IfSeqNo *int - Parent string Refresh string Routing string Timeout time.Duration @@ -49,6 +49,8 @@ type DeleteRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -87,10 +89,6 @@ func (r DeleteRequest) Do(ctx context.Context, transport Transport) (*Response, params["if_seq_no"] = strconv.FormatInt(int64(*r.IfSeqNo), 10) } - if r.Parent != "" { - params["parent"] = r.Parent - } - if r.Refresh != "" { params["refresh"] = r.Refresh } @@ -141,6 +139,18 @@ func (r DeleteRequest) Do(ctx context.Context, transport Transport) (*Response, req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -191,14 +201,6 @@ func (f Delete) WithIfSeqNo(v int) func(*DeleteRequest) { } } -// WithParent - ID of parent document. -// -func (f Delete) WithParent(v string) func(*DeleteRequest) { - return func(r *DeleteRequest) { - r.Parent = v - } -} - // WithRefresh - if `true` then refresh the effected 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.. // func (f Delete) WithRefresh(v string) func(*DeleteRequest) { @@ -278,3 +280,16 @@ func (f Delete) WithFilterPath(v ...string) func(*DeleteRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Delete) WithHeader(h map[string]string) func(*DeleteRequest) { + return func(r *DeleteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.delete_by_query.go b/esapi/api.delete_by_query.go index a47b065cf9..4b884bc655 100755 --- a/esapi/api.delete_by_query.go +++ b/esapi/api.delete_by_query.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -46,6 +47,7 @@ type DeleteByQueryRequest struct { From *int IgnoreUnavailable *bool Lenient *bool + MaxDocs *int Preference string Query string Refresh *bool @@ -74,6 +76,8 @@ type DeleteByQueryRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -140,6 +144,10 @@ func (r DeleteByQueryRequest) Do(ctx context.Context, transport Transport) (*Res params["lenient"] = strconv.FormatBool(*r.Lenient) } + if r.MaxDocs != nil { + params["max_docs"] = strconv.FormatInt(int64(*r.MaxDocs), 10) + } + if r.Preference != "" { params["preference"] = r.Preference } @@ -258,6 +266,18 @@ func (r DeleteByQueryRequest) Do(ctx context.Context, transport Transport) (*Res req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -372,6 +392,14 @@ func (f DeleteByQuery) WithLenient(v bool) func(*DeleteByQueryRequest) { } } +// WithMaxDocs - maximum number of documents to process (default: all documents). +// +func (f DeleteByQuery) WithMaxDocs(v int) func(*DeleteByQueryRequest) { + return func(r *DeleteByQueryRequest) { + r.MaxDocs = &v + } +} + // WithPreference - specify the node or shard the operation should be performed on (default: random). // func (f DeleteByQuery) WithPreference(v string) func(*DeleteByQueryRequest) { @@ -452,7 +480,7 @@ func (f DeleteByQuery) WithSearchType(v string) func(*DeleteByQueryRequest) { } } -// WithSize - number of hits to return (default: 10). +// WithSize - deprecated, please use `max_docs` instead. // func (f DeleteByQuery) WithSize(v int) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { @@ -579,3 +607,16 @@ func (f DeleteByQuery) WithFilterPath(v ...string) func(*DeleteByQueryRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f DeleteByQuery) WithHeader(h map[string]string) func(*DeleteByQueryRequest) { + return func(r *DeleteByQueryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.delete_by_query_rethrottle.go b/esapi/api.delete_by_query_rethrottle.go index d2b9520462..bce7d1e35a 100755 --- a/esapi/api.delete_by_query_rethrottle.go +++ b/esapi/api.delete_by_query_rethrottle.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -38,6 +39,8 @@ type DeleteByQueryRethrottleRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -92,6 +95,18 @@ func (r DeleteByQueryRethrottleRequest) Do(ctx context.Context, transport Transp req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -157,3 +172,16 @@ func (f DeleteByQueryRethrottle) WithFilterPath(v ...string) func(*DeleteByQuery r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f DeleteByQueryRethrottle) WithHeader(h map[string]string) func(*DeleteByQueryRethrottleRequest) { + return func(r *DeleteByQueryRethrottleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.delete_script.go b/esapi/api.delete_script.go index 7c96281181..ee1cf07ece 100755 --- a/esapi/api.delete_script.go +++ b/esapi/api.delete_script.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" "time" ) @@ -39,6 +40,8 @@ type DeleteScriptRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -95,6 +98,18 @@ func (r DeleteScriptRequest) Do(ctx context.Context, transport Transport) (*Resp req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -168,3 +183,16 @@ func (f DeleteScript) WithFilterPath(v ...string) func(*DeleteScriptRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f DeleteScript) WithHeader(h map[string]string) func(*DeleteScriptRequest) { + return func(r *DeleteScriptRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.exists.go b/esapi/api.exists.go index 24cd9518d7..dca47ac034 100755 --- a/esapi/api.exists.go +++ b/esapi/api.exists.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -33,7 +34,6 @@ type ExistsRequest struct { DocumentType string DocumentID string - Parent string Preference string Realtime *bool Refresh *bool @@ -50,6 +50,8 @@ type ExistsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -80,10 +82,6 @@ func (r ExistsRequest) Do(ctx context.Context, transport Transport) (*Response, params = make(map[string]string) - if r.Parent != "" { - params["parent"] = r.Parent - } - if r.Preference != "" { params["preference"] = r.Preference } @@ -150,6 +148,18 @@ func (r ExistsRequest) Do(ctx context.Context, transport Transport) (*Response, req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -184,14 +194,6 @@ func (f Exists) WithDocumentType(v string) func(*ExistsRequest) { } } -// WithParent - the ID of the parent document. -// -func (f Exists) WithParent(v string) func(*ExistsRequest) { - return func(r *ExistsRequest) { - r.Parent = v - } -} - // WithPreference - specify the node or shard the operation should be performed on (default: random). // func (f Exists) WithPreference(v string) func(*ExistsRequest) { @@ -303,3 +305,16 @@ func (f Exists) WithFilterPath(v ...string) func(*ExistsRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Exists) WithHeader(h map[string]string) func(*ExistsRequest) { + return func(r *ExistsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.exists_source.go b/esapi/api.exists_source.go index 3dd7de738d..d423f8e66f 100755 --- a/esapi/api.exists_source.go +++ b/esapi/api.exists_source.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -33,7 +34,6 @@ type ExistsSourceRequest struct { DocumentType string DocumentID string - Parent string Preference string Realtime *bool Refresh *bool @@ -49,6 +49,8 @@ type ExistsSourceRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -77,10 +79,6 @@ func (r ExistsSourceRequest) Do(ctx context.Context, transport Transport) (*Resp params = make(map[string]string) - if r.Parent != "" { - params["parent"] = r.Parent - } - if r.Preference != "" { params["preference"] = r.Preference } @@ -143,6 +141,18 @@ func (r ExistsSourceRequest) Do(ctx context.Context, transport Transport) (*Resp req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -177,14 +187,6 @@ func (f ExistsSource) WithDocumentType(v string) func(*ExistsSourceRequest) { } } -// WithParent - the ID of the parent document. -// -func (f ExistsSource) WithParent(v string) func(*ExistsSourceRequest) { - return func(r *ExistsSourceRequest) { - r.Parent = v - } -} - // WithPreference - specify the node or shard the operation should be performed on (default: random). // func (f ExistsSource) WithPreference(v string) func(*ExistsSourceRequest) { @@ -288,3 +290,16 @@ func (f ExistsSource) WithFilterPath(v ...string) func(*ExistsSourceRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f ExistsSource) WithHeader(h map[string]string) func(*ExistsSourceRequest) { + return func(r *ExistsSourceRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.explain.go b/esapi/api.explain.go index d0e8617e6e..7362564c71 100755 --- a/esapi/api.explain.go +++ b/esapi/api.explain.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" ) @@ -41,7 +42,6 @@ type ExplainRequest struct { DefaultOperator string Df string Lenient *bool - Parent string Preference string Query string Routing string @@ -55,6 +55,8 @@ type ExplainRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -107,10 +109,6 @@ func (r ExplainRequest) Do(ctx context.Context, transport Transport) (*Response, params["lenient"] = strconv.FormatBool(*r.Lenient) } - if r.Parent != "" { - params["parent"] = r.Parent - } - if r.Preference != "" { params["preference"] = r.Preference } @@ -169,6 +167,18 @@ func (r ExplainRequest) Do(ctx context.Context, transport Transport) (*Response, req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -251,14 +261,6 @@ func (f Explain) WithLenient(v bool) func(*ExplainRequest) { } } -// WithParent - the ID of the parent document. -// -func (f Explain) WithParent(v string) func(*ExplainRequest) { - return func(r *ExplainRequest) { - r.Parent = v - } -} - // WithPreference - specify the node or shard the operation should be performed on (default: random). // func (f Explain) WithPreference(v string) func(*ExplainRequest) { @@ -346,3 +348,16 @@ func (f Explain) WithFilterPath(v ...string) func(*ExplainRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Explain) WithHeader(h map[string]string) func(*ExplainRequest) { + return func(r *ExplainRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.field_caps.go b/esapi/api.field_caps.go index 3938ec478b..88f3f454da 100755 --- a/esapi/api.field_caps.go +++ b/esapi/api.field_caps.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -35,12 +36,15 @@ type FieldCapsRequest struct { ExpandWildcards string Fields []string IgnoreUnavailable *bool + IncludeUnmapped *bool Pretty bool Human bool ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -81,6 +85,10 @@ func (r FieldCapsRequest) Do(ctx context.Context, transport Transport) (*Respons params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) } + if r.IncludeUnmapped != nil { + params["include_unmapped"] = strconv.FormatBool(*r.IncludeUnmapped) + } + if r.Pretty { params["pretty"] = "true" } @@ -107,6 +115,18 @@ func (r FieldCapsRequest) Do(ctx context.Context, transport Transport) (*Respons req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -173,6 +193,14 @@ func (f FieldCaps) WithIgnoreUnavailable(v bool) func(*FieldCapsRequest) { } } +// WithIncludeUnmapped - indicates whether unmapped fields should be included in the response.. +// +func (f FieldCaps) WithIncludeUnmapped(v bool) func(*FieldCapsRequest) { + return func(r *FieldCapsRequest) { + r.IncludeUnmapped = &v + } +} + // WithPretty makes the response body pretty-printed. // func (f FieldCaps) WithPretty() func(*FieldCapsRequest) { @@ -204,3 +232,16 @@ func (f FieldCaps) WithFilterPath(v ...string) func(*FieldCapsRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f FieldCaps) WithHeader(h map[string]string) func(*FieldCapsRequest) { + return func(r *FieldCapsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.get.go b/esapi/api.get.go index 2b78eee3b6..d0dc3eb2b2 100755 --- a/esapi/api.get.go +++ b/esapi/api.get.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -33,15 +34,12 @@ type GetRequest struct { DocumentType string DocumentID string - Parent string Preference string Realtime *bool Refresh *bool Routing string Source []string - SourceExclude []string SourceExcludes []string - SourceInclude []string SourceIncludes []string StoredFields []string Version *int @@ -52,6 +50,8 @@ type GetRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -82,10 +82,6 @@ func (r GetRequest) Do(ctx context.Context, transport Transport) (*Response, err params = make(map[string]string) - if r.Parent != "" { - params["parent"] = r.Parent - } - if r.Preference != "" { params["preference"] = r.Preference } @@ -106,18 +102,10 @@ func (r GetRequest) Do(ctx context.Context, transport Transport) (*Response, err params["_source"] = strings.Join(r.Source, ",") } - if len(r.SourceExclude) > 0 { - params["_source_exclude"] = strings.Join(r.SourceExclude, ",") - } - if len(r.SourceExcludes) > 0 { params["_source_excludes"] = strings.Join(r.SourceExcludes, ",") } - if len(r.SourceInclude) > 0 { - params["_source_include"] = strings.Join(r.SourceInclude, ",") - } - if len(r.SourceIncludes) > 0 { params["_source_includes"] = strings.Join(r.SourceIncludes, ",") } @@ -160,6 +148,18 @@ func (r GetRequest) Do(ctx context.Context, transport Transport) (*Response, err req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -194,14 +194,6 @@ func (f Get) WithDocumentType(v string) func(*GetRequest) { } } -// WithParent - the ID of the parent document. -// -func (f Get) WithParent(v string) func(*GetRequest) { - return func(r *GetRequest) { - r.Parent = v - } -} - // WithPreference - specify the node or shard the operation should be performed on (default: random). // func (f Get) WithPreference(v string) func(*GetRequest) { @@ -242,14 +234,6 @@ func (f Get) WithSource(v ...string) func(*GetRequest) { } } -// WithSourceExclude - a list of fields to exclude from the returned _source field. -// -func (f Get) WithSourceExclude(v ...string) func(*GetRequest) { - return func(r *GetRequest) { - r.SourceExclude = v - } -} - // WithSourceExcludes - a list of fields to exclude from the returned _source field. // func (f Get) WithSourceExcludes(v ...string) func(*GetRequest) { @@ -258,14 +242,6 @@ func (f Get) WithSourceExcludes(v ...string) func(*GetRequest) { } } -// WithSourceInclude - a list of fields to extract and return from the _source field. -// -func (f Get) WithSourceInclude(v ...string) func(*GetRequest) { - return func(r *GetRequest) { - r.SourceInclude = v - } -} - // WithSourceIncludes - a list of fields to extract and return from the _source field. // func (f Get) WithSourceIncludes(v ...string) func(*GetRequest) { @@ -329,3 +305,16 @@ func (f Get) WithFilterPath(v ...string) func(*GetRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Get) WithHeader(h map[string]string) func(*GetRequest) { + return func(r *GetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.get_script.go b/esapi/api.get_script.go index be395e4261..b4a7786d17 100755 --- a/esapi/api.get_script.go +++ b/esapi/api.get_script.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" "time" ) @@ -38,6 +39,8 @@ type GetScriptRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -90,6 +93,18 @@ func (r GetScriptRequest) Do(ctx context.Context, transport Transport) (*Respons req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -155,3 +170,16 @@ func (f GetScript) WithFilterPath(v ...string) func(*GetScriptRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f GetScript) WithHeader(h map[string]string) func(*GetScriptRequest) { + return func(r *GetScriptRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.get_source.go b/esapi/api.get_source.go index e1f705d1d6..fedd41a3b1 100755 --- a/esapi/api.get_source.go +++ b/esapi/api.get_source.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -33,7 +34,6 @@ type GetSourceRequest struct { DocumentType string DocumentID string - Parent string Preference string Realtime *bool Refresh *bool @@ -49,6 +49,8 @@ type GetSourceRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -81,10 +83,6 @@ func (r GetSourceRequest) Do(ctx context.Context, transport Transport) (*Respons params = make(map[string]string) - if r.Parent != "" { - params["parent"] = r.Parent - } - if r.Preference != "" { params["preference"] = r.Preference } @@ -147,6 +145,18 @@ func (r GetSourceRequest) Do(ctx context.Context, transport Transport) (*Respons req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -181,14 +191,6 @@ func (f GetSource) WithDocumentType(v string) func(*GetSourceRequest) { } } -// WithParent - the ID of the parent document. -// -func (f GetSource) WithParent(v string) func(*GetSourceRequest) { - return func(r *GetSourceRequest) { - r.Parent = v - } -} - // WithPreference - specify the node or shard the operation should be performed on (default: random). // func (f GetSource) WithPreference(v string) func(*GetSourceRequest) { @@ -292,3 +294,16 @@ func (f GetSource) WithFilterPath(v ...string) func(*GetSourceRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f GetSource) WithHeader(h map[string]string) func(*GetSourceRequest) { + return func(r *GetSourceRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.index.go b/esapi/api.index.go index 0dd17fabec..62442005e2 100755 --- a/esapi/api.index.go +++ b/esapi/api.index.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -40,7 +41,6 @@ type IndexRequest struct { IfPrimaryTerm *int IfSeqNo *int OpType string - Parent string Pipeline string Refresh string Routing string @@ -54,6 +54,8 @@ type IndexRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -100,10 +102,6 @@ func (r IndexRequest) Do(ctx context.Context, transport Transport) (*Response, e params["op_type"] = r.OpType } - if r.Parent != "" { - params["parent"] = r.Parent - } - if r.Pipeline != "" { params["pipeline"] = r.Pipeline } @@ -162,6 +160,18 @@ func (r IndexRequest) Do(ctx context.Context, transport Transport) (*Response, e req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -228,14 +238,6 @@ func (f Index) WithOpType(v string) func(*IndexRequest) { } } -// WithParent - ID of the parent document. -// -func (f Index) WithParent(v string) func(*IndexRequest) { - return func(r *IndexRequest) { - r.Parent = v - } -} - // WithPipeline - the pipeline ID to preprocess incoming documents with. // func (f Index) WithPipeline(v string) func(*IndexRequest) { @@ -323,3 +325,16 @@ func (f Index) WithFilterPath(v ...string) func(*IndexRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Index) WithHeader(h map[string]string) func(*IndexRequest) { + return func(r *IndexRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.analyze.go b/esapi/api.indices.analyze.go index 1f1322acfc..f48c706b42 100755 --- a/esapi/api.indices.analyze.go +++ b/esapi/api.indices.analyze.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strings" ) @@ -38,6 +39,8 @@ type IndicesAnalyzeRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -96,6 +99,18 @@ func (r IndicesAnalyzeRequest) Do(ctx context.Context, transport Transport) (*Re req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -169,3 +184,16 @@ func (f IndicesAnalyze) WithFilterPath(v ...string) func(*IndicesAnalyzeRequest) r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesAnalyze) WithHeader(h map[string]string) func(*IndicesAnalyzeRequest) { + return func(r *IndicesAnalyzeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.clear_cache.go b/esapi/api.indices.clear_cache.go index 3e02ea34f5..f95fcb8491 100755 --- a/esapi/api.indices.clear_cache.go +++ b/esapi/api.indices.clear_cache.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -44,6 +45,8 @@ type IndicesClearCacheRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -128,6 +131,18 @@ func (r IndicesClearCacheRequest) Do(ctx context.Context, transport Transport) ( req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -249,3 +264,16 @@ func (f IndicesClearCache) WithFilterPath(v ...string) func(*IndicesClearCacheRe r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesClearCache) WithHeader(h map[string]string) func(*IndicesClearCacheRequest) { + return func(r *IndicesClearCacheRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.close.go b/esapi/api.indices.close.go index 2913c25f39..57ed34ec77 100755 --- a/esapi/api.indices.close.go +++ b/esapi/api.indices.close.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -32,17 +33,20 @@ type IndicesClose func(index []string, o ...func(*IndicesCloseRequest)) (*Respon type IndicesCloseRequest struct { Index []string - AllowNoIndices *bool - ExpandWildcards string - IgnoreUnavailable *bool - MasterTimeout time.Duration - Timeout time.Duration + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + MasterTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string Pretty bool Human bool ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -85,6 +89,10 @@ func (r IndicesCloseRequest) Do(ctx context.Context, transport Transport) (*Resp params["timeout"] = formatDuration(r.Timeout) } + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + if r.Pretty { params["pretty"] = "true" } @@ -111,6 +119,18 @@ func (r IndicesCloseRequest) Do(ctx context.Context, transport Transport) (*Resp req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -177,6 +197,14 @@ func (f IndicesClose) WithTimeout(v time.Duration) func(*IndicesCloseRequest) { } } +// WithWaitForActiveShards - sets the number of active shards to wait for before the operation returns.. +// +func (f IndicesClose) WithWaitForActiveShards(v string) func(*IndicesCloseRequest) { + return func(r *IndicesCloseRequest) { + r.WaitForActiveShards = v + } +} + // WithPretty makes the response body pretty-printed. // func (f IndicesClose) WithPretty() func(*IndicesCloseRequest) { @@ -208,3 +236,16 @@ func (f IndicesClose) WithFilterPath(v ...string) func(*IndicesCloseRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesClose) WithHeader(h map[string]string) func(*IndicesCloseRequest) { + return func(r *IndicesCloseRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.create.go b/esapi/api.indices.create.go index e08801c876..1d78896163 100755 --- a/esapi/api.indices.create.go +++ b/esapi/api.indices.create.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -45,6 +46,8 @@ type IndicesCreateRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -111,6 +114,18 @@ func (r IndicesCreateRequest) Do(ctx context.Context, transport Transport) (*Res req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -208,3 +223,16 @@ func (f IndicesCreate) WithFilterPath(v ...string) func(*IndicesCreateRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesCreate) WithHeader(h map[string]string) func(*IndicesCreateRequest) { + return func(r *IndicesCreateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.delete.go b/esapi/api.indices.delete.go index 63c668a09d..b85f6e8b86 100755 --- a/esapi/api.indices.delete.go +++ b/esapi/api.indices.delete.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -43,6 +44,8 @@ type IndicesDeleteRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -109,6 +112,18 @@ func (r IndicesDeleteRequest) Do(ctx context.Context, transport Transport) (*Res req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -206,3 +221,16 @@ func (f IndicesDelete) WithFilterPath(v ...string) func(*IndicesDeleteRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesDelete) WithHeader(h map[string]string) func(*IndicesDeleteRequest) { + return func(r *IndicesDeleteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.delete_alias.go b/esapi/api.indices.delete_alias.go index 2c4791916f..56c9ef7610 100755 --- a/esapi/api.indices.delete_alias.go +++ b/esapi/api.indices.delete_alias.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" "time" ) @@ -41,6 +42,8 @@ type IndicesDeleteAliasRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -99,6 +102,18 @@ func (r IndicesDeleteAliasRequest) Do(ctx context.Context, transport Transport) req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -172,3 +187,16 @@ func (f IndicesDeleteAlias) WithFilterPath(v ...string) func(*IndicesDeleteAlias r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesDeleteAlias) WithHeader(h map[string]string) func(*IndicesDeleteAliasRequest) { + return func(r *IndicesDeleteAliasRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.delete_template.go b/esapi/api.indices.delete_template.go index c452312759..25faed6b80 100755 --- a/esapi/api.indices.delete_template.go +++ b/esapi/api.indices.delete_template.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" "time" ) @@ -39,6 +40,8 @@ type IndicesDeleteTemplateRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -95,6 +98,18 @@ func (r IndicesDeleteTemplateRequest) Do(ctx context.Context, transport Transpor req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -168,3 +183,16 @@ func (f IndicesDeleteTemplate) WithFilterPath(v ...string) func(*IndicesDeleteTe r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesDeleteTemplate) WithHeader(h map[string]string) func(*IndicesDeleteTemplateRequest) { + return func(r *IndicesDeleteTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.exists.go b/esapi/api.indices.exists.go index 07310f5a86..f744d8beec 100755 --- a/esapi/api.indices.exists.go +++ b/esapi/api.indices.exists.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -43,6 +44,8 @@ type IndicesExistsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -113,6 +116,18 @@ func (r IndicesExistsRequest) Do(ctx context.Context, transport Transport) (*Res req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -218,3 +233,16 @@ func (f IndicesExists) WithFilterPath(v ...string) func(*IndicesExistsRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesExists) WithHeader(h map[string]string) func(*IndicesExistsRequest) { + return func(r *IndicesExistsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.exists_alias.go b/esapi/api.indices.exists_alias.go index 5852fbee24..228e3fc210 100755 --- a/esapi/api.indices.exists_alias.go +++ b/esapi/api.indices.exists_alias.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -43,6 +44,8 @@ type IndicesExistsAliasRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -111,6 +114,18 @@ func (r IndicesExistsAliasRequest) Do(ctx context.Context, transport Transport) req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -208,3 +223,16 @@ func (f IndicesExistsAlias) WithFilterPath(v ...string) func(*IndicesExistsAlias r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesExistsAlias) WithHeader(h map[string]string) func(*IndicesExistsAliasRequest) { + return func(r *IndicesExistsAliasRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.exists_template.go b/esapi/api.indices.exists_template.go index b6cda49c0b..995d9eeefd 100755 --- a/esapi/api.indices.exists_template.go +++ b/esapi/api.indices.exists_template.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -41,6 +42,8 @@ type IndicesExistsTemplateRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -101,6 +104,18 @@ func (r IndicesExistsTemplateRequest) Do(ctx context.Context, transport Transpor req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -182,3 +197,16 @@ func (f IndicesExistsTemplate) WithFilterPath(v ...string) func(*IndicesExistsTe r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesExistsTemplate) WithHeader(h map[string]string) func(*IndicesExistsTemplateRequest) { + return func(r *IndicesExistsTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.exists_type.go b/esapi/api.indices.exists_type.go index 0c8ea9c8bc..b3eea0f71f 100755 --- a/esapi/api.indices.exists_type.go +++ b/esapi/api.indices.exists_type.go @@ -1,16 +1,17 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) -func newIndicesExistsTypeFunc(t Transport) IndicesExistsType { - return func(index []string, o ...func(*IndicesExistsTypeRequest)) (*Response, error) { - var r = IndicesExistsTypeRequest{Index: index} +func newIndicesExistsDocumentTypeFunc(t Transport) IndicesExistsDocumentType { + return func(index []string, o ...func(*IndicesExistsDocumentTypeRequest)) (*Response, error) { + var r = IndicesExistsDocumentTypeRequest{Index: index} for _, f := range o { f(&r) } @@ -20,15 +21,15 @@ func newIndicesExistsTypeFunc(t Transport) IndicesExistsType { // ----- API Definition ------------------------------------------------------- -// IndicesExistsType returns information about whether a particular document type exists. (DEPRECATED) +// IndicesExistsDocumentType returns information about whether a particular document type exists. (DEPRECATED) // // See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html. // -type IndicesExistsType func(index []string, o ...func(*IndicesExistsTypeRequest)) (*Response, error) +type IndicesExistsDocumentType func(index []string, o ...func(*IndicesExistsDocumentTypeRequest)) (*Response, error) -// IndicesExistsTypeRequest configures the Indices Exists Type API request. +// IndicesExistsDocumentTypeRequest configures the Indices Exists Type API request. // -type IndicesExistsTypeRequest struct { +type IndicesExistsDocumentTypeRequest struct { Index []string DocumentType []string @@ -42,12 +43,14 @@ type IndicesExistsTypeRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } // Do executes the request and returns response or error. // -func (r IndicesExistsTypeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { +func (r IndicesExistsDocumentTypeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string path strings.Builder @@ -108,6 +111,18 @@ func (r IndicesExistsTypeRequest) Do(ctx context.Context, transport Transport) ( req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -128,80 +143,93 @@ func (r IndicesExistsTypeRequest) Do(ctx context.Context, transport Transport) ( // WithContext sets the request context. // -func (f IndicesExistsType) WithContext(v context.Context) func(*IndicesExistsTypeRequest) { - return func(r *IndicesExistsTypeRequest) { +func (f IndicesExistsDocumentType) WithContext(v context.Context) func(*IndicesExistsDocumentTypeRequest) { + return func(r *IndicesExistsDocumentTypeRequest) { r.ctx = v } } // WithDocumentType - a list of document types to check. // -func (f IndicesExistsType) WithDocumentType(v ...string) func(*IndicesExistsTypeRequest) { - return func(r *IndicesExistsTypeRequest) { +func (f IndicesExistsDocumentType) WithDocumentType(v ...string) func(*IndicesExistsDocumentTypeRequest) { + return func(r *IndicesExistsDocumentTypeRequest) { r.DocumentType = v } } // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). // -func (f IndicesExistsType) WithAllowNoIndices(v bool) func(*IndicesExistsTypeRequest) { - return func(r *IndicesExistsTypeRequest) { +func (f IndicesExistsDocumentType) WithAllowNoIndices(v bool) func(*IndicesExistsDocumentTypeRequest) { + return func(r *IndicesExistsDocumentTypeRequest) { r.AllowNoIndices = &v } } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. // -func (f IndicesExistsType) WithExpandWildcards(v string) func(*IndicesExistsTypeRequest) { - return func(r *IndicesExistsTypeRequest) { +func (f IndicesExistsDocumentType) WithExpandWildcards(v string) func(*IndicesExistsDocumentTypeRequest) { + return func(r *IndicesExistsDocumentTypeRequest) { r.ExpandWildcards = v } } // WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). // -func (f IndicesExistsType) WithIgnoreUnavailable(v bool) func(*IndicesExistsTypeRequest) { - return func(r *IndicesExistsTypeRequest) { +func (f IndicesExistsDocumentType) WithIgnoreUnavailable(v bool) func(*IndicesExistsDocumentTypeRequest) { + return func(r *IndicesExistsDocumentTypeRequest) { r.IgnoreUnavailable = &v } } // WithLocal - return local information, do not retrieve the state from master node (default: false). // -func (f IndicesExistsType) WithLocal(v bool) func(*IndicesExistsTypeRequest) { - return func(r *IndicesExistsTypeRequest) { +func (f IndicesExistsDocumentType) WithLocal(v bool) func(*IndicesExistsDocumentTypeRequest) { + return func(r *IndicesExistsDocumentTypeRequest) { r.Local = &v } } // WithPretty makes the response body pretty-printed. // -func (f IndicesExistsType) WithPretty() func(*IndicesExistsTypeRequest) { - return func(r *IndicesExistsTypeRequest) { +func (f IndicesExistsDocumentType) WithPretty() func(*IndicesExistsDocumentTypeRequest) { + return func(r *IndicesExistsDocumentTypeRequest) { r.Pretty = true } } // WithHuman makes statistical values human-readable. // -func (f IndicesExistsType) WithHuman() func(*IndicesExistsTypeRequest) { - return func(r *IndicesExistsTypeRequest) { +func (f IndicesExistsDocumentType) WithHuman() func(*IndicesExistsDocumentTypeRequest) { + return func(r *IndicesExistsDocumentTypeRequest) { r.Human = true } } // WithErrorTrace includes the stack trace for errors in the response body. // -func (f IndicesExistsType) WithErrorTrace() func(*IndicesExistsTypeRequest) { - return func(r *IndicesExistsTypeRequest) { +func (f IndicesExistsDocumentType) WithErrorTrace() func(*IndicesExistsDocumentTypeRequest) { + return func(r *IndicesExistsDocumentTypeRequest) { r.ErrorTrace = true } } // WithFilterPath filters the properties of the response body. // -func (f IndicesExistsType) WithFilterPath(v ...string) func(*IndicesExistsTypeRequest) { - return func(r *IndicesExistsTypeRequest) { +func (f IndicesExistsDocumentType) WithFilterPath(v ...string) func(*IndicesExistsDocumentTypeRequest) { + return func(r *IndicesExistsDocumentTypeRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesExistsDocumentType) WithHeader(h map[string]string) func(*IndicesExistsDocumentTypeRequest) { + return func(r *IndicesExistsDocumentTypeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.flush.go b/esapi/api.indices.flush.go index 353bc1ac8a..08ac5f97e7 100755 --- a/esapi/api.indices.flush.go +++ b/esapi/api.indices.flush.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -42,6 +43,8 @@ type IndicesFlushRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -112,6 +115,18 @@ func (r IndicesFlushRequest) Do(ctx context.Context, transport Transport) (*Resp req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -217,3 +232,16 @@ func (f IndicesFlush) WithFilterPath(v ...string) func(*IndicesFlushRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesFlush) WithHeader(h map[string]string) func(*IndicesFlushRequest) { + return func(r *IndicesFlushRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.flush_synced.go b/esapi/api.indices.flush_synced.go index 975d3d7203..948e432f46 100755 --- a/esapi/api.indices.flush_synced.go +++ b/esapi/api.indices.flush_synced.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -40,6 +41,8 @@ type IndicesFlushSyncedRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -104,6 +107,18 @@ func (r IndicesFlushSyncedRequest) Do(ctx context.Context, transport Transport) req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -193,3 +208,16 @@ func (f IndicesFlushSynced) WithFilterPath(v ...string) func(*IndicesFlushSynced r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesFlushSynced) WithHeader(h map[string]string) func(*IndicesFlushSyncedRequest) { + return func(r *IndicesFlushSyncedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.forcemerge.go b/esapi/api.indices.forcemerge.go index 71e8a0ebe0..6697a205fc 100755 --- a/esapi/api.indices.forcemerge.go +++ b/esapi/api.indices.forcemerge.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -43,6 +44,8 @@ type IndicesForcemergeRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -117,6 +120,18 @@ func (r IndicesForcemergeRequest) Do(ctx context.Context, transport Transport) ( req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -230,3 +245,16 @@ func (f IndicesForcemerge) WithFilterPath(v ...string) func(*IndicesForcemergeRe r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesForcemerge) WithHeader(h map[string]string) func(*IndicesForcemergeRequest) { + return func(r *IndicesForcemergeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.get.go b/esapi/api.indices.get.go index c37ece21de..38a92af5f2 100755 --- a/esapi/api.indices.get.go +++ b/esapi/api.indices.get.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -46,6 +47,8 @@ type IndicesGetRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -124,6 +127,18 @@ func (r IndicesGetRequest) Do(ctx context.Context, transport Transport) (*Respon req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -245,3 +260,16 @@ func (f IndicesGet) WithFilterPath(v ...string) func(*IndicesGetRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesGet) WithHeader(h map[string]string) func(*IndicesGetRequest) { + return func(r *IndicesGetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.get_alias.go b/esapi/api.indices.get_alias.go index d37ae7ebcd..efaf092109 100755 --- a/esapi/api.indices.get_alias.go +++ b/esapi/api.indices.get_alias.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -43,6 +44,8 @@ type IndicesGetAliasRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -113,6 +116,18 @@ func (r IndicesGetAliasRequest) Do(ctx context.Context, transport Transport) (*R req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -218,3 +233,16 @@ func (f IndicesGetAlias) WithFilterPath(v ...string) func(*IndicesGetAliasReques r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesGetAlias) WithHeader(h map[string]string) func(*IndicesGetAliasRequest) { + return func(r *IndicesGetAliasRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.get_field_mapping.go b/esapi/api.indices.get_field_mapping.go index 6ec0194ab1..c836db70e6 100755 --- a/esapi/api.indices.get_field_mapping.go +++ b/esapi/api.indices.get_field_mapping.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -46,6 +47,8 @@ type IndicesGetFieldMappingRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -128,6 +131,18 @@ func (r IndicesGetFieldMappingRequest) Do(ctx context.Context, transport Transpo req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -249,3 +264,16 @@ func (f IndicesGetFieldMapping) WithFilterPath(v ...string) func(*IndicesGetFiel r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesGetFieldMapping) WithHeader(h map[string]string) func(*IndicesGetFieldMappingRequest) { + return func(r *IndicesGetFieldMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.get_mapping.go b/esapi/api.indices.get_mapping.go index 423591046f..e06d158654 100755 --- a/esapi/api.indices.get_mapping.go +++ b/esapi/api.indices.get_mapping.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -45,6 +46,8 @@ type IndicesGetMappingRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -123,6 +126,18 @@ func (r IndicesGetMappingRequest) Do(ctx context.Context, transport Transport) ( req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -244,3 +259,16 @@ func (f IndicesGetMapping) WithFilterPath(v ...string) func(*IndicesGetMappingRe r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesGetMapping) WithHeader(h map[string]string) func(*IndicesGetMappingRequest) { + return func(r *IndicesGetMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.get_settings.go b/esapi/api.indices.get_settings.go index 923df5a54b..4b382d7f15 100755 --- a/esapi/api.indices.get_settings.go +++ b/esapi/api.indices.get_settings.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -47,6 +48,8 @@ type IndicesGetSettingsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -129,6 +132,18 @@ func (r IndicesGetSettingsRequest) Do(ctx context.Context, transport Transport) req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -258,3 +273,16 @@ func (f IndicesGetSettings) WithFilterPath(v ...string) func(*IndicesGetSettings r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesGetSettings) WithHeader(h map[string]string) func(*IndicesGetSettingsRequest) { + return func(r *IndicesGetSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.get_template.go b/esapi/api.indices.get_template.go index bc42005d5b..150c6902a9 100755 --- a/esapi/api.indices.get_template.go +++ b/esapi/api.indices.get_template.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -42,6 +43,8 @@ type IndicesGetTemplateRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -108,6 +111,18 @@ func (r IndicesGetTemplateRequest) Do(ctx context.Context, transport Transport) req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -205,3 +220,16 @@ func (f IndicesGetTemplate) WithFilterPath(v ...string) func(*IndicesGetTemplate r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesGetTemplate) WithHeader(h map[string]string) func(*IndicesGetTemplateRequest) { + return func(r *IndicesGetTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.get_upgrade.go b/esapi/api.indices.get_upgrade.go index 969fbbe2f6..237dda45d2 100755 --- a/esapi/api.indices.get_upgrade.go +++ b/esapi/api.indices.get_upgrade.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -40,6 +41,8 @@ type IndicesGetUpgradeRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -102,6 +105,18 @@ func (r IndicesGetUpgradeRequest) Do(ctx context.Context, transport Transport) ( req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -191,3 +206,16 @@ func (f IndicesGetUpgrade) WithFilterPath(v ...string) func(*IndicesGetUpgradeRe r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesGetUpgrade) WithHeader(h map[string]string) func(*IndicesGetUpgradeRequest) { + return func(r *IndicesGetUpgradeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.open.go b/esapi/api.indices.open.go index 8e47e6e8c1..1ab90efc66 100755 --- a/esapi/api.indices.open.go +++ b/esapi/api.indices.open.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -44,6 +45,8 @@ type IndicesOpenRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -116,6 +119,18 @@ func (r IndicesOpenRequest) Do(ctx context.Context, transport Transport) (*Respo req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -221,3 +236,16 @@ func (f IndicesOpen) WithFilterPath(v ...string) func(*IndicesOpenRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesOpen) WithHeader(h map[string]string) func(*IndicesOpenRequest) { + return func(r *IndicesOpenRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.put_alias.go b/esapi/api.indices.put_alias.go index b2cbd3e717..2d551cd59b 100755 --- a/esapi/api.indices.put_alias.go +++ b/esapi/api.indices.put_alias.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strings" "time" ) @@ -44,6 +45,8 @@ type IndicesPutAliasRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -106,6 +109,18 @@ func (r IndicesPutAliasRequest) Do(ctx context.Context, transport Transport) (*R req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -187,3 +202,16 @@ func (f IndicesPutAlias) WithFilterPath(v ...string) func(*IndicesPutAliasReques r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesPutAlias) WithHeader(h map[string]string) func(*IndicesPutAliasRequest) { + return func(r *IndicesPutAliasRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.put_mapping.go b/esapi/api.indices.put_mapping.go index 505cce298f..7cb0f4a3b6 100755 --- a/esapi/api.indices.put_mapping.go +++ b/esapi/api.indices.put_mapping.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -48,6 +49,8 @@ type IndicesPutMappingRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -130,6 +133,18 @@ func (r IndicesPutMappingRequest) Do(ctx context.Context, transport Transport) ( req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -251,3 +266,16 @@ func (f IndicesPutMapping) WithFilterPath(v ...string) func(*IndicesPutMappingRe r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesPutMapping) WithHeader(h map[string]string) func(*IndicesPutMappingRequest) { + return func(r *IndicesPutMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.put_settings.go b/esapi/api.indices.put_settings.go index b678831e9f..776207e77f 100755 --- a/esapi/api.indices.put_settings.go +++ b/esapi/api.indices.put_settings.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -48,6 +49,8 @@ type IndicesPutSettingsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -130,6 +133,18 @@ func (r IndicesPutSettingsRequest) Do(ctx context.Context, transport Transport) req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -251,3 +266,16 @@ func (f IndicesPutSettings) WithFilterPath(v ...string) func(*IndicesPutSettings r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesPutSettings) WithHeader(h map[string]string) func(*IndicesPutSettingsRequest) { + return func(r *IndicesPutSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.put_template.go b/esapi/api.indices.put_template.go index eb81319f7b..441e28a8e3 100755 --- a/esapi/api.indices.put_template.go +++ b/esapi/api.indices.put_template.go @@ -1,18 +1,19 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" ) func newIndicesPutTemplateFunc(t Transport) IndicesPutTemplate { - return func(body io.Reader, name string, o ...func(*IndicesPutTemplateRequest)) (*Response, error) { - var r = IndicesPutTemplateRequest{Body: body, Name: name} + return func(name string, body io.Reader, o ...func(*IndicesPutTemplateRequest)) (*Response, error) { + var r = IndicesPutTemplateRequest{Name: name, Body: body} for _, f := range o { f(&r) } @@ -26,7 +27,7 @@ func newIndicesPutTemplateFunc(t Transport) IndicesPutTemplate { // // See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. // -type IndicesPutTemplate func(body io.Reader, name string, o ...func(*IndicesPutTemplateRequest)) (*Response, error) +type IndicesPutTemplate func(name string, body io.Reader, o ...func(*IndicesPutTemplateRequest)) (*Response, error) // IndicesPutTemplateRequest configures the Indices Put Template API request. // @@ -47,6 +48,8 @@ type IndicesPutTemplateRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -123,6 +126,18 @@ func (r IndicesPutTemplateRequest) Do(ctx context.Context, transport Transport) req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -228,3 +243,16 @@ func (f IndicesPutTemplate) WithFilterPath(v ...string) func(*IndicesPutTemplate r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesPutTemplate) WithHeader(h map[string]string) func(*IndicesPutTemplateRequest) { + return func(r *IndicesPutTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.recovery.go b/esapi/api.indices.recovery.go index f081434a00..923e11c994 100755 --- a/esapi/api.indices.recovery.go +++ b/esapi/api.indices.recovery.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -39,6 +40,8 @@ type IndicesRecoveryRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -97,6 +100,18 @@ func (r IndicesRecoveryRequest) Do(ctx context.Context, transport Transport) (*R req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -178,3 +193,16 @@ func (f IndicesRecovery) WithFilterPath(v ...string) func(*IndicesRecoveryReques r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesRecovery) WithHeader(h map[string]string) func(*IndicesRecoveryRequest) { + return func(r *IndicesRecoveryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.refresh.go b/esapi/api.indices.refresh.go index 1a8a23cbfd..dcb2722a27 100755 --- a/esapi/api.indices.refresh.go +++ b/esapi/api.indices.refresh.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -40,6 +41,8 @@ type IndicesRefreshRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -102,6 +105,18 @@ func (r IndicesRefreshRequest) Do(ctx context.Context, transport Transport) (*Re req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -191,3 +206,16 @@ func (f IndicesRefresh) WithFilterPath(v ...string) func(*IndicesRefreshRequest) r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesRefresh) WithHeader(h map[string]string) func(*IndicesRefreshRequest) { + return func(r *IndicesRefreshRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.rollover.go b/esapi/api.indices.rollover.go index 54edc162b7..ceb0e735be 100755 --- a/esapi/api.indices.rollover.go +++ b/esapi/api.indices.rollover.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -48,6 +49,8 @@ type IndicesRolloverRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -124,6 +127,18 @@ func (r IndicesRolloverRequest) Do(ctx context.Context, transport Transport) (*R req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -237,3 +252,16 @@ func (f IndicesRollover) WithFilterPath(v ...string) func(*IndicesRolloverReques r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesRollover) WithHeader(h map[string]string) func(*IndicesRolloverRequest) { + return func(r *IndicesRolloverRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.segments.go b/esapi/api.indices.segments.go index 5b6478e0bf..e4be81606c 100755 --- a/esapi/api.indices.segments.go +++ b/esapi/api.indices.segments.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -41,6 +42,8 @@ type IndicesSegmentsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -107,6 +110,18 @@ func (r IndicesSegmentsRequest) Do(ctx context.Context, transport Transport) (*R req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -204,3 +219,16 @@ func (f IndicesSegments) WithFilterPath(v ...string) func(*IndicesSegmentsReques r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesSegments) WithHeader(h map[string]string) func(*IndicesSegmentsRequest) { + return func(r *IndicesSegmentsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.shard_stores.go b/esapi/api.indices.shard_stores.go index 052f23a82f..62ebd22225 100755 --- a/esapi/api.indices.shard_stores.go +++ b/esapi/api.indices.shard_stores.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -41,6 +42,8 @@ type IndicesShardStoresRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -107,6 +110,18 @@ func (r IndicesShardStoresRequest) Do(ctx context.Context, transport Transport) req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -204,3 +219,16 @@ func (f IndicesShardStores) WithFilterPath(v ...string) func(*IndicesShardStores r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesShardStores) WithHeader(h map[string]string) func(*IndicesShardStoresRequest) { + return func(r *IndicesShardStoresRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.shrink.go b/esapi/api.indices.shrink.go index 9da86dbd75..b81ab72065 100755 --- a/esapi/api.indices.shrink.go +++ b/esapi/api.indices.shrink.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -47,6 +48,8 @@ type IndicesShrinkRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -117,6 +120,18 @@ func (r IndicesShrinkRequest) Do(ctx context.Context, transport Transport) (*Res req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -214,3 +229,16 @@ func (f IndicesShrink) WithFilterPath(v ...string) func(*IndicesShrinkRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesShrink) WithHeader(h map[string]string) func(*IndicesShrinkRequest) { + return func(r *IndicesShrinkRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.split.go b/esapi/api.indices.split.go index 3196864bcc..b455f5effc 100755 --- a/esapi/api.indices.split.go +++ b/esapi/api.indices.split.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -47,6 +48,8 @@ type IndicesSplitRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -117,6 +120,18 @@ func (r IndicesSplitRequest) Do(ctx context.Context, transport Transport) (*Resp req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -214,3 +229,16 @@ func (f IndicesSplit) WithFilterPath(v ...string) func(*IndicesSplitRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesSplit) WithHeader(h map[string]string) func(*IndicesSplitRequest) { + return func(r *IndicesSplitRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.stats.go b/esapi/api.indices.stats.go index 23df02b1d7..c906dc525f 100755 --- a/esapi/api.indices.stats.go +++ b/esapi/api.indices.stats.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -34,10 +35,13 @@ type IndicesStatsRequest struct { Metric []string CompletionFields []string + ExpandWildcards string FielddataFields []string Fields []string + ForbidClosedIndices *bool Groups []string IncludeSegmentFileSizes *bool + IncludeUnloadedSegments *bool Level string Types []string @@ -46,6 +50,8 @@ type IndicesStatsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -78,6 +84,10 @@ func (r IndicesStatsRequest) Do(ctx context.Context, transport Transport) (*Resp params["completion_fields"] = strings.Join(r.CompletionFields, ",") } + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + if len(r.FielddataFields) > 0 { params["fielddata_fields"] = strings.Join(r.FielddataFields, ",") } @@ -86,6 +96,10 @@ func (r IndicesStatsRequest) Do(ctx context.Context, transport Transport) (*Resp params["fields"] = strings.Join(r.Fields, ",") } + if r.ForbidClosedIndices != nil { + params["forbid_closed_indices"] = strconv.FormatBool(*r.ForbidClosedIndices) + } + if len(r.Groups) > 0 { params["groups"] = strings.Join(r.Groups, ",") } @@ -94,6 +108,10 @@ func (r IndicesStatsRequest) Do(ctx context.Context, transport Transport) (*Resp params["include_segment_file_sizes"] = strconv.FormatBool(*r.IncludeSegmentFileSizes) } + if r.IncludeUnloadedSegments != nil { + params["include_unloaded_segments"] = strconv.FormatBool(*r.IncludeUnloadedSegments) + } + if r.Level != "" { params["level"] = r.Level } @@ -128,6 +146,18 @@ func (r IndicesStatsRequest) Do(ctx context.Context, transport Transport) (*Resp req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -178,6 +208,14 @@ func (f IndicesStats) WithCompletionFields(v ...string) func(*IndicesStatsReques } } +// WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// +func (f IndicesStats) WithExpandWildcards(v string) func(*IndicesStatsRequest) { + return func(r *IndicesStatsRequest) { + r.ExpandWildcards = v + } +} + // WithFielddataFields - a list of fields for `fielddata` index metric (supports wildcards). // func (f IndicesStats) WithFielddataFields(v ...string) func(*IndicesStatsRequest) { @@ -194,6 +232,14 @@ func (f IndicesStats) WithFields(v ...string) func(*IndicesStatsRequest) { } } +// WithForbidClosedIndices - if set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices. +// +func (f IndicesStats) WithForbidClosedIndices(v bool) func(*IndicesStatsRequest) { + return func(r *IndicesStatsRequest) { + r.ForbidClosedIndices = &v + } +} + // WithGroups - a list of search groups for `search` index metric. // func (f IndicesStats) WithGroups(v ...string) func(*IndicesStatsRequest) { @@ -210,6 +256,14 @@ func (f IndicesStats) WithIncludeSegmentFileSizes(v bool) func(*IndicesStatsRequ } } +// WithIncludeUnloadedSegments - if set to true segment stats will include stats for segments that are not currently loaded into memory. +// +func (f IndicesStats) WithIncludeUnloadedSegments(v bool) func(*IndicesStatsRequest) { + return func(r *IndicesStatsRequest) { + r.IncludeUnloadedSegments = &v + } +} + // WithLevel - return stats aggregated at cluster, index or shard level. // func (f IndicesStats) WithLevel(v string) func(*IndicesStatsRequest) { @@ -257,3 +311,16 @@ func (f IndicesStats) WithFilterPath(v ...string) func(*IndicesStatsRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesStats) WithHeader(h map[string]string) func(*IndicesStatsRequest) { + return func(r *IndicesStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.update_aliases.go b/esapi/api.indices.update_aliases.go index 37d510cabe..e70735ad68 100755 --- a/esapi/api.indices.update_aliases.go +++ b/esapi/api.indices.update_aliases.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strings" "time" ) @@ -40,6 +41,8 @@ type IndicesUpdateAliasesRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -97,6 +100,18 @@ func (r IndicesUpdateAliasesRequest) Do(ctx context.Context, transport Transport req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -170,3 +185,16 @@ func (f IndicesUpdateAliases) WithFilterPath(v ...string) func(*IndicesUpdateAli r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesUpdateAliases) WithHeader(h map[string]string) func(*IndicesUpdateAliasesRequest) { + return func(r *IndicesUpdateAliasesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.upgrade.go b/esapi/api.indices.upgrade.go index e6da5915c8..f1e5051cb0 100755 --- a/esapi/api.indices.upgrade.go +++ b/esapi/api.indices.upgrade.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -42,6 +43,8 @@ type IndicesUpgradeRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -112,6 +115,18 @@ func (r IndicesUpgradeRequest) Do(ctx context.Context, transport Transport) (*Re req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -217,3 +232,16 @@ func (f IndicesUpgrade) WithFilterPath(v ...string) func(*IndicesUpgradeRequest) r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesUpgrade) WithHeader(h map[string]string) func(*IndicesUpgradeRequest) { + return func(r *IndicesUpgradeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.validate_query.go b/esapi/api.indices.validate_query.go index 80ffed90f8..5c0f8f8cf5 100755 --- a/esapi/api.indices.validate_query.go +++ b/esapi/api.indices.validate_query.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" ) @@ -53,6 +54,8 @@ type IndicesValidateQueryRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -161,6 +164,18 @@ func (r IndicesValidateQueryRequest) Do(ctx context.Context, transport Transport req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -338,3 +353,16 @@ func (f IndicesValidateQuery) WithFilterPath(v ...string) func(*IndicesValidateQ r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesValidateQuery) WithHeader(h map[string]string) func(*IndicesValidateQueryRequest) { + return func(r *IndicesValidateQueryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.info.go b/esapi/api.info.go index 11fb6464d4..2b29438846 100755 --- a/esapi/api.info.go +++ b/esapi/api.info.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" ) @@ -33,6 +34,8 @@ type InfoRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -78,6 +81,18 @@ func (r InfoRequest) Do(ctx context.Context, transport Transport) (*Response, er req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -127,3 +142,16 @@ func (f Info) WithFilterPath(v ...string) func(*InfoRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Info) WithHeader(h map[string]string) func(*InfoRequest) { + return func(r *InfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.ingest.delete_pipeline.go b/esapi/api.ingest.delete_pipeline.go index b541b70ca4..f60c31203a 100755 --- a/esapi/api.ingest.delete_pipeline.go +++ b/esapi/api.ingest.delete_pipeline.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" "time" ) @@ -22,7 +23,7 @@ func newIngestDeletePipelineFunc(t Transport) IngestDeletePipeline { // IngestDeletePipeline deletes a pipeline. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html. // type IngestDeletePipeline func(id string, o ...func(*IngestDeletePipelineRequest)) (*Response, error) @@ -39,6 +40,8 @@ type IngestDeletePipelineRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -97,6 +100,18 @@ func (r IngestDeletePipelineRequest) Do(ctx context.Context, transport Transport req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -170,3 +185,16 @@ func (f IngestDeletePipeline) WithFilterPath(v ...string) func(*IngestDeletePipe r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IngestDeletePipeline) WithHeader(h map[string]string) func(*IngestDeletePipelineRequest) { + return func(r *IngestDeletePipelineRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.ingest.get_pipeline.go b/esapi/api.ingest.get_pipeline.go index 5874869256..258f86e6c8 100755 --- a/esapi/api.ingest.get_pipeline.go +++ b/esapi/api.ingest.get_pipeline.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" "time" ) @@ -22,7 +23,7 @@ func newIngestGetPipelineFunc(t Transport) IngestGetPipeline { // IngestGetPipeline returns a pipeline. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html. // type IngestGetPipeline func(o ...func(*IngestGetPipelineRequest)) (*Response, error) @@ -38,6 +39,8 @@ type IngestGetPipelineRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -94,6 +97,18 @@ func (r IngestGetPipelineRequest) Do(ctx context.Context, transport Transport) ( req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -167,3 +182,16 @@ func (f IngestGetPipeline) WithFilterPath(v ...string) func(*IngestGetPipelineRe r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IngestGetPipeline) WithHeader(h map[string]string) func(*IngestGetPipelineRequest) { + return func(r *IngestGetPipelineRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.ingest.processor_grok.go b/esapi/api.ingest.processor_grok.go index 697c7b8245..3b63cc6750 100755 --- a/esapi/api.ingest.processor_grok.go +++ b/esapi/api.ingest.processor_grok.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" ) @@ -21,7 +22,7 @@ func newIngestProcessorGrokFunc(t Transport) IngestProcessorGrok { // IngestProcessorGrok returns a list of the built-in patterns. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get. // type IngestProcessorGrok func(o ...func(*IngestProcessorGrokRequest)) (*Response, error) @@ -33,6 +34,8 @@ type IngestProcessorGrokRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -78,6 +81,18 @@ func (r IngestProcessorGrokRequest) Do(ctx context.Context, transport Transport) req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -135,3 +150,16 @@ func (f IngestProcessorGrok) WithFilterPath(v ...string) func(*IngestProcessorGr r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IngestProcessorGrok) WithHeader(h map[string]string) func(*IngestProcessorGrokRequest) { + return func(r *IngestProcessorGrokRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.ingest.put_pipeline.go b/esapi/api.ingest.put_pipeline.go index 689bc1b28d..2e38c8f0bd 100755 --- a/esapi/api.ingest.put_pipeline.go +++ b/esapi/api.ingest.put_pipeline.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strings" "time" ) @@ -23,7 +24,7 @@ func newIngestPutPipelineFunc(t Transport) IngestPutPipeline { // IngestPutPipeline creates or updates a pipeline. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html. // type IngestPutPipeline func(id string, body io.Reader, o ...func(*IngestPutPipelineRequest)) (*Response, error) @@ -42,6 +43,8 @@ type IngestPutPipelineRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -104,6 +107,18 @@ func (r IngestPutPipelineRequest) Do(ctx context.Context, transport Transport) ( req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -177,3 +192,16 @@ func (f IngestPutPipeline) WithFilterPath(v ...string) func(*IngestPutPipelineRe r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IngestPutPipeline) WithHeader(h map[string]string) func(*IngestPutPipelineRequest) { + return func(r *IngestPutPipelineRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.ingest.simulate.go b/esapi/api.ingest.simulate.go index f5fd55d4f3..b1b6ea648d 100755 --- a/esapi/api.ingest.simulate.go +++ b/esapi/api.ingest.simulate.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" ) @@ -23,7 +24,7 @@ func newIngestSimulateFunc(t Transport) IngestSimulate { // IngestSimulate allows to simulate a pipeline with example documents. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html. // type IngestSimulate func(body io.Reader, o ...func(*IngestSimulateRequest)) (*Response, error) @@ -41,6 +42,8 @@ type IngestSimulateRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -103,6 +106,18 @@ func (r IngestSimulateRequest) Do(ctx context.Context, transport Transport) (*Re req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -176,3 +191,16 @@ func (f IngestSimulate) WithFilterPath(v ...string) func(*IngestSimulateRequest) r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f IngestSimulate) WithHeader(h map[string]string) func(*IngestSimulateRequest) { + return func(r *IngestSimulateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.mget.go b/esapi/api.mget.go index f523d0ac01..e253316252 100755 --- a/esapi/api.mget.go +++ b/esapi/api.mget.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" ) @@ -49,6 +50,8 @@ type MgetRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -139,6 +142,18 @@ func (r MgetRequest) Do(ctx context.Context, transport Transport) (*Response, er req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -276,3 +291,16 @@ func (f Mget) WithFilterPath(v ...string) func(*MgetRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Mget) WithHeader(h map[string]string) func(*MgetRequest) { + return func(r *MgetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.msearch.go b/esapi/api.msearch.go index 4ae20d24a1..47117e85e7 100755 --- a/esapi/api.msearch.go +++ b/esapi/api.msearch.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" ) @@ -48,6 +49,8 @@ type MsearchRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -134,6 +137,18 @@ func (r MsearchRequest) Do(ctx context.Context, transport Transport) (*Response, req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -192,7 +207,7 @@ func (f Msearch) WithMaxConcurrentSearches(v int) func(*MsearchRequest) { } } -// WithMaxConcurrentShardRequests - the number of concurrent shard requests each sub 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. +// WithMaxConcurrentShardRequests - 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. // func (f Msearch) WithMaxConcurrentShardRequests(v int) func(*MsearchRequest) { return func(r *MsearchRequest) { @@ -263,3 +278,16 @@ func (f Msearch) WithFilterPath(v ...string) func(*MsearchRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Msearch) WithHeader(h map[string]string) func(*MsearchRequest) { + return func(r *MsearchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.msearch_template.go b/esapi/api.msearch_template.go index 065c5d23cb..b67bebfdeb 100755 --- a/esapi/api.msearch_template.go +++ b/esapi/api.msearch_template.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" ) @@ -46,6 +47,8 @@ type MsearchTemplateRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -126,6 +129,18 @@ func (r MsearchTemplateRequest) Do(ctx context.Context, transport Transport) (*R req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -239,3 +254,16 @@ func (f MsearchTemplate) WithFilterPath(v ...string) func(*MsearchTemplateReques r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f MsearchTemplate) WithHeader(h map[string]string) func(*MsearchTemplateRequest) { + return func(r *MsearchTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.mtermvectors.go b/esapi/api.mtermvectors.go index ac2b1c6c79..580d254ee5 100755 --- a/esapi/api.mtermvectors.go +++ b/esapi/api.mtermvectors.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" ) @@ -39,7 +40,6 @@ type MtermvectorsRequest struct { FieldStatistics *bool Ids []string Offsets *bool - Parent string Payloads *bool Positions *bool Preference string @@ -54,6 +54,8 @@ type MtermvectorsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -98,10 +100,6 @@ func (r MtermvectorsRequest) Do(ctx context.Context, transport Transport) (*Resp params["offsets"] = strconv.FormatBool(*r.Offsets) } - if r.Parent != "" { - params["parent"] = r.Parent - } - if r.Payloads != nil { params["payloads"] = strconv.FormatBool(*r.Payloads) } @@ -164,6 +162,18 @@ func (r MtermvectorsRequest) Do(ctx context.Context, transport Transport) (*Resp req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -246,14 +256,6 @@ func (f Mtermvectors) WithOffsets(v bool) func(*MtermvectorsRequest) { } } -// WithParent - parent ID of documents. applies to all returned documents unless otherwise specified in body "params" or "docs".. -// -func (f Mtermvectors) WithParent(v string) func(*MtermvectorsRequest) { - return func(r *MtermvectorsRequest) { - r.Parent = v - } -} - // WithPayloads - specifies if term payloads should be returned. applies to all returned documents unless otherwise specified in body "params" or "docs".. // func (f Mtermvectors) WithPayloads(v bool) func(*MtermvectorsRequest) { @@ -349,3 +351,16 @@ func (f Mtermvectors) WithFilterPath(v ...string) func(*MtermvectorsRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Mtermvectors) WithHeader(h map[string]string) func(*MtermvectorsRequest) { + return func(r *MtermvectorsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.nodes.hot_threads.go b/esapi/api.nodes.hot_threads.go index 5a846e64de..3bb128ec01 100755 --- a/esapi/api.nodes.hot_threads.go +++ b/esapi/api.nodes.hot_threads.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -44,6 +45,8 @@ type NodesHotThreadsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -122,6 +125,18 @@ func (r NodesHotThreadsRequest) Do(ctx context.Context, transport Transport) (*R req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -235,3 +250,16 @@ func (f NodesHotThreads) WithFilterPath(v ...string) func(*NodesHotThreadsReques r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f NodesHotThreads) WithHeader(h map[string]string) func(*NodesHotThreadsRequest) { + return func(r *NodesHotThreadsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.nodes.info.go b/esapi/api.nodes.info.go index aa5926af9a..15ee9234b6 100755 --- a/esapi/api.nodes.info.go +++ b/esapi/api.nodes.info.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -41,6 +42,8 @@ type NodesInfoRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -103,6 +106,18 @@ func (r NodesInfoRequest) Do(ctx context.Context, transport Transport) (*Respons req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -192,3 +207,16 @@ func (f NodesInfo) WithFilterPath(v ...string) func(*NodesInfoRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f NodesInfo) WithHeader(h map[string]string) func(*NodesInfoRequest) { + return func(r *NodesInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.nodes.reload_secure_settings.go b/esapi/api.nodes.reload_secure_settings.go index cf0f2d1342..306588e1f2 100755 --- a/esapi/api.nodes.reload_secure_settings.go +++ b/esapi/api.nodes.reload_secure_settings.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" "time" ) @@ -38,6 +39,8 @@ type NodesReloadSecureSettingsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -94,6 +97,18 @@ func (r NodesReloadSecureSettingsRequest) Do(ctx context.Context, transport Tran req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -167,3 +182,16 @@ func (f NodesReloadSecureSettings) WithFilterPath(v ...string) func(*NodesReload r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f NodesReloadSecureSettings) WithHeader(h map[string]string) func(*NodesReloadSecureSettingsRequest) { + return func(r *NodesReloadSecureSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.nodes.stats.go b/esapi/api.nodes.stats.go index 800ef88968..0db813896c 100755 --- a/esapi/api.nodes.stats.go +++ b/esapi/api.nodes.stats.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -48,6 +49,8 @@ type NodesStatsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -140,6 +143,18 @@ func (r NodesStatsRequest) Do(ctx context.Context, transport Transport) (*Respon req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -285,3 +300,16 @@ func (f NodesStats) WithFilterPath(v ...string) func(*NodesStatsRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f NodesStats) WithHeader(h map[string]string) func(*NodesStatsRequest) { + return func(r *NodesStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.nodes.usage.go b/esapi/api.nodes.usage.go index 6f0721c47f..720b8a9173 100755 --- a/esapi/api.nodes.usage.go +++ b/esapi/api.nodes.usage.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" "time" ) @@ -39,6 +40,8 @@ type NodesUsageRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -99,6 +102,18 @@ func (r NodesUsageRequest) Do(ctx context.Context, transport Transport) (*Respon req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -180,3 +195,16 @@ func (f NodesUsage) WithFilterPath(v ...string) func(*NodesUsageRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f NodesUsage) WithHeader(h map[string]string) func(*NodesUsageRequest) { + return func(r *NodesUsageRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.ping.go b/esapi/api.ping.go index 4a9f1f2f7c..062850f4cd 100755 --- a/esapi/api.ping.go +++ b/esapi/api.ping.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" ) @@ -33,6 +34,8 @@ type PingRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -78,6 +81,18 @@ func (r PingRequest) Do(ctx context.Context, transport Transport) (*Response, er req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -135,3 +150,16 @@ func (f Ping) WithFilterPath(v ...string) func(*PingRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Ping) WithHeader(h map[string]string) func(*PingRequest) { + return func(r *PingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.put_script.go b/esapi/api.put_script.go index 9b66dfb001..6f7f6863a7 100755 --- a/esapi/api.put_script.go +++ b/esapi/api.put_script.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strings" "time" ) @@ -44,6 +45,8 @@ type PutScriptRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -112,6 +115,18 @@ func (r PutScriptRequest) Do(ctx context.Context, transport Transport) (*Respons req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -193,3 +208,16 @@ func (f PutScript) WithFilterPath(v ...string) func(*PutScriptRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f PutScript) WithHeader(h map[string]string) func(*PutScriptRequest) { + return func(r *PutScriptRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.rank_eval.go b/esapi/api.rank_eval.go index dc0635acbc..2efb2e697c 100755 --- a/esapi/api.rank_eval.go +++ b/esapi/api.rank_eval.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" ) @@ -43,6 +44,8 @@ type RankEvalRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -109,6 +112,18 @@ func (r RankEvalRequest) Do(ctx context.Context, transport Transport) (*Response req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -198,3 +213,16 @@ func (f RankEval) WithFilterPath(v ...string) func(*RankEvalRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f RankEval) WithHeader(h map[string]string) func(*RankEvalRequest) { + return func(r *RankEvalRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.reindex.go b/esapi/api.reindex.go index cb83590c1e..4eaa923021 100755 --- a/esapi/api.reindex.go +++ b/esapi/api.reindex.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -35,6 +36,7 @@ type Reindex func(body io.Reader, o ...func(*ReindexRequest)) (*Response, error) type ReindexRequest struct { Body io.Reader + MaxDocs *int Refresh *bool RequestsPerSecond *int Scroll time.Duration @@ -48,6 +50,8 @@ type ReindexRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -67,6 +71,10 @@ func (r ReindexRequest) Do(ctx context.Context, transport Transport) (*Response, params = make(map[string]string) + if r.MaxDocs != nil { + params["max_docs"] = strconv.FormatInt(int64(*r.MaxDocs), 10) + } + if r.Refresh != nil { params["refresh"] = strconv.FormatBool(*r.Refresh) } @@ -125,6 +133,18 @@ func (r ReindexRequest) Do(ctx context.Context, transport Transport) (*Response, req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -151,6 +171,14 @@ func (f Reindex) WithContext(v context.Context) func(*ReindexRequest) { } } +// WithMaxDocs - maximum number of documents to process (default: all documents). +// +func (f Reindex) WithMaxDocs(v int) func(*ReindexRequest) { + return func(r *ReindexRequest) { + r.MaxDocs = &v + } +} + // WithRefresh - should the effected indexes be refreshed?. // func (f Reindex) WithRefresh(v bool) func(*ReindexRequest) { @@ -238,3 +266,16 @@ func (f Reindex) WithFilterPath(v ...string) func(*ReindexRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Reindex) WithHeader(h map[string]string) func(*ReindexRequest) { + return func(r *ReindexRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.reindex_rethrottle.go b/esapi/api.reindex_rethrottle.go index 68b7d3abee..cc31fb4e02 100755 --- a/esapi/api.reindex_rethrottle.go +++ b/esapi/api.reindex_rethrottle.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -38,6 +39,8 @@ type ReindexRethrottleRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -92,6 +95,18 @@ func (r ReindexRethrottleRequest) Do(ctx context.Context, transport Transport) ( req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -157,3 +172,16 @@ func (f ReindexRethrottle) WithFilterPath(v ...string) func(*ReindexRethrottleRe r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f ReindexRethrottle) WithHeader(h map[string]string) func(*ReindexRethrottleRequest) { + return func(r *ReindexRethrottleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.render_search_template.go b/esapi/api.render_search_template.go index bac060065b..c53d3a0974 100755 --- a/esapi/api.render_search_template.go +++ b/esapi/api.render_search_template.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strings" ) @@ -38,6 +39,8 @@ type RenderSearchTemplateRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -94,6 +97,18 @@ func (r RenderSearchTemplateRequest) Do(ctx context.Context, transport Transport req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -167,3 +182,16 @@ func (f RenderSearchTemplate) WithFilterPath(v ...string) func(*RenderSearchTemp r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f RenderSearchTemplate) WithHeader(h map[string]string) func(*RenderSearchTemplateRequest) { + return func(r *RenderSearchTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.scripts_painless_execute.go b/esapi/api.scripts_painless_execute.go index e4edb0b591..dd457b48cc 100755 --- a/esapi/api.scripts_painless_execute.go +++ b/esapi/api.scripts_painless_execute.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strings" ) @@ -36,6 +37,8 @@ type ScriptsPainlessExecuteRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -85,6 +88,18 @@ func (r ScriptsPainlessExecuteRequest) Do(ctx context.Context, transport Transpo req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -150,3 +165,16 @@ func (f ScriptsPainlessExecute) WithFilterPath(v ...string) func(*ScriptsPainles r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f ScriptsPainlessExecute) WithHeader(h map[string]string) func(*ScriptsPainlessExecuteRequest) { + return func(r *ScriptsPainlessExecuteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.scroll.go b/esapi/api.scroll.go index e4e5a5e3ed..1ab3f3a205 100755 --- a/esapi/api.scroll.go +++ b/esapi/api.scroll.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -43,6 +44,8 @@ type ScrollRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -104,6 +107,18 @@ func (r ScrollRequest) Do(ctx context.Context, transport Transport) (*Response, req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -193,3 +208,16 @@ func (f Scroll) WithFilterPath(v ...string) func(*ScrollRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Scroll) WithHeader(h map[string]string) func(*ScrollRequest) { + return func(r *ScrollRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.search.go b/esapi/api.search.go index 411e8f26db..cd44866962 100755 --- a/esapi/api.search.go +++ b/esapi/api.search.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi @@ -6,6 +6,7 @@ import ( "context" "fmt" "io" + "net/http" "strconv" "strings" "time" @@ -85,6 +86,8 @@ type SearchRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -311,6 +314,18 @@ func (r SearchRequest) Do(ctx context.Context, transport Transport) (*Response, req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -728,3 +743,16 @@ func (f Search) WithFilterPath(v ...string) func(*SearchRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Search) WithHeader(h map[string]string) func(*SearchRequest) { + return func(r *SearchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.search_shards.go b/esapi/api.search_shards.go index 84368a1cf6..c2fb18d81d 100755 --- a/esapi/api.search_shards.go +++ b/esapi/api.search_shards.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -43,6 +44,8 @@ type SearchShardsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -117,6 +120,18 @@ func (r SearchShardsRequest) Do(ctx context.Context, transport Transport) (*Resp req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -230,3 +245,16 @@ func (f SearchShards) WithFilterPath(v ...string) func(*SearchShardsRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f SearchShards) WithHeader(h map[string]string) func(*SearchShardsRequest) { + return func(r *SearchShardsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.search_template.go b/esapi/api.search_template.go index 2b9ce2191d..8c49e7b331 100755 --- a/esapi/api.search_template.go +++ b/esapi/api.search_template.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -55,6 +56,8 @@ type SearchTemplateRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -167,6 +170,18 @@ func (r SearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Re req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -344,3 +359,16 @@ func (f SearchTemplate) WithFilterPath(v ...string) func(*SearchTemplateRequest) r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f SearchTemplate) WithHeader(h map[string]string) func(*SearchTemplateRequest) { + return func(r *SearchTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.snapshot.create.go b/esapi/api.snapshot.create.go index 5736d3afab..c856b06397 100755 --- a/esapi/api.snapshot.create.go +++ b/esapi/api.snapshot.create.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -44,6 +45,8 @@ type SnapshotCreateRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -106,6 +109,18 @@ func (r SnapshotCreateRequest) Do(ctx context.Context, transport Transport) (*Re req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -187,3 +202,16 @@ func (f SnapshotCreate) WithFilterPath(v ...string) func(*SnapshotCreateRequest) r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f SnapshotCreate) WithHeader(h map[string]string) func(*SnapshotCreateRequest) { + return func(r *SnapshotCreateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.snapshot.create_repository.go b/esapi/api.snapshot.create_repository.go index fff7aa21f7..baee1d2602 100755 --- a/esapi/api.snapshot.create_repository.go +++ b/esapi/api.snapshot.create_repository.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -44,6 +45,8 @@ type SnapshotCreateRepositoryRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -108,6 +111,18 @@ func (r SnapshotCreateRepositoryRequest) Do(ctx context.Context, transport Trans req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -189,3 +204,16 @@ func (f SnapshotCreateRepository) WithFilterPath(v ...string) func(*SnapshotCrea r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f SnapshotCreateRepository) WithHeader(h map[string]string) func(*SnapshotCreateRepositoryRequest) { + return func(r *SnapshotCreateRepositoryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.snapshot.delete.go b/esapi/api.snapshot.delete.go index 924196981b..4a2e47e8a5 100755 --- a/esapi/api.snapshot.delete.go +++ b/esapi/api.snapshot.delete.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" "time" ) @@ -39,6 +40,8 @@ type SnapshotDeleteRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -93,6 +96,18 @@ func (r SnapshotDeleteRequest) Do(ctx context.Context, transport Transport) (*Re req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -158,3 +173,16 @@ func (f SnapshotDelete) WithFilterPath(v ...string) func(*SnapshotDeleteRequest) r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f SnapshotDelete) WithHeader(h map[string]string) func(*SnapshotDeleteRequest) { + return func(r *SnapshotDeleteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.snapshot.delete_repository.go b/esapi/api.snapshot.delete_repository.go index acfe2c9e13..4c52ce6690 100755 --- a/esapi/api.snapshot.delete_repository.go +++ b/esapi/api.snapshot.delete_repository.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" "time" ) @@ -39,6 +40,8 @@ type SnapshotDeleteRepositoryRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -95,6 +98,18 @@ func (r SnapshotDeleteRepositoryRequest) Do(ctx context.Context, transport Trans req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -168,3 +183,16 @@ func (f SnapshotDeleteRepository) WithFilterPath(v ...string) func(*SnapshotDele r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f SnapshotDeleteRepository) WithHeader(h map[string]string) func(*SnapshotDeleteRepositoryRequest) { + return func(r *SnapshotDeleteRepositoryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.snapshot.get.go b/esapi/api.snapshot.get.go index 0bc4b12969..cfeaafc7df 100755 --- a/esapi/api.snapshot.get.go +++ b/esapi/api.snapshot.get.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -42,6 +43,8 @@ type SnapshotGetRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -104,6 +107,18 @@ func (r SnapshotGetRequest) Do(ctx context.Context, transport Transport) (*Respo req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -185,3 +200,16 @@ func (f SnapshotGet) WithFilterPath(v ...string) func(*SnapshotGetRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f SnapshotGet) WithHeader(h map[string]string) func(*SnapshotGetRequest) { + return func(r *SnapshotGetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.snapshot.get_repository.go b/esapi/api.snapshot.get_repository.go index f966471aca..b7540406db 100755 --- a/esapi/api.snapshot.get_repository.go +++ b/esapi/api.snapshot.get_repository.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -40,6 +41,8 @@ type SnapshotGetRepositoryRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -98,6 +101,18 @@ func (r SnapshotGetRepositoryRequest) Do(ctx context.Context, transport Transpor req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -179,3 +194,16 @@ func (f SnapshotGetRepository) WithFilterPath(v ...string) func(*SnapshotGetRepo r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f SnapshotGetRepository) WithHeader(h map[string]string) func(*SnapshotGetRepositoryRequest) { + return func(r *SnapshotGetRepositoryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.snapshot.restore.go b/esapi/api.snapshot.restore.go index 0714d283cc..8b52e9e7c4 100755 --- a/esapi/api.snapshot.restore.go +++ b/esapi/api.snapshot.restore.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -44,6 +45,8 @@ type SnapshotRestoreRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -108,6 +111,18 @@ func (r SnapshotRestoreRequest) Do(ctx context.Context, transport Transport) (*R req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -189,3 +204,16 @@ func (f SnapshotRestore) WithFilterPath(v ...string) func(*SnapshotRestoreReques r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f SnapshotRestore) WithHeader(h map[string]string) func(*SnapshotRestoreRequest) { + return func(r *SnapshotRestoreRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.snapshot.status.go b/esapi/api.snapshot.status.go index 4d01416ea3..7defd57838 100755 --- a/esapi/api.snapshot.status.go +++ b/esapi/api.snapshot.status.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -41,6 +42,8 @@ type SnapshotStatusRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -105,6 +108,18 @@ func (r SnapshotStatusRequest) Do(ctx context.Context, transport Transport) (*Re req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -194,3 +209,16 @@ func (f SnapshotStatus) WithFilterPath(v ...string) func(*SnapshotStatusRequest) r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f SnapshotStatus) WithHeader(h map[string]string) func(*SnapshotStatusRequest) { + return func(r *SnapshotStatusRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.snapshot.verify_repository.go b/esapi/api.snapshot.verify_repository.go index b823e90d2a..6f28b1c0f9 100755 --- a/esapi/api.snapshot.verify_repository.go +++ b/esapi/api.snapshot.verify_repository.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" "time" ) @@ -39,6 +40,8 @@ type SnapshotVerifyRepositoryRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -97,6 +100,18 @@ func (r SnapshotVerifyRepositoryRequest) Do(ctx context.Context, transport Trans req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -170,3 +185,16 @@ func (f SnapshotVerifyRepository) WithFilterPath(v ...string) func(*SnapshotVeri r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f SnapshotVerifyRepository) WithHeader(h map[string]string) func(*SnapshotVerifyRepositoryRequest) { + return func(r *SnapshotVerifyRepositoryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.tasks.cancel.go b/esapi/api.tasks.cancel.go index 56408abe26..6a94df2c29 100755 --- a/esapi/api.tasks.cancel.go +++ b/esapi/api.tasks.cancel.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strings" ) @@ -39,6 +40,8 @@ type TasksCancelRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -103,6 +106,18 @@ func (r TasksCancelRequest) Do(ctx context.Context, transport Transport) (*Respo req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -192,3 +207,16 @@ func (f TasksCancel) WithFilterPath(v ...string) func(*TasksCancelRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f TasksCancel) WithHeader(h map[string]string) func(*TasksCancelRequest) { + return func(r *TasksCancelRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.tasks.get.go b/esapi/api.tasks.get.go index 5a6f8e5da4..d9d81ff2a5 100755 --- a/esapi/api.tasks.get.go +++ b/esapi/api.tasks.get.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -40,6 +41,8 @@ type TasksGetRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -96,6 +99,18 @@ func (r TasksGetRequest) Do(ctx context.Context, transport Transport) (*Response req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -169,3 +184,16 @@ func (f TasksGet) WithFilterPath(v ...string) func(*TasksGetRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f TasksGet) WithHeader(h map[string]string) func(*TasksGetRequest) { + return func(r *TasksGetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.tasks.list.go b/esapi/api.tasks.list.go index 9e9371fa01..30720db57d 100755 --- a/esapi/api.tasks.list.go +++ b/esapi/api.tasks.list.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" "time" @@ -43,6 +44,8 @@ type TasksListRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -116,6 +119,18 @@ func (r TasksListRequest) Do(ctx context.Context, transport Transport) (*Respons req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -229,3 +244,16 @@ func (f TasksList) WithFilterPath(v ...string) func(*TasksListRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f TasksList) WithHeader(h map[string]string) func(*TasksListRequest) { + return func(r *TasksListRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.termvectors.go b/esapi/api.termvectors.go index 4623a6f5af..3ca9878215 100755 --- a/esapi/api.termvectors.go +++ b/esapi/api.termvectors.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" ) @@ -39,7 +40,6 @@ type TermvectorsRequest struct { Fields []string FieldStatistics *bool Offsets *bool - Parent string Payloads *bool Positions *bool Preference string @@ -54,6 +54,8 @@ type TermvectorsRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -100,10 +102,6 @@ func (r TermvectorsRequest) Do(ctx context.Context, transport Transport) (*Respo params["offsets"] = strconv.FormatBool(*r.Offsets) } - if r.Parent != "" { - params["parent"] = r.Parent - } - if r.Payloads != nil { params["payloads"] = strconv.FormatBool(*r.Payloads) } @@ -166,6 +164,18 @@ func (r TermvectorsRequest) Do(ctx context.Context, transport Transport) (*Respo req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -240,14 +250,6 @@ func (f Termvectors) WithOffsets(v bool) func(*TermvectorsRequest) { } } -// WithParent - parent ID of documents.. -// -func (f Termvectors) WithParent(v string) func(*TermvectorsRequest) { - return func(r *TermvectorsRequest) { - r.Parent = v - } -} - // WithPayloads - specifies if term payloads should be returned.. // func (f Termvectors) WithPayloads(v bool) func(*TermvectorsRequest) { @@ -343,3 +345,16 @@ func (f Termvectors) WithFilterPath(v ...string) func(*TermvectorsRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Termvectors) WithHeader(h map[string]string) func(*TermvectorsRequest) { + return func(r *TermvectorsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.update.go b/esapi/api.update.go index ffbc0948c8..c9864c0995 100755 --- a/esapi/api.update.go +++ b/esapi/api.update.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -40,7 +41,6 @@ type UpdateRequest struct { IfPrimaryTerm *int IfSeqNo *int Lang string - Parent string Refresh string RetryOnConflict *int Routing string @@ -55,6 +55,8 @@ type UpdateRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -99,10 +101,6 @@ func (r UpdateRequest) Do(ctx context.Context, transport Transport) (*Response, params["lang"] = r.Lang } - if r.Parent != "" { - params["parent"] = r.Parent - } - if r.Refresh != "" { params["refresh"] = r.Refresh } @@ -165,6 +163,18 @@ func (r UpdateRequest) Do(ctx context.Context, transport Transport) (*Response, req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -223,14 +233,6 @@ func (f Update) WithLang(v string) func(*UpdateRequest) { } } -// WithParent - ID of the parent document. is is only used for routing and when for the upsert request. -// -func (f Update) WithParent(v string) func(*UpdateRequest) { - return func(r *UpdateRequest) { - r.Parent = v - } -} - // WithRefresh - if `true` then refresh the effected 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.. // func (f Update) WithRefresh(v string) func(*UpdateRequest) { @@ -326,3 +328,16 @@ func (f Update) WithFilterPath(v ...string) func(*UpdateRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f Update) WithHeader(h map[string]string) func(*UpdateRequest) { + return func(r *UpdateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.update_by_query.go b/esapi/api.update_by_query.go index 7238bdd32e..0c57bc7507 100755 --- a/esapi/api.update_by_query.go +++ b/esapi/api.update_by_query.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "io" + "net/http" "strconv" "strings" "time" @@ -47,6 +48,7 @@ type UpdateByQueryRequest struct { From *int IgnoreUnavailable *bool Lenient *bool + MaxDocs *int Pipeline string Preference string Query string @@ -77,6 +79,8 @@ type UpdateByQueryRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -143,6 +147,10 @@ func (r UpdateByQueryRequest) Do(ctx context.Context, transport Transport) (*Res params["lenient"] = strconv.FormatBool(*r.Lenient) } + if r.MaxDocs != nil { + params["max_docs"] = strconv.FormatInt(int64(*r.MaxDocs), 10) + } + if r.Pipeline != "" { params["pipeline"] = r.Pipeline } @@ -269,6 +277,18 @@ func (r UpdateByQueryRequest) Do(ctx context.Context, transport Transport) (*Res req.Header[headerContentType] = headerContentTypeJSON } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -391,6 +411,14 @@ func (f UpdateByQuery) WithLenient(v bool) func(*UpdateByQueryRequest) { } } +// WithMaxDocs - maximum number of documents to process (default: all documents). +// +func (f UpdateByQuery) WithMaxDocs(v int) func(*UpdateByQueryRequest) { + return func(r *UpdateByQueryRequest) { + r.MaxDocs = &v + } +} + // WithPipeline - ingest pipeline to set on index requests made by this action. (default: none). // func (f UpdateByQuery) WithPipeline(v string) func(*UpdateByQueryRequest) { @@ -479,7 +507,7 @@ func (f UpdateByQuery) WithSearchType(v string) func(*UpdateByQueryRequest) { } } -// WithSize - number of hits to return (default: 10). +// WithSize - deprecated, please use `max_docs` instead. // func (f UpdateByQuery) WithSize(v int) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { @@ -614,3 +642,16 @@ func (f UpdateByQuery) WithFilterPath(v ...string) func(*UpdateByQueryRequest) { r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f UpdateByQuery) WithHeader(h map[string]string) func(*UpdateByQueryRequest) { + return func(r *UpdateByQueryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.update_by_query_rethrottle.go b/esapi/api.update_by_query_rethrottle.go index 0290d3b36a..d1a8341724 100755 --- a/esapi/api.update_by_query_rethrottle.go +++ b/esapi/api.update_by_query_rethrottle.go @@ -1,9 +1,10 @@ -// Code generated from specification version 7.0.0: DO NOT EDIT +// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" + "net/http" "strconv" "strings" ) @@ -38,6 +39,8 @@ type UpdateByQueryRethrottleRequest struct { ErrorTrace bool FilterPath []string + Header http.Header + ctx context.Context } @@ -92,6 +95,18 @@ func (r UpdateByQueryRethrottleRequest) Do(ctx context.Context, transport Transp req.URL.RawQuery = q.Encode() } + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + if ctx != nil { req = req.WithContext(ctx) } @@ -157,3 +172,16 @@ func (f UpdateByQueryRethrottle) WithFilterPath(v ...string) func(*UpdateByQuery r.FilterPath = v } } + +// WithHeader adds the headers to the HTTP request. +// +func (f UpdateByQueryRethrottle) WithHeader(h map[string]string) func(*UpdateByQueryRethrottleRequest) { + return func(r *UpdateByQueryRethrottleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} From 1fa5b8a5e3e6c7b29a7387e73e366b5ad57752dc Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 5 Jul 2019 15:38:17 +0200 Subject: [PATCH 071/355] API: Add the X-Pack APIs for Elasticsearch 7.x (cff607cbd83) --- ...pi.xpack.ccr.delete_auto_follow_pattern.go | 170 +++++++++ esapi/api.xpack.ccr.follow.go | 191 ++++++++++ esapi/api.xpack.ccr.follow_info.go | 180 +++++++++ esapi/api.xpack.ccr.follow_stats.go | 170 +++++++++ esapi/api.xpack.ccr.forget_follower.go | 177 +++++++++ .../api.xpack.ccr.get_auto_follow_pattern.go | 180 +++++++++ esapi/api.xpack.ccr.pause_follow.go | 170 +++++++++ .../api.xpack.ccr.put_auto_follow_pattern.go | 177 +++++++++ esapi/api.xpack.ccr.resume_follow.go | 185 +++++++++ esapi/api.xpack.ccr.stats.go | 163 ++++++++ esapi/api.xpack.ccr.unfollow.go | 170 +++++++++ ....data_frame.delete_data_frame_transform.go | 170 +++++++++ ...ack.data_frame.get_data_frame_transform.go | 221 +++++++++++ ...ta_frame.get_data_frame_transform_stats.go | 223 +++++++++++ ...data_frame.preview_data_frame_transform.go | 170 +++++++++ ...ack.data_frame.put_data_frame_transform.go | 177 +++++++++ ...k.data_frame.start_data_frame_transform.go | 187 +++++++++ ...ck.data_frame.stop_data_frame_transform.go | 214 +++++++++++ esapi/api.xpack.graph.explore.go | 236 ++++++++++++ esapi/api.xpack.ilm.delete_lifecycle.go | 180 +++++++++ esapi/api.xpack.ilm.explain_lifecycle.go | 180 +++++++++ esapi/api.xpack.ilm.get_lifecycle.go | 180 +++++++++ esapi/api.xpack.ilm.get_status.go | 163 ++++++++ esapi/api.xpack.ilm.move_to_step.go | 195 ++++++++++ esapi/api.xpack.ilm.put_lifecycle.go | 195 ++++++++++ esapi/api.xpack.ilm.remove_policy.go | 180 +++++++++ esapi/api.xpack.ilm.retry.go | 180 +++++++++ esapi/api.xpack.ilm.start.go | 163 ++++++++ esapi/api.xpack.ilm.stop.go | 163 ++++++++ esapi/api.xpack.indices.freeze.go | 249 ++++++++++++ ...i.xpack.indices.reload_search_analyzers.go | 219 +++++++++++ esapi/api.xpack.indices.unfreeze.go | 249 ++++++++++++ esapi/api.xpack.license.delete.go | 163 ++++++++ esapi/api.xpack.license.get.go | 178 +++++++++ esapi/api.xpack.license.get_basic_status.go | 163 ++++++++ esapi/api.xpack.license.get_trial_status.go | 163 ++++++++ esapi/api.xpack.license.post.go | 193 ++++++++++ esapi/api.xpack.license.post_start_basic.go | 178 +++++++++ esapi/api.xpack.license.post_start_trial.go | 191 ++++++++++ esapi/api.xpack.migration.deprecations.go | 180 +++++++++ esapi/api.xpack.ml.close_job.go | 229 +++++++++++ esapi/api.xpack.ml.delete_calendar.go | 170 +++++++++ esapi/api.xpack.ml.delete_calendar_event.go | 175 +++++++++ esapi/api.xpack.ml.delete_calendar_job.go | 175 +++++++++ ...pi.xpack.ml.delete_data_frame_analytics.go | 172 +++++++++ esapi/api.xpack.ml.delete_datafeed.go | 185 +++++++++ esapi/api.xpack.ml.delete_expired_data.go | 163 ++++++++ esapi/api.xpack.ml.delete_filter.go | 170 +++++++++ esapi/api.xpack.ml.delete_forecast.go | 214 +++++++++++ esapi/api.xpack.ml.delete_job.go | 198 ++++++++++ esapi/api.xpack.ml.delete_model_snapshot.go | 175 +++++++++ esapi/api.xpack.ml.evaluate_data_frame.go | 170 +++++++++ esapi/api.xpack.ml.find_file_structure.go | 355 ++++++++++++++++++ esapi/api.xpack.ml.flush_job.go | 254 +++++++++++++ esapi/api.xpack.ml.forecast.go | 200 ++++++++++ esapi/api.xpack.ml.get_buckets.go | 322 ++++++++++++++++ esapi/api.xpack.ml.get_calendar_events.go | 240 ++++++++++++ esapi/api.xpack.ml.get_calendars.go | 223 +++++++++++ esapi/api.xpack.ml.get_categories.go | 232 ++++++++++++ .../api.xpack.ml.get_data_frame_analytics.go | 223 +++++++++++ ...xpack.ml.get_data_frame_analytics_stats.go | 225 +++++++++++ esapi/api.xpack.ml.get_datafeed_stats.go | 197 ++++++++++ esapi/api.xpack.ml.get_datafeeds.go | 195 ++++++++++ esapi/api.xpack.ml.get_filters.go | 208 ++++++++++ esapi/api.xpack.ml.get_influencers.go | 296 +++++++++++++++ esapi/api.xpack.ml.get_job_stats.go | 197 ++++++++++ esapi/api.xpack.ml.get_jobs.go | 195 ++++++++++ esapi/api.xpack.ml.get_model_snapshots.go | 281 ++++++++++++++ esapi/api.xpack.ml.get_overall_buckets.go | 283 ++++++++++++++ esapi/api.xpack.ml.get_records.go | 296 +++++++++++++++ esapi/api.xpack.ml.info.go | 163 ++++++++ esapi/api.xpack.ml.open_job.go | 191 ++++++++++ esapi/api.xpack.ml.post_calendar_events.go | 179 +++++++++ esapi/api.xpack.ml.post_data.go | 206 ++++++++++ esapi/api.xpack.ml.preview_datafeed.go | 172 +++++++++ esapi/api.xpack.ml.put_calendar.go | 185 +++++++++ esapi/api.xpack.ml.put_calendar_job.go | 175 +++++++++ .../api.xpack.ml.put_data_frame_analytics.go | 179 +++++++++ esapi/api.xpack.ml.put_datafeed.go | 177 +++++++++ esapi/api.xpack.ml.put_filter.go | 177 +++++++++ esapi/api.xpack.ml.put_job.go | 177 +++++++++ esapi/api.xpack.ml.revert_model_snapshot.go | 207 ++++++++++ esapi/api.xpack.ml.set_upgrade_mode.go | 192 ++++++++++ ...api.xpack.ml.start_data_frame_analytics.go | 204 ++++++++++ esapi/api.xpack.ml.start_datafeed.go | 228 +++++++++++ .../api.xpack.ml.stop_data_frame_analytics.go | 231 ++++++++++++ esapi/api.xpack.ml.stop_datafeed.go | 214 +++++++++++ esapi/api.xpack.ml.update_datafeed.go | 179 +++++++++ esapi/api.xpack.ml.update_filter.go | 179 +++++++++ esapi/api.xpack.ml.update_job.go | 179 +++++++++ esapi/api.xpack.ml.update_model_snapshot.go | 184 +++++++++ esapi/api.xpack.ml.validate.go | 170 +++++++++ esapi/api.xpack.ml.validate_detector.go | 170 +++++++++ esapi/api.xpack.monitoring.bulk.go | 227 +++++++++++ esapi/api.xpack.rollup.delete_job.go | 170 +++++++++ esapi/api.xpack.rollup.get_jobs.go | 180 +++++++++ esapi/api.xpack.rollup.get_rollup_caps.go | 180 +++++++++ .../api.xpack.rollup.get_rollup_index_caps.go | 170 +++++++++ esapi/api.xpack.rollup.put_job.go | 177 +++++++++ esapi/api.xpack.rollup.rollup_search.go | 216 +++++++++++ esapi/api.xpack.rollup.start_job.go | 172 +++++++++ esapi/api.xpack.rollup.stop_job.go | 201 ++++++++++ esapi/api.xpack.security.authenticate.go | 163 ++++++++ esapi/api.xpack.security.change_password.go | 203 ++++++++++ .../api.xpack.security.clear_cached_realms.go | 186 +++++++++ .../api.xpack.security.clear_cached_roles.go | 172 +++++++++ esapi/api.xpack.security.create_api_key.go | 184 +++++++++ esapi/api.xpack.security.delete_privileges.go | 187 +++++++++ esapi/api.xpack.security.delete_role.go | 184 +++++++++ .../api.xpack.security.delete_role_mapping.go | 184 +++++++++ esapi/api.xpack.security.delete_user.go | 184 +++++++++ esapi/api.xpack.security.disable_user.go | 186 +++++++++ esapi/api.xpack.security.enable_user.go | 186 +++++++++ esapi/api.xpack.security.get_api_key.go | 216 +++++++++++ ...i.xpack.security.get_builtin_privileges.go | 163 ++++++++ esapi/api.xpack.security.get_privileges.go | 193 ++++++++++ esapi/api.xpack.security.get_role.go | 180 +++++++++ esapi/api.xpack.security.get_role_mapping.go | 180 +++++++++ esapi/api.xpack.security.get_token.go | 170 +++++++++ esapi/api.xpack.security.get_user.go | 180 +++++++++ .../api.xpack.security.get_user_privileges.go | 163 ++++++++ esapi/api.xpack.security.has_privileges.go | 189 ++++++++++ .../api.xpack.security.invalidate_api_key.go | 170 +++++++++ esapi/api.xpack.security.invalidate_token.go | 170 +++++++++ esapi/api.xpack.security.put_privileges.go | 184 +++++++++ esapi/api.xpack.security.put_role.go | 191 ++++++++++ esapi/api.xpack.security.put_role_mapping.go | 191 ++++++++++ esapi/api.xpack.security.put_user.go | 191 ++++++++++ esapi/api.xpack.sql.clear_cursor.go | 170 +++++++++ esapi/api.xpack.sql.query.go | 184 +++++++++ esapi/api.xpack.sql.translate.go | 170 +++++++++ esapi/api.xpack.ssl.certificates.go | 163 ++++++++ esapi/api.xpack.watcher.ack_watch.go | 185 +++++++++ esapi/api.xpack.watcher.activate_watch.go | 172 +++++++++ esapi/api.xpack.watcher.deactivate_watch.go | 172 +++++++++ esapi/api.xpack.watcher.delete_watch.go | 170 +++++++++ esapi/api.xpack.watcher.execute_watch.go | 212 +++++++++++ esapi/api.xpack.watcher.get_watch.go | 170 +++++++++ esapi/api.xpack.watcher.put_watch.go | 239 ++++++++++++ esapi/api.xpack.watcher.start.go | 163 ++++++++ esapi/api.xpack.watcher.stats.go | 199 ++++++++++ esapi/api.xpack.watcher.stop.go | 163 ++++++++ esapi/api.xpack.xpack.info.go | 177 +++++++++ esapi/api.xpack.xpack.usage.go | 178 +++++++++ 144 files changed, 27702 insertions(+) create mode 100755 esapi/api.xpack.ccr.delete_auto_follow_pattern.go create mode 100755 esapi/api.xpack.ccr.follow.go create mode 100755 esapi/api.xpack.ccr.follow_info.go create mode 100755 esapi/api.xpack.ccr.follow_stats.go create mode 100755 esapi/api.xpack.ccr.forget_follower.go create mode 100755 esapi/api.xpack.ccr.get_auto_follow_pattern.go create mode 100755 esapi/api.xpack.ccr.pause_follow.go create mode 100755 esapi/api.xpack.ccr.put_auto_follow_pattern.go create mode 100755 esapi/api.xpack.ccr.resume_follow.go create mode 100755 esapi/api.xpack.ccr.stats.go create mode 100755 esapi/api.xpack.ccr.unfollow.go create mode 100755 esapi/api.xpack.data_frame.delete_data_frame_transform.go create mode 100755 esapi/api.xpack.data_frame.get_data_frame_transform.go create mode 100755 esapi/api.xpack.data_frame.get_data_frame_transform_stats.go create mode 100755 esapi/api.xpack.data_frame.preview_data_frame_transform.go create mode 100755 esapi/api.xpack.data_frame.put_data_frame_transform.go create mode 100755 esapi/api.xpack.data_frame.start_data_frame_transform.go create mode 100755 esapi/api.xpack.data_frame.stop_data_frame_transform.go create mode 100755 esapi/api.xpack.graph.explore.go create mode 100755 esapi/api.xpack.ilm.delete_lifecycle.go create mode 100755 esapi/api.xpack.ilm.explain_lifecycle.go create mode 100755 esapi/api.xpack.ilm.get_lifecycle.go create mode 100755 esapi/api.xpack.ilm.get_status.go create mode 100755 esapi/api.xpack.ilm.move_to_step.go create mode 100755 esapi/api.xpack.ilm.put_lifecycle.go create mode 100755 esapi/api.xpack.ilm.remove_policy.go create mode 100755 esapi/api.xpack.ilm.retry.go create mode 100755 esapi/api.xpack.ilm.start.go create mode 100755 esapi/api.xpack.ilm.stop.go create mode 100755 esapi/api.xpack.indices.freeze.go create mode 100755 esapi/api.xpack.indices.reload_search_analyzers.go create mode 100755 esapi/api.xpack.indices.unfreeze.go create mode 100755 esapi/api.xpack.license.delete.go create mode 100755 esapi/api.xpack.license.get.go create mode 100755 esapi/api.xpack.license.get_basic_status.go create mode 100755 esapi/api.xpack.license.get_trial_status.go create mode 100755 esapi/api.xpack.license.post.go create mode 100755 esapi/api.xpack.license.post_start_basic.go create mode 100755 esapi/api.xpack.license.post_start_trial.go create mode 100755 esapi/api.xpack.migration.deprecations.go create mode 100755 esapi/api.xpack.ml.close_job.go create mode 100755 esapi/api.xpack.ml.delete_calendar.go create mode 100755 esapi/api.xpack.ml.delete_calendar_event.go create mode 100755 esapi/api.xpack.ml.delete_calendar_job.go create mode 100755 esapi/api.xpack.ml.delete_data_frame_analytics.go create mode 100755 esapi/api.xpack.ml.delete_datafeed.go create mode 100755 esapi/api.xpack.ml.delete_expired_data.go create mode 100755 esapi/api.xpack.ml.delete_filter.go create mode 100755 esapi/api.xpack.ml.delete_forecast.go create mode 100755 esapi/api.xpack.ml.delete_job.go create mode 100755 esapi/api.xpack.ml.delete_model_snapshot.go create mode 100755 esapi/api.xpack.ml.evaluate_data_frame.go create mode 100755 esapi/api.xpack.ml.find_file_structure.go create mode 100755 esapi/api.xpack.ml.flush_job.go create mode 100755 esapi/api.xpack.ml.forecast.go create mode 100755 esapi/api.xpack.ml.get_buckets.go create mode 100755 esapi/api.xpack.ml.get_calendar_events.go create mode 100755 esapi/api.xpack.ml.get_calendars.go create mode 100755 esapi/api.xpack.ml.get_categories.go create mode 100755 esapi/api.xpack.ml.get_data_frame_analytics.go create mode 100755 esapi/api.xpack.ml.get_data_frame_analytics_stats.go create mode 100755 esapi/api.xpack.ml.get_datafeed_stats.go create mode 100755 esapi/api.xpack.ml.get_datafeeds.go create mode 100755 esapi/api.xpack.ml.get_filters.go create mode 100755 esapi/api.xpack.ml.get_influencers.go create mode 100755 esapi/api.xpack.ml.get_job_stats.go create mode 100755 esapi/api.xpack.ml.get_jobs.go create mode 100755 esapi/api.xpack.ml.get_model_snapshots.go create mode 100755 esapi/api.xpack.ml.get_overall_buckets.go create mode 100755 esapi/api.xpack.ml.get_records.go create mode 100755 esapi/api.xpack.ml.info.go create mode 100755 esapi/api.xpack.ml.open_job.go create mode 100755 esapi/api.xpack.ml.post_calendar_events.go create mode 100755 esapi/api.xpack.ml.post_data.go create mode 100755 esapi/api.xpack.ml.preview_datafeed.go create mode 100755 esapi/api.xpack.ml.put_calendar.go create mode 100755 esapi/api.xpack.ml.put_calendar_job.go create mode 100755 esapi/api.xpack.ml.put_data_frame_analytics.go create mode 100755 esapi/api.xpack.ml.put_datafeed.go create mode 100755 esapi/api.xpack.ml.put_filter.go create mode 100755 esapi/api.xpack.ml.put_job.go create mode 100755 esapi/api.xpack.ml.revert_model_snapshot.go create mode 100755 esapi/api.xpack.ml.set_upgrade_mode.go create mode 100755 esapi/api.xpack.ml.start_data_frame_analytics.go create mode 100755 esapi/api.xpack.ml.start_datafeed.go create mode 100755 esapi/api.xpack.ml.stop_data_frame_analytics.go create mode 100755 esapi/api.xpack.ml.stop_datafeed.go create mode 100755 esapi/api.xpack.ml.update_datafeed.go create mode 100755 esapi/api.xpack.ml.update_filter.go create mode 100755 esapi/api.xpack.ml.update_job.go create mode 100755 esapi/api.xpack.ml.update_model_snapshot.go create mode 100755 esapi/api.xpack.ml.validate.go create mode 100755 esapi/api.xpack.ml.validate_detector.go create mode 100755 esapi/api.xpack.monitoring.bulk.go create mode 100755 esapi/api.xpack.rollup.delete_job.go create mode 100755 esapi/api.xpack.rollup.get_jobs.go create mode 100755 esapi/api.xpack.rollup.get_rollup_caps.go create mode 100755 esapi/api.xpack.rollup.get_rollup_index_caps.go create mode 100755 esapi/api.xpack.rollup.put_job.go create mode 100755 esapi/api.xpack.rollup.rollup_search.go create mode 100755 esapi/api.xpack.rollup.start_job.go create mode 100755 esapi/api.xpack.rollup.stop_job.go create mode 100755 esapi/api.xpack.security.authenticate.go create mode 100755 esapi/api.xpack.security.change_password.go create mode 100755 esapi/api.xpack.security.clear_cached_realms.go create mode 100755 esapi/api.xpack.security.clear_cached_roles.go create mode 100755 esapi/api.xpack.security.create_api_key.go create mode 100755 esapi/api.xpack.security.delete_privileges.go create mode 100755 esapi/api.xpack.security.delete_role.go create mode 100755 esapi/api.xpack.security.delete_role_mapping.go create mode 100755 esapi/api.xpack.security.delete_user.go create mode 100755 esapi/api.xpack.security.disable_user.go create mode 100755 esapi/api.xpack.security.enable_user.go create mode 100755 esapi/api.xpack.security.get_api_key.go create mode 100755 esapi/api.xpack.security.get_builtin_privileges.go create mode 100755 esapi/api.xpack.security.get_privileges.go create mode 100755 esapi/api.xpack.security.get_role.go create mode 100755 esapi/api.xpack.security.get_role_mapping.go create mode 100755 esapi/api.xpack.security.get_token.go create mode 100755 esapi/api.xpack.security.get_user.go create mode 100755 esapi/api.xpack.security.get_user_privileges.go create mode 100755 esapi/api.xpack.security.has_privileges.go create mode 100755 esapi/api.xpack.security.invalidate_api_key.go create mode 100755 esapi/api.xpack.security.invalidate_token.go create mode 100755 esapi/api.xpack.security.put_privileges.go create mode 100755 esapi/api.xpack.security.put_role.go create mode 100755 esapi/api.xpack.security.put_role_mapping.go create mode 100755 esapi/api.xpack.security.put_user.go create mode 100755 esapi/api.xpack.sql.clear_cursor.go create mode 100755 esapi/api.xpack.sql.query.go create mode 100755 esapi/api.xpack.sql.translate.go create mode 100755 esapi/api.xpack.ssl.certificates.go create mode 100755 esapi/api.xpack.watcher.ack_watch.go create mode 100755 esapi/api.xpack.watcher.activate_watch.go create mode 100755 esapi/api.xpack.watcher.deactivate_watch.go create mode 100755 esapi/api.xpack.watcher.delete_watch.go create mode 100755 esapi/api.xpack.watcher.execute_watch.go create mode 100755 esapi/api.xpack.watcher.get_watch.go create mode 100755 esapi/api.xpack.watcher.put_watch.go create mode 100755 esapi/api.xpack.watcher.start.go create mode 100755 esapi/api.xpack.watcher.stats.go create mode 100755 esapi/api.xpack.watcher.stop.go create mode 100755 esapi/api.xpack.xpack.info.go create mode 100755 esapi/api.xpack.xpack.usage.go diff --git a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go new file mode 100755 index 0000000000..566ec528ed --- /dev/null +++ b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newCCRDeleteAutoFollowPatternFunc(t Transport) CCRDeleteAutoFollowPattern { + return func(name string, o ...func(*CCRDeleteAutoFollowPatternRequest)) (*Response, error) { + var r = CCRDeleteAutoFollowPatternRequest{Name: name} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// CCRDeleteAutoFollowPattern - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html +// +type CCRDeleteAutoFollowPattern func(name string, o ...func(*CCRDeleteAutoFollowPatternRequest)) (*Response, error) + +// CCRDeleteAutoFollowPatternRequest configures the Ccr Delete Auto Follow Pattern API request. +// +type CCRDeleteAutoFollowPatternRequest struct { + Name string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r CCRDeleteAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_ccr") + 1 + len("auto_follow") + 1 + len(r.Name)) + path.WriteString("/") + path.WriteString("_ccr") + path.WriteString("/") + path.WriteString("auto_follow") + path.WriteString("/") + path.WriteString(r.Name) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f CCRDeleteAutoFollowPattern) WithContext(v context.Context) func(*CCRDeleteAutoFollowPatternRequest) { + return func(r *CCRDeleteAutoFollowPatternRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f CCRDeleteAutoFollowPattern) WithPretty() func(*CCRDeleteAutoFollowPatternRequest) { + return func(r *CCRDeleteAutoFollowPatternRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f CCRDeleteAutoFollowPattern) WithHuman() func(*CCRDeleteAutoFollowPatternRequest) { + return func(r *CCRDeleteAutoFollowPatternRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f CCRDeleteAutoFollowPattern) WithErrorTrace() func(*CCRDeleteAutoFollowPatternRequest) { + return func(r *CCRDeleteAutoFollowPatternRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f CCRDeleteAutoFollowPattern) WithFilterPath(v ...string) func(*CCRDeleteAutoFollowPatternRequest) { + return func(r *CCRDeleteAutoFollowPatternRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f CCRDeleteAutoFollowPattern) WithHeader(h map[string]string) func(*CCRDeleteAutoFollowPatternRequest) { + return func(r *CCRDeleteAutoFollowPatternRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ccr.follow.go b/esapi/api.xpack.ccr.follow.go new file mode 100755 index 0000000000..1ca28fec71 --- /dev/null +++ b/esapi/api.xpack.ccr.follow.go @@ -0,0 +1,191 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newCCRFollowFunc(t Transport) CCRFollow { + return func(index string, body io.Reader, o ...func(*CCRFollowRequest)) (*Response, error) { + var r = CCRFollowRequest{Index: index, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// CCRFollow - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html +// +type CCRFollow func(index string, body io.Reader, o ...func(*CCRFollowRequest)) (*Response, error) + +// CCRFollowRequest configures the Ccr Follow API request. +// +type CCRFollowRequest struct { + Index string + + Body io.Reader + + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r CCRFollowRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len(r.Index) + 1 + len("_ccr") + 1 + len("follow")) + path.WriteString("/") + path.WriteString(r.Index) + path.WriteString("/") + path.WriteString("_ccr") + path.WriteString("/") + path.WriteString("follow") + + params = make(map[string]string) + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f CCRFollow) WithContext(v context.Context) func(*CCRFollowRequest) { + return func(r *CCRFollowRequest) { + r.ctx = v + } +} + +// WithWaitForActiveShards - sets the number of shard copies that must be active before returning. defaults to 0. 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). +// +func (f CCRFollow) WithWaitForActiveShards(v string) func(*CCRFollowRequest) { + return func(r *CCRFollowRequest) { + r.WaitForActiveShards = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f CCRFollow) WithPretty() func(*CCRFollowRequest) { + return func(r *CCRFollowRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f CCRFollow) WithHuman() func(*CCRFollowRequest) { + return func(r *CCRFollowRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f CCRFollow) WithErrorTrace() func(*CCRFollowRequest) { + return func(r *CCRFollowRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f CCRFollow) WithFilterPath(v ...string) func(*CCRFollowRequest) { + return func(r *CCRFollowRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f CCRFollow) WithHeader(h map[string]string) func(*CCRFollowRequest) { + return func(r *CCRFollowRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ccr.follow_info.go b/esapi/api.xpack.ccr.follow_info.go new file mode 100755 index 0000000000..5e0a838151 --- /dev/null +++ b/esapi/api.xpack.ccr.follow_info.go @@ -0,0 +1,180 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newCCRFollowInfoFunc(t Transport) CCRFollowInfo { + return func(o ...func(*CCRFollowInfoRequest)) (*Response, error) { + var r = CCRFollowInfoRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// CCRFollowInfo - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html +// +type CCRFollowInfo func(o ...func(*CCRFollowInfoRequest)) (*Response, error) + +// CCRFollowInfoRequest configures the Ccr Follow Info API request. +// +type CCRFollowInfoRequest struct { + Index []string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r CCRFollowInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len(strings.Join(r.Index, ",")) + 1 + len("_ccr") + 1 + len("info")) + if len(r.Index) > 0 { + path.WriteString("/") + path.WriteString(strings.Join(r.Index, ",")) + } + path.WriteString("/") + path.WriteString("_ccr") + path.WriteString("/") + path.WriteString("info") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f CCRFollowInfo) WithContext(v context.Context) func(*CCRFollowInfoRequest) { + return func(r *CCRFollowInfoRequest) { + r.ctx = v + } +} + +// WithIndex - a list of index patterns; use `_all` to perform the operation on all indices. +// +func (f CCRFollowInfo) WithIndex(v ...string) func(*CCRFollowInfoRequest) { + return func(r *CCRFollowInfoRequest) { + r.Index = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f CCRFollowInfo) WithPretty() func(*CCRFollowInfoRequest) { + return func(r *CCRFollowInfoRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f CCRFollowInfo) WithHuman() func(*CCRFollowInfoRequest) { + return func(r *CCRFollowInfoRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f CCRFollowInfo) WithErrorTrace() func(*CCRFollowInfoRequest) { + return func(r *CCRFollowInfoRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f CCRFollowInfo) WithFilterPath(v ...string) func(*CCRFollowInfoRequest) { + return func(r *CCRFollowInfoRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f CCRFollowInfo) WithHeader(h map[string]string) func(*CCRFollowInfoRequest) { + return func(r *CCRFollowInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ccr.follow_stats.go b/esapi/api.xpack.ccr.follow_stats.go new file mode 100755 index 0000000000..7d3260a63a --- /dev/null +++ b/esapi/api.xpack.ccr.follow_stats.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newCCRFollowStatsFunc(t Transport) CCRFollowStats { + return func(index []string, o ...func(*CCRFollowStatsRequest)) (*Response, error) { + var r = CCRFollowStatsRequest{Index: index} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// CCRFollowStats - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html +// +type CCRFollowStats func(index []string, o ...func(*CCRFollowStatsRequest)) (*Response, error) + +// CCRFollowStatsRequest configures the Ccr Follow Stats API request. +// +type CCRFollowStatsRequest struct { + Index []string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r CCRFollowStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len(strings.Join(r.Index, ",")) + 1 + len("_ccr") + 1 + len("stats")) + path.WriteString("/") + path.WriteString(strings.Join(r.Index, ",")) + path.WriteString("/") + path.WriteString("_ccr") + path.WriteString("/") + path.WriteString("stats") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f CCRFollowStats) WithContext(v context.Context) func(*CCRFollowStatsRequest) { + return func(r *CCRFollowStatsRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f CCRFollowStats) WithPretty() func(*CCRFollowStatsRequest) { + return func(r *CCRFollowStatsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f CCRFollowStats) WithHuman() func(*CCRFollowStatsRequest) { + return func(r *CCRFollowStatsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f CCRFollowStats) WithErrorTrace() func(*CCRFollowStatsRequest) { + return func(r *CCRFollowStatsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f CCRFollowStats) WithFilterPath(v ...string) func(*CCRFollowStatsRequest) { + return func(r *CCRFollowStatsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f CCRFollowStats) WithHeader(h map[string]string) func(*CCRFollowStatsRequest) { + return func(r *CCRFollowStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ccr.forget_follower.go b/esapi/api.xpack.ccr.forget_follower.go new file mode 100755 index 0000000000..602e5507c8 --- /dev/null +++ b/esapi/api.xpack.ccr.forget_follower.go @@ -0,0 +1,177 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newCCRForgetFollowerFunc(t Transport) CCRForgetFollower { + return func(index string, body io.Reader, o ...func(*CCRForgetFollowerRequest)) (*Response, error) { + var r = CCRForgetFollowerRequest{Index: index, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// CCRForgetFollower - http://www.elastic.co/guide/en/elasticsearch/reference/current +// +type CCRForgetFollower func(index string, body io.Reader, o ...func(*CCRForgetFollowerRequest)) (*Response, error) + +// CCRForgetFollowerRequest configures the Ccr Forget Follower API request. +// +type CCRForgetFollowerRequest struct { + Index string + + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r CCRForgetFollowerRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len(r.Index) + 1 + len("_ccr") + 1 + len("forget_follower")) + path.WriteString("/") + path.WriteString(r.Index) + path.WriteString("/") + path.WriteString("_ccr") + path.WriteString("/") + path.WriteString("forget_follower") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f CCRForgetFollower) WithContext(v context.Context) func(*CCRForgetFollowerRequest) { + return func(r *CCRForgetFollowerRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f CCRForgetFollower) WithPretty() func(*CCRForgetFollowerRequest) { + return func(r *CCRForgetFollowerRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f CCRForgetFollower) WithHuman() func(*CCRForgetFollowerRequest) { + return func(r *CCRForgetFollowerRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f CCRForgetFollower) WithErrorTrace() func(*CCRForgetFollowerRequest) { + return func(r *CCRForgetFollowerRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f CCRForgetFollower) WithFilterPath(v ...string) func(*CCRForgetFollowerRequest) { + return func(r *CCRForgetFollowerRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f CCRForgetFollower) WithHeader(h map[string]string) func(*CCRForgetFollowerRequest) { + return func(r *CCRForgetFollowerRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ccr.get_auto_follow_pattern.go b/esapi/api.xpack.ccr.get_auto_follow_pattern.go new file mode 100755 index 0000000000..b921ef5e36 --- /dev/null +++ b/esapi/api.xpack.ccr.get_auto_follow_pattern.go @@ -0,0 +1,180 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newCCRGetAutoFollowPatternFunc(t Transport) CCRGetAutoFollowPattern { + return func(o ...func(*CCRGetAutoFollowPatternRequest)) (*Response, error) { + var r = CCRGetAutoFollowPatternRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// CCRGetAutoFollowPattern - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html +// +type CCRGetAutoFollowPattern func(o ...func(*CCRGetAutoFollowPatternRequest)) (*Response, error) + +// CCRGetAutoFollowPatternRequest configures the Ccr Get Auto Follow Pattern API request. +// +type CCRGetAutoFollowPatternRequest struct { + Name string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r CCRGetAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ccr") + 1 + len("auto_follow") + 1 + len(r.Name)) + path.WriteString("/") + path.WriteString("_ccr") + path.WriteString("/") + path.WriteString("auto_follow") + if r.Name != "" { + path.WriteString("/") + path.WriteString(r.Name) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f CCRGetAutoFollowPattern) WithContext(v context.Context) func(*CCRGetAutoFollowPatternRequest) { + return func(r *CCRGetAutoFollowPatternRequest) { + r.ctx = v + } +} + +// WithName - the name of the auto follow pattern.. +// +func (f CCRGetAutoFollowPattern) WithName(v string) func(*CCRGetAutoFollowPatternRequest) { + return func(r *CCRGetAutoFollowPatternRequest) { + r.Name = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f CCRGetAutoFollowPattern) WithPretty() func(*CCRGetAutoFollowPatternRequest) { + return func(r *CCRGetAutoFollowPatternRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f CCRGetAutoFollowPattern) WithHuman() func(*CCRGetAutoFollowPatternRequest) { + return func(r *CCRGetAutoFollowPatternRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f CCRGetAutoFollowPattern) WithErrorTrace() func(*CCRGetAutoFollowPatternRequest) { + return func(r *CCRGetAutoFollowPatternRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f CCRGetAutoFollowPattern) WithFilterPath(v ...string) func(*CCRGetAutoFollowPatternRequest) { + return func(r *CCRGetAutoFollowPatternRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f CCRGetAutoFollowPattern) WithHeader(h map[string]string) func(*CCRGetAutoFollowPatternRequest) { + return func(r *CCRGetAutoFollowPatternRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ccr.pause_follow.go b/esapi/api.xpack.ccr.pause_follow.go new file mode 100755 index 0000000000..58604a163d --- /dev/null +++ b/esapi/api.xpack.ccr.pause_follow.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newCCRPauseFollowFunc(t Transport) CCRPauseFollow { + return func(index string, o ...func(*CCRPauseFollowRequest)) (*Response, error) { + var r = CCRPauseFollowRequest{Index: index} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// CCRPauseFollow - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html +// +type CCRPauseFollow func(index string, o ...func(*CCRPauseFollowRequest)) (*Response, error) + +// CCRPauseFollowRequest configures the Ccr Pause Follow API request. +// +type CCRPauseFollowRequest struct { + Index string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r CCRPauseFollowRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len(r.Index) + 1 + len("_ccr") + 1 + len("pause_follow")) + path.WriteString("/") + path.WriteString(r.Index) + path.WriteString("/") + path.WriteString("_ccr") + path.WriteString("/") + path.WriteString("pause_follow") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f CCRPauseFollow) WithContext(v context.Context) func(*CCRPauseFollowRequest) { + return func(r *CCRPauseFollowRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f CCRPauseFollow) WithPretty() func(*CCRPauseFollowRequest) { + return func(r *CCRPauseFollowRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f CCRPauseFollow) WithHuman() func(*CCRPauseFollowRequest) { + return func(r *CCRPauseFollowRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f CCRPauseFollow) WithErrorTrace() func(*CCRPauseFollowRequest) { + return func(r *CCRPauseFollowRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f CCRPauseFollow) WithFilterPath(v ...string) func(*CCRPauseFollowRequest) { + return func(r *CCRPauseFollowRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f CCRPauseFollow) WithHeader(h map[string]string) func(*CCRPauseFollowRequest) { + return func(r *CCRPauseFollowRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ccr.put_auto_follow_pattern.go b/esapi/api.xpack.ccr.put_auto_follow_pattern.go new file mode 100755 index 0000000000..938d8d47ce --- /dev/null +++ b/esapi/api.xpack.ccr.put_auto_follow_pattern.go @@ -0,0 +1,177 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newCCRPutAutoFollowPatternFunc(t Transport) CCRPutAutoFollowPattern { + return func(name string, body io.Reader, o ...func(*CCRPutAutoFollowPatternRequest)) (*Response, error) { + var r = CCRPutAutoFollowPatternRequest{Name: name, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// CCRPutAutoFollowPattern - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html +// +type CCRPutAutoFollowPattern func(name string, body io.Reader, o ...func(*CCRPutAutoFollowPatternRequest)) (*Response, error) + +// CCRPutAutoFollowPatternRequest configures the Ccr Put Auto Follow Pattern API request. +// +type CCRPutAutoFollowPatternRequest struct { + Body io.Reader + + Name string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r CCRPutAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_ccr") + 1 + len("auto_follow") + 1 + len(r.Name)) + path.WriteString("/") + path.WriteString("_ccr") + path.WriteString("/") + path.WriteString("auto_follow") + path.WriteString("/") + path.WriteString(r.Name) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f CCRPutAutoFollowPattern) WithContext(v context.Context) func(*CCRPutAutoFollowPatternRequest) { + return func(r *CCRPutAutoFollowPatternRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f CCRPutAutoFollowPattern) WithPretty() func(*CCRPutAutoFollowPatternRequest) { + return func(r *CCRPutAutoFollowPatternRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f CCRPutAutoFollowPattern) WithHuman() func(*CCRPutAutoFollowPatternRequest) { + return func(r *CCRPutAutoFollowPatternRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f CCRPutAutoFollowPattern) WithErrorTrace() func(*CCRPutAutoFollowPatternRequest) { + return func(r *CCRPutAutoFollowPatternRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f CCRPutAutoFollowPattern) WithFilterPath(v ...string) func(*CCRPutAutoFollowPatternRequest) { + return func(r *CCRPutAutoFollowPatternRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f CCRPutAutoFollowPattern) WithHeader(h map[string]string) func(*CCRPutAutoFollowPatternRequest) { + return func(r *CCRPutAutoFollowPatternRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ccr.resume_follow.go b/esapi/api.xpack.ccr.resume_follow.go new file mode 100755 index 0000000000..e59c257d2a --- /dev/null +++ b/esapi/api.xpack.ccr.resume_follow.go @@ -0,0 +1,185 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newCCRResumeFollowFunc(t Transport) CCRResumeFollow { + return func(index string, o ...func(*CCRResumeFollowRequest)) (*Response, error) { + var r = CCRResumeFollowRequest{Index: index} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// CCRResumeFollow - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html +// +type CCRResumeFollow func(index string, o ...func(*CCRResumeFollowRequest)) (*Response, error) + +// CCRResumeFollowRequest configures the Ccr Resume Follow API request. +// +type CCRResumeFollowRequest struct { + Index string + + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r CCRResumeFollowRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len(r.Index) + 1 + len("_ccr") + 1 + len("resume_follow")) + path.WriteString("/") + path.WriteString(r.Index) + path.WriteString("/") + path.WriteString("_ccr") + path.WriteString("/") + path.WriteString("resume_follow") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f CCRResumeFollow) WithContext(v context.Context) func(*CCRResumeFollowRequest) { + return func(r *CCRResumeFollowRequest) { + r.ctx = v + } +} + +// WithBody - The name of the leader index and other optional ccr related parameters. +// +func (f CCRResumeFollow) WithBody(v io.Reader) func(*CCRResumeFollowRequest) { + return func(r *CCRResumeFollowRequest) { + r.Body = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f CCRResumeFollow) WithPretty() func(*CCRResumeFollowRequest) { + return func(r *CCRResumeFollowRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f CCRResumeFollow) WithHuman() func(*CCRResumeFollowRequest) { + return func(r *CCRResumeFollowRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f CCRResumeFollow) WithErrorTrace() func(*CCRResumeFollowRequest) { + return func(r *CCRResumeFollowRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f CCRResumeFollow) WithFilterPath(v ...string) func(*CCRResumeFollowRequest) { + return func(r *CCRResumeFollowRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f CCRResumeFollow) WithHeader(h map[string]string) func(*CCRResumeFollowRequest) { + return func(r *CCRResumeFollowRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ccr.stats.go b/esapi/api.xpack.ccr.stats.go new file mode 100755 index 0000000000..6738eef493 --- /dev/null +++ b/esapi/api.xpack.ccr.stats.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newCCRStatsFunc(t Transport) CCRStats { + return func(o ...func(*CCRStatsRequest)) (*Response, error) { + var r = CCRStatsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// CCRStats - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html +// +type CCRStats func(o ...func(*CCRStatsRequest)) (*Response, error) + +// CCRStatsRequest configures the Ccr Stats API request. +// +type CCRStatsRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r CCRStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_ccr/stats")) + path.WriteString("/_ccr/stats") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f CCRStats) WithContext(v context.Context) func(*CCRStatsRequest) { + return func(r *CCRStatsRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f CCRStats) WithPretty() func(*CCRStatsRequest) { + return func(r *CCRStatsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f CCRStats) WithHuman() func(*CCRStatsRequest) { + return func(r *CCRStatsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f CCRStats) WithErrorTrace() func(*CCRStatsRequest) { + return func(r *CCRStatsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f CCRStats) WithFilterPath(v ...string) func(*CCRStatsRequest) { + return func(r *CCRStatsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f CCRStats) WithHeader(h map[string]string) func(*CCRStatsRequest) { + return func(r *CCRStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ccr.unfollow.go b/esapi/api.xpack.ccr.unfollow.go new file mode 100755 index 0000000000..4eae26d523 --- /dev/null +++ b/esapi/api.xpack.ccr.unfollow.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newCCRUnfollowFunc(t Transport) CCRUnfollow { + return func(index string, o ...func(*CCRUnfollowRequest)) (*Response, error) { + var r = CCRUnfollowRequest{Index: index} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// CCRUnfollow - http://www.elastic.co/guide/en/elasticsearch/reference/current +// +type CCRUnfollow func(index string, o ...func(*CCRUnfollowRequest)) (*Response, error) + +// CCRUnfollowRequest configures the Ccr Unfollow API request. +// +type CCRUnfollowRequest struct { + Index string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r CCRUnfollowRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len(r.Index) + 1 + len("_ccr") + 1 + len("unfollow")) + path.WriteString("/") + path.WriteString(r.Index) + path.WriteString("/") + path.WriteString("_ccr") + path.WriteString("/") + path.WriteString("unfollow") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f CCRUnfollow) WithContext(v context.Context) func(*CCRUnfollowRequest) { + return func(r *CCRUnfollowRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f CCRUnfollow) WithPretty() func(*CCRUnfollowRequest) { + return func(r *CCRUnfollowRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f CCRUnfollow) WithHuman() func(*CCRUnfollowRequest) { + return func(r *CCRUnfollowRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f CCRUnfollow) WithErrorTrace() func(*CCRUnfollowRequest) { + return func(r *CCRUnfollowRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f CCRUnfollow) WithFilterPath(v ...string) func(*CCRUnfollowRequest) { + return func(r *CCRUnfollowRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f CCRUnfollow) WithHeader(h map[string]string) func(*CCRUnfollowRequest) { + return func(r *CCRUnfollowRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.data_frame.delete_data_frame_transform.go b/esapi/api.xpack.data_frame.delete_data_frame_transform.go new file mode 100755 index 0000000000..24181ce8d1 --- /dev/null +++ b/esapi/api.xpack.data_frame.delete_data_frame_transform.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newDataFrameDeleteDataFrameTransformFunc(t Transport) DataFrameDeleteDataFrameTransform { + return func(transform_id string, o ...func(*DataFrameDeleteDataFrameTransformRequest)) (*Response, error) { + var r = DataFrameDeleteDataFrameTransformRequest{TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFrameDeleteDataFrameTransform - https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-data-frame-transform.html +// +type DataFrameDeleteDataFrameTransform func(transform_id string, o ...func(*DataFrameDeleteDataFrameTransformRequest)) (*Response, error) + +// DataFrameDeleteDataFrameTransformRequest configures the Data Frame Delete Data Frame Transform API request. +// +type DataFrameDeleteDataFrameTransformRequest struct { + TransformID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFrameDeleteDataFrameTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_data_frame") + 1 + len("transforms") + 1 + len(r.TransformID)) + path.WriteString("/") + path.WriteString("_data_frame") + path.WriteString("/") + path.WriteString("transforms") + path.WriteString("/") + path.WriteString(r.TransformID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFrameDeleteDataFrameTransform) WithContext(v context.Context) func(*DataFrameDeleteDataFrameTransformRequest) { + return func(r *DataFrameDeleteDataFrameTransformRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFrameDeleteDataFrameTransform) WithPretty() func(*DataFrameDeleteDataFrameTransformRequest) { + return func(r *DataFrameDeleteDataFrameTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFrameDeleteDataFrameTransform) WithHuman() func(*DataFrameDeleteDataFrameTransformRequest) { + return func(r *DataFrameDeleteDataFrameTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFrameDeleteDataFrameTransform) WithErrorTrace() func(*DataFrameDeleteDataFrameTransformRequest) { + return func(r *DataFrameDeleteDataFrameTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFrameDeleteDataFrameTransform) WithFilterPath(v ...string) func(*DataFrameDeleteDataFrameTransformRequest) { + return func(r *DataFrameDeleteDataFrameTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFrameDeleteDataFrameTransform) WithHeader(h map[string]string) func(*DataFrameDeleteDataFrameTransformRequest) { + return func(r *DataFrameDeleteDataFrameTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.data_frame.get_data_frame_transform.go b/esapi/api.xpack.data_frame.get_data_frame_transform.go new file mode 100755 index 0000000000..061b3b2cef --- /dev/null +++ b/esapi/api.xpack.data_frame.get_data_frame_transform.go @@ -0,0 +1,221 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newDataFrameGetDataFrameTransformFunc(t Transport) DataFrameGetDataFrameTransform { + return func(o ...func(*DataFrameGetDataFrameTransformRequest)) (*Response, error) { + var r = DataFrameGetDataFrameTransformRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFrameGetDataFrameTransform - https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html +// +type DataFrameGetDataFrameTransform func(o ...func(*DataFrameGetDataFrameTransformRequest)) (*Response, error) + +// DataFrameGetDataFrameTransformRequest configures the Data Frame Get Data Frame Transform API request. +// +type DataFrameGetDataFrameTransformRequest struct { + TransformID string + + AllowNoMatch *bool + From *int + Size *int + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFrameGetDataFrameTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_data_frame") + 1 + len("transforms") + 1 + len(r.TransformID)) + path.WriteString("/") + path.WriteString("_data_frame") + path.WriteString("/") + path.WriteString("transforms") + if r.TransformID != "" { + path.WriteString("/") + path.WriteString(r.TransformID) + } + + params = make(map[string]string) + + if r.AllowNoMatch != nil { + params["allow_no_match"] = strconv.FormatBool(*r.AllowNoMatch) + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFrameGetDataFrameTransform) WithContext(v context.Context) func(*DataFrameGetDataFrameTransformRequest) { + return func(r *DataFrameGetDataFrameTransformRequest) { + r.ctx = v + } +} + +// WithTransformID - the ID or comma delimited list of ID expressions of the transforms to get, '_all' or '*' implies get all transforms. +// +func (f DataFrameGetDataFrameTransform) WithTransformID(v string) func(*DataFrameGetDataFrameTransformRequest) { + return func(r *DataFrameGetDataFrameTransformRequest) { + r.TransformID = v + } +} + +// WithAllowNoMatch - whether to ignore if a wildcard expression matches no data frame transforms. (this includes `_all` string or when no data frame transforms have been specified). +// +func (f DataFrameGetDataFrameTransform) WithAllowNoMatch(v bool) func(*DataFrameGetDataFrameTransformRequest) { + return func(r *DataFrameGetDataFrameTransformRequest) { + r.AllowNoMatch = &v + } +} + +// WithFrom - skips a number of transform configs, defaults to 0. +// +func (f DataFrameGetDataFrameTransform) WithFrom(v int) func(*DataFrameGetDataFrameTransformRequest) { + return func(r *DataFrameGetDataFrameTransformRequest) { + r.From = &v + } +} + +// WithSize - specifies a max number of transforms to get, defaults to 100. +// +func (f DataFrameGetDataFrameTransform) WithSize(v int) func(*DataFrameGetDataFrameTransformRequest) { + return func(r *DataFrameGetDataFrameTransformRequest) { + r.Size = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFrameGetDataFrameTransform) WithPretty() func(*DataFrameGetDataFrameTransformRequest) { + return func(r *DataFrameGetDataFrameTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFrameGetDataFrameTransform) WithHuman() func(*DataFrameGetDataFrameTransformRequest) { + return func(r *DataFrameGetDataFrameTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFrameGetDataFrameTransform) WithErrorTrace() func(*DataFrameGetDataFrameTransformRequest) { + return func(r *DataFrameGetDataFrameTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFrameGetDataFrameTransform) WithFilterPath(v ...string) func(*DataFrameGetDataFrameTransformRequest) { + return func(r *DataFrameGetDataFrameTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFrameGetDataFrameTransform) WithHeader(h map[string]string) func(*DataFrameGetDataFrameTransformRequest) { + return func(r *DataFrameGetDataFrameTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go b/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go new file mode 100755 index 0000000000..d5f9bb9fd7 --- /dev/null +++ b/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go @@ -0,0 +1,223 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newDataFrameGetDataFrameTransformStatsFunc(t Transport) DataFrameGetDataFrameTransformStats { + return func(o ...func(*DataFrameGetDataFrameTransformStatsRequest)) (*Response, error) { + var r = DataFrameGetDataFrameTransformStatsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFrameGetDataFrameTransformStats - https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html +// +type DataFrameGetDataFrameTransformStats func(o ...func(*DataFrameGetDataFrameTransformStatsRequest)) (*Response, error) + +// DataFrameGetDataFrameTransformStatsRequest configures the Data Frame Get Data Frame Transform Stats API request. +// +type DataFrameGetDataFrameTransformStatsRequest struct { + TransformID string + + AllowNoMatch *bool + From *int + Size *int + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFrameGetDataFrameTransformStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_data_frame") + 1 + len("transforms") + 1 + len(r.TransformID) + 1 + len("_stats")) + path.WriteString("/") + path.WriteString("_data_frame") + path.WriteString("/") + path.WriteString("transforms") + if r.TransformID != "" { + path.WriteString("/") + path.WriteString(r.TransformID) + } + path.WriteString("/") + path.WriteString("_stats") + + params = make(map[string]string) + + if r.AllowNoMatch != nil { + params["allow_no_match"] = strconv.FormatBool(*r.AllowNoMatch) + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFrameGetDataFrameTransformStats) WithContext(v context.Context) func(*DataFrameGetDataFrameTransformStatsRequest) { + return func(r *DataFrameGetDataFrameTransformStatsRequest) { + r.ctx = v + } +} + +// WithTransformID - the ID of the transform for which to get stats. '_all' or '*' implies all transforms. +// +func (f DataFrameGetDataFrameTransformStats) WithTransformID(v string) func(*DataFrameGetDataFrameTransformStatsRequest) { + return func(r *DataFrameGetDataFrameTransformStatsRequest) { + r.TransformID = v + } +} + +// WithAllowNoMatch - whether to ignore if a wildcard expression matches no data frame transforms. (this includes `_all` string or when no data frame transforms have been specified). +// +func (f DataFrameGetDataFrameTransformStats) WithAllowNoMatch(v bool) func(*DataFrameGetDataFrameTransformStatsRequest) { + return func(r *DataFrameGetDataFrameTransformStatsRequest) { + r.AllowNoMatch = &v + } +} + +// WithFrom - skips a number of transform stats, defaults to 0. +// +func (f DataFrameGetDataFrameTransformStats) WithFrom(v int) func(*DataFrameGetDataFrameTransformStatsRequest) { + return func(r *DataFrameGetDataFrameTransformStatsRequest) { + r.From = &v + } +} + +// WithSize - specifies a max number of transform stats to get, defaults to 100. +// +func (f DataFrameGetDataFrameTransformStats) WithSize(v int) func(*DataFrameGetDataFrameTransformStatsRequest) { + return func(r *DataFrameGetDataFrameTransformStatsRequest) { + r.Size = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFrameGetDataFrameTransformStats) WithPretty() func(*DataFrameGetDataFrameTransformStatsRequest) { + return func(r *DataFrameGetDataFrameTransformStatsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFrameGetDataFrameTransformStats) WithHuman() func(*DataFrameGetDataFrameTransformStatsRequest) { + return func(r *DataFrameGetDataFrameTransformStatsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFrameGetDataFrameTransformStats) WithErrorTrace() func(*DataFrameGetDataFrameTransformStatsRequest) { + return func(r *DataFrameGetDataFrameTransformStatsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFrameGetDataFrameTransformStats) WithFilterPath(v ...string) func(*DataFrameGetDataFrameTransformStatsRequest) { + return func(r *DataFrameGetDataFrameTransformStatsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFrameGetDataFrameTransformStats) WithHeader(h map[string]string) func(*DataFrameGetDataFrameTransformStatsRequest) { + return func(r *DataFrameGetDataFrameTransformStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.data_frame.preview_data_frame_transform.go b/esapi/api.xpack.data_frame.preview_data_frame_transform.go new file mode 100755 index 0000000000..c7f9788f7f --- /dev/null +++ b/esapi/api.xpack.data_frame.preview_data_frame_transform.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newDataFramePreviewDataFrameTransformFunc(t Transport) DataFramePreviewDataFrameTransform { + return func(body io.Reader, o ...func(*DataFramePreviewDataFrameTransformRequest)) (*Response, error) { + var r = DataFramePreviewDataFrameTransformRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFramePreviewDataFrameTransform - https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html +// +type DataFramePreviewDataFrameTransform func(body io.Reader, o ...func(*DataFramePreviewDataFrameTransformRequest)) (*Response, error) + +// DataFramePreviewDataFrameTransformRequest configures the Data Frame Preview Data Frame Transform API request. +// +type DataFramePreviewDataFrameTransformRequest struct { + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFramePreviewDataFrameTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_data_frame/transforms/_preview")) + path.WriteString("/_data_frame/transforms/_preview") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFramePreviewDataFrameTransform) WithContext(v context.Context) func(*DataFramePreviewDataFrameTransformRequest) { + return func(r *DataFramePreviewDataFrameTransformRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFramePreviewDataFrameTransform) WithPretty() func(*DataFramePreviewDataFrameTransformRequest) { + return func(r *DataFramePreviewDataFrameTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFramePreviewDataFrameTransform) WithHuman() func(*DataFramePreviewDataFrameTransformRequest) { + return func(r *DataFramePreviewDataFrameTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFramePreviewDataFrameTransform) WithErrorTrace() func(*DataFramePreviewDataFrameTransformRequest) { + return func(r *DataFramePreviewDataFrameTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFramePreviewDataFrameTransform) WithFilterPath(v ...string) func(*DataFramePreviewDataFrameTransformRequest) { + return func(r *DataFramePreviewDataFrameTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFramePreviewDataFrameTransform) WithHeader(h map[string]string) func(*DataFramePreviewDataFrameTransformRequest) { + return func(r *DataFramePreviewDataFrameTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.data_frame.put_data_frame_transform.go b/esapi/api.xpack.data_frame.put_data_frame_transform.go new file mode 100755 index 0000000000..41252e9732 --- /dev/null +++ b/esapi/api.xpack.data_frame.put_data_frame_transform.go @@ -0,0 +1,177 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newDataFramePutDataFrameTransformFunc(t Transport) DataFramePutDataFrameTransform { + return func(body io.Reader, transform_id string, o ...func(*DataFramePutDataFrameTransformRequest)) (*Response, error) { + var r = DataFramePutDataFrameTransformRequest{Body: body, TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFramePutDataFrameTransform - https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html +// +type DataFramePutDataFrameTransform func(body io.Reader, transform_id string, o ...func(*DataFramePutDataFrameTransformRequest)) (*Response, error) + +// DataFramePutDataFrameTransformRequest configures the Data Frame Put Data Frame Transform API request. +// +type DataFramePutDataFrameTransformRequest struct { + Body io.Reader + + TransformID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFramePutDataFrameTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_data_frame") + 1 + len("transforms") + 1 + len(r.TransformID)) + path.WriteString("/") + path.WriteString("_data_frame") + path.WriteString("/") + path.WriteString("transforms") + path.WriteString("/") + path.WriteString(r.TransformID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFramePutDataFrameTransform) WithContext(v context.Context) func(*DataFramePutDataFrameTransformRequest) { + return func(r *DataFramePutDataFrameTransformRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFramePutDataFrameTransform) WithPretty() func(*DataFramePutDataFrameTransformRequest) { + return func(r *DataFramePutDataFrameTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFramePutDataFrameTransform) WithHuman() func(*DataFramePutDataFrameTransformRequest) { + return func(r *DataFramePutDataFrameTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFramePutDataFrameTransform) WithErrorTrace() func(*DataFramePutDataFrameTransformRequest) { + return func(r *DataFramePutDataFrameTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFramePutDataFrameTransform) WithFilterPath(v ...string) func(*DataFramePutDataFrameTransformRequest) { + return func(r *DataFramePutDataFrameTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFramePutDataFrameTransform) WithHeader(h map[string]string) func(*DataFramePutDataFrameTransformRequest) { + return func(r *DataFramePutDataFrameTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.data_frame.start_data_frame_transform.go b/esapi/api.xpack.data_frame.start_data_frame_transform.go new file mode 100755 index 0000000000..01de9a95e3 --- /dev/null +++ b/esapi/api.xpack.data_frame.start_data_frame_transform.go @@ -0,0 +1,187 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" + "time" +) + +func newDataFrameStartDataFrameTransformFunc(t Transport) DataFrameStartDataFrameTransform { + return func(transform_id string, o ...func(*DataFrameStartDataFrameTransformRequest)) (*Response, error) { + var r = DataFrameStartDataFrameTransformRequest{TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFrameStartDataFrameTransform - https://www.elastic.co/guide/en/elasticsearch/reference/current/start-data-frame-transform.html +// +type DataFrameStartDataFrameTransform func(transform_id string, o ...func(*DataFrameStartDataFrameTransformRequest)) (*Response, error) + +// DataFrameStartDataFrameTransformRequest configures the Data Frame Start Data Frame Transform API request. +// +type DataFrameStartDataFrameTransformRequest struct { + TransformID string + + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFrameStartDataFrameTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_data_frame") + 1 + len("transforms") + 1 + len(r.TransformID) + 1 + len("_start")) + path.WriteString("/") + path.WriteString("_data_frame") + path.WriteString("/") + path.WriteString("transforms") + path.WriteString("/") + path.WriteString(r.TransformID) + path.WriteString("/") + path.WriteString("_start") + + params = make(map[string]string) + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFrameStartDataFrameTransform) WithContext(v context.Context) func(*DataFrameStartDataFrameTransformRequest) { + return func(r *DataFrameStartDataFrameTransformRequest) { + r.ctx = v + } +} + +// WithTimeout - controls the time to wait for the transform to start. +// +func (f DataFrameStartDataFrameTransform) WithTimeout(v time.Duration) func(*DataFrameStartDataFrameTransformRequest) { + return func(r *DataFrameStartDataFrameTransformRequest) { + r.Timeout = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFrameStartDataFrameTransform) WithPretty() func(*DataFrameStartDataFrameTransformRequest) { + return func(r *DataFrameStartDataFrameTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFrameStartDataFrameTransform) WithHuman() func(*DataFrameStartDataFrameTransformRequest) { + return func(r *DataFrameStartDataFrameTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFrameStartDataFrameTransform) WithErrorTrace() func(*DataFrameStartDataFrameTransformRequest) { + return func(r *DataFrameStartDataFrameTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFrameStartDataFrameTransform) WithFilterPath(v ...string) func(*DataFrameStartDataFrameTransformRequest) { + return func(r *DataFrameStartDataFrameTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFrameStartDataFrameTransform) WithHeader(h map[string]string) func(*DataFrameStartDataFrameTransformRequest) { + return func(r *DataFrameStartDataFrameTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.data_frame.stop_data_frame_transform.go b/esapi/api.xpack.data_frame.stop_data_frame_transform.go new file mode 100755 index 0000000000..dd781b5d6e --- /dev/null +++ b/esapi/api.xpack.data_frame.stop_data_frame_transform.go @@ -0,0 +1,214 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" + "time" +) + +func newDataFrameStopDataFrameTransformFunc(t Transport) DataFrameStopDataFrameTransform { + return func(transform_id string, o ...func(*DataFrameStopDataFrameTransformRequest)) (*Response, error) { + var r = DataFrameStopDataFrameTransformRequest{TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFrameStopDataFrameTransform - https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html +// +type DataFrameStopDataFrameTransform func(transform_id string, o ...func(*DataFrameStopDataFrameTransformRequest)) (*Response, error) + +// DataFrameStopDataFrameTransformRequest configures the Data Frame Stop Data Frame Transform API request. +// +type DataFrameStopDataFrameTransformRequest struct { + TransformID string + + AllowNoMatch *bool + Timeout time.Duration + WaitForCompletion *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFrameStopDataFrameTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_data_frame") + 1 + len("transforms") + 1 + len(r.TransformID) + 1 + len("_stop")) + path.WriteString("/") + path.WriteString("_data_frame") + path.WriteString("/") + path.WriteString("transforms") + path.WriteString("/") + path.WriteString(r.TransformID) + path.WriteString("/") + path.WriteString("_stop") + + params = make(map[string]string) + + if r.AllowNoMatch != nil { + params["allow_no_match"] = strconv.FormatBool(*r.AllowNoMatch) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForCompletion != nil { + params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFrameStopDataFrameTransform) WithContext(v context.Context) func(*DataFrameStopDataFrameTransformRequest) { + return func(r *DataFrameStopDataFrameTransformRequest) { + r.ctx = v + } +} + +// WithAllowNoMatch - whether to ignore if a wildcard expression matches no data frame transforms. (this includes `_all` string or when no data frame transforms have been specified). +// +func (f DataFrameStopDataFrameTransform) WithAllowNoMatch(v bool) func(*DataFrameStopDataFrameTransformRequest) { + return func(r *DataFrameStopDataFrameTransformRequest) { + r.AllowNoMatch = &v + } +} + +// WithTimeout - controls the time to wait until the transform has stopped. default to 30 seconds. +// +func (f DataFrameStopDataFrameTransform) WithTimeout(v time.Duration) func(*DataFrameStopDataFrameTransformRequest) { + return func(r *DataFrameStopDataFrameTransformRequest) { + r.Timeout = v + } +} + +// WithWaitForCompletion - whether to wait for the transform to fully stop before returning or not. default to false. +// +func (f DataFrameStopDataFrameTransform) WithWaitForCompletion(v bool) func(*DataFrameStopDataFrameTransformRequest) { + return func(r *DataFrameStopDataFrameTransformRequest) { + r.WaitForCompletion = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFrameStopDataFrameTransform) WithPretty() func(*DataFrameStopDataFrameTransformRequest) { + return func(r *DataFrameStopDataFrameTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFrameStopDataFrameTransform) WithHuman() func(*DataFrameStopDataFrameTransformRequest) { + return func(r *DataFrameStopDataFrameTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFrameStopDataFrameTransform) WithErrorTrace() func(*DataFrameStopDataFrameTransformRequest) { + return func(r *DataFrameStopDataFrameTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFrameStopDataFrameTransform) WithFilterPath(v ...string) func(*DataFrameStopDataFrameTransformRequest) { + return func(r *DataFrameStopDataFrameTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFrameStopDataFrameTransform) WithHeader(h map[string]string) func(*DataFrameStopDataFrameTransformRequest) { + return func(r *DataFrameStopDataFrameTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.graph.explore.go b/esapi/api.xpack.graph.explore.go new file mode 100755 index 0000000000..2ea3360c60 --- /dev/null +++ b/esapi/api.xpack.graph.explore.go @@ -0,0 +1,236 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" + "time" +) + +func newGraphExploreFunc(t Transport) GraphExplore { + return func(o ...func(*GraphExploreRequest)) (*Response, error) { + var r = GraphExploreRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// GraphExplore - https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html +// +type GraphExplore func(o ...func(*GraphExploreRequest)) (*Response, error) + +// GraphExploreRequest configures the Graph Explore API request. +// +type GraphExploreRequest struct { + Index []string + DocumentType []string + + Body io.Reader + + Routing string + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r GraphExploreRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len(strings.Join(r.Index, ",")) + 1 + len(strings.Join(r.DocumentType, ",")) + 1 + len("_graph") + 1 + len("explore")) + if len(r.Index) > 0 { + path.WriteString("/") + path.WriteString(strings.Join(r.Index, ",")) + } + if len(r.DocumentType) > 0 { + path.WriteString("/") + path.WriteString(strings.Join(r.DocumentType, ",")) + } + path.WriteString("/") + path.WriteString("_graph") + path.WriteString("/") + path.WriteString("explore") + + params = make(map[string]string) + + if r.Routing != "" { + params["routing"] = r.Routing + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f GraphExplore) WithContext(v context.Context) func(*GraphExploreRequest) { + return func(r *GraphExploreRequest) { + r.ctx = v + } +} + +// WithBody - Graph Query DSL. +// +func (f GraphExplore) WithBody(v io.Reader) func(*GraphExploreRequest) { + return func(r *GraphExploreRequest) { + r.Body = v + } +} + +// WithIndex - a list of index names to search; use _all to perform the operation on all indices. +// +func (f GraphExplore) WithIndex(v ...string) func(*GraphExploreRequest) { + return func(r *GraphExploreRequest) { + r.Index = v + } +} + +// WithDocumentType - a list of document types to search; leave empty to perform the operation on all types. +// +func (f GraphExplore) WithDocumentType(v ...string) func(*GraphExploreRequest) { + return func(r *GraphExploreRequest) { + r.DocumentType = v + } +} + +// WithRouting - specific routing value. +// +func (f GraphExplore) WithRouting(v string) func(*GraphExploreRequest) { + return func(r *GraphExploreRequest) { + r.Routing = v + } +} + +// WithTimeout - explicit operation timeout. +// +func (f GraphExplore) WithTimeout(v time.Duration) func(*GraphExploreRequest) { + return func(r *GraphExploreRequest) { + r.Timeout = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f GraphExplore) WithPretty() func(*GraphExploreRequest) { + return func(r *GraphExploreRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f GraphExplore) WithHuman() func(*GraphExploreRequest) { + return func(r *GraphExploreRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f GraphExplore) WithErrorTrace() func(*GraphExploreRequest) { + return func(r *GraphExploreRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f GraphExplore) WithFilterPath(v ...string) func(*GraphExploreRequest) { + return func(r *GraphExploreRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f GraphExplore) WithHeader(h map[string]string) func(*GraphExploreRequest) { + return func(r *GraphExploreRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ilm.delete_lifecycle.go b/esapi/api.xpack.ilm.delete_lifecycle.go new file mode 100755 index 0000000000..deb08dff22 --- /dev/null +++ b/esapi/api.xpack.ilm.delete_lifecycle.go @@ -0,0 +1,180 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newILMDeleteLifecycleFunc(t Transport) ILMDeleteLifecycle { + return func(o ...func(*ILMDeleteLifecycleRequest)) (*Response, error) { + var r = ILMDeleteLifecycleRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ILMDeleteLifecycle - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html +// +type ILMDeleteLifecycle func(o ...func(*ILMDeleteLifecycleRequest)) (*Response, error) + +// ILMDeleteLifecycleRequest configures the Ilm Delete Lifecycle API request. +// +type ILMDeleteLifecycleRequest struct { + Policy string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r ILMDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_ilm") + 1 + len("policy") + 1 + len(r.Policy)) + path.WriteString("/") + path.WriteString("_ilm") + path.WriteString("/") + path.WriteString("policy") + if r.Policy != "" { + path.WriteString("/") + path.WriteString(r.Policy) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f ILMDeleteLifecycle) WithContext(v context.Context) func(*ILMDeleteLifecycleRequest) { + return func(r *ILMDeleteLifecycleRequest) { + r.ctx = v + } +} + +// WithPolicy - the name of the index lifecycle policy. +// +func (f ILMDeleteLifecycle) WithPolicy(v string) func(*ILMDeleteLifecycleRequest) { + return func(r *ILMDeleteLifecycleRequest) { + r.Policy = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f ILMDeleteLifecycle) WithPretty() func(*ILMDeleteLifecycleRequest) { + return func(r *ILMDeleteLifecycleRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f ILMDeleteLifecycle) WithHuman() func(*ILMDeleteLifecycleRequest) { + return func(r *ILMDeleteLifecycleRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f ILMDeleteLifecycle) WithErrorTrace() func(*ILMDeleteLifecycleRequest) { + return func(r *ILMDeleteLifecycleRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f ILMDeleteLifecycle) WithFilterPath(v ...string) func(*ILMDeleteLifecycleRequest) { + return func(r *ILMDeleteLifecycleRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f ILMDeleteLifecycle) WithHeader(h map[string]string) func(*ILMDeleteLifecycleRequest) { + return func(r *ILMDeleteLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ilm.explain_lifecycle.go b/esapi/api.xpack.ilm.explain_lifecycle.go new file mode 100755 index 0000000000..8fa886a252 --- /dev/null +++ b/esapi/api.xpack.ilm.explain_lifecycle.go @@ -0,0 +1,180 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newILMExplainLifecycleFunc(t Transport) ILMExplainLifecycle { + return func(o ...func(*ILMExplainLifecycleRequest)) (*Response, error) { + var r = ILMExplainLifecycleRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ILMExplainLifecycle - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html +// +type ILMExplainLifecycle func(o ...func(*ILMExplainLifecycleRequest)) (*Response, error) + +// ILMExplainLifecycleRequest configures the Ilm Explain Lifecycle API request. +// +type ILMExplainLifecycleRequest struct { + Index string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r ILMExplainLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len(r.Index) + 1 + len("_ilm") + 1 + len("explain")) + if r.Index != "" { + path.WriteString("/") + path.WriteString(r.Index) + } + path.WriteString("/") + path.WriteString("_ilm") + path.WriteString("/") + path.WriteString("explain") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f ILMExplainLifecycle) WithContext(v context.Context) func(*ILMExplainLifecycleRequest) { + return func(r *ILMExplainLifecycleRequest) { + r.ctx = v + } +} + +// WithIndex - the name of the index to explain. +// +func (f ILMExplainLifecycle) WithIndex(v string) func(*ILMExplainLifecycleRequest) { + return func(r *ILMExplainLifecycleRequest) { + r.Index = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f ILMExplainLifecycle) WithPretty() func(*ILMExplainLifecycleRequest) { + return func(r *ILMExplainLifecycleRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f ILMExplainLifecycle) WithHuman() func(*ILMExplainLifecycleRequest) { + return func(r *ILMExplainLifecycleRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f ILMExplainLifecycle) WithErrorTrace() func(*ILMExplainLifecycleRequest) { + return func(r *ILMExplainLifecycleRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f ILMExplainLifecycle) WithFilterPath(v ...string) func(*ILMExplainLifecycleRequest) { + return func(r *ILMExplainLifecycleRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f ILMExplainLifecycle) WithHeader(h map[string]string) func(*ILMExplainLifecycleRequest) { + return func(r *ILMExplainLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ilm.get_lifecycle.go b/esapi/api.xpack.ilm.get_lifecycle.go new file mode 100755 index 0000000000..f37c89927e --- /dev/null +++ b/esapi/api.xpack.ilm.get_lifecycle.go @@ -0,0 +1,180 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newILMGetLifecycleFunc(t Transport) ILMGetLifecycle { + return func(o ...func(*ILMGetLifecycleRequest)) (*Response, error) { + var r = ILMGetLifecycleRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ILMGetLifecycle - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html +// +type ILMGetLifecycle func(o ...func(*ILMGetLifecycleRequest)) (*Response, error) + +// ILMGetLifecycleRequest configures the Ilm Get Lifecycle API request. +// +type ILMGetLifecycleRequest struct { + Policy string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r ILMGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ilm") + 1 + len("policy") + 1 + len(r.Policy)) + path.WriteString("/") + path.WriteString("_ilm") + path.WriteString("/") + path.WriteString("policy") + if r.Policy != "" { + path.WriteString("/") + path.WriteString(r.Policy) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f ILMGetLifecycle) WithContext(v context.Context) func(*ILMGetLifecycleRequest) { + return func(r *ILMGetLifecycleRequest) { + r.ctx = v + } +} + +// WithPolicy - the name of the index lifecycle policy. +// +func (f ILMGetLifecycle) WithPolicy(v string) func(*ILMGetLifecycleRequest) { + return func(r *ILMGetLifecycleRequest) { + r.Policy = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f ILMGetLifecycle) WithPretty() func(*ILMGetLifecycleRequest) { + return func(r *ILMGetLifecycleRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f ILMGetLifecycle) WithHuman() func(*ILMGetLifecycleRequest) { + return func(r *ILMGetLifecycleRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f ILMGetLifecycle) WithErrorTrace() func(*ILMGetLifecycleRequest) { + return func(r *ILMGetLifecycleRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f ILMGetLifecycle) WithFilterPath(v ...string) func(*ILMGetLifecycleRequest) { + return func(r *ILMGetLifecycleRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f ILMGetLifecycle) WithHeader(h map[string]string) func(*ILMGetLifecycleRequest) { + return func(r *ILMGetLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ilm.get_status.go b/esapi/api.xpack.ilm.get_status.go new file mode 100755 index 0000000000..3c2a52827b --- /dev/null +++ b/esapi/api.xpack.ilm.get_status.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newILMGetStatusFunc(t Transport) ILMGetStatus { + return func(o ...func(*ILMGetStatusRequest)) (*Response, error) { + var r = ILMGetStatusRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ILMGetStatus - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html +// +type ILMGetStatus func(o ...func(*ILMGetStatusRequest)) (*Response, error) + +// ILMGetStatusRequest configures the Ilm Get Status API request. +// +type ILMGetStatusRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r ILMGetStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_ilm/status")) + path.WriteString("/_ilm/status") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f ILMGetStatus) WithContext(v context.Context) func(*ILMGetStatusRequest) { + return func(r *ILMGetStatusRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f ILMGetStatus) WithPretty() func(*ILMGetStatusRequest) { + return func(r *ILMGetStatusRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f ILMGetStatus) WithHuman() func(*ILMGetStatusRequest) { + return func(r *ILMGetStatusRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f ILMGetStatus) WithErrorTrace() func(*ILMGetStatusRequest) { + return func(r *ILMGetStatusRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f ILMGetStatus) WithFilterPath(v ...string) func(*ILMGetStatusRequest) { + return func(r *ILMGetStatusRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f ILMGetStatus) WithHeader(h map[string]string) func(*ILMGetStatusRequest) { + return func(r *ILMGetStatusRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ilm.move_to_step.go b/esapi/api.xpack.ilm.move_to_step.go new file mode 100755 index 0000000000..92f1f07317 --- /dev/null +++ b/esapi/api.xpack.ilm.move_to_step.go @@ -0,0 +1,195 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newILMMoveToStepFunc(t Transport) ILMMoveToStep { + return func(o ...func(*ILMMoveToStepRequest)) (*Response, error) { + var r = ILMMoveToStepRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ILMMoveToStep - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html +// +type ILMMoveToStep func(o ...func(*ILMMoveToStepRequest)) (*Response, error) + +// ILMMoveToStepRequest configures the Ilm Move To Step API request. +// +type ILMMoveToStepRequest struct { + Index string + + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r ILMMoveToStepRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ilm") + 1 + len("move") + 1 + len(r.Index)) + path.WriteString("/") + path.WriteString("_ilm") + path.WriteString("/") + path.WriteString("move") + if r.Index != "" { + path.WriteString("/") + path.WriteString(r.Index) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f ILMMoveToStep) WithContext(v context.Context) func(*ILMMoveToStepRequest) { + return func(r *ILMMoveToStepRequest) { + r.ctx = v + } +} + +// WithBody - The new lifecycle step to move to. +// +func (f ILMMoveToStep) WithBody(v io.Reader) func(*ILMMoveToStepRequest) { + return func(r *ILMMoveToStepRequest) { + r.Body = v + } +} + +// WithIndex - the name of the index whose lifecycle step is to change. +// +func (f ILMMoveToStep) WithIndex(v string) func(*ILMMoveToStepRequest) { + return func(r *ILMMoveToStepRequest) { + r.Index = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f ILMMoveToStep) WithPretty() func(*ILMMoveToStepRequest) { + return func(r *ILMMoveToStepRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f ILMMoveToStep) WithHuman() func(*ILMMoveToStepRequest) { + return func(r *ILMMoveToStepRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f ILMMoveToStep) WithErrorTrace() func(*ILMMoveToStepRequest) { + return func(r *ILMMoveToStepRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f ILMMoveToStep) WithFilterPath(v ...string) func(*ILMMoveToStepRequest) { + return func(r *ILMMoveToStepRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f ILMMoveToStep) WithHeader(h map[string]string) func(*ILMMoveToStepRequest) { + return func(r *ILMMoveToStepRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ilm.put_lifecycle.go b/esapi/api.xpack.ilm.put_lifecycle.go new file mode 100755 index 0000000000..2283ae6c3f --- /dev/null +++ b/esapi/api.xpack.ilm.put_lifecycle.go @@ -0,0 +1,195 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newILMPutLifecycleFunc(t Transport) ILMPutLifecycle { + return func(o ...func(*ILMPutLifecycleRequest)) (*Response, error) { + var r = ILMPutLifecycleRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ILMPutLifecycle - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html +// +type ILMPutLifecycle func(o ...func(*ILMPutLifecycleRequest)) (*Response, error) + +// ILMPutLifecycleRequest configures the Ilm Put Lifecycle API request. +// +type ILMPutLifecycleRequest struct { + Body io.Reader + + Policy string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r ILMPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_ilm") + 1 + len("policy") + 1 + len(r.Policy)) + path.WriteString("/") + path.WriteString("_ilm") + path.WriteString("/") + path.WriteString("policy") + if r.Policy != "" { + path.WriteString("/") + path.WriteString(r.Policy) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f ILMPutLifecycle) WithContext(v context.Context) func(*ILMPutLifecycleRequest) { + return func(r *ILMPutLifecycleRequest) { + r.ctx = v + } +} + +// WithBody - The lifecycle policy definition to register. +// +func (f ILMPutLifecycle) WithBody(v io.Reader) func(*ILMPutLifecycleRequest) { + return func(r *ILMPutLifecycleRequest) { + r.Body = v + } +} + +// WithPolicy - the name of the index lifecycle policy. +// +func (f ILMPutLifecycle) WithPolicy(v string) func(*ILMPutLifecycleRequest) { + return func(r *ILMPutLifecycleRequest) { + r.Policy = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f ILMPutLifecycle) WithPretty() func(*ILMPutLifecycleRequest) { + return func(r *ILMPutLifecycleRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f ILMPutLifecycle) WithHuman() func(*ILMPutLifecycleRequest) { + return func(r *ILMPutLifecycleRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f ILMPutLifecycle) WithErrorTrace() func(*ILMPutLifecycleRequest) { + return func(r *ILMPutLifecycleRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f ILMPutLifecycle) WithFilterPath(v ...string) func(*ILMPutLifecycleRequest) { + return func(r *ILMPutLifecycleRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f ILMPutLifecycle) WithHeader(h map[string]string) func(*ILMPutLifecycleRequest) { + return func(r *ILMPutLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ilm.remove_policy.go b/esapi/api.xpack.ilm.remove_policy.go new file mode 100755 index 0000000000..5609b33796 --- /dev/null +++ b/esapi/api.xpack.ilm.remove_policy.go @@ -0,0 +1,180 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newILMRemovePolicyFunc(t Transport) ILMRemovePolicy { + return func(o ...func(*ILMRemovePolicyRequest)) (*Response, error) { + var r = ILMRemovePolicyRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ILMRemovePolicy - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html +// +type ILMRemovePolicy func(o ...func(*ILMRemovePolicyRequest)) (*Response, error) + +// ILMRemovePolicyRequest configures the Ilm Remove Policy API request. +// +type ILMRemovePolicyRequest struct { + Index string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r ILMRemovePolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len(r.Index) + 1 + len("_ilm") + 1 + len("remove")) + if r.Index != "" { + path.WriteString("/") + path.WriteString(r.Index) + } + path.WriteString("/") + path.WriteString("_ilm") + path.WriteString("/") + path.WriteString("remove") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f ILMRemovePolicy) WithContext(v context.Context) func(*ILMRemovePolicyRequest) { + return func(r *ILMRemovePolicyRequest) { + r.ctx = v + } +} + +// WithIndex - the name of the index to remove policy on. +// +func (f ILMRemovePolicy) WithIndex(v string) func(*ILMRemovePolicyRequest) { + return func(r *ILMRemovePolicyRequest) { + r.Index = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f ILMRemovePolicy) WithPretty() func(*ILMRemovePolicyRequest) { + return func(r *ILMRemovePolicyRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f ILMRemovePolicy) WithHuman() func(*ILMRemovePolicyRequest) { + return func(r *ILMRemovePolicyRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f ILMRemovePolicy) WithErrorTrace() func(*ILMRemovePolicyRequest) { + return func(r *ILMRemovePolicyRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f ILMRemovePolicy) WithFilterPath(v ...string) func(*ILMRemovePolicyRequest) { + return func(r *ILMRemovePolicyRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f ILMRemovePolicy) WithHeader(h map[string]string) func(*ILMRemovePolicyRequest) { + return func(r *ILMRemovePolicyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ilm.retry.go b/esapi/api.xpack.ilm.retry.go new file mode 100755 index 0000000000..8a193478c3 --- /dev/null +++ b/esapi/api.xpack.ilm.retry.go @@ -0,0 +1,180 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newILMRetryFunc(t Transport) ILMRetry { + return func(o ...func(*ILMRetryRequest)) (*Response, error) { + var r = ILMRetryRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ILMRetry - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html +// +type ILMRetry func(o ...func(*ILMRetryRequest)) (*Response, error) + +// ILMRetryRequest configures the Ilm Retry API request. +// +type ILMRetryRequest struct { + Index string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r ILMRetryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len(r.Index) + 1 + len("_ilm") + 1 + len("retry")) + if r.Index != "" { + path.WriteString("/") + path.WriteString(r.Index) + } + path.WriteString("/") + path.WriteString("_ilm") + path.WriteString("/") + path.WriteString("retry") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f ILMRetry) WithContext(v context.Context) func(*ILMRetryRequest) { + return func(r *ILMRetryRequest) { + r.ctx = v + } +} + +// WithIndex - the name of the indices (comma-separated) whose failed lifecycle step is to be retry. +// +func (f ILMRetry) WithIndex(v string) func(*ILMRetryRequest) { + return func(r *ILMRetryRequest) { + r.Index = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f ILMRetry) WithPretty() func(*ILMRetryRequest) { + return func(r *ILMRetryRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f ILMRetry) WithHuman() func(*ILMRetryRequest) { + return func(r *ILMRetryRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f ILMRetry) WithErrorTrace() func(*ILMRetryRequest) { + return func(r *ILMRetryRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f ILMRetry) WithFilterPath(v ...string) func(*ILMRetryRequest) { + return func(r *ILMRetryRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f ILMRetry) WithHeader(h map[string]string) func(*ILMRetryRequest) { + return func(r *ILMRetryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ilm.start.go b/esapi/api.xpack.ilm.start.go new file mode 100755 index 0000000000..68aea2032e --- /dev/null +++ b/esapi/api.xpack.ilm.start.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newILMStartFunc(t Transport) ILMStart { + return func(o ...func(*ILMStartRequest)) (*Response, error) { + var r = ILMStartRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ILMStart - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html +// +type ILMStart func(o ...func(*ILMStartRequest)) (*Response, error) + +// ILMStartRequest configures the Ilm Start API request. +// +type ILMStartRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r ILMStartRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_ilm/start")) + path.WriteString("/_ilm/start") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f ILMStart) WithContext(v context.Context) func(*ILMStartRequest) { + return func(r *ILMStartRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f ILMStart) WithPretty() func(*ILMStartRequest) { + return func(r *ILMStartRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f ILMStart) WithHuman() func(*ILMStartRequest) { + return func(r *ILMStartRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f ILMStart) WithErrorTrace() func(*ILMStartRequest) { + return func(r *ILMStartRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f ILMStart) WithFilterPath(v ...string) func(*ILMStartRequest) { + return func(r *ILMStartRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f ILMStart) WithHeader(h map[string]string) func(*ILMStartRequest) { + return func(r *ILMStartRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ilm.stop.go b/esapi/api.xpack.ilm.stop.go new file mode 100755 index 0000000000..febea07257 --- /dev/null +++ b/esapi/api.xpack.ilm.stop.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newILMStopFunc(t Transport) ILMStop { + return func(o ...func(*ILMStopRequest)) (*Response, error) { + var r = ILMStopRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// ILMStop - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html +// +type ILMStop func(o ...func(*ILMStopRequest)) (*Response, error) + +// ILMStopRequest configures the Ilm Stop API request. +// +type ILMStopRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r ILMStopRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_ilm/stop")) + path.WriteString("/_ilm/stop") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f ILMStop) WithContext(v context.Context) func(*ILMStopRequest) { + return func(r *ILMStopRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f ILMStop) WithPretty() func(*ILMStopRequest) { + return func(r *ILMStopRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f ILMStop) WithHuman() func(*ILMStopRequest) { + return func(r *ILMStopRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f ILMStop) WithErrorTrace() func(*ILMStopRequest) { + return func(r *ILMStopRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f ILMStop) WithFilterPath(v ...string) func(*ILMStopRequest) { + return func(r *ILMStopRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f ILMStop) WithHeader(h map[string]string) func(*ILMStopRequest) { + return func(r *ILMStopRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.indices.freeze.go b/esapi/api.xpack.indices.freeze.go new file mode 100755 index 0000000000..2c2a0b2cac --- /dev/null +++ b/esapi/api.xpack.indices.freeze.go @@ -0,0 +1,249 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" + "time" +) + +func newIndicesFreezeFunc(t Transport) IndicesFreeze { + return func(index string, o ...func(*IndicesFreezeRequest)) (*Response, error) { + var r = IndicesFreezeRequest{Index: index} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// IndicesFreeze - https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html +// +type IndicesFreeze func(index string, o ...func(*IndicesFreezeRequest)) (*Response, error) + +// IndicesFreezeRequest configures the Indices Freeze API request. +// +type IndicesFreezeRequest struct { + Index string + + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + MasterTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r IndicesFreezeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len(r.Index) + 1 + len("_freeze")) + path.WriteString("/") + path.WriteString(r.Index) + path.WriteString("/") + path.WriteString("_freeze") + + params = make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f IndicesFreeze) WithContext(v context.Context) func(*IndicesFreezeRequest) { + return func(r *IndicesFreezeRequest) { + r.ctx = v + } +} + +// WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// +func (f IndicesFreeze) WithAllowNoIndices(v bool) func(*IndicesFreezeRequest) { + return func(r *IndicesFreezeRequest) { + r.AllowNoIndices = &v + } +} + +// WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// +func (f IndicesFreeze) WithExpandWildcards(v string) func(*IndicesFreezeRequest) { + return func(r *IndicesFreezeRequest) { + r.ExpandWildcards = v + } +} + +// WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// +func (f IndicesFreeze) WithIgnoreUnavailable(v bool) func(*IndicesFreezeRequest) { + return func(r *IndicesFreezeRequest) { + r.IgnoreUnavailable = &v + } +} + +// WithMasterTimeout - specify timeout for connection to master. +// +func (f IndicesFreeze) WithMasterTimeout(v time.Duration) func(*IndicesFreezeRequest) { + return func(r *IndicesFreezeRequest) { + r.MasterTimeout = v + } +} + +// WithTimeout - explicit operation timeout. +// +func (f IndicesFreeze) WithTimeout(v time.Duration) func(*IndicesFreezeRequest) { + return func(r *IndicesFreezeRequest) { + r.Timeout = v + } +} + +// WithWaitForActiveShards - sets the number of active shards to wait for before the operation returns.. +// +func (f IndicesFreeze) WithWaitForActiveShards(v string) func(*IndicesFreezeRequest) { + return func(r *IndicesFreezeRequest) { + r.WaitForActiveShards = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f IndicesFreeze) WithPretty() func(*IndicesFreezeRequest) { + return func(r *IndicesFreezeRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f IndicesFreeze) WithHuman() func(*IndicesFreezeRequest) { + return func(r *IndicesFreezeRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f IndicesFreeze) WithErrorTrace() func(*IndicesFreezeRequest) { + return func(r *IndicesFreezeRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f IndicesFreeze) WithFilterPath(v ...string) func(*IndicesFreezeRequest) { + return func(r *IndicesFreezeRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesFreeze) WithHeader(h map[string]string) func(*IndicesFreezeRequest) { + return func(r *IndicesFreezeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.indices.reload_search_analyzers.go b/esapi/api.xpack.indices.reload_search_analyzers.go new file mode 100755 index 0000000000..957865b7f9 --- /dev/null +++ b/esapi/api.xpack.indices.reload_search_analyzers.go @@ -0,0 +1,219 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newIndicesReloadSearchAnalyzersFunc(t Transport) IndicesReloadSearchAnalyzers { + return func(o ...func(*IndicesReloadSearchAnalyzersRequest)) (*Response, error) { + var r = IndicesReloadSearchAnalyzersRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// IndicesReloadSearchAnalyzers - https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html +// +type IndicesReloadSearchAnalyzers func(o ...func(*IndicesReloadSearchAnalyzersRequest)) (*Response, error) + +// IndicesReloadSearchAnalyzersRequest configures the Indices Reload Search Analyzers API request. +// +type IndicesReloadSearchAnalyzersRequest struct { + Index []string + + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r IndicesReloadSearchAnalyzersRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len(strings.Join(r.Index, ",")) + 1 + len("_reload_search_analyzers")) + if len(r.Index) > 0 { + path.WriteString("/") + path.WriteString(strings.Join(r.Index, ",")) + } + path.WriteString("/") + path.WriteString("_reload_search_analyzers") + + params = make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f IndicesReloadSearchAnalyzers) WithContext(v context.Context) func(*IndicesReloadSearchAnalyzersRequest) { + return func(r *IndicesReloadSearchAnalyzersRequest) { + r.ctx = v + } +} + +// WithIndex - a list of index names to reload analyzers for. +// +func (f IndicesReloadSearchAnalyzers) WithIndex(v ...string) func(*IndicesReloadSearchAnalyzersRequest) { + return func(r *IndicesReloadSearchAnalyzersRequest) { + r.Index = v + } +} + +// WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// +func (f IndicesReloadSearchAnalyzers) WithAllowNoIndices(v bool) func(*IndicesReloadSearchAnalyzersRequest) { + return func(r *IndicesReloadSearchAnalyzersRequest) { + r.AllowNoIndices = &v + } +} + +// WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// +func (f IndicesReloadSearchAnalyzers) WithExpandWildcards(v string) func(*IndicesReloadSearchAnalyzersRequest) { + return func(r *IndicesReloadSearchAnalyzersRequest) { + r.ExpandWildcards = v + } +} + +// WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// +func (f IndicesReloadSearchAnalyzers) WithIgnoreUnavailable(v bool) func(*IndicesReloadSearchAnalyzersRequest) { + return func(r *IndicesReloadSearchAnalyzersRequest) { + r.IgnoreUnavailable = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f IndicesReloadSearchAnalyzers) WithPretty() func(*IndicesReloadSearchAnalyzersRequest) { + return func(r *IndicesReloadSearchAnalyzersRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f IndicesReloadSearchAnalyzers) WithHuman() func(*IndicesReloadSearchAnalyzersRequest) { + return func(r *IndicesReloadSearchAnalyzersRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f IndicesReloadSearchAnalyzers) WithErrorTrace() func(*IndicesReloadSearchAnalyzersRequest) { + return func(r *IndicesReloadSearchAnalyzersRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f IndicesReloadSearchAnalyzers) WithFilterPath(v ...string) func(*IndicesReloadSearchAnalyzersRequest) { + return func(r *IndicesReloadSearchAnalyzersRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesReloadSearchAnalyzers) WithHeader(h map[string]string) func(*IndicesReloadSearchAnalyzersRequest) { + return func(r *IndicesReloadSearchAnalyzersRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.indices.unfreeze.go b/esapi/api.xpack.indices.unfreeze.go new file mode 100755 index 0000000000..e6df3b7e7a --- /dev/null +++ b/esapi/api.xpack.indices.unfreeze.go @@ -0,0 +1,249 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" + "time" +) + +func newIndicesUnfreezeFunc(t Transport) IndicesUnfreeze { + return func(index string, o ...func(*IndicesUnfreezeRequest)) (*Response, error) { + var r = IndicesUnfreezeRequest{Index: index} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// IndicesUnfreeze - https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html +// +type IndicesUnfreeze func(index string, o ...func(*IndicesUnfreezeRequest)) (*Response, error) + +// IndicesUnfreezeRequest configures the Indices Unfreeze API request. +// +type IndicesUnfreezeRequest struct { + Index string + + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + MasterTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r IndicesUnfreezeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len(r.Index) + 1 + len("_unfreeze")) + path.WriteString("/") + path.WriteString(r.Index) + path.WriteString("/") + path.WriteString("_unfreeze") + + params = make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f IndicesUnfreeze) WithContext(v context.Context) func(*IndicesUnfreezeRequest) { + return func(r *IndicesUnfreezeRequest) { + r.ctx = v + } +} + +// WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). +// +func (f IndicesUnfreeze) WithAllowNoIndices(v bool) func(*IndicesUnfreezeRequest) { + return func(r *IndicesUnfreezeRequest) { + r.AllowNoIndices = &v + } +} + +// WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +// +func (f IndicesUnfreeze) WithExpandWildcards(v string) func(*IndicesUnfreezeRequest) { + return func(r *IndicesUnfreezeRequest) { + r.ExpandWildcards = v + } +} + +// WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). +// +func (f IndicesUnfreeze) WithIgnoreUnavailable(v bool) func(*IndicesUnfreezeRequest) { + return func(r *IndicesUnfreezeRequest) { + r.IgnoreUnavailable = &v + } +} + +// WithMasterTimeout - specify timeout for connection to master. +// +func (f IndicesUnfreeze) WithMasterTimeout(v time.Duration) func(*IndicesUnfreezeRequest) { + return func(r *IndicesUnfreezeRequest) { + r.MasterTimeout = v + } +} + +// WithTimeout - explicit operation timeout. +// +func (f IndicesUnfreeze) WithTimeout(v time.Duration) func(*IndicesUnfreezeRequest) { + return func(r *IndicesUnfreezeRequest) { + r.Timeout = v + } +} + +// WithWaitForActiveShards - sets the number of active shards to wait for before the operation returns.. +// +func (f IndicesUnfreeze) WithWaitForActiveShards(v string) func(*IndicesUnfreezeRequest) { + return func(r *IndicesUnfreezeRequest) { + r.WaitForActiveShards = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f IndicesUnfreeze) WithPretty() func(*IndicesUnfreezeRequest) { + return func(r *IndicesUnfreezeRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f IndicesUnfreeze) WithHuman() func(*IndicesUnfreezeRequest) { + return func(r *IndicesUnfreezeRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f IndicesUnfreeze) WithErrorTrace() func(*IndicesUnfreezeRequest) { + return func(r *IndicesUnfreezeRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f IndicesUnfreeze) WithFilterPath(v ...string) func(*IndicesUnfreezeRequest) { + return func(r *IndicesUnfreezeRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesUnfreeze) WithHeader(h map[string]string) func(*IndicesUnfreezeRequest) { + return func(r *IndicesUnfreezeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.license.delete.go b/esapi/api.xpack.license.delete.go new file mode 100755 index 0000000000..37c85c244a --- /dev/null +++ b/esapi/api.xpack.license.delete.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newLicenseDeleteFunc(t Transport) LicenseDelete { + return func(o ...func(*LicenseDeleteRequest)) (*Response, error) { + var r = LicenseDeleteRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// LicenseDelete - https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html +// +type LicenseDelete func(o ...func(*LicenseDeleteRequest)) (*Response, error) + +// LicenseDeleteRequest configures the License Delete API request. +// +type LicenseDeleteRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r LicenseDeleteRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(len("/_license")) + path.WriteString("/_license") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f LicenseDelete) WithContext(v context.Context) func(*LicenseDeleteRequest) { + return func(r *LicenseDeleteRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f LicenseDelete) WithPretty() func(*LicenseDeleteRequest) { + return func(r *LicenseDeleteRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f LicenseDelete) WithHuman() func(*LicenseDeleteRequest) { + return func(r *LicenseDeleteRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f LicenseDelete) WithErrorTrace() func(*LicenseDeleteRequest) { + return func(r *LicenseDeleteRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f LicenseDelete) WithFilterPath(v ...string) func(*LicenseDeleteRequest) { + return func(r *LicenseDeleteRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f LicenseDelete) WithHeader(h map[string]string) func(*LicenseDeleteRequest) { + return func(r *LicenseDeleteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.license.get.go b/esapi/api.xpack.license.get.go new file mode 100755 index 0000000000..5e46d22030 --- /dev/null +++ b/esapi/api.xpack.license.get.go @@ -0,0 +1,178 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newLicenseGetFunc(t Transport) LicenseGet { + return func(o ...func(*LicenseGetRequest)) (*Response, error) { + var r = LicenseGetRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// LicenseGet - https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html +// +type LicenseGet func(o ...func(*LicenseGetRequest)) (*Response, error) + +// LicenseGetRequest configures the License Get API request. +// +type LicenseGetRequest struct { + Local *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r LicenseGetRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_license")) + path.WriteString("/_license") + + params = make(map[string]string) + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f LicenseGet) WithContext(v context.Context) func(*LicenseGetRequest) { + return func(r *LicenseGetRequest) { + r.ctx = v + } +} + +// WithLocal - return local information, do not retrieve the state from master node (default: false). +// +func (f LicenseGet) WithLocal(v bool) func(*LicenseGetRequest) { + return func(r *LicenseGetRequest) { + r.Local = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f LicenseGet) WithPretty() func(*LicenseGetRequest) { + return func(r *LicenseGetRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f LicenseGet) WithHuman() func(*LicenseGetRequest) { + return func(r *LicenseGetRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f LicenseGet) WithErrorTrace() func(*LicenseGetRequest) { + return func(r *LicenseGetRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f LicenseGet) WithFilterPath(v ...string) func(*LicenseGetRequest) { + return func(r *LicenseGetRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f LicenseGet) WithHeader(h map[string]string) func(*LicenseGetRequest) { + return func(r *LicenseGetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.license.get_basic_status.go b/esapi/api.xpack.license.get_basic_status.go new file mode 100755 index 0000000000..dd42415548 --- /dev/null +++ b/esapi/api.xpack.license.get_basic_status.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newLicenseGetBasicStatusFunc(t Transport) LicenseGetBasicStatus { + return func(o ...func(*LicenseGetBasicStatusRequest)) (*Response, error) { + var r = LicenseGetBasicStatusRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// LicenseGetBasicStatus - https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html +// +type LicenseGetBasicStatus func(o ...func(*LicenseGetBasicStatusRequest)) (*Response, error) + +// LicenseGetBasicStatusRequest configures the License Get Basic Status API request. +// +type LicenseGetBasicStatusRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r LicenseGetBasicStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_license/basic_status")) + path.WriteString("/_license/basic_status") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f LicenseGetBasicStatus) WithContext(v context.Context) func(*LicenseGetBasicStatusRequest) { + return func(r *LicenseGetBasicStatusRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f LicenseGetBasicStatus) WithPretty() func(*LicenseGetBasicStatusRequest) { + return func(r *LicenseGetBasicStatusRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f LicenseGetBasicStatus) WithHuman() func(*LicenseGetBasicStatusRequest) { + return func(r *LicenseGetBasicStatusRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f LicenseGetBasicStatus) WithErrorTrace() func(*LicenseGetBasicStatusRequest) { + return func(r *LicenseGetBasicStatusRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f LicenseGetBasicStatus) WithFilterPath(v ...string) func(*LicenseGetBasicStatusRequest) { + return func(r *LicenseGetBasicStatusRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f LicenseGetBasicStatus) WithHeader(h map[string]string) func(*LicenseGetBasicStatusRequest) { + return func(r *LicenseGetBasicStatusRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.license.get_trial_status.go b/esapi/api.xpack.license.get_trial_status.go new file mode 100755 index 0000000000..d7f494e123 --- /dev/null +++ b/esapi/api.xpack.license.get_trial_status.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newLicenseGetTrialStatusFunc(t Transport) LicenseGetTrialStatus { + return func(o ...func(*LicenseGetTrialStatusRequest)) (*Response, error) { + var r = LicenseGetTrialStatusRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// LicenseGetTrialStatus - https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html +// +type LicenseGetTrialStatus func(o ...func(*LicenseGetTrialStatusRequest)) (*Response, error) + +// LicenseGetTrialStatusRequest configures the License Get Trial Status API request. +// +type LicenseGetTrialStatusRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r LicenseGetTrialStatusRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_license/trial_status")) + path.WriteString("/_license/trial_status") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f LicenseGetTrialStatus) WithContext(v context.Context) func(*LicenseGetTrialStatusRequest) { + return func(r *LicenseGetTrialStatusRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f LicenseGetTrialStatus) WithPretty() func(*LicenseGetTrialStatusRequest) { + return func(r *LicenseGetTrialStatusRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f LicenseGetTrialStatus) WithHuman() func(*LicenseGetTrialStatusRequest) { + return func(r *LicenseGetTrialStatusRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f LicenseGetTrialStatus) WithErrorTrace() func(*LicenseGetTrialStatusRequest) { + return func(r *LicenseGetTrialStatusRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f LicenseGetTrialStatus) WithFilterPath(v ...string) func(*LicenseGetTrialStatusRequest) { + return func(r *LicenseGetTrialStatusRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f LicenseGetTrialStatus) WithHeader(h map[string]string) func(*LicenseGetTrialStatusRequest) { + return func(r *LicenseGetTrialStatusRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.license.post.go b/esapi/api.xpack.license.post.go new file mode 100755 index 0000000000..b7ed5877af --- /dev/null +++ b/esapi/api.xpack.license.post.go @@ -0,0 +1,193 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" +) + +func newLicensePostFunc(t Transport) LicensePost { + return func(o ...func(*LicensePostRequest)) (*Response, error) { + var r = LicensePostRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// LicensePost - https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html +// +type LicensePost func(o ...func(*LicensePostRequest)) (*Response, error) + +// LicensePostRequest configures the License Post API request. +// +type LicensePostRequest struct { + Body io.Reader + + Acknowledge *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r LicensePostRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(len("/_license")) + path.WriteString("/_license") + + params = make(map[string]string) + + if r.Acknowledge != nil { + params["acknowledge"] = strconv.FormatBool(*r.Acknowledge) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f LicensePost) WithContext(v context.Context) func(*LicensePostRequest) { + return func(r *LicensePostRequest) { + r.ctx = v + } +} + +// WithBody - licenses to be installed. +// +func (f LicensePost) WithBody(v io.Reader) func(*LicensePostRequest) { + return func(r *LicensePostRequest) { + r.Body = v + } +} + +// WithAcknowledge - whether the user has acknowledged acknowledge messages (default: false). +// +func (f LicensePost) WithAcknowledge(v bool) func(*LicensePostRequest) { + return func(r *LicensePostRequest) { + r.Acknowledge = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f LicensePost) WithPretty() func(*LicensePostRequest) { + return func(r *LicensePostRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f LicensePost) WithHuman() func(*LicensePostRequest) { + return func(r *LicensePostRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f LicensePost) WithErrorTrace() func(*LicensePostRequest) { + return func(r *LicensePostRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f LicensePost) WithFilterPath(v ...string) func(*LicensePostRequest) { + return func(r *LicensePostRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f LicensePost) WithHeader(h map[string]string) func(*LicensePostRequest) { + return func(r *LicensePostRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.license.post_start_basic.go b/esapi/api.xpack.license.post_start_basic.go new file mode 100755 index 0000000000..da199d92c0 --- /dev/null +++ b/esapi/api.xpack.license.post_start_basic.go @@ -0,0 +1,178 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newLicensePostStartBasicFunc(t Transport) LicensePostStartBasic { + return func(o ...func(*LicensePostStartBasicRequest)) (*Response, error) { + var r = LicensePostStartBasicRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// LicensePostStartBasic - https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html +// +type LicensePostStartBasic func(o ...func(*LicensePostStartBasicRequest)) (*Response, error) + +// LicensePostStartBasicRequest configures the License Post Start Basic API request. +// +type LicensePostStartBasicRequest struct { + Acknowledge *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r LicensePostStartBasicRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_license/start_basic")) + path.WriteString("/_license/start_basic") + + params = make(map[string]string) + + if r.Acknowledge != nil { + params["acknowledge"] = strconv.FormatBool(*r.Acknowledge) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f LicensePostStartBasic) WithContext(v context.Context) func(*LicensePostStartBasicRequest) { + return func(r *LicensePostStartBasicRequest) { + r.ctx = v + } +} + +// WithAcknowledge - whether the user has acknowledged acknowledge messages (default: false). +// +func (f LicensePostStartBasic) WithAcknowledge(v bool) func(*LicensePostStartBasicRequest) { + return func(r *LicensePostStartBasicRequest) { + r.Acknowledge = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f LicensePostStartBasic) WithPretty() func(*LicensePostStartBasicRequest) { + return func(r *LicensePostStartBasicRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f LicensePostStartBasic) WithHuman() func(*LicensePostStartBasicRequest) { + return func(r *LicensePostStartBasicRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f LicensePostStartBasic) WithErrorTrace() func(*LicensePostStartBasicRequest) { + return func(r *LicensePostStartBasicRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f LicensePostStartBasic) WithFilterPath(v ...string) func(*LicensePostStartBasicRequest) { + return func(r *LicensePostStartBasicRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f LicensePostStartBasic) WithHeader(h map[string]string) func(*LicensePostStartBasicRequest) { + return func(r *LicensePostStartBasicRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.license.post_start_trial.go b/esapi/api.xpack.license.post_start_trial.go new file mode 100755 index 0000000000..a66aca3652 --- /dev/null +++ b/esapi/api.xpack.license.post_start_trial.go @@ -0,0 +1,191 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newLicensePostStartTrialFunc(t Transport) LicensePostStartTrial { + return func(o ...func(*LicensePostStartTrialRequest)) (*Response, error) { + var r = LicensePostStartTrialRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// LicensePostStartTrial - https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html +// +type LicensePostStartTrial func(o ...func(*LicensePostStartTrialRequest)) (*Response, error) + +// LicensePostStartTrialRequest configures the License Post Start Trial API request. +// +type LicensePostStartTrialRequest struct { + Acknowledge *bool + DocumentType string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r LicensePostStartTrialRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_license/start_trial")) + path.WriteString("/_license/start_trial") + + params = make(map[string]string) + + if r.Acknowledge != nil { + params["acknowledge"] = strconv.FormatBool(*r.Acknowledge) + } + + if r.DocumentType != "" { + params["type"] = r.DocumentType + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f LicensePostStartTrial) WithContext(v context.Context) func(*LicensePostStartTrialRequest) { + return func(r *LicensePostStartTrialRequest) { + r.ctx = v + } +} + +// WithAcknowledge - whether the user has acknowledged acknowledge messages (default: false). +// +func (f LicensePostStartTrial) WithAcknowledge(v bool) func(*LicensePostStartTrialRequest) { + return func(r *LicensePostStartTrialRequest) { + r.Acknowledge = &v + } +} + +// WithDocumentType - the type of trial license to generate (default: "trial"). +// +func (f LicensePostStartTrial) WithDocumentType(v string) func(*LicensePostStartTrialRequest) { + return func(r *LicensePostStartTrialRequest) { + r.DocumentType = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f LicensePostStartTrial) WithPretty() func(*LicensePostStartTrialRequest) { + return func(r *LicensePostStartTrialRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f LicensePostStartTrial) WithHuman() func(*LicensePostStartTrialRequest) { + return func(r *LicensePostStartTrialRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f LicensePostStartTrial) WithErrorTrace() func(*LicensePostStartTrialRequest) { + return func(r *LicensePostStartTrialRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f LicensePostStartTrial) WithFilterPath(v ...string) func(*LicensePostStartTrialRequest) { + return func(r *LicensePostStartTrialRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f LicensePostStartTrial) WithHeader(h map[string]string) func(*LicensePostStartTrialRequest) { + return func(r *LicensePostStartTrialRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.migration.deprecations.go b/esapi/api.xpack.migration.deprecations.go new file mode 100755 index 0000000000..f08857a8ff --- /dev/null +++ b/esapi/api.xpack.migration.deprecations.go @@ -0,0 +1,180 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newMigrationDeprecationsFunc(t Transport) MigrationDeprecations { + return func(o ...func(*MigrationDeprecationsRequest)) (*Response, error) { + var r = MigrationDeprecationsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MigrationDeprecations - http://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html +// +type MigrationDeprecations func(o ...func(*MigrationDeprecationsRequest)) (*Response, error) + +// MigrationDeprecationsRequest configures the Migration Deprecations API request. +// +type MigrationDeprecationsRequest struct { + Index string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MigrationDeprecationsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len(r.Index) + 1 + len("_migration") + 1 + len("deprecations")) + if r.Index != "" { + path.WriteString("/") + path.WriteString(r.Index) + } + path.WriteString("/") + path.WriteString("_migration") + path.WriteString("/") + path.WriteString("deprecations") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MigrationDeprecations) WithContext(v context.Context) func(*MigrationDeprecationsRequest) { + return func(r *MigrationDeprecationsRequest) { + r.ctx = v + } +} + +// WithIndex - index pattern. +// +func (f MigrationDeprecations) WithIndex(v string) func(*MigrationDeprecationsRequest) { + return func(r *MigrationDeprecationsRequest) { + r.Index = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MigrationDeprecations) WithPretty() func(*MigrationDeprecationsRequest) { + return func(r *MigrationDeprecationsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MigrationDeprecations) WithHuman() func(*MigrationDeprecationsRequest) { + return func(r *MigrationDeprecationsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MigrationDeprecations) WithErrorTrace() func(*MigrationDeprecationsRequest) { + return func(r *MigrationDeprecationsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MigrationDeprecations) WithFilterPath(v ...string) func(*MigrationDeprecationsRequest) { + return func(r *MigrationDeprecationsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MigrationDeprecations) WithHeader(h map[string]string) func(*MigrationDeprecationsRequest) { + return func(r *MigrationDeprecationsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.close_job.go b/esapi/api.xpack.ml.close_job.go new file mode 100755 index 0000000000..9b2c75616b --- /dev/null +++ b/esapi/api.xpack.ml.close_job.go @@ -0,0 +1,229 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" + "time" +) + +func newMLCloseJobFunc(t Transport) MLCloseJob { + return func(job_id string, o ...func(*MLCloseJobRequest)) (*Response, error) { + var r = MLCloseJobRequest{JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLCloseJob - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html +// +type MLCloseJob func(job_id string, o ...func(*MLCloseJobRequest)) (*Response, error) + +// MLCloseJobRequest configures the Ml Close Job API request. +// +type MLCloseJobRequest struct { + Body io.Reader + + JobID string + + AllowNoJobs *bool + Force *bool + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLCloseJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_close")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("_close") + + params = make(map[string]string) + + if r.AllowNoJobs != nil { + params["allow_no_jobs"] = strconv.FormatBool(*r.AllowNoJobs) + } + + if r.Force != nil { + params["force"] = strconv.FormatBool(*r.Force) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLCloseJob) WithContext(v context.Context) func(*MLCloseJobRequest) { + return func(r *MLCloseJobRequest) { + r.ctx = v + } +} + +// WithBody - The URL params optionally sent in the body. +// +func (f MLCloseJob) WithBody(v io.Reader) func(*MLCloseJobRequest) { + return func(r *MLCloseJobRequest) { + r.Body = v + } +} + +// WithAllowNoJobs - whether to ignore if a wildcard expression matches no jobs. (this includes `_all` string or when no jobs have been specified). +// +func (f MLCloseJob) WithAllowNoJobs(v bool) func(*MLCloseJobRequest) { + return func(r *MLCloseJobRequest) { + r.AllowNoJobs = &v + } +} + +// WithForce - true if the job should be forcefully closed. +// +func (f MLCloseJob) WithForce(v bool) func(*MLCloseJobRequest) { + return func(r *MLCloseJobRequest) { + r.Force = &v + } +} + +// WithTimeout - controls the time to wait until a job has closed. default to 30 minutes. +// +func (f MLCloseJob) WithTimeout(v time.Duration) func(*MLCloseJobRequest) { + return func(r *MLCloseJobRequest) { + r.Timeout = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLCloseJob) WithPretty() func(*MLCloseJobRequest) { + return func(r *MLCloseJobRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLCloseJob) WithHuman() func(*MLCloseJobRequest) { + return func(r *MLCloseJobRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLCloseJob) WithErrorTrace() func(*MLCloseJobRequest) { + return func(r *MLCloseJobRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLCloseJob) WithFilterPath(v ...string) func(*MLCloseJobRequest) { + return func(r *MLCloseJobRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLCloseJob) WithHeader(h map[string]string) func(*MLCloseJobRequest) { + return func(r *MLCloseJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.delete_calendar.go b/esapi/api.xpack.ml.delete_calendar.go new file mode 100755 index 0000000000..fc676c2da0 --- /dev/null +++ b/esapi/api.xpack.ml.delete_calendar.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newMLDeleteCalendarFunc(t Transport) MLDeleteCalendar { + return func(calendar_id string, o ...func(*MLDeleteCalendarRequest)) (*Response, error) { + var r = MLDeleteCalendarRequest{CalendarID: calendar_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLDeleteCalendar - +// +type MLDeleteCalendar func(calendar_id string, o ...func(*MLDeleteCalendarRequest)) (*Response, error) + +// MLDeleteCalendarRequest configures the Ml Delete Calendar API request. +// +type MLDeleteCalendarRequest struct { + CalendarID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLDeleteCalendarRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("calendars") + path.WriteString("/") + path.WriteString(r.CalendarID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLDeleteCalendar) WithContext(v context.Context) func(*MLDeleteCalendarRequest) { + return func(r *MLDeleteCalendarRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLDeleteCalendar) WithPretty() func(*MLDeleteCalendarRequest) { + return func(r *MLDeleteCalendarRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLDeleteCalendar) WithHuman() func(*MLDeleteCalendarRequest) { + return func(r *MLDeleteCalendarRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLDeleteCalendar) WithErrorTrace() func(*MLDeleteCalendarRequest) { + return func(r *MLDeleteCalendarRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLDeleteCalendar) WithFilterPath(v ...string) func(*MLDeleteCalendarRequest) { + return func(r *MLDeleteCalendarRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLDeleteCalendar) WithHeader(h map[string]string) func(*MLDeleteCalendarRequest) { + return func(r *MLDeleteCalendarRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.delete_calendar_event.go b/esapi/api.xpack.ml.delete_calendar_event.go new file mode 100755 index 0000000000..32a6caf51b --- /dev/null +++ b/esapi/api.xpack.ml.delete_calendar_event.go @@ -0,0 +1,175 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newMLDeleteCalendarEventFunc(t Transport) MLDeleteCalendarEvent { + return func(calendar_id string, event_id string, o ...func(*MLDeleteCalendarEventRequest)) (*Response, error) { + var r = MLDeleteCalendarEventRequest{CalendarID: calendar_id, EventID: event_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLDeleteCalendarEvent - +// +type MLDeleteCalendarEvent func(calendar_id string, event_id string, o ...func(*MLDeleteCalendarEventRequest)) (*Response, error) + +// MLDeleteCalendarEventRequest configures the Ml Delete Calendar Event API request. +// +type MLDeleteCalendarEventRequest struct { + CalendarID string + EventID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLDeleteCalendarEventRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID) + 1 + len("events") + 1 + len(r.EventID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("calendars") + path.WriteString("/") + path.WriteString(r.CalendarID) + path.WriteString("/") + path.WriteString("events") + path.WriteString("/") + path.WriteString(r.EventID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLDeleteCalendarEvent) WithContext(v context.Context) func(*MLDeleteCalendarEventRequest) { + return func(r *MLDeleteCalendarEventRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLDeleteCalendarEvent) WithPretty() func(*MLDeleteCalendarEventRequest) { + return func(r *MLDeleteCalendarEventRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLDeleteCalendarEvent) WithHuman() func(*MLDeleteCalendarEventRequest) { + return func(r *MLDeleteCalendarEventRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLDeleteCalendarEvent) WithErrorTrace() func(*MLDeleteCalendarEventRequest) { + return func(r *MLDeleteCalendarEventRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLDeleteCalendarEvent) WithFilterPath(v ...string) func(*MLDeleteCalendarEventRequest) { + return func(r *MLDeleteCalendarEventRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLDeleteCalendarEvent) WithHeader(h map[string]string) func(*MLDeleteCalendarEventRequest) { + return func(r *MLDeleteCalendarEventRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.delete_calendar_job.go b/esapi/api.xpack.ml.delete_calendar_job.go new file mode 100755 index 0000000000..54a18c11e3 --- /dev/null +++ b/esapi/api.xpack.ml.delete_calendar_job.go @@ -0,0 +1,175 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newMLDeleteCalendarJobFunc(t Transport) MLDeleteCalendarJob { + return func(calendar_id string, job_id string, o ...func(*MLDeleteCalendarJobRequest)) (*Response, error) { + var r = MLDeleteCalendarJobRequest{CalendarID: calendar_id, JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLDeleteCalendarJob - +// +type MLDeleteCalendarJob func(calendar_id string, job_id string, o ...func(*MLDeleteCalendarJobRequest)) (*Response, error) + +// MLDeleteCalendarJobRequest configures the Ml Delete Calendar Job API request. +// +type MLDeleteCalendarJobRequest struct { + CalendarID string + JobID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLDeleteCalendarJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID) + 1 + len("jobs") + 1 + len(r.JobID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("calendars") + path.WriteString("/") + path.WriteString(r.CalendarID) + path.WriteString("/") + path.WriteString("jobs") + path.WriteString("/") + path.WriteString(r.JobID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLDeleteCalendarJob) WithContext(v context.Context) func(*MLDeleteCalendarJobRequest) { + return func(r *MLDeleteCalendarJobRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLDeleteCalendarJob) WithPretty() func(*MLDeleteCalendarJobRequest) { + return func(r *MLDeleteCalendarJobRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLDeleteCalendarJob) WithHuman() func(*MLDeleteCalendarJobRequest) { + return func(r *MLDeleteCalendarJobRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLDeleteCalendarJob) WithErrorTrace() func(*MLDeleteCalendarJobRequest) { + return func(r *MLDeleteCalendarJobRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLDeleteCalendarJob) WithFilterPath(v ...string) func(*MLDeleteCalendarJobRequest) { + return func(r *MLDeleteCalendarJobRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLDeleteCalendarJob) WithHeader(h map[string]string) func(*MLDeleteCalendarJobRequest) { + return func(r *MLDeleteCalendarJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.delete_data_frame_analytics.go b/esapi/api.xpack.ml.delete_data_frame_analytics.go new file mode 100755 index 0000000000..97f6af3f2f --- /dev/null +++ b/esapi/api.xpack.ml.delete_data_frame_analytics.go @@ -0,0 +1,172 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newMLDeleteDataFrameAnalyticsFunc(t Transport) MLDeleteDataFrameAnalytics { + return func(id string, o ...func(*MLDeleteDataFrameAnalyticsRequest)) (*Response, error) { + var r = MLDeleteDataFrameAnalyticsRequest{DocumentID: id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLDeleteDataFrameAnalytics - +// +type MLDeleteDataFrameAnalytics func(id string, o ...func(*MLDeleteDataFrameAnalyticsRequest)) (*Response, error) + +// MLDeleteDataFrameAnalyticsRequest configures the Ml Delete Data Frame Analytics API request. +// +type MLDeleteDataFrameAnalyticsRequest struct { + DocumentID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLDeleteDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("data_frame") + path.WriteString("/") + path.WriteString("analytics") + path.WriteString("/") + path.WriteString(r.DocumentID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLDeleteDataFrameAnalytics) WithContext(v context.Context) func(*MLDeleteDataFrameAnalyticsRequest) { + return func(r *MLDeleteDataFrameAnalyticsRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLDeleteDataFrameAnalytics) WithPretty() func(*MLDeleteDataFrameAnalyticsRequest) { + return func(r *MLDeleteDataFrameAnalyticsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLDeleteDataFrameAnalytics) WithHuman() func(*MLDeleteDataFrameAnalyticsRequest) { + return func(r *MLDeleteDataFrameAnalyticsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLDeleteDataFrameAnalytics) WithErrorTrace() func(*MLDeleteDataFrameAnalyticsRequest) { + return func(r *MLDeleteDataFrameAnalyticsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLDeleteDataFrameAnalytics) WithFilterPath(v ...string) func(*MLDeleteDataFrameAnalyticsRequest) { + return func(r *MLDeleteDataFrameAnalyticsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLDeleteDataFrameAnalytics) WithHeader(h map[string]string) func(*MLDeleteDataFrameAnalyticsRequest) { + return func(r *MLDeleteDataFrameAnalyticsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.delete_datafeed.go b/esapi/api.xpack.ml.delete_datafeed.go new file mode 100755 index 0000000000..25e3d28d1d --- /dev/null +++ b/esapi/api.xpack.ml.delete_datafeed.go @@ -0,0 +1,185 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newMLDeleteDatafeedFunc(t Transport) MLDeleteDatafeed { + return func(datafeed_id string, o ...func(*MLDeleteDatafeedRequest)) (*Response, error) { + var r = MLDeleteDatafeedRequest{DatafeedID: datafeed_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLDeleteDatafeed - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html +// +type MLDeleteDatafeed func(datafeed_id string, o ...func(*MLDeleteDatafeedRequest)) (*Response, error) + +// MLDeleteDatafeedRequest configures the Ml Delete Datafeed API request. +// +type MLDeleteDatafeedRequest struct { + DatafeedID string + + Force *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLDeleteDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("datafeeds") + path.WriteString("/") + path.WriteString(r.DatafeedID) + + params = make(map[string]string) + + if r.Force != nil { + params["force"] = strconv.FormatBool(*r.Force) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLDeleteDatafeed) WithContext(v context.Context) func(*MLDeleteDatafeedRequest) { + return func(r *MLDeleteDatafeedRequest) { + r.ctx = v + } +} + +// WithForce - true if the datafeed should be forcefully deleted. +// +func (f MLDeleteDatafeed) WithForce(v bool) func(*MLDeleteDatafeedRequest) { + return func(r *MLDeleteDatafeedRequest) { + r.Force = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLDeleteDatafeed) WithPretty() func(*MLDeleteDatafeedRequest) { + return func(r *MLDeleteDatafeedRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLDeleteDatafeed) WithHuman() func(*MLDeleteDatafeedRequest) { + return func(r *MLDeleteDatafeedRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLDeleteDatafeed) WithErrorTrace() func(*MLDeleteDatafeedRequest) { + return func(r *MLDeleteDatafeedRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLDeleteDatafeed) WithFilterPath(v ...string) func(*MLDeleteDatafeedRequest) { + return func(r *MLDeleteDatafeedRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLDeleteDatafeed) WithHeader(h map[string]string) func(*MLDeleteDatafeedRequest) { + return func(r *MLDeleteDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.delete_expired_data.go b/esapi/api.xpack.ml.delete_expired_data.go new file mode 100755 index 0000000000..532ae68a68 --- /dev/null +++ b/esapi/api.xpack.ml.delete_expired_data.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newMLDeleteExpiredDataFunc(t Transport) MLDeleteExpiredData { + return func(o ...func(*MLDeleteExpiredDataRequest)) (*Response, error) { + var r = MLDeleteExpiredDataRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLDeleteExpiredData - +// +type MLDeleteExpiredData func(o ...func(*MLDeleteExpiredDataRequest)) (*Response, error) + +// MLDeleteExpiredDataRequest configures the Ml Delete Expired Data API request. +// +type MLDeleteExpiredDataRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLDeleteExpiredDataRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(len("/_ml/_delete_expired_data")) + path.WriteString("/_ml/_delete_expired_data") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLDeleteExpiredData) WithContext(v context.Context) func(*MLDeleteExpiredDataRequest) { + return func(r *MLDeleteExpiredDataRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLDeleteExpiredData) WithPretty() func(*MLDeleteExpiredDataRequest) { + return func(r *MLDeleteExpiredDataRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLDeleteExpiredData) WithHuman() func(*MLDeleteExpiredDataRequest) { + return func(r *MLDeleteExpiredDataRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLDeleteExpiredData) WithErrorTrace() func(*MLDeleteExpiredDataRequest) { + return func(r *MLDeleteExpiredDataRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLDeleteExpiredData) WithFilterPath(v ...string) func(*MLDeleteExpiredDataRequest) { + return func(r *MLDeleteExpiredDataRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLDeleteExpiredData) WithHeader(h map[string]string) func(*MLDeleteExpiredDataRequest) { + return func(r *MLDeleteExpiredDataRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.delete_filter.go b/esapi/api.xpack.ml.delete_filter.go new file mode 100755 index 0000000000..128332738f --- /dev/null +++ b/esapi/api.xpack.ml.delete_filter.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newMLDeleteFilterFunc(t Transport) MLDeleteFilter { + return func(filter_id string, o ...func(*MLDeleteFilterRequest)) (*Response, error) { + var r = MLDeleteFilterRequest{FilterID: filter_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLDeleteFilter - +// +type MLDeleteFilter func(filter_id string, o ...func(*MLDeleteFilterRequest)) (*Response, error) + +// MLDeleteFilterRequest configures the Ml Delete Filter API request. +// +type MLDeleteFilterRequest struct { + FilterID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLDeleteFilterRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_ml") + 1 + len("filters") + 1 + len(r.FilterID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("filters") + path.WriteString("/") + path.WriteString(r.FilterID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLDeleteFilter) WithContext(v context.Context) func(*MLDeleteFilterRequest) { + return func(r *MLDeleteFilterRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLDeleteFilter) WithPretty() func(*MLDeleteFilterRequest) { + return func(r *MLDeleteFilterRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLDeleteFilter) WithHuman() func(*MLDeleteFilterRequest) { + return func(r *MLDeleteFilterRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLDeleteFilter) WithErrorTrace() func(*MLDeleteFilterRequest) { + return func(r *MLDeleteFilterRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLDeleteFilter) WithFilterPath(v ...string) func(*MLDeleteFilterRequest) { + return func(r *MLDeleteFilterRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLDeleteFilter) WithHeader(h map[string]string) func(*MLDeleteFilterRequest) { + return func(r *MLDeleteFilterRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.delete_forecast.go b/esapi/api.xpack.ml.delete_forecast.go new file mode 100755 index 0000000000..b3f6524d64 --- /dev/null +++ b/esapi/api.xpack.ml.delete_forecast.go @@ -0,0 +1,214 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" + "time" +) + +func newMLDeleteForecastFunc(t Transport) MLDeleteForecast { + return func(job_id string, o ...func(*MLDeleteForecastRequest)) (*Response, error) { + var r = MLDeleteForecastRequest{JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLDeleteForecast - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html +// +type MLDeleteForecast func(job_id string, o ...func(*MLDeleteForecastRequest)) (*Response, error) + +// MLDeleteForecastRequest configures the Ml Delete Forecast API request. +// +type MLDeleteForecastRequest struct { + ForecastID string + JobID string + + AllowNoForecasts *bool + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLDeleteForecastRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_forecast") + 1 + len(r.ForecastID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("_forecast") + if r.ForecastID != "" { + path.WriteString("/") + path.WriteString(r.ForecastID) + } + + params = make(map[string]string) + + if r.AllowNoForecasts != nil { + params["allow_no_forecasts"] = strconv.FormatBool(*r.AllowNoForecasts) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLDeleteForecast) WithContext(v context.Context) func(*MLDeleteForecastRequest) { + return func(r *MLDeleteForecastRequest) { + r.ctx = v + } +} + +// WithForecastID - the ID of the forecast to delete, can be comma delimited list. leaving blank implies `_all`. +// +func (f MLDeleteForecast) WithForecastID(v string) func(*MLDeleteForecastRequest) { + return func(r *MLDeleteForecastRequest) { + r.ForecastID = v + } +} + +// WithAllowNoForecasts - whether to ignore if `_all` matches no forecasts. +// +func (f MLDeleteForecast) WithAllowNoForecasts(v bool) func(*MLDeleteForecastRequest) { + return func(r *MLDeleteForecastRequest) { + r.AllowNoForecasts = &v + } +} + +// WithTimeout - controls the time to wait until the forecast(s) are deleted. default to 30 seconds. +// +func (f MLDeleteForecast) WithTimeout(v time.Duration) func(*MLDeleteForecastRequest) { + return func(r *MLDeleteForecastRequest) { + r.Timeout = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLDeleteForecast) WithPretty() func(*MLDeleteForecastRequest) { + return func(r *MLDeleteForecastRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLDeleteForecast) WithHuman() func(*MLDeleteForecastRequest) { + return func(r *MLDeleteForecastRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLDeleteForecast) WithErrorTrace() func(*MLDeleteForecastRequest) { + return func(r *MLDeleteForecastRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLDeleteForecast) WithFilterPath(v ...string) func(*MLDeleteForecastRequest) { + return func(r *MLDeleteForecastRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLDeleteForecast) WithHeader(h map[string]string) func(*MLDeleteForecastRequest) { + return func(r *MLDeleteForecastRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.delete_job.go b/esapi/api.xpack.ml.delete_job.go new file mode 100755 index 0000000000..4ce93fbf59 --- /dev/null +++ b/esapi/api.xpack.ml.delete_job.go @@ -0,0 +1,198 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newMLDeleteJobFunc(t Transport) MLDeleteJob { + return func(job_id string, o ...func(*MLDeleteJobRequest)) (*Response, error) { + var r = MLDeleteJobRequest{JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLDeleteJob - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html +// +type MLDeleteJob func(job_id string, o ...func(*MLDeleteJobRequest)) (*Response, error) + +// MLDeleteJobRequest configures the Ml Delete Job API request. +// +type MLDeleteJobRequest struct { + JobID string + + Force *bool + WaitForCompletion *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLDeleteJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + + params = make(map[string]string) + + if r.Force != nil { + params["force"] = strconv.FormatBool(*r.Force) + } + + if r.WaitForCompletion != nil { + params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLDeleteJob) WithContext(v context.Context) func(*MLDeleteJobRequest) { + return func(r *MLDeleteJobRequest) { + r.ctx = v + } +} + +// WithForce - true if the job should be forcefully deleted. +// +func (f MLDeleteJob) WithForce(v bool) func(*MLDeleteJobRequest) { + return func(r *MLDeleteJobRequest) { + r.Force = &v + } +} + +// WithWaitForCompletion - should this request wait until the operation has completed before returning. +// +func (f MLDeleteJob) WithWaitForCompletion(v bool) func(*MLDeleteJobRequest) { + return func(r *MLDeleteJobRequest) { + r.WaitForCompletion = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLDeleteJob) WithPretty() func(*MLDeleteJobRequest) { + return func(r *MLDeleteJobRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLDeleteJob) WithHuman() func(*MLDeleteJobRequest) { + return func(r *MLDeleteJobRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLDeleteJob) WithErrorTrace() func(*MLDeleteJobRequest) { + return func(r *MLDeleteJobRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLDeleteJob) WithFilterPath(v ...string) func(*MLDeleteJobRequest) { + return func(r *MLDeleteJobRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLDeleteJob) WithHeader(h map[string]string) func(*MLDeleteJobRequest) { + return func(r *MLDeleteJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.delete_model_snapshot.go b/esapi/api.xpack.ml.delete_model_snapshot.go new file mode 100755 index 0000000000..c4f46f6e72 --- /dev/null +++ b/esapi/api.xpack.ml.delete_model_snapshot.go @@ -0,0 +1,175 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newMLDeleteModelSnapshotFunc(t Transport) MLDeleteModelSnapshot { + return func(snapshot_id string, job_id string, o ...func(*MLDeleteModelSnapshotRequest)) (*Response, error) { + var r = MLDeleteModelSnapshotRequest{SnapshotID: snapshot_id, JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLDeleteModelSnapshot - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html +// +type MLDeleteModelSnapshot func(snapshot_id string, job_id string, o ...func(*MLDeleteModelSnapshotRequest)) (*Response, error) + +// MLDeleteModelSnapshotRequest configures the Ml Delete Model Snapshot API request. +// +type MLDeleteModelSnapshotRequest struct { + JobID string + SnapshotID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLDeleteModelSnapshotRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("model_snapshots") + 1 + len(r.SnapshotID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("model_snapshots") + path.WriteString("/") + path.WriteString(r.SnapshotID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLDeleteModelSnapshot) WithContext(v context.Context) func(*MLDeleteModelSnapshotRequest) { + return func(r *MLDeleteModelSnapshotRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLDeleteModelSnapshot) WithPretty() func(*MLDeleteModelSnapshotRequest) { + return func(r *MLDeleteModelSnapshotRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLDeleteModelSnapshot) WithHuman() func(*MLDeleteModelSnapshotRequest) { + return func(r *MLDeleteModelSnapshotRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLDeleteModelSnapshot) WithErrorTrace() func(*MLDeleteModelSnapshotRequest) { + return func(r *MLDeleteModelSnapshotRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLDeleteModelSnapshot) WithFilterPath(v ...string) func(*MLDeleteModelSnapshotRequest) { + return func(r *MLDeleteModelSnapshotRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLDeleteModelSnapshot) WithHeader(h map[string]string) func(*MLDeleteModelSnapshotRequest) { + return func(r *MLDeleteModelSnapshotRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.evaluate_data_frame.go b/esapi/api.xpack.ml.evaluate_data_frame.go new file mode 100755 index 0000000000..a1f275c6bb --- /dev/null +++ b/esapi/api.xpack.ml.evaluate_data_frame.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLEvaluateDataFrameFunc(t Transport) MLEvaluateDataFrame { + return func(body io.Reader, o ...func(*MLEvaluateDataFrameRequest)) (*Response, error) { + var r = MLEvaluateDataFrameRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLEvaluateDataFrame - +// +type MLEvaluateDataFrame func(body io.Reader, o ...func(*MLEvaluateDataFrameRequest)) (*Response, error) + +// MLEvaluateDataFrameRequest configures the Ml Evaluate Data Frame API request. +// +type MLEvaluateDataFrameRequest struct { + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLEvaluateDataFrameRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_ml/data_frame/_evaluate")) + path.WriteString("/_ml/data_frame/_evaluate") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLEvaluateDataFrame) WithContext(v context.Context) func(*MLEvaluateDataFrameRequest) { + return func(r *MLEvaluateDataFrameRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLEvaluateDataFrame) WithPretty() func(*MLEvaluateDataFrameRequest) { + return func(r *MLEvaluateDataFrameRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLEvaluateDataFrame) WithHuman() func(*MLEvaluateDataFrameRequest) { + return func(r *MLEvaluateDataFrameRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLEvaluateDataFrame) WithErrorTrace() func(*MLEvaluateDataFrameRequest) { + return func(r *MLEvaluateDataFrameRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLEvaluateDataFrame) WithFilterPath(v ...string) func(*MLEvaluateDataFrameRequest) { + return func(r *MLEvaluateDataFrameRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLEvaluateDataFrame) WithHeader(h map[string]string) func(*MLEvaluateDataFrameRequest) { + return func(r *MLEvaluateDataFrameRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.find_file_structure.go b/esapi/api.xpack.ml.find_file_structure.go new file mode 100755 index 0000000000..093535c6df --- /dev/null +++ b/esapi/api.xpack.ml.find_file_structure.go @@ -0,0 +1,355 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" + "time" +) + +func newMLFindFileStructureFunc(t Transport) MLFindFileStructure { + return func(body io.Reader, o ...func(*MLFindFileStructureRequest)) (*Response, error) { + var r = MLFindFileStructureRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLFindFileStructure - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html +// +type MLFindFileStructure func(body io.Reader, o ...func(*MLFindFileStructureRequest)) (*Response, error) + +// MLFindFileStructureRequest configures the Ml Find File Structure API request. +// +type MLFindFileStructureRequest struct { + Body io.Reader + + Charset string + ColumnNames []string + Delimiter string + Explain *bool + Format string + GrokPattern string + HasHeaderRow *bool + LineMergeSizeLimit *int + LinesToSample *int + Quote string + ShouldTrimFields *bool + Timeout time.Duration + TimestampField string + TimestampFormat string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLFindFileStructureRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_ml/find_file_structure")) + path.WriteString("/_ml/find_file_structure") + + params = make(map[string]string) + + if r.Charset != "" { + params["charset"] = r.Charset + } + + if len(r.ColumnNames) > 0 { + params["column_names"] = strings.Join(r.ColumnNames, ",") + } + + if r.Delimiter != "" { + params["delimiter"] = r.Delimiter + } + + if r.Explain != nil { + params["explain"] = strconv.FormatBool(*r.Explain) + } + + if r.Format != "" { + params["format"] = r.Format + } + + if r.GrokPattern != "" { + params["grok_pattern"] = r.GrokPattern + } + + if r.HasHeaderRow != nil { + params["has_header_row"] = strconv.FormatBool(*r.HasHeaderRow) + } + + if r.LineMergeSizeLimit != nil { + params["line_merge_size_limit"] = strconv.FormatInt(int64(*r.LineMergeSizeLimit), 10) + } + + if r.LinesToSample != nil { + params["lines_to_sample"] = strconv.FormatInt(int64(*r.LinesToSample), 10) + } + + if r.Quote != "" { + params["quote"] = r.Quote + } + + if r.ShouldTrimFields != nil { + params["should_trim_fields"] = strconv.FormatBool(*r.ShouldTrimFields) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.TimestampField != "" { + params["timestamp_field"] = r.TimestampField + } + + if r.TimestampFormat != "" { + params["timestamp_format"] = r.TimestampFormat + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLFindFileStructure) WithContext(v context.Context) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.ctx = v + } +} + +// WithCharset - optional parameter to specify the character set of the file. +// +func (f MLFindFileStructure) WithCharset(v string) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.Charset = v + } +} + +// WithColumnNames - optional parameter containing a comma separated list of the column names for a delimited file. +// +func (f MLFindFileStructure) WithColumnNames(v ...string) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.ColumnNames = v + } +} + +// WithDelimiter - optional parameter to specify the delimiter character for a delimited file - must be a single character. +// +func (f MLFindFileStructure) WithDelimiter(v string) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.Delimiter = v + } +} + +// WithExplain - whether to include a commentary on how the structure was derived. +// +func (f MLFindFileStructure) WithExplain(v bool) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.Explain = &v + } +} + +// WithFormat - optional parameter to specify the high level file format. +// +func (f MLFindFileStructure) WithFormat(v string) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.Format = v + } +} + +// WithGrokPattern - optional parameter to specify the grok pattern that should be used to extract fields from messages in a semi-structured text file. +// +func (f MLFindFileStructure) WithGrokPattern(v string) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.GrokPattern = v + } +} + +// WithHasHeaderRow - optional parameter to specify whether a delimited file includes the column names in its first row. +// +func (f MLFindFileStructure) WithHasHeaderRow(v bool) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.HasHeaderRow = &v + } +} + +// WithLineMergeSizeLimit - maximum number of characters permitted in a single message when lines are merged to create messages.. +// +func (f MLFindFileStructure) WithLineMergeSizeLimit(v int) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.LineMergeSizeLimit = &v + } +} + +// WithLinesToSample - how many lines of the file should be included in the analysis. +// +func (f MLFindFileStructure) WithLinesToSample(v int) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.LinesToSample = &v + } +} + +// WithQuote - optional parameter to specify the quote character for a delimited file - must be a single character. +// +func (f MLFindFileStructure) WithQuote(v string) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.Quote = v + } +} + +// WithShouldTrimFields - optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them. +// +func (f MLFindFileStructure) WithShouldTrimFields(v bool) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.ShouldTrimFields = &v + } +} + +// WithTimeout - timeout after which the analysis will be aborted. +// +func (f MLFindFileStructure) WithTimeout(v time.Duration) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.Timeout = v + } +} + +// WithTimestampField - optional parameter to specify the timestamp field in the file. +// +func (f MLFindFileStructure) WithTimestampField(v string) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.TimestampField = v + } +} + +// WithTimestampFormat - optional parameter to specify the timestamp format in the file - may be either a joda or java time format. +// +func (f MLFindFileStructure) WithTimestampFormat(v string) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.TimestampFormat = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLFindFileStructure) WithPretty() func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLFindFileStructure) WithHuman() func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLFindFileStructure) WithErrorTrace() func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLFindFileStructure) WithFilterPath(v ...string) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLFindFileStructure) WithHeader(h map[string]string) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.flush_job.go b/esapi/api.xpack.ml.flush_job.go new file mode 100755 index 0000000000..2570eeb60a --- /dev/null +++ b/esapi/api.xpack.ml.flush_job.go @@ -0,0 +1,254 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" +) + +func newMLFlushJobFunc(t Transport) MLFlushJob { + return func(job_id string, o ...func(*MLFlushJobRequest)) (*Response, error) { + var r = MLFlushJobRequest{JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLFlushJob - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html +// +type MLFlushJob func(job_id string, o ...func(*MLFlushJobRequest)) (*Response, error) + +// MLFlushJobRequest configures the Ml Flush Job API request. +// +type MLFlushJobRequest struct { + Body io.Reader + + JobID string + + AdvanceTime string + CalcInterim *bool + End string + SkipTime string + Start string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLFlushJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_flush")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("_flush") + + params = make(map[string]string) + + if r.AdvanceTime != "" { + params["advance_time"] = r.AdvanceTime + } + + if r.CalcInterim != nil { + params["calc_interim"] = strconv.FormatBool(*r.CalcInterim) + } + + if r.End != "" { + params["end"] = r.End + } + + if r.SkipTime != "" { + params["skip_time"] = r.SkipTime + } + + if r.Start != "" { + params["start"] = r.Start + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLFlushJob) WithContext(v context.Context) func(*MLFlushJobRequest) { + return func(r *MLFlushJobRequest) { + r.ctx = v + } +} + +// WithBody - Flush parameters. +// +func (f MLFlushJob) WithBody(v io.Reader) func(*MLFlushJobRequest) { + return func(r *MLFlushJobRequest) { + r.Body = v + } +} + +// WithAdvanceTime - advances time to the given value generating results and updating the model for the advanced interval. +// +func (f MLFlushJob) WithAdvanceTime(v string) func(*MLFlushJobRequest) { + return func(r *MLFlushJobRequest) { + r.AdvanceTime = v + } +} + +// WithCalcInterim - calculates interim results for the most recent bucket or all buckets within the latency period. +// +func (f MLFlushJob) WithCalcInterim(v bool) func(*MLFlushJobRequest) { + return func(r *MLFlushJobRequest) { + r.CalcInterim = &v + } +} + +// WithEnd - when used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results. +// +func (f MLFlushJob) WithEnd(v string) func(*MLFlushJobRequest) { + return func(r *MLFlushJobRequest) { + r.End = v + } +} + +// WithSkipTime - skips time to the given value without generating results or updating the model for the skipped interval. +// +func (f MLFlushJob) WithSkipTime(v string) func(*MLFlushJobRequest) { + return func(r *MLFlushJobRequest) { + r.SkipTime = v + } +} + +// WithStart - when used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results. +// +func (f MLFlushJob) WithStart(v string) func(*MLFlushJobRequest) { + return func(r *MLFlushJobRequest) { + r.Start = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLFlushJob) WithPretty() func(*MLFlushJobRequest) { + return func(r *MLFlushJobRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLFlushJob) WithHuman() func(*MLFlushJobRequest) { + return func(r *MLFlushJobRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLFlushJob) WithErrorTrace() func(*MLFlushJobRequest) { + return func(r *MLFlushJobRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLFlushJob) WithFilterPath(v ...string) func(*MLFlushJobRequest) { + return func(r *MLFlushJobRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLFlushJob) WithHeader(h map[string]string) func(*MLFlushJobRequest) { + return func(r *MLFlushJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.forecast.go b/esapi/api.xpack.ml.forecast.go new file mode 100755 index 0000000000..bb94891fce --- /dev/null +++ b/esapi/api.xpack.ml.forecast.go @@ -0,0 +1,200 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" + "time" +) + +func newMLForecastFunc(t Transport) MLForecast { + return func(job_id string, o ...func(*MLForecastRequest)) (*Response, error) { + var r = MLForecastRequest{JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLForecast - +// +type MLForecast func(job_id string, o ...func(*MLForecastRequest)) (*Response, error) + +// MLForecastRequest configures the Ml Forecast API request. +// +type MLForecastRequest struct { + JobID string + + Duration time.Duration + ExpiresIn time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLForecastRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_forecast")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("_forecast") + + params = make(map[string]string) + + if r.Duration != 0 { + params["duration"] = formatDuration(r.Duration) + } + + if r.ExpiresIn != 0 { + params["expires_in"] = formatDuration(r.ExpiresIn) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLForecast) WithContext(v context.Context) func(*MLForecastRequest) { + return func(r *MLForecastRequest) { + r.ctx = v + } +} + +// WithDuration - the duration of the forecast. +// +func (f MLForecast) WithDuration(v time.Duration) func(*MLForecastRequest) { + return func(r *MLForecastRequest) { + r.Duration = v + } +} + +// WithExpiresIn - the time interval after which the forecast expires. expired forecasts will be deleted at the first opportunity.. +// +func (f MLForecast) WithExpiresIn(v time.Duration) func(*MLForecastRequest) { + return func(r *MLForecastRequest) { + r.ExpiresIn = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLForecast) WithPretty() func(*MLForecastRequest) { + return func(r *MLForecastRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLForecast) WithHuman() func(*MLForecastRequest) { + return func(r *MLForecastRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLForecast) WithErrorTrace() func(*MLForecastRequest) { + return func(r *MLForecastRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLForecast) WithFilterPath(v ...string) func(*MLForecastRequest) { + return func(r *MLForecastRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLForecast) WithHeader(h map[string]string) func(*MLForecastRequest) { + return func(r *MLForecastRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_buckets.go b/esapi/api.xpack.ml.get_buckets.go new file mode 100755 index 0000000000..01a05eb4b4 --- /dev/null +++ b/esapi/api.xpack.ml.get_buckets.go @@ -0,0 +1,322 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "fmt" + "io" + "net/http" + "strconv" + "strings" +) + +func newMLGetBucketsFunc(t Transport) MLGetBuckets { + return func(job_id string, o ...func(*MLGetBucketsRequest)) (*Response, error) { + var r = MLGetBucketsRequest{JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetBuckets - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html +// +type MLGetBuckets func(job_id string, o ...func(*MLGetBucketsRequest)) (*Response, error) + +// MLGetBucketsRequest configures the Ml Get Buckets API request. +// +type MLGetBucketsRequest struct { + Body io.Reader + + JobID string + Timestamp string + + AnomalyScore interface{} + Desc *bool + End string + ExcludeInterim *bool + Expand *bool + From *int + Size *int + Sort string + Start string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetBucketsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("results") + 1 + len("buckets") + 1 + len(r.Timestamp)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("results") + path.WriteString("/") + path.WriteString("buckets") + if r.Timestamp != "" { + path.WriteString("/") + path.WriteString(r.Timestamp) + } + + params = make(map[string]string) + + if r.AnomalyScore != nil { + params["anomaly_score"] = fmt.Sprintf("%v", r.AnomalyScore) + } + + if r.Desc != nil { + params["desc"] = strconv.FormatBool(*r.Desc) + } + + if r.End != "" { + params["end"] = r.End + } + + if r.ExcludeInterim != nil { + params["exclude_interim"] = strconv.FormatBool(*r.ExcludeInterim) + } + + if r.Expand != nil { + params["expand"] = strconv.FormatBool(*r.Expand) + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Sort != "" { + params["sort"] = r.Sort + } + + if r.Start != "" { + params["start"] = r.Start + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetBuckets) WithContext(v context.Context) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.ctx = v + } +} + +// WithBody - Bucket selection details if not provided in URI. +// +func (f MLGetBuckets) WithBody(v io.Reader) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.Body = v + } +} + +// WithTimestamp - the timestamp of the desired single bucket result. +// +func (f MLGetBuckets) WithTimestamp(v string) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.Timestamp = v + } +} + +// WithAnomalyScore - filter for the most anomalous buckets. +// +func (f MLGetBuckets) WithAnomalyScore(v interface{}) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.AnomalyScore = v + } +} + +// WithDesc - set the sort direction. +// +func (f MLGetBuckets) WithDesc(v bool) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.Desc = &v + } +} + +// WithEnd - end time filter for buckets. +// +func (f MLGetBuckets) WithEnd(v string) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.End = v + } +} + +// WithExcludeInterim - exclude interim results. +// +func (f MLGetBuckets) WithExcludeInterim(v bool) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.ExcludeInterim = &v + } +} + +// WithExpand - include anomaly records. +// +func (f MLGetBuckets) WithExpand(v bool) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.Expand = &v + } +} + +// WithFrom - skips a number of buckets. +// +func (f MLGetBuckets) WithFrom(v int) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.From = &v + } +} + +// WithSize - specifies a max number of buckets to get. +// +func (f MLGetBuckets) WithSize(v int) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.Size = &v + } +} + +// WithSort - sort buckets by a particular field. +// +func (f MLGetBuckets) WithSort(v string) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.Sort = v + } +} + +// WithStart - start time filter for buckets. +// +func (f MLGetBuckets) WithStart(v string) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.Start = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetBuckets) WithPretty() func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetBuckets) WithHuman() func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetBuckets) WithErrorTrace() func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetBuckets) WithFilterPath(v ...string) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetBuckets) WithHeader(h map[string]string) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_calendar_events.go b/esapi/api.xpack.ml.get_calendar_events.go new file mode 100755 index 0000000000..a2a119fa16 --- /dev/null +++ b/esapi/api.xpack.ml.get_calendar_events.go @@ -0,0 +1,240 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "fmt" + "net/http" + "strconv" + "strings" +) + +func newMLGetCalendarEventsFunc(t Transport) MLGetCalendarEvents { + return func(calendar_id string, o ...func(*MLGetCalendarEventsRequest)) (*Response, error) { + var r = MLGetCalendarEventsRequest{CalendarID: calendar_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetCalendarEvents - +// +type MLGetCalendarEvents func(calendar_id string, o ...func(*MLGetCalendarEventsRequest)) (*Response, error) + +// MLGetCalendarEventsRequest configures the Ml Get Calendar Events API request. +// +type MLGetCalendarEventsRequest struct { + CalendarID string + + End interface{} + From *int + JobID string + Size *int + Start string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetCalendarEventsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID) + 1 + len("events")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("calendars") + path.WriteString("/") + path.WriteString(r.CalendarID) + path.WriteString("/") + path.WriteString("events") + + params = make(map[string]string) + + if r.End != nil { + params["end"] = fmt.Sprintf("%v", r.End) + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.JobID != "" { + params["job_id"] = r.JobID + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Start != "" { + params["start"] = r.Start + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetCalendarEvents) WithContext(v context.Context) func(*MLGetCalendarEventsRequest) { + return func(r *MLGetCalendarEventsRequest) { + r.ctx = v + } +} + +// WithEnd - get events before this time. +// +func (f MLGetCalendarEvents) WithEnd(v interface{}) func(*MLGetCalendarEventsRequest) { + return func(r *MLGetCalendarEventsRequest) { + r.End = v + } +} + +// WithFrom - skips a number of events. +// +func (f MLGetCalendarEvents) WithFrom(v int) func(*MLGetCalendarEventsRequest) { + return func(r *MLGetCalendarEventsRequest) { + r.From = &v + } +} + +// WithJobID - get events for the job. when this option is used calendar_id must be '_all'. +// +func (f MLGetCalendarEvents) WithJobID(v string) func(*MLGetCalendarEventsRequest) { + return func(r *MLGetCalendarEventsRequest) { + r.JobID = v + } +} + +// WithSize - specifies a max number of events to get. +// +func (f MLGetCalendarEvents) WithSize(v int) func(*MLGetCalendarEventsRequest) { + return func(r *MLGetCalendarEventsRequest) { + r.Size = &v + } +} + +// WithStart - get events after this time. +// +func (f MLGetCalendarEvents) WithStart(v string) func(*MLGetCalendarEventsRequest) { + return func(r *MLGetCalendarEventsRequest) { + r.Start = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetCalendarEvents) WithPretty() func(*MLGetCalendarEventsRequest) { + return func(r *MLGetCalendarEventsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetCalendarEvents) WithHuman() func(*MLGetCalendarEventsRequest) { + return func(r *MLGetCalendarEventsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetCalendarEvents) WithErrorTrace() func(*MLGetCalendarEventsRequest) { + return func(r *MLGetCalendarEventsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetCalendarEvents) WithFilterPath(v ...string) func(*MLGetCalendarEventsRequest) { + return func(r *MLGetCalendarEventsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetCalendarEvents) WithHeader(h map[string]string) func(*MLGetCalendarEventsRequest) { + return func(r *MLGetCalendarEventsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_calendars.go b/esapi/api.xpack.ml.get_calendars.go new file mode 100755 index 0000000000..f43831d4ed --- /dev/null +++ b/esapi/api.xpack.ml.get_calendars.go @@ -0,0 +1,223 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" +) + +func newMLGetCalendarsFunc(t Transport) MLGetCalendars { + return func(o ...func(*MLGetCalendarsRequest)) (*Response, error) { + var r = MLGetCalendarsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetCalendars - +// +type MLGetCalendars func(o ...func(*MLGetCalendarsRequest)) (*Response, error) + +// MLGetCalendarsRequest configures the Ml Get Calendars API request. +// +type MLGetCalendarsRequest struct { + Body io.Reader + + CalendarID string + + From *int + Size *int + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetCalendarsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("calendars") + if r.CalendarID != "" { + path.WriteString("/") + path.WriteString(r.CalendarID) + } + + params = make(map[string]string) + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetCalendars) WithContext(v context.Context) func(*MLGetCalendarsRequest) { + return func(r *MLGetCalendarsRequest) { + r.ctx = v + } +} + +// WithBody - The from and size parameters optionally sent in the body. +// +func (f MLGetCalendars) WithBody(v io.Reader) func(*MLGetCalendarsRequest) { + return func(r *MLGetCalendarsRequest) { + r.Body = v + } +} + +// WithCalendarID - the ID of the calendar to fetch. +// +func (f MLGetCalendars) WithCalendarID(v string) func(*MLGetCalendarsRequest) { + return func(r *MLGetCalendarsRequest) { + r.CalendarID = v + } +} + +// WithFrom - skips a number of calendars. +// +func (f MLGetCalendars) WithFrom(v int) func(*MLGetCalendarsRequest) { + return func(r *MLGetCalendarsRequest) { + r.From = &v + } +} + +// WithSize - specifies a max number of calendars to get. +// +func (f MLGetCalendars) WithSize(v int) func(*MLGetCalendarsRequest) { + return func(r *MLGetCalendarsRequest) { + r.Size = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetCalendars) WithPretty() func(*MLGetCalendarsRequest) { + return func(r *MLGetCalendarsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetCalendars) WithHuman() func(*MLGetCalendarsRequest) { + return func(r *MLGetCalendarsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetCalendars) WithErrorTrace() func(*MLGetCalendarsRequest) { + return func(r *MLGetCalendarsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetCalendars) WithFilterPath(v ...string) func(*MLGetCalendarsRequest) { + return func(r *MLGetCalendarsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetCalendars) WithHeader(h map[string]string) func(*MLGetCalendarsRequest) { + return func(r *MLGetCalendarsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_categories.go b/esapi/api.xpack.ml.get_categories.go new file mode 100755 index 0000000000..cf61eba98d --- /dev/null +++ b/esapi/api.xpack.ml.get_categories.go @@ -0,0 +1,232 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" +) + +func newMLGetCategoriesFunc(t Transport) MLGetCategories { + return func(job_id string, o ...func(*MLGetCategoriesRequest)) (*Response, error) { + var r = MLGetCategoriesRequest{JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetCategories - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html +// +type MLGetCategories func(job_id string, o ...func(*MLGetCategoriesRequest)) (*Response, error) + +// MLGetCategoriesRequest configures the Ml Get Categories API request. +// +type MLGetCategoriesRequest struct { + Body io.Reader + + CategoryID *int + JobID string + + From *int + Size *int + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetCategoriesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("results") + 1 + len("categories")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("results") + path.WriteString("/") + path.WriteString("categories") + if r.CategoryID != nil { + value := strconv.FormatInt(int64(*r.CategoryID), 10) + path.Grow(1 + len(value)) + path.WriteString("/") + path.WriteString(value) + } + + params = make(map[string]string) + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetCategories) WithContext(v context.Context) func(*MLGetCategoriesRequest) { + return func(r *MLGetCategoriesRequest) { + r.ctx = v + } +} + +// WithBody - Category selection details if not provided in URI. +// +func (f MLGetCategories) WithBody(v io.Reader) func(*MLGetCategoriesRequest) { + return func(r *MLGetCategoriesRequest) { + r.Body = v + } +} + +// WithCategoryID - the identifier of the category definition of interest. +// +func (f MLGetCategories) WithCategoryID(v int) func(*MLGetCategoriesRequest) { + return func(r *MLGetCategoriesRequest) { + r.CategoryID = &v + } +} + +// WithFrom - skips a number of categories. +// +func (f MLGetCategories) WithFrom(v int) func(*MLGetCategoriesRequest) { + return func(r *MLGetCategoriesRequest) { + r.From = &v + } +} + +// WithSize - specifies a max number of categories to get. +// +func (f MLGetCategories) WithSize(v int) func(*MLGetCategoriesRequest) { + return func(r *MLGetCategoriesRequest) { + r.Size = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetCategories) WithPretty() func(*MLGetCategoriesRequest) { + return func(r *MLGetCategoriesRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetCategories) WithHuman() func(*MLGetCategoriesRequest) { + return func(r *MLGetCategoriesRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetCategories) WithErrorTrace() func(*MLGetCategoriesRequest) { + return func(r *MLGetCategoriesRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetCategories) WithFilterPath(v ...string) func(*MLGetCategoriesRequest) { + return func(r *MLGetCategoriesRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetCategories) WithHeader(h map[string]string) func(*MLGetCategoriesRequest) { + return func(r *MLGetCategoriesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_data_frame_analytics.go b/esapi/api.xpack.ml.get_data_frame_analytics.go new file mode 100755 index 0000000000..b208028350 --- /dev/null +++ b/esapi/api.xpack.ml.get_data_frame_analytics.go @@ -0,0 +1,223 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newMLGetDataFrameAnalyticsFunc(t Transport) MLGetDataFrameAnalytics { + return func(o ...func(*MLGetDataFrameAnalyticsRequest)) (*Response, error) { + var r = MLGetDataFrameAnalyticsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetDataFrameAnalytics - +// +type MLGetDataFrameAnalytics func(o ...func(*MLGetDataFrameAnalyticsRequest)) (*Response, error) + +// MLGetDataFrameAnalyticsRequest configures the Ml Get Data Frame Analytics API request. +// +type MLGetDataFrameAnalyticsRequest struct { + DocumentID string + + AllowNoMatch *bool + From *int + Size *int + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("data_frame") + path.WriteString("/") + path.WriteString("analytics") + if r.DocumentID != "" { + path.WriteString("/") + path.WriteString(r.DocumentID) + } + + params = make(map[string]string) + + if r.AllowNoMatch != nil { + params["allow_no_match"] = strconv.FormatBool(*r.AllowNoMatch) + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetDataFrameAnalytics) WithContext(v context.Context) func(*MLGetDataFrameAnalyticsRequest) { + return func(r *MLGetDataFrameAnalyticsRequest) { + r.ctx = v + } +} + +// WithDocumentID - the ID of the data frame analytics to fetch. +// +func (f MLGetDataFrameAnalytics) WithDocumentID(v string) func(*MLGetDataFrameAnalyticsRequest) { + return func(r *MLGetDataFrameAnalyticsRequest) { + r.DocumentID = v + } +} + +// WithAllowNoMatch - whether to ignore if a wildcard expression matches no data frame analytics. (this includes `_all` string or when no data frame analytics have been specified). +// +func (f MLGetDataFrameAnalytics) WithAllowNoMatch(v bool) func(*MLGetDataFrameAnalyticsRequest) { + return func(r *MLGetDataFrameAnalyticsRequest) { + r.AllowNoMatch = &v + } +} + +// WithFrom - skips a number of analytics. +// +func (f MLGetDataFrameAnalytics) WithFrom(v int) func(*MLGetDataFrameAnalyticsRequest) { + return func(r *MLGetDataFrameAnalyticsRequest) { + r.From = &v + } +} + +// WithSize - specifies a max number of analytics to get. +// +func (f MLGetDataFrameAnalytics) WithSize(v int) func(*MLGetDataFrameAnalyticsRequest) { + return func(r *MLGetDataFrameAnalyticsRequest) { + r.Size = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetDataFrameAnalytics) WithPretty() func(*MLGetDataFrameAnalyticsRequest) { + return func(r *MLGetDataFrameAnalyticsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetDataFrameAnalytics) WithHuman() func(*MLGetDataFrameAnalyticsRequest) { + return func(r *MLGetDataFrameAnalyticsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetDataFrameAnalytics) WithErrorTrace() func(*MLGetDataFrameAnalyticsRequest) { + return func(r *MLGetDataFrameAnalyticsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetDataFrameAnalytics) WithFilterPath(v ...string) func(*MLGetDataFrameAnalyticsRequest) { + return func(r *MLGetDataFrameAnalyticsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetDataFrameAnalytics) WithHeader(h map[string]string) func(*MLGetDataFrameAnalyticsRequest) { + return func(r *MLGetDataFrameAnalyticsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go new file mode 100755 index 0000000000..b38c177aef --- /dev/null +++ b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go @@ -0,0 +1,225 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newMLGetDataFrameAnalyticsStatsFunc(t Transport) MLGetDataFrameAnalyticsStats { + return func(o ...func(*MLGetDataFrameAnalyticsStatsRequest)) (*Response, error) { + var r = MLGetDataFrameAnalyticsStatsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetDataFrameAnalyticsStats - +// +type MLGetDataFrameAnalyticsStats func(o ...func(*MLGetDataFrameAnalyticsStatsRequest)) (*Response, error) + +// MLGetDataFrameAnalyticsStatsRequest configures the Ml Get Data Frame Analytics Stats API request. +// +type MLGetDataFrameAnalyticsStatsRequest struct { + DocumentID string + + AllowNoMatch *bool + From *int + Size *int + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetDataFrameAnalyticsStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID) + 1 + len("_stats")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("data_frame") + path.WriteString("/") + path.WriteString("analytics") + if r.DocumentID != "" { + path.WriteString("/") + path.WriteString(r.DocumentID) + } + path.WriteString("/") + path.WriteString("_stats") + + params = make(map[string]string) + + if r.AllowNoMatch != nil { + params["allow_no_match"] = strconv.FormatBool(*r.AllowNoMatch) + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetDataFrameAnalyticsStats) WithContext(v context.Context) func(*MLGetDataFrameAnalyticsStatsRequest) { + return func(r *MLGetDataFrameAnalyticsStatsRequest) { + r.ctx = v + } +} + +// WithDocumentID - the ID of the data frame analytics stats to fetch. +// +func (f MLGetDataFrameAnalyticsStats) WithDocumentID(v string) func(*MLGetDataFrameAnalyticsStatsRequest) { + return func(r *MLGetDataFrameAnalyticsStatsRequest) { + r.DocumentID = v + } +} + +// WithAllowNoMatch - whether to ignore if a wildcard expression matches no data frame analytics. (this includes `_all` string or when no data frame analytics have been specified). +// +func (f MLGetDataFrameAnalyticsStats) WithAllowNoMatch(v bool) func(*MLGetDataFrameAnalyticsStatsRequest) { + return func(r *MLGetDataFrameAnalyticsStatsRequest) { + r.AllowNoMatch = &v + } +} + +// WithFrom - skips a number of analytics. +// +func (f MLGetDataFrameAnalyticsStats) WithFrom(v int) func(*MLGetDataFrameAnalyticsStatsRequest) { + return func(r *MLGetDataFrameAnalyticsStatsRequest) { + r.From = &v + } +} + +// WithSize - specifies a max number of analytics to get. +// +func (f MLGetDataFrameAnalyticsStats) WithSize(v int) func(*MLGetDataFrameAnalyticsStatsRequest) { + return func(r *MLGetDataFrameAnalyticsStatsRequest) { + r.Size = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetDataFrameAnalyticsStats) WithPretty() func(*MLGetDataFrameAnalyticsStatsRequest) { + return func(r *MLGetDataFrameAnalyticsStatsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetDataFrameAnalyticsStats) WithHuman() func(*MLGetDataFrameAnalyticsStatsRequest) { + return func(r *MLGetDataFrameAnalyticsStatsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetDataFrameAnalyticsStats) WithErrorTrace() func(*MLGetDataFrameAnalyticsStatsRequest) { + return func(r *MLGetDataFrameAnalyticsStatsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetDataFrameAnalyticsStats) WithFilterPath(v ...string) func(*MLGetDataFrameAnalyticsStatsRequest) { + return func(r *MLGetDataFrameAnalyticsStatsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetDataFrameAnalyticsStats) WithHeader(h map[string]string) func(*MLGetDataFrameAnalyticsStatsRequest) { + return func(r *MLGetDataFrameAnalyticsStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_datafeed_stats.go b/esapi/api.xpack.ml.get_datafeed_stats.go new file mode 100755 index 0000000000..52fcc5f5f7 --- /dev/null +++ b/esapi/api.xpack.ml.get_datafeed_stats.go @@ -0,0 +1,197 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newMLGetDatafeedStatsFunc(t Transport) MLGetDatafeedStats { + return func(o ...func(*MLGetDatafeedStatsRequest)) (*Response, error) { + var r = MLGetDatafeedStatsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetDatafeedStats - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html +// +type MLGetDatafeedStats func(o ...func(*MLGetDatafeedStatsRequest)) (*Response, error) + +// MLGetDatafeedStatsRequest configures the Ml Get Datafeed Stats API request. +// +type MLGetDatafeedStatsRequest struct { + DatafeedID string + + AllowNoDatafeeds *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetDatafeedStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID) + 1 + len("_stats")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("datafeeds") + if r.DatafeedID != "" { + path.WriteString("/") + path.WriteString(r.DatafeedID) + } + path.WriteString("/") + path.WriteString("_stats") + + params = make(map[string]string) + + if r.AllowNoDatafeeds != nil { + params["allow_no_datafeeds"] = strconv.FormatBool(*r.AllowNoDatafeeds) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetDatafeedStats) WithContext(v context.Context) func(*MLGetDatafeedStatsRequest) { + return func(r *MLGetDatafeedStatsRequest) { + r.ctx = v + } +} + +// WithDatafeedID - the ID of the datafeeds stats to fetch. +// +func (f MLGetDatafeedStats) WithDatafeedID(v string) func(*MLGetDatafeedStatsRequest) { + return func(r *MLGetDatafeedStatsRequest) { + r.DatafeedID = v + } +} + +// WithAllowNoDatafeeds - whether to ignore if a wildcard expression matches no datafeeds. (this includes `_all` string or when no datafeeds have been specified). +// +func (f MLGetDatafeedStats) WithAllowNoDatafeeds(v bool) func(*MLGetDatafeedStatsRequest) { + return func(r *MLGetDatafeedStatsRequest) { + r.AllowNoDatafeeds = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetDatafeedStats) WithPretty() func(*MLGetDatafeedStatsRequest) { + return func(r *MLGetDatafeedStatsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetDatafeedStats) WithHuman() func(*MLGetDatafeedStatsRequest) { + return func(r *MLGetDatafeedStatsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetDatafeedStats) WithErrorTrace() func(*MLGetDatafeedStatsRequest) { + return func(r *MLGetDatafeedStatsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetDatafeedStats) WithFilterPath(v ...string) func(*MLGetDatafeedStatsRequest) { + return func(r *MLGetDatafeedStatsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetDatafeedStats) WithHeader(h map[string]string) func(*MLGetDatafeedStatsRequest) { + return func(r *MLGetDatafeedStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_datafeeds.go b/esapi/api.xpack.ml.get_datafeeds.go new file mode 100755 index 0000000000..a72c9a2362 --- /dev/null +++ b/esapi/api.xpack.ml.get_datafeeds.go @@ -0,0 +1,195 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newMLGetDatafeedsFunc(t Transport) MLGetDatafeeds { + return func(o ...func(*MLGetDatafeedsRequest)) (*Response, error) { + var r = MLGetDatafeedsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetDatafeeds - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html +// +type MLGetDatafeeds func(o ...func(*MLGetDatafeedsRequest)) (*Response, error) + +// MLGetDatafeedsRequest configures the Ml Get Datafeeds API request. +// +type MLGetDatafeedsRequest struct { + DatafeedID string + + AllowNoDatafeeds *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetDatafeedsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("datafeeds") + if r.DatafeedID != "" { + path.WriteString("/") + path.WriteString(r.DatafeedID) + } + + params = make(map[string]string) + + if r.AllowNoDatafeeds != nil { + params["allow_no_datafeeds"] = strconv.FormatBool(*r.AllowNoDatafeeds) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetDatafeeds) WithContext(v context.Context) func(*MLGetDatafeedsRequest) { + return func(r *MLGetDatafeedsRequest) { + r.ctx = v + } +} + +// WithDatafeedID - the ID of the datafeeds to fetch. +// +func (f MLGetDatafeeds) WithDatafeedID(v string) func(*MLGetDatafeedsRequest) { + return func(r *MLGetDatafeedsRequest) { + r.DatafeedID = v + } +} + +// WithAllowNoDatafeeds - whether to ignore if a wildcard expression matches no datafeeds. (this includes `_all` string or when no datafeeds have been specified). +// +func (f MLGetDatafeeds) WithAllowNoDatafeeds(v bool) func(*MLGetDatafeedsRequest) { + return func(r *MLGetDatafeedsRequest) { + r.AllowNoDatafeeds = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetDatafeeds) WithPretty() func(*MLGetDatafeedsRequest) { + return func(r *MLGetDatafeedsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetDatafeeds) WithHuman() func(*MLGetDatafeedsRequest) { + return func(r *MLGetDatafeedsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetDatafeeds) WithErrorTrace() func(*MLGetDatafeedsRequest) { + return func(r *MLGetDatafeedsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetDatafeeds) WithFilterPath(v ...string) func(*MLGetDatafeedsRequest) { + return func(r *MLGetDatafeedsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetDatafeeds) WithHeader(h map[string]string) func(*MLGetDatafeedsRequest) { + return func(r *MLGetDatafeedsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_filters.go b/esapi/api.xpack.ml.get_filters.go new file mode 100755 index 0000000000..a3eaa4d962 --- /dev/null +++ b/esapi/api.xpack.ml.get_filters.go @@ -0,0 +1,208 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newMLGetFiltersFunc(t Transport) MLGetFilters { + return func(o ...func(*MLGetFiltersRequest)) (*Response, error) { + var r = MLGetFiltersRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetFilters - +// +type MLGetFilters func(o ...func(*MLGetFiltersRequest)) (*Response, error) + +// MLGetFiltersRequest configures the Ml Get Filters API request. +// +type MLGetFiltersRequest struct { + FilterID string + + From *int + Size *int + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetFiltersRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("filters") + 1 + len(r.FilterID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("filters") + if r.FilterID != "" { + path.WriteString("/") + path.WriteString(r.FilterID) + } + + params = make(map[string]string) + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetFilters) WithContext(v context.Context) func(*MLGetFiltersRequest) { + return func(r *MLGetFiltersRequest) { + r.ctx = v + } +} + +// WithFilterID - the ID of the filter to fetch. +// +func (f MLGetFilters) WithFilterID(v string) func(*MLGetFiltersRequest) { + return func(r *MLGetFiltersRequest) { + r.FilterID = v + } +} + +// WithFrom - skips a number of filters. +// +func (f MLGetFilters) WithFrom(v int) func(*MLGetFiltersRequest) { + return func(r *MLGetFiltersRequest) { + r.From = &v + } +} + +// WithSize - specifies a max number of filters to get. +// +func (f MLGetFilters) WithSize(v int) func(*MLGetFiltersRequest) { + return func(r *MLGetFiltersRequest) { + r.Size = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetFilters) WithPretty() func(*MLGetFiltersRequest) { + return func(r *MLGetFiltersRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetFilters) WithHuman() func(*MLGetFiltersRequest) { + return func(r *MLGetFiltersRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetFilters) WithErrorTrace() func(*MLGetFiltersRequest) { + return func(r *MLGetFiltersRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetFilters) WithFilterPath(v ...string) func(*MLGetFiltersRequest) { + return func(r *MLGetFiltersRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetFilters) WithHeader(h map[string]string) func(*MLGetFiltersRequest) { + return func(r *MLGetFiltersRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_influencers.go b/esapi/api.xpack.ml.get_influencers.go new file mode 100755 index 0000000000..5c1011744f --- /dev/null +++ b/esapi/api.xpack.ml.get_influencers.go @@ -0,0 +1,296 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "fmt" + "io" + "net/http" + "strconv" + "strings" +) + +func newMLGetInfluencersFunc(t Transport) MLGetInfluencers { + return func(job_id string, o ...func(*MLGetInfluencersRequest)) (*Response, error) { + var r = MLGetInfluencersRequest{JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetInfluencers - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html +// +type MLGetInfluencers func(job_id string, o ...func(*MLGetInfluencersRequest)) (*Response, error) + +// MLGetInfluencersRequest configures the Ml Get Influencers API request. +// +type MLGetInfluencersRequest struct { + Body io.Reader + + JobID string + + Desc *bool + End string + ExcludeInterim *bool + From *int + InfluencerScore interface{} + Size *int + Sort string + Start string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetInfluencersRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("results") + 1 + len("influencers")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("results") + path.WriteString("/") + path.WriteString("influencers") + + params = make(map[string]string) + + if r.Desc != nil { + params["desc"] = strconv.FormatBool(*r.Desc) + } + + if r.End != "" { + params["end"] = r.End + } + + if r.ExcludeInterim != nil { + params["exclude_interim"] = strconv.FormatBool(*r.ExcludeInterim) + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.InfluencerScore != nil { + params["influencer_score"] = fmt.Sprintf("%v", r.InfluencerScore) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Sort != "" { + params["sort"] = r.Sort + } + + if r.Start != "" { + params["start"] = r.Start + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetInfluencers) WithContext(v context.Context) func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + r.ctx = v + } +} + +// WithBody - Influencer selection criteria. +// +func (f MLGetInfluencers) WithBody(v io.Reader) func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + r.Body = v + } +} + +// WithDesc - whether the results should be sorted in decending order. +// +func (f MLGetInfluencers) WithDesc(v bool) func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + r.Desc = &v + } +} + +// WithEnd - end timestamp for the requested influencers. +// +func (f MLGetInfluencers) WithEnd(v string) func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + r.End = v + } +} + +// WithExcludeInterim - exclude interim results. +// +func (f MLGetInfluencers) WithExcludeInterim(v bool) func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + r.ExcludeInterim = &v + } +} + +// WithFrom - skips a number of influencers. +// +func (f MLGetInfluencers) WithFrom(v int) func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + r.From = &v + } +} + +// WithInfluencerScore - influencer score threshold for the requested influencers. +// +func (f MLGetInfluencers) WithInfluencerScore(v interface{}) func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + r.InfluencerScore = v + } +} + +// WithSize - specifies a max number of influencers to get. +// +func (f MLGetInfluencers) WithSize(v int) func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + r.Size = &v + } +} + +// WithSort - sort field for the requested influencers. +// +func (f MLGetInfluencers) WithSort(v string) func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + r.Sort = v + } +} + +// WithStart - start timestamp for the requested influencers. +// +func (f MLGetInfluencers) WithStart(v string) func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + r.Start = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetInfluencers) WithPretty() func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetInfluencers) WithHuman() func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetInfluencers) WithErrorTrace() func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetInfluencers) WithFilterPath(v ...string) func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetInfluencers) WithHeader(h map[string]string) func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_job_stats.go b/esapi/api.xpack.ml.get_job_stats.go new file mode 100755 index 0000000000..c406025e32 --- /dev/null +++ b/esapi/api.xpack.ml.get_job_stats.go @@ -0,0 +1,197 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newMLGetJobStatsFunc(t Transport) MLGetJobStats { + return func(o ...func(*MLGetJobStatsRequest)) (*Response, error) { + var r = MLGetJobStatsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetJobStats - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html +// +type MLGetJobStats func(o ...func(*MLGetJobStatsRequest)) (*Response, error) + +// MLGetJobStatsRequest configures the Ml Get Job Stats API request. +// +type MLGetJobStatsRequest struct { + JobID string + + AllowNoJobs *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetJobStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_stats")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + if r.JobID != "" { + path.WriteString("/") + path.WriteString(r.JobID) + } + path.WriteString("/") + path.WriteString("_stats") + + params = make(map[string]string) + + if r.AllowNoJobs != nil { + params["allow_no_jobs"] = strconv.FormatBool(*r.AllowNoJobs) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetJobStats) WithContext(v context.Context) func(*MLGetJobStatsRequest) { + return func(r *MLGetJobStatsRequest) { + r.ctx = v + } +} + +// WithJobID - the ID of the jobs stats to fetch. +// +func (f MLGetJobStats) WithJobID(v string) func(*MLGetJobStatsRequest) { + return func(r *MLGetJobStatsRequest) { + r.JobID = v + } +} + +// WithAllowNoJobs - whether to ignore if a wildcard expression matches no jobs. (this includes `_all` string or when no jobs have been specified). +// +func (f MLGetJobStats) WithAllowNoJobs(v bool) func(*MLGetJobStatsRequest) { + return func(r *MLGetJobStatsRequest) { + r.AllowNoJobs = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetJobStats) WithPretty() func(*MLGetJobStatsRequest) { + return func(r *MLGetJobStatsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetJobStats) WithHuman() func(*MLGetJobStatsRequest) { + return func(r *MLGetJobStatsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetJobStats) WithErrorTrace() func(*MLGetJobStatsRequest) { + return func(r *MLGetJobStatsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetJobStats) WithFilterPath(v ...string) func(*MLGetJobStatsRequest) { + return func(r *MLGetJobStatsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetJobStats) WithHeader(h map[string]string) func(*MLGetJobStatsRequest) { + return func(r *MLGetJobStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_jobs.go b/esapi/api.xpack.ml.get_jobs.go new file mode 100755 index 0000000000..d81b8360ec --- /dev/null +++ b/esapi/api.xpack.ml.get_jobs.go @@ -0,0 +1,195 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newMLGetJobsFunc(t Transport) MLGetJobs { + return func(o ...func(*MLGetJobsRequest)) (*Response, error) { + var r = MLGetJobsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetJobs - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html +// +type MLGetJobs func(o ...func(*MLGetJobsRequest)) (*Response, error) + +// MLGetJobsRequest configures the Ml Get Jobs API request. +// +type MLGetJobsRequest struct { + JobID string + + AllowNoJobs *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetJobsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + if r.JobID != "" { + path.WriteString("/") + path.WriteString(r.JobID) + } + + params = make(map[string]string) + + if r.AllowNoJobs != nil { + params["allow_no_jobs"] = strconv.FormatBool(*r.AllowNoJobs) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetJobs) WithContext(v context.Context) func(*MLGetJobsRequest) { + return func(r *MLGetJobsRequest) { + r.ctx = v + } +} + +// WithJobID - the ID of the jobs to fetch. +// +func (f MLGetJobs) WithJobID(v string) func(*MLGetJobsRequest) { + return func(r *MLGetJobsRequest) { + r.JobID = v + } +} + +// WithAllowNoJobs - whether to ignore if a wildcard expression matches no jobs. (this includes `_all` string or when no jobs have been specified). +// +func (f MLGetJobs) WithAllowNoJobs(v bool) func(*MLGetJobsRequest) { + return func(r *MLGetJobsRequest) { + r.AllowNoJobs = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetJobs) WithPretty() func(*MLGetJobsRequest) { + return func(r *MLGetJobsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetJobs) WithHuman() func(*MLGetJobsRequest) { + return func(r *MLGetJobsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetJobs) WithErrorTrace() func(*MLGetJobsRequest) { + return func(r *MLGetJobsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetJobs) WithFilterPath(v ...string) func(*MLGetJobsRequest) { + return func(r *MLGetJobsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetJobs) WithHeader(h map[string]string) func(*MLGetJobsRequest) { + return func(r *MLGetJobsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_model_snapshots.go b/esapi/api.xpack.ml.get_model_snapshots.go new file mode 100755 index 0000000000..4156be0911 --- /dev/null +++ b/esapi/api.xpack.ml.get_model_snapshots.go @@ -0,0 +1,281 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "fmt" + "io" + "net/http" + "strconv" + "strings" +) + +func newMLGetModelSnapshotsFunc(t Transport) MLGetModelSnapshots { + return func(job_id string, o ...func(*MLGetModelSnapshotsRequest)) (*Response, error) { + var r = MLGetModelSnapshotsRequest{JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetModelSnapshots - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html +// +type MLGetModelSnapshots func(job_id string, o ...func(*MLGetModelSnapshotsRequest)) (*Response, error) + +// MLGetModelSnapshotsRequest configures the Ml Get Model Snapshots API request. +// +type MLGetModelSnapshotsRequest struct { + Body io.Reader + + JobID string + SnapshotID string + + Desc *bool + End interface{} + From *int + Size *int + Sort string + Start interface{} + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetModelSnapshotsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("model_snapshots") + 1 + len(r.SnapshotID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("model_snapshots") + if r.SnapshotID != "" { + path.WriteString("/") + path.WriteString(r.SnapshotID) + } + + params = make(map[string]string) + + if r.Desc != nil { + params["desc"] = strconv.FormatBool(*r.Desc) + } + + if r.End != nil { + params["end"] = fmt.Sprintf("%v", r.End) + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Sort != "" { + params["sort"] = r.Sort + } + + if r.Start != nil { + params["start"] = fmt.Sprintf("%v", r.Start) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetModelSnapshots) WithContext(v context.Context) func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + r.ctx = v + } +} + +// WithBody - Model snapshot selection criteria. +// +func (f MLGetModelSnapshots) WithBody(v io.Reader) func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + r.Body = v + } +} + +// WithSnapshotID - the ID of the snapshot to fetch. +// +func (f MLGetModelSnapshots) WithSnapshotID(v string) func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + r.SnapshotID = v + } +} + +// WithDesc - true if the results should be sorted in descending order. +// +func (f MLGetModelSnapshots) WithDesc(v bool) func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + r.Desc = &v + } +} + +// WithEnd - the filter 'end' query parameter. +// +func (f MLGetModelSnapshots) WithEnd(v interface{}) func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + r.End = v + } +} + +// WithFrom - skips a number of documents. +// +func (f MLGetModelSnapshots) WithFrom(v int) func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + r.From = &v + } +} + +// WithSize - the default number of documents returned in queries as a string.. +// +func (f MLGetModelSnapshots) WithSize(v int) func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + r.Size = &v + } +} + +// WithSort - name of the field to sort on. +// +func (f MLGetModelSnapshots) WithSort(v string) func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + r.Sort = v + } +} + +// WithStart - the filter 'start' query parameter. +// +func (f MLGetModelSnapshots) WithStart(v interface{}) func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + r.Start = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetModelSnapshots) WithPretty() func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetModelSnapshots) WithHuman() func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetModelSnapshots) WithErrorTrace() func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetModelSnapshots) WithFilterPath(v ...string) func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetModelSnapshots) WithHeader(h map[string]string) func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_overall_buckets.go b/esapi/api.xpack.ml.get_overall_buckets.go new file mode 100755 index 0000000000..266944c21e --- /dev/null +++ b/esapi/api.xpack.ml.get_overall_buckets.go @@ -0,0 +1,283 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "fmt" + "io" + "net/http" + "strconv" + "strings" +) + +func newMLGetOverallBucketsFunc(t Transport) MLGetOverallBuckets { + return func(job_id string, o ...func(*MLGetOverallBucketsRequest)) (*Response, error) { + var r = MLGetOverallBucketsRequest{JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetOverallBuckets - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html +// +type MLGetOverallBuckets func(job_id string, o ...func(*MLGetOverallBucketsRequest)) (*Response, error) + +// MLGetOverallBucketsRequest configures the Ml Get Overall Buckets API request. +// +type MLGetOverallBucketsRequest struct { + Body io.Reader + + JobID string + + AllowNoJobs *bool + BucketSpan string + End string + ExcludeInterim *bool + OverallScore interface{} + Start string + TopN *int + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetOverallBucketsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("results") + 1 + len("overall_buckets")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("results") + path.WriteString("/") + path.WriteString("overall_buckets") + + params = make(map[string]string) + + if r.AllowNoJobs != nil { + params["allow_no_jobs"] = strconv.FormatBool(*r.AllowNoJobs) + } + + if r.BucketSpan != "" { + params["bucket_span"] = r.BucketSpan + } + + if r.End != "" { + params["end"] = r.End + } + + if r.ExcludeInterim != nil { + params["exclude_interim"] = strconv.FormatBool(*r.ExcludeInterim) + } + + if r.OverallScore != nil { + params["overall_score"] = fmt.Sprintf("%v", r.OverallScore) + } + + if r.Start != "" { + params["start"] = r.Start + } + + if r.TopN != nil { + params["top_n"] = strconv.FormatInt(int64(*r.TopN), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetOverallBuckets) WithContext(v context.Context) func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + r.ctx = v + } +} + +// WithBody - Overall bucket selection details if not provided in URI. +// +func (f MLGetOverallBuckets) WithBody(v io.Reader) func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + r.Body = v + } +} + +// WithAllowNoJobs - whether to ignore if a wildcard expression matches no jobs. (this includes `_all` string or when no jobs have been specified). +// +func (f MLGetOverallBuckets) WithAllowNoJobs(v bool) func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + r.AllowNoJobs = &v + } +} + +// WithBucketSpan - the span of the overall buckets. defaults to the longest job bucket_span. +// +func (f MLGetOverallBuckets) WithBucketSpan(v string) func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + r.BucketSpan = v + } +} + +// WithEnd - returns overall buckets with timestamps earlier than this time. +// +func (f MLGetOverallBuckets) WithEnd(v string) func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + r.End = v + } +} + +// WithExcludeInterim - if true overall buckets that include interim buckets will be excluded. +// +func (f MLGetOverallBuckets) WithExcludeInterim(v bool) func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + r.ExcludeInterim = &v + } +} + +// WithOverallScore - returns overall buckets with overall scores higher than this value. +// +func (f MLGetOverallBuckets) WithOverallScore(v interface{}) func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + r.OverallScore = v + } +} + +// WithStart - returns overall buckets with timestamps after this time. +// +func (f MLGetOverallBuckets) WithStart(v string) func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + r.Start = v + } +} + +// WithTopN - the number of top job bucket scores to be used in the overall_score calculation. +// +func (f MLGetOverallBuckets) WithTopN(v int) func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + r.TopN = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetOverallBuckets) WithPretty() func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetOverallBuckets) WithHuman() func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetOverallBuckets) WithErrorTrace() func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetOverallBuckets) WithFilterPath(v ...string) func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetOverallBuckets) WithHeader(h map[string]string) func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.get_records.go b/esapi/api.xpack.ml.get_records.go new file mode 100755 index 0000000000..6015b11aee --- /dev/null +++ b/esapi/api.xpack.ml.get_records.go @@ -0,0 +1,296 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "fmt" + "io" + "net/http" + "strconv" + "strings" +) + +func newMLGetRecordsFunc(t Transport) MLGetRecords { + return func(job_id string, o ...func(*MLGetRecordsRequest)) (*Response, error) { + var r = MLGetRecordsRequest{JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLGetRecords - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html +// +type MLGetRecords func(job_id string, o ...func(*MLGetRecordsRequest)) (*Response, error) + +// MLGetRecordsRequest configures the Ml Get Records API request. +// +type MLGetRecordsRequest struct { + Body io.Reader + + JobID string + + Desc *bool + End string + ExcludeInterim *bool + From *int + RecordScore interface{} + Size *int + Sort string + Start string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLGetRecordsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("results") + 1 + len("records")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("results") + path.WriteString("/") + path.WriteString("records") + + params = make(map[string]string) + + if r.Desc != nil { + params["desc"] = strconv.FormatBool(*r.Desc) + } + + if r.End != "" { + params["end"] = r.End + } + + if r.ExcludeInterim != nil { + params["exclude_interim"] = strconv.FormatBool(*r.ExcludeInterim) + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.RecordScore != nil { + params["record_score"] = fmt.Sprintf("%v", r.RecordScore) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Sort != "" { + params["sort"] = r.Sort + } + + if r.Start != "" { + params["start"] = r.Start + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLGetRecords) WithContext(v context.Context) func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + r.ctx = v + } +} + +// WithBody - Record selection criteria. +// +func (f MLGetRecords) WithBody(v io.Reader) func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + r.Body = v + } +} + +// WithDesc - set the sort direction. +// +func (f MLGetRecords) WithDesc(v bool) func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + r.Desc = &v + } +} + +// WithEnd - end time filter for records. +// +func (f MLGetRecords) WithEnd(v string) func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + r.End = v + } +} + +// WithExcludeInterim - exclude interim results. +// +func (f MLGetRecords) WithExcludeInterim(v bool) func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + r.ExcludeInterim = &v + } +} + +// WithFrom - skips a number of records. +// +func (f MLGetRecords) WithFrom(v int) func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + r.From = &v + } +} + +// WithRecordScore - . +// +func (f MLGetRecords) WithRecordScore(v interface{}) func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + r.RecordScore = v + } +} + +// WithSize - specifies a max number of records to get. +// +func (f MLGetRecords) WithSize(v int) func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + r.Size = &v + } +} + +// WithSort - sort records by a particular field. +// +func (f MLGetRecords) WithSort(v string) func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + r.Sort = v + } +} + +// WithStart - start time filter for records. +// +func (f MLGetRecords) WithStart(v string) func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + r.Start = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLGetRecords) WithPretty() func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLGetRecords) WithHuman() func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLGetRecords) WithErrorTrace() func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLGetRecords) WithFilterPath(v ...string) func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLGetRecords) WithHeader(h map[string]string) func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.info.go b/esapi/api.xpack.ml.info.go new file mode 100755 index 0000000000..bd61b92269 --- /dev/null +++ b/esapi/api.xpack.ml.info.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newMLInfoFunc(t Transport) MLInfo { + return func(o ...func(*MLInfoRequest)) (*Response, error) { + var r = MLInfoRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLInfo - +// +type MLInfo func(o ...func(*MLInfoRequest)) (*Response, error) + +// MLInfoRequest configures the Ml Info API request. +// +type MLInfoRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_ml/info")) + path.WriteString("/_ml/info") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLInfo) WithContext(v context.Context) func(*MLInfoRequest) { + return func(r *MLInfoRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLInfo) WithPretty() func(*MLInfoRequest) { + return func(r *MLInfoRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLInfo) WithHuman() func(*MLInfoRequest) { + return func(r *MLInfoRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLInfo) WithErrorTrace() func(*MLInfoRequest) { + return func(r *MLInfoRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLInfo) WithFilterPath(v ...string) func(*MLInfoRequest) { + return func(r *MLInfoRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLInfo) WithHeader(h map[string]string) func(*MLInfoRequest) { + return func(r *MLInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.open_job.go b/esapi/api.xpack.ml.open_job.go new file mode 100755 index 0000000000..9438b84c7d --- /dev/null +++ b/esapi/api.xpack.ml.open_job.go @@ -0,0 +1,191 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" + "time" +) + +func newMLOpenJobFunc(t Transport) MLOpenJob { + return func(job_id string, o ...func(*MLOpenJobRequest)) (*Response, error) { + var r = MLOpenJobRequest{JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLOpenJob - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html +// +type MLOpenJob func(job_id string, o ...func(*MLOpenJobRequest)) (*Response, error) + +// MLOpenJobRequest configures the Ml Open Job API request. +// +type MLOpenJobRequest struct { + IgnoreDowntime *bool + JobID string + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLOpenJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_open")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("_open") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLOpenJob) WithContext(v context.Context) func(*MLOpenJobRequest) { + return func(r *MLOpenJobRequest) { + r.ctx = v + } +} + +// WithIgnoreDowntime - controls if gaps in data are treated as anomalous or as a maintenance window after a job re-start. +// +func (f MLOpenJob) WithIgnoreDowntime(v bool) func(*MLOpenJobRequest) { + return func(r *MLOpenJobRequest) { + r.IgnoreDowntime = &v + } +} + +// WithTimeout - controls the time to wait until a job has opened. default to 30 minutes. +// +func (f MLOpenJob) WithTimeout(v time.Duration) func(*MLOpenJobRequest) { + return func(r *MLOpenJobRequest) { + r.Timeout = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLOpenJob) WithPretty() func(*MLOpenJobRequest) { + return func(r *MLOpenJobRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLOpenJob) WithHuman() func(*MLOpenJobRequest) { + return func(r *MLOpenJobRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLOpenJob) WithErrorTrace() func(*MLOpenJobRequest) { + return func(r *MLOpenJobRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLOpenJob) WithFilterPath(v ...string) func(*MLOpenJobRequest) { + return func(r *MLOpenJobRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLOpenJob) WithHeader(h map[string]string) func(*MLOpenJobRequest) { + return func(r *MLOpenJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.post_calendar_events.go b/esapi/api.xpack.ml.post_calendar_events.go new file mode 100755 index 0000000000..0c66f10ad4 --- /dev/null +++ b/esapi/api.xpack.ml.post_calendar_events.go @@ -0,0 +1,179 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLPostCalendarEventsFunc(t Transport) MLPostCalendarEvents { + return func(calendar_id string, body io.Reader, o ...func(*MLPostCalendarEventsRequest)) (*Response, error) { + var r = MLPostCalendarEventsRequest{CalendarID: calendar_id, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLPostCalendarEvents - +// +type MLPostCalendarEvents func(calendar_id string, body io.Reader, o ...func(*MLPostCalendarEventsRequest)) (*Response, error) + +// MLPostCalendarEventsRequest configures the Ml Post Calendar Events API request. +// +type MLPostCalendarEventsRequest struct { + Body io.Reader + + CalendarID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLPostCalendarEventsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID) + 1 + len("events")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("calendars") + path.WriteString("/") + path.WriteString(r.CalendarID) + path.WriteString("/") + path.WriteString("events") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLPostCalendarEvents) WithContext(v context.Context) func(*MLPostCalendarEventsRequest) { + return func(r *MLPostCalendarEventsRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLPostCalendarEvents) WithPretty() func(*MLPostCalendarEventsRequest) { + return func(r *MLPostCalendarEventsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLPostCalendarEvents) WithHuman() func(*MLPostCalendarEventsRequest) { + return func(r *MLPostCalendarEventsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLPostCalendarEvents) WithErrorTrace() func(*MLPostCalendarEventsRequest) { + return func(r *MLPostCalendarEventsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLPostCalendarEvents) WithFilterPath(v ...string) func(*MLPostCalendarEventsRequest) { + return func(r *MLPostCalendarEventsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLPostCalendarEvents) WithHeader(h map[string]string) func(*MLPostCalendarEventsRequest) { + return func(r *MLPostCalendarEventsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.post_data.go b/esapi/api.xpack.ml.post_data.go new file mode 100755 index 0000000000..ff4df45105 --- /dev/null +++ b/esapi/api.xpack.ml.post_data.go @@ -0,0 +1,206 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLPostDataFunc(t Transport) MLPostData { + return func(job_id string, body io.Reader, o ...func(*MLPostDataRequest)) (*Response, error) { + var r = MLPostDataRequest{JobID: job_id, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLPostData - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html +// +type MLPostData func(job_id string, body io.Reader, o ...func(*MLPostDataRequest)) (*Response, error) + +// MLPostDataRequest configures the Ml Post Data API request. +// +type MLPostDataRequest struct { + Body io.Reader + + JobID string + + ResetEnd string + ResetStart string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLPostDataRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_data")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("_data") + + params = make(map[string]string) + + if r.ResetEnd != "" { + params["reset_end"] = r.ResetEnd + } + + if r.ResetStart != "" { + params["reset_start"] = r.ResetStart + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLPostData) WithContext(v context.Context) func(*MLPostDataRequest) { + return func(r *MLPostDataRequest) { + r.ctx = v + } +} + +// WithResetEnd - optional parameter to specify the end of the bucket resetting range. +// +func (f MLPostData) WithResetEnd(v string) func(*MLPostDataRequest) { + return func(r *MLPostDataRequest) { + r.ResetEnd = v + } +} + +// WithResetStart - optional parameter to specify the start of the bucket resetting range. +// +func (f MLPostData) WithResetStart(v string) func(*MLPostDataRequest) { + return func(r *MLPostDataRequest) { + r.ResetStart = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLPostData) WithPretty() func(*MLPostDataRequest) { + return func(r *MLPostDataRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLPostData) WithHuman() func(*MLPostDataRequest) { + return func(r *MLPostDataRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLPostData) WithErrorTrace() func(*MLPostDataRequest) { + return func(r *MLPostDataRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLPostData) WithFilterPath(v ...string) func(*MLPostDataRequest) { + return func(r *MLPostDataRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLPostData) WithHeader(h map[string]string) func(*MLPostDataRequest) { + return func(r *MLPostDataRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.preview_datafeed.go b/esapi/api.xpack.ml.preview_datafeed.go new file mode 100755 index 0000000000..3e32006a7e --- /dev/null +++ b/esapi/api.xpack.ml.preview_datafeed.go @@ -0,0 +1,172 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newMLPreviewDatafeedFunc(t Transport) MLPreviewDatafeed { + return func(datafeed_id string, o ...func(*MLPreviewDatafeedRequest)) (*Response, error) { + var r = MLPreviewDatafeedRequest{DatafeedID: datafeed_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLPreviewDatafeed - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html +// +type MLPreviewDatafeed func(datafeed_id string, o ...func(*MLPreviewDatafeedRequest)) (*Response, error) + +// MLPreviewDatafeedRequest configures the Ml Preview Datafeed API request. +// +type MLPreviewDatafeedRequest struct { + DatafeedID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLPreviewDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID) + 1 + len("_preview")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("datafeeds") + path.WriteString("/") + path.WriteString(r.DatafeedID) + path.WriteString("/") + path.WriteString("_preview") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLPreviewDatafeed) WithContext(v context.Context) func(*MLPreviewDatafeedRequest) { + return func(r *MLPreviewDatafeedRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLPreviewDatafeed) WithPretty() func(*MLPreviewDatafeedRequest) { + return func(r *MLPreviewDatafeedRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLPreviewDatafeed) WithHuman() func(*MLPreviewDatafeedRequest) { + return func(r *MLPreviewDatafeedRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLPreviewDatafeed) WithErrorTrace() func(*MLPreviewDatafeedRequest) { + return func(r *MLPreviewDatafeedRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLPreviewDatafeed) WithFilterPath(v ...string) func(*MLPreviewDatafeedRequest) { + return func(r *MLPreviewDatafeedRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLPreviewDatafeed) WithHeader(h map[string]string) func(*MLPreviewDatafeedRequest) { + return func(r *MLPreviewDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.put_calendar.go b/esapi/api.xpack.ml.put_calendar.go new file mode 100755 index 0000000000..2b7b6349d3 --- /dev/null +++ b/esapi/api.xpack.ml.put_calendar.go @@ -0,0 +1,185 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLPutCalendarFunc(t Transport) MLPutCalendar { + return func(calendar_id string, o ...func(*MLPutCalendarRequest)) (*Response, error) { + var r = MLPutCalendarRequest{CalendarID: calendar_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLPutCalendar - +// +type MLPutCalendar func(calendar_id string, o ...func(*MLPutCalendarRequest)) (*Response, error) + +// MLPutCalendarRequest configures the Ml Put Calendar API request. +// +type MLPutCalendarRequest struct { + Body io.Reader + + CalendarID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLPutCalendarRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("calendars") + path.WriteString("/") + path.WriteString(r.CalendarID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLPutCalendar) WithContext(v context.Context) func(*MLPutCalendarRequest) { + return func(r *MLPutCalendarRequest) { + r.ctx = v + } +} + +// WithBody - The calendar details. +// +func (f MLPutCalendar) WithBody(v io.Reader) func(*MLPutCalendarRequest) { + return func(r *MLPutCalendarRequest) { + r.Body = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLPutCalendar) WithPretty() func(*MLPutCalendarRequest) { + return func(r *MLPutCalendarRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLPutCalendar) WithHuman() func(*MLPutCalendarRequest) { + return func(r *MLPutCalendarRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLPutCalendar) WithErrorTrace() func(*MLPutCalendarRequest) { + return func(r *MLPutCalendarRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLPutCalendar) WithFilterPath(v ...string) func(*MLPutCalendarRequest) { + return func(r *MLPutCalendarRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLPutCalendar) WithHeader(h map[string]string) func(*MLPutCalendarRequest) { + return func(r *MLPutCalendarRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.put_calendar_job.go b/esapi/api.xpack.ml.put_calendar_job.go new file mode 100755 index 0000000000..9cce8f3652 --- /dev/null +++ b/esapi/api.xpack.ml.put_calendar_job.go @@ -0,0 +1,175 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newMLPutCalendarJobFunc(t Transport) MLPutCalendarJob { + return func(calendar_id string, job_id string, o ...func(*MLPutCalendarJobRequest)) (*Response, error) { + var r = MLPutCalendarJobRequest{CalendarID: calendar_id, JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLPutCalendarJob - +// +type MLPutCalendarJob func(calendar_id string, job_id string, o ...func(*MLPutCalendarJobRequest)) (*Response, error) + +// MLPutCalendarJobRequest configures the Ml Put Calendar Job API request. +// +type MLPutCalendarJobRequest struct { + CalendarID string + JobID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLPutCalendarJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_ml") + 1 + len("calendars") + 1 + len(r.CalendarID) + 1 + len("jobs") + 1 + len(r.JobID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("calendars") + path.WriteString("/") + path.WriteString(r.CalendarID) + path.WriteString("/") + path.WriteString("jobs") + path.WriteString("/") + path.WriteString(r.JobID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLPutCalendarJob) WithContext(v context.Context) func(*MLPutCalendarJobRequest) { + return func(r *MLPutCalendarJobRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLPutCalendarJob) WithPretty() func(*MLPutCalendarJobRequest) { + return func(r *MLPutCalendarJobRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLPutCalendarJob) WithHuman() func(*MLPutCalendarJobRequest) { + return func(r *MLPutCalendarJobRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLPutCalendarJob) WithErrorTrace() func(*MLPutCalendarJobRequest) { + return func(r *MLPutCalendarJobRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLPutCalendarJob) WithFilterPath(v ...string) func(*MLPutCalendarJobRequest) { + return func(r *MLPutCalendarJobRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLPutCalendarJob) WithHeader(h map[string]string) func(*MLPutCalendarJobRequest) { + return func(r *MLPutCalendarJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.put_data_frame_analytics.go b/esapi/api.xpack.ml.put_data_frame_analytics.go new file mode 100755 index 0000000000..452317493f --- /dev/null +++ b/esapi/api.xpack.ml.put_data_frame_analytics.go @@ -0,0 +1,179 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLPutDataFrameAnalyticsFunc(t Transport) MLPutDataFrameAnalytics { + return func(id string, body io.Reader, o ...func(*MLPutDataFrameAnalyticsRequest)) (*Response, error) { + var r = MLPutDataFrameAnalyticsRequest{DocumentID: id, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLPutDataFrameAnalytics - +// +type MLPutDataFrameAnalytics func(id string, body io.Reader, o ...func(*MLPutDataFrameAnalyticsRequest)) (*Response, error) + +// MLPutDataFrameAnalyticsRequest configures the Ml Put Data Frame Analytics API request. +// +type MLPutDataFrameAnalyticsRequest struct { + DocumentID string + + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLPutDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("data_frame") + path.WriteString("/") + path.WriteString("analytics") + path.WriteString("/") + path.WriteString(r.DocumentID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLPutDataFrameAnalytics) WithContext(v context.Context) func(*MLPutDataFrameAnalyticsRequest) { + return func(r *MLPutDataFrameAnalyticsRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLPutDataFrameAnalytics) WithPretty() func(*MLPutDataFrameAnalyticsRequest) { + return func(r *MLPutDataFrameAnalyticsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLPutDataFrameAnalytics) WithHuman() func(*MLPutDataFrameAnalyticsRequest) { + return func(r *MLPutDataFrameAnalyticsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLPutDataFrameAnalytics) WithErrorTrace() func(*MLPutDataFrameAnalyticsRequest) { + return func(r *MLPutDataFrameAnalyticsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLPutDataFrameAnalytics) WithFilterPath(v ...string) func(*MLPutDataFrameAnalyticsRequest) { + return func(r *MLPutDataFrameAnalyticsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLPutDataFrameAnalytics) WithHeader(h map[string]string) func(*MLPutDataFrameAnalyticsRequest) { + return func(r *MLPutDataFrameAnalyticsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.put_datafeed.go b/esapi/api.xpack.ml.put_datafeed.go new file mode 100755 index 0000000000..12e2560df2 --- /dev/null +++ b/esapi/api.xpack.ml.put_datafeed.go @@ -0,0 +1,177 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLPutDatafeedFunc(t Transport) MLPutDatafeed { + return func(body io.Reader, datafeed_id string, o ...func(*MLPutDatafeedRequest)) (*Response, error) { + var r = MLPutDatafeedRequest{Body: body, DatafeedID: datafeed_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLPutDatafeed - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html +// +type MLPutDatafeed func(body io.Reader, datafeed_id string, o ...func(*MLPutDatafeedRequest)) (*Response, error) + +// MLPutDatafeedRequest configures the Ml Put Datafeed API request. +// +type MLPutDatafeedRequest struct { + Body io.Reader + + DatafeedID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLPutDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("datafeeds") + path.WriteString("/") + path.WriteString(r.DatafeedID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLPutDatafeed) WithContext(v context.Context) func(*MLPutDatafeedRequest) { + return func(r *MLPutDatafeedRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLPutDatafeed) WithPretty() func(*MLPutDatafeedRequest) { + return func(r *MLPutDatafeedRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLPutDatafeed) WithHuman() func(*MLPutDatafeedRequest) { + return func(r *MLPutDatafeedRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLPutDatafeed) WithErrorTrace() func(*MLPutDatafeedRequest) { + return func(r *MLPutDatafeedRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLPutDatafeed) WithFilterPath(v ...string) func(*MLPutDatafeedRequest) { + return func(r *MLPutDatafeedRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLPutDatafeed) WithHeader(h map[string]string) func(*MLPutDatafeedRequest) { + return func(r *MLPutDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.put_filter.go b/esapi/api.xpack.ml.put_filter.go new file mode 100755 index 0000000000..c8c3f2defa --- /dev/null +++ b/esapi/api.xpack.ml.put_filter.go @@ -0,0 +1,177 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLPutFilterFunc(t Transport) MLPutFilter { + return func(body io.Reader, filter_id string, o ...func(*MLPutFilterRequest)) (*Response, error) { + var r = MLPutFilterRequest{Body: body, FilterID: filter_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLPutFilter - +// +type MLPutFilter func(body io.Reader, filter_id string, o ...func(*MLPutFilterRequest)) (*Response, error) + +// MLPutFilterRequest configures the Ml Put Filter API request. +// +type MLPutFilterRequest struct { + Body io.Reader + + FilterID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLPutFilterRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_ml") + 1 + len("filters") + 1 + len(r.FilterID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("filters") + path.WriteString("/") + path.WriteString(r.FilterID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLPutFilter) WithContext(v context.Context) func(*MLPutFilterRequest) { + return func(r *MLPutFilterRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLPutFilter) WithPretty() func(*MLPutFilterRequest) { + return func(r *MLPutFilterRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLPutFilter) WithHuman() func(*MLPutFilterRequest) { + return func(r *MLPutFilterRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLPutFilter) WithErrorTrace() func(*MLPutFilterRequest) { + return func(r *MLPutFilterRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLPutFilter) WithFilterPath(v ...string) func(*MLPutFilterRequest) { + return func(r *MLPutFilterRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLPutFilter) WithHeader(h map[string]string) func(*MLPutFilterRequest) { + return func(r *MLPutFilterRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.put_job.go b/esapi/api.xpack.ml.put_job.go new file mode 100755 index 0000000000..bc0d6f1a9f --- /dev/null +++ b/esapi/api.xpack.ml.put_job.go @@ -0,0 +1,177 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLPutJobFunc(t Transport) MLPutJob { + return func(job_id string, body io.Reader, o ...func(*MLPutJobRequest)) (*Response, error) { + var r = MLPutJobRequest{JobID: job_id, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLPutJob - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html +// +type MLPutJob func(job_id string, body io.Reader, o ...func(*MLPutJobRequest)) (*Response, error) + +// MLPutJobRequest configures the Ml Put Job API request. +// +type MLPutJobRequest struct { + Body io.Reader + + JobID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLPutJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID)) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLPutJob) WithContext(v context.Context) func(*MLPutJobRequest) { + return func(r *MLPutJobRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLPutJob) WithPretty() func(*MLPutJobRequest) { + return func(r *MLPutJobRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLPutJob) WithHuman() func(*MLPutJobRequest) { + return func(r *MLPutJobRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLPutJob) WithErrorTrace() func(*MLPutJobRequest) { + return func(r *MLPutJobRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLPutJob) WithFilterPath(v ...string) func(*MLPutJobRequest) { + return func(r *MLPutJobRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLPutJob) WithHeader(h map[string]string) func(*MLPutJobRequest) { + return func(r *MLPutJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.revert_model_snapshot.go b/esapi/api.xpack.ml.revert_model_snapshot.go new file mode 100755 index 0000000000..0b9a03a1e0 --- /dev/null +++ b/esapi/api.xpack.ml.revert_model_snapshot.go @@ -0,0 +1,207 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" +) + +func newMLRevertModelSnapshotFunc(t Transport) MLRevertModelSnapshot { + return func(snapshot_id string, job_id string, o ...func(*MLRevertModelSnapshotRequest)) (*Response, error) { + var r = MLRevertModelSnapshotRequest{SnapshotID: snapshot_id, JobID: job_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLRevertModelSnapshot - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html +// +type MLRevertModelSnapshot func(snapshot_id string, job_id string, o ...func(*MLRevertModelSnapshotRequest)) (*Response, error) + +// MLRevertModelSnapshotRequest configures the Ml Revert Model Snapshot API request. +// +type MLRevertModelSnapshotRequest struct { + Body io.Reader + + JobID string + SnapshotID string + + DeleteInterveningResults *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLRevertModelSnapshotRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("model_snapshots") + 1 + len(r.SnapshotID) + 1 + len("_revert")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("model_snapshots") + path.WriteString("/") + path.WriteString(r.SnapshotID) + path.WriteString("/") + path.WriteString("_revert") + + params = make(map[string]string) + + if r.DeleteInterveningResults != nil { + params["delete_intervening_results"] = strconv.FormatBool(*r.DeleteInterveningResults) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLRevertModelSnapshot) WithContext(v context.Context) func(*MLRevertModelSnapshotRequest) { + return func(r *MLRevertModelSnapshotRequest) { + r.ctx = v + } +} + +// WithBody - Reversion options. +// +func (f MLRevertModelSnapshot) WithBody(v io.Reader) func(*MLRevertModelSnapshotRequest) { + return func(r *MLRevertModelSnapshotRequest) { + r.Body = v + } +} + +// WithDeleteInterveningResults - should we reset the results back to the time of the snapshot?. +// +func (f MLRevertModelSnapshot) WithDeleteInterveningResults(v bool) func(*MLRevertModelSnapshotRequest) { + return func(r *MLRevertModelSnapshotRequest) { + r.DeleteInterveningResults = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLRevertModelSnapshot) WithPretty() func(*MLRevertModelSnapshotRequest) { + return func(r *MLRevertModelSnapshotRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLRevertModelSnapshot) WithHuman() func(*MLRevertModelSnapshotRequest) { + return func(r *MLRevertModelSnapshotRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLRevertModelSnapshot) WithErrorTrace() func(*MLRevertModelSnapshotRequest) { + return func(r *MLRevertModelSnapshotRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLRevertModelSnapshot) WithFilterPath(v ...string) func(*MLRevertModelSnapshotRequest) { + return func(r *MLRevertModelSnapshotRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLRevertModelSnapshot) WithHeader(h map[string]string) func(*MLRevertModelSnapshotRequest) { + return func(r *MLRevertModelSnapshotRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.set_upgrade_mode.go b/esapi/api.xpack.ml.set_upgrade_mode.go new file mode 100755 index 0000000000..7c3920779b --- /dev/null +++ b/esapi/api.xpack.ml.set_upgrade_mode.go @@ -0,0 +1,192 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" + "time" +) + +func newMLSetUpgradeModeFunc(t Transport) MLSetUpgradeMode { + return func(o ...func(*MLSetUpgradeModeRequest)) (*Response, error) { + var r = MLSetUpgradeModeRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLSetUpgradeMode - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html +// +type MLSetUpgradeMode func(o ...func(*MLSetUpgradeModeRequest)) (*Response, error) + +// MLSetUpgradeModeRequest configures the Ml Set Upgrade Mode API request. +// +type MLSetUpgradeModeRequest struct { + Enabled *bool + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLSetUpgradeModeRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_ml/set_upgrade_mode")) + path.WriteString("/_ml/set_upgrade_mode") + + params = make(map[string]string) + + if r.Enabled != nil { + params["enabled"] = strconv.FormatBool(*r.Enabled) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLSetUpgradeMode) WithContext(v context.Context) func(*MLSetUpgradeModeRequest) { + return func(r *MLSetUpgradeModeRequest) { + r.ctx = v + } +} + +// WithEnabled - whether to enable upgrade_mode ml setting or not. defaults to false.. +// +func (f MLSetUpgradeMode) WithEnabled(v bool) func(*MLSetUpgradeModeRequest) { + return func(r *MLSetUpgradeModeRequest) { + r.Enabled = &v + } +} + +// WithTimeout - controls the time to wait before action times out. defaults to 30 seconds. +// +func (f MLSetUpgradeMode) WithTimeout(v time.Duration) func(*MLSetUpgradeModeRequest) { + return func(r *MLSetUpgradeModeRequest) { + r.Timeout = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLSetUpgradeMode) WithPretty() func(*MLSetUpgradeModeRequest) { + return func(r *MLSetUpgradeModeRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLSetUpgradeMode) WithHuman() func(*MLSetUpgradeModeRequest) { + return func(r *MLSetUpgradeModeRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLSetUpgradeMode) WithErrorTrace() func(*MLSetUpgradeModeRequest) { + return func(r *MLSetUpgradeModeRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLSetUpgradeMode) WithFilterPath(v ...string) func(*MLSetUpgradeModeRequest) { + return func(r *MLSetUpgradeModeRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLSetUpgradeMode) WithHeader(h map[string]string) func(*MLSetUpgradeModeRequest) { + return func(r *MLSetUpgradeModeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.start_data_frame_analytics.go b/esapi/api.xpack.ml.start_data_frame_analytics.go new file mode 100755 index 0000000000..12fb460b66 --- /dev/null +++ b/esapi/api.xpack.ml.start_data_frame_analytics.go @@ -0,0 +1,204 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" + "time" +) + +func newMLStartDataFrameAnalyticsFunc(t Transport) MLStartDataFrameAnalytics { + return func(id string, o ...func(*MLStartDataFrameAnalyticsRequest)) (*Response, error) { + var r = MLStartDataFrameAnalyticsRequest{DocumentID: id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLStartDataFrameAnalytics - +// +type MLStartDataFrameAnalytics func(id string, o ...func(*MLStartDataFrameAnalyticsRequest)) (*Response, error) + +// MLStartDataFrameAnalyticsRequest configures the Ml Start Data Frame Analytics API request. +// +type MLStartDataFrameAnalyticsRequest struct { + DocumentID string + + Body io.Reader + + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLStartDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID) + 1 + len("_start")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("data_frame") + path.WriteString("/") + path.WriteString("analytics") + path.WriteString("/") + path.WriteString(r.DocumentID) + path.WriteString("/") + path.WriteString("_start") + + params = make(map[string]string) + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLStartDataFrameAnalytics) WithContext(v context.Context) func(*MLStartDataFrameAnalyticsRequest) { + return func(r *MLStartDataFrameAnalyticsRequest) { + r.ctx = v + } +} + +// WithBody - The start data frame analytics parameters. +// +func (f MLStartDataFrameAnalytics) WithBody(v io.Reader) func(*MLStartDataFrameAnalyticsRequest) { + return func(r *MLStartDataFrameAnalyticsRequest) { + r.Body = v + } +} + +// WithTimeout - controls the time to wait until the task has started. defaults to 20 seconds. +// +func (f MLStartDataFrameAnalytics) WithTimeout(v time.Duration) func(*MLStartDataFrameAnalyticsRequest) { + return func(r *MLStartDataFrameAnalyticsRequest) { + r.Timeout = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLStartDataFrameAnalytics) WithPretty() func(*MLStartDataFrameAnalyticsRequest) { + return func(r *MLStartDataFrameAnalyticsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLStartDataFrameAnalytics) WithHuman() func(*MLStartDataFrameAnalyticsRequest) { + return func(r *MLStartDataFrameAnalyticsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLStartDataFrameAnalytics) WithErrorTrace() func(*MLStartDataFrameAnalyticsRequest) { + return func(r *MLStartDataFrameAnalyticsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLStartDataFrameAnalytics) WithFilterPath(v ...string) func(*MLStartDataFrameAnalyticsRequest) { + return func(r *MLStartDataFrameAnalyticsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLStartDataFrameAnalytics) WithHeader(h map[string]string) func(*MLStartDataFrameAnalyticsRequest) { + return func(r *MLStartDataFrameAnalyticsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.start_datafeed.go b/esapi/api.xpack.ml.start_datafeed.go new file mode 100755 index 0000000000..44b273c882 --- /dev/null +++ b/esapi/api.xpack.ml.start_datafeed.go @@ -0,0 +1,228 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" + "time" +) + +func newMLStartDatafeedFunc(t Transport) MLStartDatafeed { + return func(datafeed_id string, o ...func(*MLStartDatafeedRequest)) (*Response, error) { + var r = MLStartDatafeedRequest{DatafeedID: datafeed_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLStartDatafeed - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html +// +type MLStartDatafeed func(datafeed_id string, o ...func(*MLStartDatafeedRequest)) (*Response, error) + +// MLStartDatafeedRequest configures the Ml Start Datafeed API request. +// +type MLStartDatafeedRequest struct { + Body io.Reader + + DatafeedID string + + End string + Start string + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLStartDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID) + 1 + len("_start")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("datafeeds") + path.WriteString("/") + path.WriteString(r.DatafeedID) + path.WriteString("/") + path.WriteString("_start") + + params = make(map[string]string) + + if r.End != "" { + params["end"] = r.End + } + + if r.Start != "" { + params["start"] = r.Start + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLStartDatafeed) WithContext(v context.Context) func(*MLStartDatafeedRequest) { + return func(r *MLStartDatafeedRequest) { + r.ctx = v + } +} + +// WithBody - The start datafeed parameters. +// +func (f MLStartDatafeed) WithBody(v io.Reader) func(*MLStartDatafeedRequest) { + return func(r *MLStartDatafeedRequest) { + r.Body = v + } +} + +// WithEnd - the end time when the datafeed should stop. when not set, the datafeed continues in real time. +// +func (f MLStartDatafeed) WithEnd(v string) func(*MLStartDatafeedRequest) { + return func(r *MLStartDatafeedRequest) { + r.End = v + } +} + +// WithStart - the start time from where the datafeed should begin. +// +func (f MLStartDatafeed) WithStart(v string) func(*MLStartDatafeedRequest) { + return func(r *MLStartDatafeedRequest) { + r.Start = v + } +} + +// WithTimeout - controls the time to wait until a datafeed has started. default to 20 seconds. +// +func (f MLStartDatafeed) WithTimeout(v time.Duration) func(*MLStartDatafeedRequest) { + return func(r *MLStartDatafeedRequest) { + r.Timeout = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLStartDatafeed) WithPretty() func(*MLStartDatafeedRequest) { + return func(r *MLStartDatafeedRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLStartDatafeed) WithHuman() func(*MLStartDatafeedRequest) { + return func(r *MLStartDatafeedRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLStartDatafeed) WithErrorTrace() func(*MLStartDatafeedRequest) { + return func(r *MLStartDatafeedRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLStartDatafeed) WithFilterPath(v ...string) func(*MLStartDatafeedRequest) { + return func(r *MLStartDatafeedRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLStartDatafeed) WithHeader(h map[string]string) func(*MLStartDatafeedRequest) { + return func(r *MLStartDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.stop_data_frame_analytics.go b/esapi/api.xpack.ml.stop_data_frame_analytics.go new file mode 100755 index 0000000000..20b7981763 --- /dev/null +++ b/esapi/api.xpack.ml.stop_data_frame_analytics.go @@ -0,0 +1,231 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" + "time" +) + +func newMLStopDataFrameAnalyticsFunc(t Transport) MLStopDataFrameAnalytics { + return func(id string, o ...func(*MLStopDataFrameAnalyticsRequest)) (*Response, error) { + var r = MLStopDataFrameAnalyticsRequest{DocumentID: id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLStopDataFrameAnalytics - +// +type MLStopDataFrameAnalytics func(id string, o ...func(*MLStopDataFrameAnalyticsRequest)) (*Response, error) + +// MLStopDataFrameAnalyticsRequest configures the Ml Stop Data Frame Analytics API request. +// +type MLStopDataFrameAnalyticsRequest struct { + DocumentID string + + Body io.Reader + + AllowNoMatch *bool + Force *bool + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLStopDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID) + 1 + len("_stop")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("data_frame") + path.WriteString("/") + path.WriteString("analytics") + path.WriteString("/") + path.WriteString(r.DocumentID) + path.WriteString("/") + path.WriteString("_stop") + + params = make(map[string]string) + + if r.AllowNoMatch != nil { + params["allow_no_match"] = strconv.FormatBool(*r.AllowNoMatch) + } + + if r.Force != nil { + params["force"] = strconv.FormatBool(*r.Force) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLStopDataFrameAnalytics) WithContext(v context.Context) func(*MLStopDataFrameAnalyticsRequest) { + return func(r *MLStopDataFrameAnalyticsRequest) { + r.ctx = v + } +} + +// WithBody - The stop data frame analytics parameters. +// +func (f MLStopDataFrameAnalytics) WithBody(v io.Reader) func(*MLStopDataFrameAnalyticsRequest) { + return func(r *MLStopDataFrameAnalyticsRequest) { + r.Body = v + } +} + +// WithAllowNoMatch - whether to ignore if a wildcard expression matches no data frame analytics. (this includes `_all` string or when no data frame analytics have been specified). +// +func (f MLStopDataFrameAnalytics) WithAllowNoMatch(v bool) func(*MLStopDataFrameAnalyticsRequest) { + return func(r *MLStopDataFrameAnalyticsRequest) { + r.AllowNoMatch = &v + } +} + +// WithForce - true if the data frame analytics should be forcefully stopped. +// +func (f MLStopDataFrameAnalytics) WithForce(v bool) func(*MLStopDataFrameAnalyticsRequest) { + return func(r *MLStopDataFrameAnalyticsRequest) { + r.Force = &v + } +} + +// WithTimeout - controls the time to wait until the task has stopped. defaults to 20 seconds. +// +func (f MLStopDataFrameAnalytics) WithTimeout(v time.Duration) func(*MLStopDataFrameAnalyticsRequest) { + return func(r *MLStopDataFrameAnalyticsRequest) { + r.Timeout = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLStopDataFrameAnalytics) WithPretty() func(*MLStopDataFrameAnalyticsRequest) { + return func(r *MLStopDataFrameAnalyticsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLStopDataFrameAnalytics) WithHuman() func(*MLStopDataFrameAnalyticsRequest) { + return func(r *MLStopDataFrameAnalyticsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLStopDataFrameAnalytics) WithErrorTrace() func(*MLStopDataFrameAnalyticsRequest) { + return func(r *MLStopDataFrameAnalyticsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLStopDataFrameAnalytics) WithFilterPath(v ...string) func(*MLStopDataFrameAnalyticsRequest) { + return func(r *MLStopDataFrameAnalyticsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLStopDataFrameAnalytics) WithHeader(h map[string]string) func(*MLStopDataFrameAnalyticsRequest) { + return func(r *MLStopDataFrameAnalyticsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.stop_datafeed.go b/esapi/api.xpack.ml.stop_datafeed.go new file mode 100755 index 0000000000..ea9e56e85f --- /dev/null +++ b/esapi/api.xpack.ml.stop_datafeed.go @@ -0,0 +1,214 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" + "time" +) + +func newMLStopDatafeedFunc(t Transport) MLStopDatafeed { + return func(datafeed_id string, o ...func(*MLStopDatafeedRequest)) (*Response, error) { + var r = MLStopDatafeedRequest{DatafeedID: datafeed_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLStopDatafeed - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html +// +type MLStopDatafeed func(datafeed_id string, o ...func(*MLStopDatafeedRequest)) (*Response, error) + +// MLStopDatafeedRequest configures the Ml Stop Datafeed API request. +// +type MLStopDatafeedRequest struct { + DatafeedID string + + AllowNoDatafeeds *bool + Force *bool + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLStopDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID) + 1 + len("_stop")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("datafeeds") + path.WriteString("/") + path.WriteString(r.DatafeedID) + path.WriteString("/") + path.WriteString("_stop") + + params = make(map[string]string) + + if r.AllowNoDatafeeds != nil { + params["allow_no_datafeeds"] = strconv.FormatBool(*r.AllowNoDatafeeds) + } + + if r.Force != nil { + params["force"] = strconv.FormatBool(*r.Force) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLStopDatafeed) WithContext(v context.Context) func(*MLStopDatafeedRequest) { + return func(r *MLStopDatafeedRequest) { + r.ctx = v + } +} + +// WithAllowNoDatafeeds - whether to ignore if a wildcard expression matches no datafeeds. (this includes `_all` string or when no datafeeds have been specified). +// +func (f MLStopDatafeed) WithAllowNoDatafeeds(v bool) func(*MLStopDatafeedRequest) { + return func(r *MLStopDatafeedRequest) { + r.AllowNoDatafeeds = &v + } +} + +// WithForce - true if the datafeed should be forcefully stopped.. +// +func (f MLStopDatafeed) WithForce(v bool) func(*MLStopDatafeedRequest) { + return func(r *MLStopDatafeedRequest) { + r.Force = &v + } +} + +// WithTimeout - controls the time to wait until a datafeed has stopped. default to 20 seconds. +// +func (f MLStopDatafeed) WithTimeout(v time.Duration) func(*MLStopDatafeedRequest) { + return func(r *MLStopDatafeedRequest) { + r.Timeout = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLStopDatafeed) WithPretty() func(*MLStopDatafeedRequest) { + return func(r *MLStopDatafeedRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLStopDatafeed) WithHuman() func(*MLStopDatafeedRequest) { + return func(r *MLStopDatafeedRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLStopDatafeed) WithErrorTrace() func(*MLStopDatafeedRequest) { + return func(r *MLStopDatafeedRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLStopDatafeed) WithFilterPath(v ...string) func(*MLStopDatafeedRequest) { + return func(r *MLStopDatafeedRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLStopDatafeed) WithHeader(h map[string]string) func(*MLStopDatafeedRequest) { + return func(r *MLStopDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.update_datafeed.go b/esapi/api.xpack.ml.update_datafeed.go new file mode 100755 index 0000000000..017acee166 --- /dev/null +++ b/esapi/api.xpack.ml.update_datafeed.go @@ -0,0 +1,179 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLUpdateDatafeedFunc(t Transport) MLUpdateDatafeed { + return func(body io.Reader, datafeed_id string, o ...func(*MLUpdateDatafeedRequest)) (*Response, error) { + var r = MLUpdateDatafeedRequest{Body: body, DatafeedID: datafeed_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLUpdateDatafeed - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html +// +type MLUpdateDatafeed func(body io.Reader, datafeed_id string, o ...func(*MLUpdateDatafeedRequest)) (*Response, error) + +// MLUpdateDatafeedRequest configures the Ml Update Datafeed API request. +// +type MLUpdateDatafeedRequest struct { + Body io.Reader + + DatafeedID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLUpdateDatafeedRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("datafeeds") + 1 + len(r.DatafeedID) + 1 + len("_update")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("datafeeds") + path.WriteString("/") + path.WriteString(r.DatafeedID) + path.WriteString("/") + path.WriteString("_update") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLUpdateDatafeed) WithContext(v context.Context) func(*MLUpdateDatafeedRequest) { + return func(r *MLUpdateDatafeedRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLUpdateDatafeed) WithPretty() func(*MLUpdateDatafeedRequest) { + return func(r *MLUpdateDatafeedRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLUpdateDatafeed) WithHuman() func(*MLUpdateDatafeedRequest) { + return func(r *MLUpdateDatafeedRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLUpdateDatafeed) WithErrorTrace() func(*MLUpdateDatafeedRequest) { + return func(r *MLUpdateDatafeedRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLUpdateDatafeed) WithFilterPath(v ...string) func(*MLUpdateDatafeedRequest) { + return func(r *MLUpdateDatafeedRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLUpdateDatafeed) WithHeader(h map[string]string) func(*MLUpdateDatafeedRequest) { + return func(r *MLUpdateDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.update_filter.go b/esapi/api.xpack.ml.update_filter.go new file mode 100755 index 0000000000..21a8f634f3 --- /dev/null +++ b/esapi/api.xpack.ml.update_filter.go @@ -0,0 +1,179 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLUpdateFilterFunc(t Transport) MLUpdateFilter { + return func(body io.Reader, filter_id string, o ...func(*MLUpdateFilterRequest)) (*Response, error) { + var r = MLUpdateFilterRequest{Body: body, FilterID: filter_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLUpdateFilter - +// +type MLUpdateFilter func(body io.Reader, filter_id string, o ...func(*MLUpdateFilterRequest)) (*Response, error) + +// MLUpdateFilterRequest configures the Ml Update Filter API request. +// +type MLUpdateFilterRequest struct { + Body io.Reader + + FilterID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLUpdateFilterRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("filters") + 1 + len(r.FilterID) + 1 + len("_update")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("filters") + path.WriteString("/") + path.WriteString(r.FilterID) + path.WriteString("/") + path.WriteString("_update") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLUpdateFilter) WithContext(v context.Context) func(*MLUpdateFilterRequest) { + return func(r *MLUpdateFilterRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLUpdateFilter) WithPretty() func(*MLUpdateFilterRequest) { + return func(r *MLUpdateFilterRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLUpdateFilter) WithHuman() func(*MLUpdateFilterRequest) { + return func(r *MLUpdateFilterRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLUpdateFilter) WithErrorTrace() func(*MLUpdateFilterRequest) { + return func(r *MLUpdateFilterRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLUpdateFilter) WithFilterPath(v ...string) func(*MLUpdateFilterRequest) { + return func(r *MLUpdateFilterRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLUpdateFilter) WithHeader(h map[string]string) func(*MLUpdateFilterRequest) { + return func(r *MLUpdateFilterRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.update_job.go b/esapi/api.xpack.ml.update_job.go new file mode 100755 index 0000000000..ff8c21e3d2 --- /dev/null +++ b/esapi/api.xpack.ml.update_job.go @@ -0,0 +1,179 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLUpdateJobFunc(t Transport) MLUpdateJob { + return func(job_id string, body io.Reader, o ...func(*MLUpdateJobRequest)) (*Response, error) { + var r = MLUpdateJobRequest{JobID: job_id, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLUpdateJob - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html +// +type MLUpdateJob func(job_id string, body io.Reader, o ...func(*MLUpdateJobRequest)) (*Response, error) + +// MLUpdateJobRequest configures the Ml Update Job API request. +// +type MLUpdateJobRequest struct { + Body io.Reader + + JobID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLUpdateJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("_update")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("_update") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLUpdateJob) WithContext(v context.Context) func(*MLUpdateJobRequest) { + return func(r *MLUpdateJobRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLUpdateJob) WithPretty() func(*MLUpdateJobRequest) { + return func(r *MLUpdateJobRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLUpdateJob) WithHuman() func(*MLUpdateJobRequest) { + return func(r *MLUpdateJobRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLUpdateJob) WithErrorTrace() func(*MLUpdateJobRequest) { + return func(r *MLUpdateJobRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLUpdateJob) WithFilterPath(v ...string) func(*MLUpdateJobRequest) { + return func(r *MLUpdateJobRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLUpdateJob) WithHeader(h map[string]string) func(*MLUpdateJobRequest) { + return func(r *MLUpdateJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.update_model_snapshot.go b/esapi/api.xpack.ml.update_model_snapshot.go new file mode 100755 index 0000000000..e1d1bb71ca --- /dev/null +++ b/esapi/api.xpack.ml.update_model_snapshot.go @@ -0,0 +1,184 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLUpdateModelSnapshotFunc(t Transport) MLUpdateModelSnapshot { + return func(snapshot_id string, job_id string, body io.Reader, o ...func(*MLUpdateModelSnapshotRequest)) (*Response, error) { + var r = MLUpdateModelSnapshotRequest{SnapshotID: snapshot_id, JobID: job_id, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLUpdateModelSnapshot - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html +// +type MLUpdateModelSnapshot func(snapshot_id string, job_id string, body io.Reader, o ...func(*MLUpdateModelSnapshotRequest)) (*Response, error) + +// MLUpdateModelSnapshotRequest configures the Ml Update Model Snapshot API request. +// +type MLUpdateModelSnapshotRequest struct { + Body io.Reader + + JobID string + SnapshotID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLUpdateModelSnapshotRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ml") + 1 + len("anomaly_detectors") + 1 + len(r.JobID) + 1 + len("model_snapshots") + 1 + len(r.SnapshotID) + 1 + len("_update")) + path.WriteString("/") + path.WriteString("_ml") + path.WriteString("/") + path.WriteString("anomaly_detectors") + path.WriteString("/") + path.WriteString(r.JobID) + path.WriteString("/") + path.WriteString("model_snapshots") + path.WriteString("/") + path.WriteString(r.SnapshotID) + path.WriteString("/") + path.WriteString("_update") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLUpdateModelSnapshot) WithContext(v context.Context) func(*MLUpdateModelSnapshotRequest) { + return func(r *MLUpdateModelSnapshotRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLUpdateModelSnapshot) WithPretty() func(*MLUpdateModelSnapshotRequest) { + return func(r *MLUpdateModelSnapshotRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLUpdateModelSnapshot) WithHuman() func(*MLUpdateModelSnapshotRequest) { + return func(r *MLUpdateModelSnapshotRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLUpdateModelSnapshot) WithErrorTrace() func(*MLUpdateModelSnapshotRequest) { + return func(r *MLUpdateModelSnapshotRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLUpdateModelSnapshot) WithFilterPath(v ...string) func(*MLUpdateModelSnapshotRequest) { + return func(r *MLUpdateModelSnapshotRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLUpdateModelSnapshot) WithHeader(h map[string]string) func(*MLUpdateModelSnapshotRequest) { + return func(r *MLUpdateModelSnapshotRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.validate.go b/esapi/api.xpack.ml.validate.go new file mode 100755 index 0000000000..4f2f8451bd --- /dev/null +++ b/esapi/api.xpack.ml.validate.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLValidateFunc(t Transport) MLValidate { + return func(body io.Reader, o ...func(*MLValidateRequest)) (*Response, error) { + var r = MLValidateRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLValidate - +// +type MLValidate func(body io.Reader, o ...func(*MLValidateRequest)) (*Response, error) + +// MLValidateRequest configures the Ml Validate API request. +// +type MLValidateRequest struct { + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLValidateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_ml/anomaly_detectors/_validate")) + path.WriteString("/_ml/anomaly_detectors/_validate") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLValidate) WithContext(v context.Context) func(*MLValidateRequest) { + return func(r *MLValidateRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLValidate) WithPretty() func(*MLValidateRequest) { + return func(r *MLValidateRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLValidate) WithHuman() func(*MLValidateRequest) { + return func(r *MLValidateRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLValidate) WithErrorTrace() func(*MLValidateRequest) { + return func(r *MLValidateRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLValidate) WithFilterPath(v ...string) func(*MLValidateRequest) { + return func(r *MLValidateRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLValidate) WithHeader(h map[string]string) func(*MLValidateRequest) { + return func(r *MLValidateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.validate_detector.go b/esapi/api.xpack.ml.validate_detector.go new file mode 100755 index 0000000000..e69b1aff3f --- /dev/null +++ b/esapi/api.xpack.ml.validate_detector.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLValidateDetectorFunc(t Transport) MLValidateDetector { + return func(body io.Reader, o ...func(*MLValidateDetectorRequest)) (*Response, error) { + var r = MLValidateDetectorRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLValidateDetector - +// +type MLValidateDetector func(body io.Reader, o ...func(*MLValidateDetectorRequest)) (*Response, error) + +// MLValidateDetectorRequest configures the Ml Validate Detector API request. +// +type MLValidateDetectorRequest struct { + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLValidateDetectorRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_ml/anomaly_detectors/_validate/detector")) + path.WriteString("/_ml/anomaly_detectors/_validate/detector") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLValidateDetector) WithContext(v context.Context) func(*MLValidateDetectorRequest) { + return func(r *MLValidateDetectorRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLValidateDetector) WithPretty() func(*MLValidateDetectorRequest) { + return func(r *MLValidateDetectorRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLValidateDetector) WithHuman() func(*MLValidateDetectorRequest) { + return func(r *MLValidateDetectorRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLValidateDetector) WithErrorTrace() func(*MLValidateDetectorRequest) { + return func(r *MLValidateDetectorRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLValidateDetector) WithFilterPath(v ...string) func(*MLValidateDetectorRequest) { + return func(r *MLValidateDetectorRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLValidateDetector) WithHeader(h map[string]string) func(*MLValidateDetectorRequest) { + return func(r *MLValidateDetectorRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.monitoring.bulk.go b/esapi/api.xpack.monitoring.bulk.go new file mode 100755 index 0000000000..e2b8c40e7c --- /dev/null +++ b/esapi/api.xpack.monitoring.bulk.go @@ -0,0 +1,227 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMonitoringBulkFunc(t Transport) MonitoringBulk { + return func(body io.Reader, o ...func(*MonitoringBulkRequest)) (*Response, error) { + var r = MonitoringBulkRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MonitoringBulk - https://www.elastic.co/guide/en/elasticsearch/reference/master/es-monitoring.html +// +type MonitoringBulk func(body io.Reader, o ...func(*MonitoringBulkRequest)) (*Response, error) + +// MonitoringBulkRequest configures the Monitoring Bulk API request. +// +type MonitoringBulkRequest struct { + DocumentType string + + Body io.Reader + + Interval string + SystemAPIVersion string + SystemID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MonitoringBulkRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_monitoring") + 1 + len(r.DocumentType) + 1 + len("bulk")) + path.WriteString("/") + path.WriteString("_monitoring") + if r.DocumentType != "" { + path.WriteString("/") + path.WriteString(r.DocumentType) + } + path.WriteString("/") + path.WriteString("bulk") + + params = make(map[string]string) + + if r.Interval != "" { + params["interval"] = r.Interval + } + + if r.SystemAPIVersion != "" { + params["system_api_version"] = r.SystemAPIVersion + } + + if r.SystemID != "" { + params["system_id"] = r.SystemID + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MonitoringBulk) WithContext(v context.Context) func(*MonitoringBulkRequest) { + return func(r *MonitoringBulkRequest) { + r.ctx = v + } +} + +// WithDocumentType - default document type for items which don't provide one. +// +func (f MonitoringBulk) WithDocumentType(v string) func(*MonitoringBulkRequest) { + return func(r *MonitoringBulkRequest) { + r.DocumentType = v + } +} + +// WithInterval - collection interval (e.g., '10s' or '10000ms') of the payload. +// +func (f MonitoringBulk) WithInterval(v string) func(*MonitoringBulkRequest) { + return func(r *MonitoringBulkRequest) { + r.Interval = v + } +} + +// WithSystemAPIVersion - api version of the monitored system. +// +func (f MonitoringBulk) WithSystemAPIVersion(v string) func(*MonitoringBulkRequest) { + return func(r *MonitoringBulkRequest) { + r.SystemAPIVersion = v + } +} + +// WithSystemID - identifier of the monitored system. +// +func (f MonitoringBulk) WithSystemID(v string) func(*MonitoringBulkRequest) { + return func(r *MonitoringBulkRequest) { + r.SystemID = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MonitoringBulk) WithPretty() func(*MonitoringBulkRequest) { + return func(r *MonitoringBulkRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MonitoringBulk) WithHuman() func(*MonitoringBulkRequest) { + return func(r *MonitoringBulkRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MonitoringBulk) WithErrorTrace() func(*MonitoringBulkRequest) { + return func(r *MonitoringBulkRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MonitoringBulk) WithFilterPath(v ...string) func(*MonitoringBulkRequest) { + return func(r *MonitoringBulkRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MonitoringBulk) WithHeader(h map[string]string) func(*MonitoringBulkRequest) { + return func(r *MonitoringBulkRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.rollup.delete_job.go b/esapi/api.xpack.rollup.delete_job.go new file mode 100755 index 0000000000..29d9b8034f --- /dev/null +++ b/esapi/api.xpack.rollup.delete_job.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newRollupDeleteJobFunc(t Transport) RollupDeleteJob { + return func(id string, o ...func(*RollupDeleteJobRequest)) (*Response, error) { + var r = RollupDeleteJobRequest{DocumentID: id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// RollupDeleteJob - +// +type RollupDeleteJob func(id string, o ...func(*RollupDeleteJobRequest)) (*Response, error) + +// RollupDeleteJobRequest configures the Rollup Delete Job API request. +// +type RollupDeleteJobRequest struct { + DocumentID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r RollupDeleteJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.DocumentID)) + path.WriteString("/") + path.WriteString("_rollup") + path.WriteString("/") + path.WriteString("job") + path.WriteString("/") + path.WriteString(r.DocumentID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f RollupDeleteJob) WithContext(v context.Context) func(*RollupDeleteJobRequest) { + return func(r *RollupDeleteJobRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f RollupDeleteJob) WithPretty() func(*RollupDeleteJobRequest) { + return func(r *RollupDeleteJobRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f RollupDeleteJob) WithHuman() func(*RollupDeleteJobRequest) { + return func(r *RollupDeleteJobRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f RollupDeleteJob) WithErrorTrace() func(*RollupDeleteJobRequest) { + return func(r *RollupDeleteJobRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f RollupDeleteJob) WithFilterPath(v ...string) func(*RollupDeleteJobRequest) { + return func(r *RollupDeleteJobRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f RollupDeleteJob) WithHeader(h map[string]string) func(*RollupDeleteJobRequest) { + return func(r *RollupDeleteJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.rollup.get_jobs.go b/esapi/api.xpack.rollup.get_jobs.go new file mode 100755 index 0000000000..e08933ea49 --- /dev/null +++ b/esapi/api.xpack.rollup.get_jobs.go @@ -0,0 +1,180 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newRollupGetJobsFunc(t Transport) RollupGetJobs { + return func(o ...func(*RollupGetJobsRequest)) (*Response, error) { + var r = RollupGetJobsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// RollupGetJobs - +// +type RollupGetJobs func(o ...func(*RollupGetJobsRequest)) (*Response, error) + +// RollupGetJobsRequest configures the Rollup Get Jobs API request. +// +type RollupGetJobsRequest struct { + DocumentID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r RollupGetJobsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.DocumentID)) + path.WriteString("/") + path.WriteString("_rollup") + path.WriteString("/") + path.WriteString("job") + if r.DocumentID != "" { + path.WriteString("/") + path.WriteString(r.DocumentID) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f RollupGetJobs) WithContext(v context.Context) func(*RollupGetJobsRequest) { + return func(r *RollupGetJobsRequest) { + r.ctx = v + } +} + +// WithDocumentID - the ID of the job(s) to fetch. accepts glob patterns, or left blank for all jobs. +// +func (f RollupGetJobs) WithDocumentID(v string) func(*RollupGetJobsRequest) { + return func(r *RollupGetJobsRequest) { + r.DocumentID = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f RollupGetJobs) WithPretty() func(*RollupGetJobsRequest) { + return func(r *RollupGetJobsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f RollupGetJobs) WithHuman() func(*RollupGetJobsRequest) { + return func(r *RollupGetJobsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f RollupGetJobs) WithErrorTrace() func(*RollupGetJobsRequest) { + return func(r *RollupGetJobsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f RollupGetJobs) WithFilterPath(v ...string) func(*RollupGetJobsRequest) { + return func(r *RollupGetJobsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f RollupGetJobs) WithHeader(h map[string]string) func(*RollupGetJobsRequest) { + return func(r *RollupGetJobsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.rollup.get_rollup_caps.go b/esapi/api.xpack.rollup.get_rollup_caps.go new file mode 100755 index 0000000000..4b69266ef6 --- /dev/null +++ b/esapi/api.xpack.rollup.get_rollup_caps.go @@ -0,0 +1,180 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newRollupGetRollupCapsFunc(t Transport) RollupGetRollupCaps { + return func(o ...func(*RollupGetRollupCapsRequest)) (*Response, error) { + var r = RollupGetRollupCapsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// RollupGetRollupCaps - +// +type RollupGetRollupCaps func(o ...func(*RollupGetRollupCapsRequest)) (*Response, error) + +// RollupGetRollupCapsRequest configures the Rollup Get Rollup Caps API request. +// +type RollupGetRollupCapsRequest struct { + DocumentID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r RollupGetRollupCapsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_rollup") + 1 + len("data") + 1 + len(r.DocumentID)) + path.WriteString("/") + path.WriteString("_rollup") + path.WriteString("/") + path.WriteString("data") + if r.DocumentID != "" { + path.WriteString("/") + path.WriteString(r.DocumentID) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f RollupGetRollupCaps) WithContext(v context.Context) func(*RollupGetRollupCapsRequest) { + return func(r *RollupGetRollupCapsRequest) { + r.ctx = v + } +} + +// WithDocumentID - the ID of the index to check rollup capabilities on, or left blank for all jobs. +// +func (f RollupGetRollupCaps) WithDocumentID(v string) func(*RollupGetRollupCapsRequest) { + return func(r *RollupGetRollupCapsRequest) { + r.DocumentID = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f RollupGetRollupCaps) WithPretty() func(*RollupGetRollupCapsRequest) { + return func(r *RollupGetRollupCapsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f RollupGetRollupCaps) WithHuman() func(*RollupGetRollupCapsRequest) { + return func(r *RollupGetRollupCapsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f RollupGetRollupCaps) WithErrorTrace() func(*RollupGetRollupCapsRequest) { + return func(r *RollupGetRollupCapsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f RollupGetRollupCaps) WithFilterPath(v ...string) func(*RollupGetRollupCapsRequest) { + return func(r *RollupGetRollupCapsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f RollupGetRollupCaps) WithHeader(h map[string]string) func(*RollupGetRollupCapsRequest) { + return func(r *RollupGetRollupCapsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.rollup.get_rollup_index_caps.go b/esapi/api.xpack.rollup.get_rollup_index_caps.go new file mode 100755 index 0000000000..683e082030 --- /dev/null +++ b/esapi/api.xpack.rollup.get_rollup_index_caps.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newRollupGetRollupIndexCapsFunc(t Transport) RollupGetRollupIndexCaps { + return func(index string, o ...func(*RollupGetRollupIndexCapsRequest)) (*Response, error) { + var r = RollupGetRollupIndexCapsRequest{Index: index} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// RollupGetRollupIndexCaps - +// +type RollupGetRollupIndexCaps func(index string, o ...func(*RollupGetRollupIndexCapsRequest)) (*Response, error) + +// RollupGetRollupIndexCapsRequest configures the Rollup Get Rollup Index Caps API request. +// +type RollupGetRollupIndexCapsRequest struct { + Index string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r RollupGetRollupIndexCapsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len(r.Index) + 1 + len("_rollup") + 1 + len("data")) + path.WriteString("/") + path.WriteString(r.Index) + path.WriteString("/") + path.WriteString("_rollup") + path.WriteString("/") + path.WriteString("data") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f RollupGetRollupIndexCaps) WithContext(v context.Context) func(*RollupGetRollupIndexCapsRequest) { + return func(r *RollupGetRollupIndexCapsRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f RollupGetRollupIndexCaps) WithPretty() func(*RollupGetRollupIndexCapsRequest) { + return func(r *RollupGetRollupIndexCapsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f RollupGetRollupIndexCaps) WithHuman() func(*RollupGetRollupIndexCapsRequest) { + return func(r *RollupGetRollupIndexCapsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f RollupGetRollupIndexCaps) WithErrorTrace() func(*RollupGetRollupIndexCapsRequest) { + return func(r *RollupGetRollupIndexCapsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f RollupGetRollupIndexCaps) WithFilterPath(v ...string) func(*RollupGetRollupIndexCapsRequest) { + return func(r *RollupGetRollupIndexCapsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f RollupGetRollupIndexCaps) WithHeader(h map[string]string) func(*RollupGetRollupIndexCapsRequest) { + return func(r *RollupGetRollupIndexCapsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.rollup.put_job.go b/esapi/api.xpack.rollup.put_job.go new file mode 100755 index 0000000000..f205ff7275 --- /dev/null +++ b/esapi/api.xpack.rollup.put_job.go @@ -0,0 +1,177 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newRollupPutJobFunc(t Transport) RollupPutJob { + return func(id string, body io.Reader, o ...func(*RollupPutJobRequest)) (*Response, error) { + var r = RollupPutJobRequest{DocumentID: id, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// RollupPutJob - +// +type RollupPutJob func(id string, body io.Reader, o ...func(*RollupPutJobRequest)) (*Response, error) + +// RollupPutJobRequest configures the Rollup Put Job API request. +// +type RollupPutJobRequest struct { + DocumentID string + + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r RollupPutJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.DocumentID)) + path.WriteString("/") + path.WriteString("_rollup") + path.WriteString("/") + path.WriteString("job") + path.WriteString("/") + path.WriteString(r.DocumentID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f RollupPutJob) WithContext(v context.Context) func(*RollupPutJobRequest) { + return func(r *RollupPutJobRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f RollupPutJob) WithPretty() func(*RollupPutJobRequest) { + return func(r *RollupPutJobRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f RollupPutJob) WithHuman() func(*RollupPutJobRequest) { + return func(r *RollupPutJobRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f RollupPutJob) WithErrorTrace() func(*RollupPutJobRequest) { + return func(r *RollupPutJobRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f RollupPutJob) WithFilterPath(v ...string) func(*RollupPutJobRequest) { + return func(r *RollupPutJobRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f RollupPutJob) WithHeader(h map[string]string) func(*RollupPutJobRequest) { + return func(r *RollupPutJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.rollup.rollup_search.go b/esapi/api.xpack.rollup.rollup_search.go new file mode 100755 index 0000000000..f7d4f6638d --- /dev/null +++ b/esapi/api.xpack.rollup.rollup_search.go @@ -0,0 +1,216 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" +) + +func newRollupRollupSearchFunc(t Transport) RollupRollupSearch { + return func(index []string, body io.Reader, o ...func(*RollupRollupSearchRequest)) (*Response, error) { + var r = RollupRollupSearchRequest{Index: index, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// RollupRollupSearch - +// +type RollupRollupSearch func(index []string, body io.Reader, o ...func(*RollupRollupSearchRequest)) (*Response, error) + +// RollupRollupSearchRequest configures the Rollup Rollup Search API request. +// +type RollupRollupSearchRequest struct { + Index []string + DocumentType string + + Body io.Reader + + RestTotalHitsAsInt *bool + TypedKeys *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r RollupRollupSearchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len(strings.Join(r.Index, ",")) + 1 + len(r.DocumentType) + 1 + len("_rollup_search")) + path.WriteString("/") + path.WriteString(strings.Join(r.Index, ",")) + if r.DocumentType != "" { + path.WriteString("/") + path.WriteString(r.DocumentType) + } + path.WriteString("/") + path.WriteString("_rollup_search") + + params = make(map[string]string) + + if r.RestTotalHitsAsInt != nil { + params["rest_total_hits_as_int"] = strconv.FormatBool(*r.RestTotalHitsAsInt) + } + + if r.TypedKeys != nil { + params["typed_keys"] = strconv.FormatBool(*r.TypedKeys) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f RollupRollupSearch) WithContext(v context.Context) func(*RollupRollupSearchRequest) { + return func(r *RollupRollupSearchRequest) { + r.ctx = v + } +} + +// WithDocumentType - the doc type inside the index. +// +func (f RollupRollupSearch) WithDocumentType(v string) func(*RollupRollupSearchRequest) { + return func(r *RollupRollupSearchRequest) { + r.DocumentType = v + } +} + +// WithRestTotalHitsAsInt - indicates whether hits.total should be rendered as an integer or an object in the rest search response. +// +func (f RollupRollupSearch) WithRestTotalHitsAsInt(v bool) func(*RollupRollupSearchRequest) { + return func(r *RollupRollupSearchRequest) { + r.RestTotalHitsAsInt = &v + } +} + +// WithTypedKeys - specify whether aggregation and suggester names should be prefixed by their respective types in the response. +// +func (f RollupRollupSearch) WithTypedKeys(v bool) func(*RollupRollupSearchRequest) { + return func(r *RollupRollupSearchRequest) { + r.TypedKeys = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f RollupRollupSearch) WithPretty() func(*RollupRollupSearchRequest) { + return func(r *RollupRollupSearchRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f RollupRollupSearch) WithHuman() func(*RollupRollupSearchRequest) { + return func(r *RollupRollupSearchRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f RollupRollupSearch) WithErrorTrace() func(*RollupRollupSearchRequest) { + return func(r *RollupRollupSearchRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f RollupRollupSearch) WithFilterPath(v ...string) func(*RollupRollupSearchRequest) { + return func(r *RollupRollupSearchRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f RollupRollupSearch) WithHeader(h map[string]string) func(*RollupRollupSearchRequest) { + return func(r *RollupRollupSearchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.rollup.start_job.go b/esapi/api.xpack.rollup.start_job.go new file mode 100755 index 0000000000..12f029ca48 --- /dev/null +++ b/esapi/api.xpack.rollup.start_job.go @@ -0,0 +1,172 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newRollupStartJobFunc(t Transport) RollupStartJob { + return func(id string, o ...func(*RollupStartJobRequest)) (*Response, error) { + var r = RollupStartJobRequest{DocumentID: id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// RollupStartJob - +// +type RollupStartJob func(id string, o ...func(*RollupStartJobRequest)) (*Response, error) + +// RollupStartJobRequest configures the Rollup Start Job API request. +// +type RollupStartJobRequest struct { + DocumentID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r RollupStartJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.DocumentID) + 1 + len("_start")) + path.WriteString("/") + path.WriteString("_rollup") + path.WriteString("/") + path.WriteString("job") + path.WriteString("/") + path.WriteString(r.DocumentID) + path.WriteString("/") + path.WriteString("_start") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f RollupStartJob) WithContext(v context.Context) func(*RollupStartJobRequest) { + return func(r *RollupStartJobRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f RollupStartJob) WithPretty() func(*RollupStartJobRequest) { + return func(r *RollupStartJobRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f RollupStartJob) WithHuman() func(*RollupStartJobRequest) { + return func(r *RollupStartJobRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f RollupStartJob) WithErrorTrace() func(*RollupStartJobRequest) { + return func(r *RollupStartJobRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f RollupStartJob) WithFilterPath(v ...string) func(*RollupStartJobRequest) { + return func(r *RollupStartJobRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f RollupStartJob) WithHeader(h map[string]string) func(*RollupStartJobRequest) { + return func(r *RollupStartJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.rollup.stop_job.go b/esapi/api.xpack.rollup.stop_job.go new file mode 100755 index 0000000000..4a35e47bf0 --- /dev/null +++ b/esapi/api.xpack.rollup.stop_job.go @@ -0,0 +1,201 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" + "time" +) + +func newRollupStopJobFunc(t Transport) RollupStopJob { + return func(id string, o ...func(*RollupStopJobRequest)) (*Response, error) { + var r = RollupStopJobRequest{DocumentID: id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// RollupStopJob - +// +type RollupStopJob func(id string, o ...func(*RollupStopJobRequest)) (*Response, error) + +// RollupStopJobRequest configures the Rollup Stop Job API request. +// +type RollupStopJobRequest struct { + DocumentID string + + Timeout time.Duration + WaitForCompletion *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r RollupStopJobRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.DocumentID) + 1 + len("_stop")) + path.WriteString("/") + path.WriteString("_rollup") + path.WriteString("/") + path.WriteString("job") + path.WriteString("/") + path.WriteString(r.DocumentID) + path.WriteString("/") + path.WriteString("_stop") + + params = make(map[string]string) + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForCompletion != nil { + params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f RollupStopJob) WithContext(v context.Context) func(*RollupStopJobRequest) { + return func(r *RollupStopJobRequest) { + r.ctx = v + } +} + +// WithTimeout - block for (at maximum) the specified duration while waiting for the job to stop. defaults to 30s.. +// +func (f RollupStopJob) WithTimeout(v time.Duration) func(*RollupStopJobRequest) { + return func(r *RollupStopJobRequest) { + r.Timeout = v + } +} + +// WithWaitForCompletion - true if the api should block until the job has fully stopped, false if should be executed async. defaults to false.. +// +func (f RollupStopJob) WithWaitForCompletion(v bool) func(*RollupStopJobRequest) { + return func(r *RollupStopJobRequest) { + r.WaitForCompletion = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f RollupStopJob) WithPretty() func(*RollupStopJobRequest) { + return func(r *RollupStopJobRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f RollupStopJob) WithHuman() func(*RollupStopJobRequest) { + return func(r *RollupStopJobRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f RollupStopJob) WithErrorTrace() func(*RollupStopJobRequest) { + return func(r *RollupStopJobRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f RollupStopJob) WithFilterPath(v ...string) func(*RollupStopJobRequest) { + return func(r *RollupStopJobRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f RollupStopJob) WithHeader(h map[string]string) func(*RollupStopJobRequest) { + return func(r *RollupStopJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.authenticate.go b/esapi/api.xpack.security.authenticate.go new file mode 100755 index 0000000000..4a0f1e593b --- /dev/null +++ b/esapi/api.xpack.security.authenticate.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityAuthenticateFunc(t Transport) SecurityAuthenticate { + return func(o ...func(*SecurityAuthenticateRequest)) (*Response, error) { + var r = SecurityAuthenticateRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityAuthenticate - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html +// +type SecurityAuthenticate func(o ...func(*SecurityAuthenticateRequest)) (*Response, error) + +// SecurityAuthenticateRequest configures the Security Authenticate API request. +// +type SecurityAuthenticateRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityAuthenticateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_security/_authenticate")) + path.WriteString("/_security/_authenticate") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityAuthenticate) WithContext(v context.Context) func(*SecurityAuthenticateRequest) { + return func(r *SecurityAuthenticateRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityAuthenticate) WithPretty() func(*SecurityAuthenticateRequest) { + return func(r *SecurityAuthenticateRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityAuthenticate) WithHuman() func(*SecurityAuthenticateRequest) { + return func(r *SecurityAuthenticateRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityAuthenticate) WithErrorTrace() func(*SecurityAuthenticateRequest) { + return func(r *SecurityAuthenticateRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityAuthenticate) WithFilterPath(v ...string) func(*SecurityAuthenticateRequest) { + return func(r *SecurityAuthenticateRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityAuthenticate) WithHeader(h map[string]string) func(*SecurityAuthenticateRequest) { + return func(r *SecurityAuthenticateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.change_password.go b/esapi/api.xpack.security.change_password.go new file mode 100755 index 0000000000..a4e19a44d2 --- /dev/null +++ b/esapi/api.xpack.security.change_password.go @@ -0,0 +1,203 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSecurityChangePasswordFunc(t Transport) SecurityChangePassword { + return func(body io.Reader, o ...func(*SecurityChangePasswordRequest)) (*Response, error) { + var r = SecurityChangePasswordRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityChangePassword - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html +// +type SecurityChangePassword func(body io.Reader, o ...func(*SecurityChangePasswordRequest)) (*Response, error) + +// SecurityChangePasswordRequest configures the Security Change Password API request. +// +type SecurityChangePasswordRequest struct { + Body io.Reader + + Username string + + Refresh string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityChangePasswordRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_security") + 1 + len("user") + 1 + len(r.Username) + 1 + len("_password")) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("user") + if r.Username != "" { + path.WriteString("/") + path.WriteString(r.Username) + } + path.WriteString("/") + path.WriteString("_password") + + params = make(map[string]string) + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityChangePassword) WithContext(v context.Context) func(*SecurityChangePasswordRequest) { + return func(r *SecurityChangePasswordRequest) { + r.ctx = v + } +} + +// WithUsername - the username of the user to change the password for. +// +func (f SecurityChangePassword) WithUsername(v string) func(*SecurityChangePasswordRequest) { + return func(r *SecurityChangePasswordRequest) { + r.Username = v + } +} + +// WithRefresh - if `true` (the default) 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` then do nothing with refreshes.. +// +func (f SecurityChangePassword) WithRefresh(v string) func(*SecurityChangePasswordRequest) { + return func(r *SecurityChangePasswordRequest) { + r.Refresh = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityChangePassword) WithPretty() func(*SecurityChangePasswordRequest) { + return func(r *SecurityChangePasswordRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityChangePassword) WithHuman() func(*SecurityChangePasswordRequest) { + return func(r *SecurityChangePasswordRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityChangePassword) WithErrorTrace() func(*SecurityChangePasswordRequest) { + return func(r *SecurityChangePasswordRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityChangePassword) WithFilterPath(v ...string) func(*SecurityChangePasswordRequest) { + return func(r *SecurityChangePasswordRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityChangePassword) WithHeader(h map[string]string) func(*SecurityChangePasswordRequest) { + return func(r *SecurityChangePasswordRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.clear_cached_realms.go b/esapi/api.xpack.security.clear_cached_realms.go new file mode 100755 index 0000000000..796494cce0 --- /dev/null +++ b/esapi/api.xpack.security.clear_cached_realms.go @@ -0,0 +1,186 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityClearCachedRealmsFunc(t Transport) SecurityClearCachedRealms { + return func(realms []string, o ...func(*SecurityClearCachedRealmsRequest)) (*Response, error) { + var r = SecurityClearCachedRealmsRequest{Realms: realms} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityClearCachedRealms - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html +// +type SecurityClearCachedRealms func(realms []string, o ...func(*SecurityClearCachedRealmsRequest)) (*Response, error) + +// SecurityClearCachedRealmsRequest configures the Security Clear Cached Realms API request. +// +type SecurityClearCachedRealmsRequest struct { + Realms []string + + Usernames []string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityClearCachedRealmsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_security") + 1 + len("realm") + 1 + len(strings.Join(r.Realms, ",")) + 1 + len("_clear_cache")) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("realm") + path.WriteString("/") + path.WriteString(strings.Join(r.Realms, ",")) + path.WriteString("/") + path.WriteString("_clear_cache") + + params = make(map[string]string) + + if len(r.Usernames) > 0 { + params["usernames"] = strings.Join(r.Usernames, ",") + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityClearCachedRealms) WithContext(v context.Context) func(*SecurityClearCachedRealmsRequest) { + return func(r *SecurityClearCachedRealmsRequest) { + r.ctx = v + } +} + +// WithUsernames - comma-separated list of usernames to clear from the cache. +// +func (f SecurityClearCachedRealms) WithUsernames(v ...string) func(*SecurityClearCachedRealmsRequest) { + return func(r *SecurityClearCachedRealmsRequest) { + r.Usernames = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityClearCachedRealms) WithPretty() func(*SecurityClearCachedRealmsRequest) { + return func(r *SecurityClearCachedRealmsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityClearCachedRealms) WithHuman() func(*SecurityClearCachedRealmsRequest) { + return func(r *SecurityClearCachedRealmsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityClearCachedRealms) WithErrorTrace() func(*SecurityClearCachedRealmsRequest) { + return func(r *SecurityClearCachedRealmsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityClearCachedRealms) WithFilterPath(v ...string) func(*SecurityClearCachedRealmsRequest) { + return func(r *SecurityClearCachedRealmsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityClearCachedRealms) WithHeader(h map[string]string) func(*SecurityClearCachedRealmsRequest) { + return func(r *SecurityClearCachedRealmsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.clear_cached_roles.go b/esapi/api.xpack.security.clear_cached_roles.go new file mode 100755 index 0000000000..f1602cebbd --- /dev/null +++ b/esapi/api.xpack.security.clear_cached_roles.go @@ -0,0 +1,172 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityClearCachedRolesFunc(t Transport) SecurityClearCachedRoles { + return func(name []string, o ...func(*SecurityClearCachedRolesRequest)) (*Response, error) { + var r = SecurityClearCachedRolesRequest{Name: name} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityClearCachedRoles - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html +// +type SecurityClearCachedRoles func(name []string, o ...func(*SecurityClearCachedRolesRequest)) (*Response, error) + +// SecurityClearCachedRolesRequest configures the Security Clear Cached Roles API request. +// +type SecurityClearCachedRolesRequest struct { + Name []string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityClearCachedRolesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_security") + 1 + len("role") + 1 + len(strings.Join(r.Name, ",")) + 1 + len("_clear_cache")) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("role") + path.WriteString("/") + path.WriteString(strings.Join(r.Name, ",")) + path.WriteString("/") + path.WriteString("_clear_cache") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityClearCachedRoles) WithContext(v context.Context) func(*SecurityClearCachedRolesRequest) { + return func(r *SecurityClearCachedRolesRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityClearCachedRoles) WithPretty() func(*SecurityClearCachedRolesRequest) { + return func(r *SecurityClearCachedRolesRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityClearCachedRoles) WithHuman() func(*SecurityClearCachedRolesRequest) { + return func(r *SecurityClearCachedRolesRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityClearCachedRoles) WithErrorTrace() func(*SecurityClearCachedRolesRequest) { + return func(r *SecurityClearCachedRolesRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityClearCachedRoles) WithFilterPath(v ...string) func(*SecurityClearCachedRolesRequest) { + return func(r *SecurityClearCachedRolesRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityClearCachedRoles) WithHeader(h map[string]string) func(*SecurityClearCachedRolesRequest) { + return func(r *SecurityClearCachedRolesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.create_api_key.go b/esapi/api.xpack.security.create_api_key.go new file mode 100755 index 0000000000..fff9315cc2 --- /dev/null +++ b/esapi/api.xpack.security.create_api_key.go @@ -0,0 +1,184 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSecurityCreateAPIKeyFunc(t Transport) SecurityCreateAPIKey { + return func(body io.Reader, o ...func(*SecurityCreateAPIKeyRequest)) (*Response, error) { + var r = SecurityCreateAPIKeyRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityCreateAPIKey - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html +// +type SecurityCreateAPIKey func(body io.Reader, o ...func(*SecurityCreateAPIKeyRequest)) (*Response, error) + +// SecurityCreateAPIKeyRequest configures the Security Create Api Key API request. +// +type SecurityCreateAPIKeyRequest struct { + Body io.Reader + + Refresh string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityCreateAPIKeyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(len("/_security/api_key")) + path.WriteString("/_security/api_key") + + params = make(map[string]string) + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityCreateAPIKey) WithContext(v context.Context) func(*SecurityCreateAPIKeyRequest) { + return func(r *SecurityCreateAPIKeyRequest) { + r.ctx = v + } +} + +// WithRefresh - if `true` (the default) 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` then do nothing with refreshes.. +// +func (f SecurityCreateAPIKey) WithRefresh(v string) func(*SecurityCreateAPIKeyRequest) { + return func(r *SecurityCreateAPIKeyRequest) { + r.Refresh = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityCreateAPIKey) WithPretty() func(*SecurityCreateAPIKeyRequest) { + return func(r *SecurityCreateAPIKeyRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityCreateAPIKey) WithHuman() func(*SecurityCreateAPIKeyRequest) { + return func(r *SecurityCreateAPIKeyRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityCreateAPIKey) WithErrorTrace() func(*SecurityCreateAPIKeyRequest) { + return func(r *SecurityCreateAPIKeyRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityCreateAPIKey) WithFilterPath(v ...string) func(*SecurityCreateAPIKeyRequest) { + return func(r *SecurityCreateAPIKeyRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityCreateAPIKey) WithHeader(h map[string]string) func(*SecurityCreateAPIKeyRequest) { + return func(r *SecurityCreateAPIKeyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.delete_privileges.go b/esapi/api.xpack.security.delete_privileges.go new file mode 100755 index 0000000000..fee8cff949 --- /dev/null +++ b/esapi/api.xpack.security.delete_privileges.go @@ -0,0 +1,187 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityDeletePrivilegesFunc(t Transport) SecurityDeletePrivileges { + return func(name string, application string, o ...func(*SecurityDeletePrivilegesRequest)) (*Response, error) { + var r = SecurityDeletePrivilegesRequest{Name: name, Application: application} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityDeletePrivileges - TODO +// +type SecurityDeletePrivileges func(name string, application string, o ...func(*SecurityDeletePrivilegesRequest)) (*Response, error) + +// SecurityDeletePrivilegesRequest configures the Security Delete Privileges API request. +// +type SecurityDeletePrivilegesRequest struct { + Application string + Name string + + Refresh string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityDeletePrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_security") + 1 + len("privilege") + 1 + len(r.Application) + 1 + len(r.Name)) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("privilege") + path.WriteString("/") + path.WriteString(r.Application) + path.WriteString("/") + path.WriteString(r.Name) + + params = make(map[string]string) + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityDeletePrivileges) WithContext(v context.Context) func(*SecurityDeletePrivilegesRequest) { + return func(r *SecurityDeletePrivilegesRequest) { + r.ctx = v + } +} + +// WithRefresh - if `true` (the default) 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` then do nothing with refreshes.. +// +func (f SecurityDeletePrivileges) WithRefresh(v string) func(*SecurityDeletePrivilegesRequest) { + return func(r *SecurityDeletePrivilegesRequest) { + r.Refresh = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityDeletePrivileges) WithPretty() func(*SecurityDeletePrivilegesRequest) { + return func(r *SecurityDeletePrivilegesRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityDeletePrivileges) WithHuman() func(*SecurityDeletePrivilegesRequest) { + return func(r *SecurityDeletePrivilegesRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityDeletePrivileges) WithErrorTrace() func(*SecurityDeletePrivilegesRequest) { + return func(r *SecurityDeletePrivilegesRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityDeletePrivileges) WithFilterPath(v ...string) func(*SecurityDeletePrivilegesRequest) { + return func(r *SecurityDeletePrivilegesRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityDeletePrivileges) WithHeader(h map[string]string) func(*SecurityDeletePrivilegesRequest) { + return func(r *SecurityDeletePrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.delete_role.go b/esapi/api.xpack.security.delete_role.go new file mode 100755 index 0000000000..67efed5fd8 --- /dev/null +++ b/esapi/api.xpack.security.delete_role.go @@ -0,0 +1,184 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityDeleteRoleFunc(t Transport) SecurityDeleteRole { + return func(name string, o ...func(*SecurityDeleteRoleRequest)) (*Response, error) { + var r = SecurityDeleteRoleRequest{Name: name} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityDeleteRole - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html +// +type SecurityDeleteRole func(name string, o ...func(*SecurityDeleteRoleRequest)) (*Response, error) + +// SecurityDeleteRoleRequest configures the Security Delete Role API request. +// +type SecurityDeleteRoleRequest struct { + Name string + + Refresh string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityDeleteRoleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_security") + 1 + len("role") + 1 + len(r.Name)) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("role") + path.WriteString("/") + path.WriteString(r.Name) + + params = make(map[string]string) + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityDeleteRole) WithContext(v context.Context) func(*SecurityDeleteRoleRequest) { + return func(r *SecurityDeleteRoleRequest) { + r.ctx = v + } +} + +// WithRefresh - if `true` (the default) 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` then do nothing with refreshes.. +// +func (f SecurityDeleteRole) WithRefresh(v string) func(*SecurityDeleteRoleRequest) { + return func(r *SecurityDeleteRoleRequest) { + r.Refresh = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityDeleteRole) WithPretty() func(*SecurityDeleteRoleRequest) { + return func(r *SecurityDeleteRoleRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityDeleteRole) WithHuman() func(*SecurityDeleteRoleRequest) { + return func(r *SecurityDeleteRoleRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityDeleteRole) WithErrorTrace() func(*SecurityDeleteRoleRequest) { + return func(r *SecurityDeleteRoleRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityDeleteRole) WithFilterPath(v ...string) func(*SecurityDeleteRoleRequest) { + return func(r *SecurityDeleteRoleRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityDeleteRole) WithHeader(h map[string]string) func(*SecurityDeleteRoleRequest) { + return func(r *SecurityDeleteRoleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.delete_role_mapping.go b/esapi/api.xpack.security.delete_role_mapping.go new file mode 100755 index 0000000000..addd627259 --- /dev/null +++ b/esapi/api.xpack.security.delete_role_mapping.go @@ -0,0 +1,184 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityDeleteRoleMappingFunc(t Transport) SecurityDeleteRoleMapping { + return func(name string, o ...func(*SecurityDeleteRoleMappingRequest)) (*Response, error) { + var r = SecurityDeleteRoleMappingRequest{Name: name} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityDeleteRoleMapping - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html +// +type SecurityDeleteRoleMapping func(name string, o ...func(*SecurityDeleteRoleMappingRequest)) (*Response, error) + +// SecurityDeleteRoleMappingRequest configures the Security Delete Role Mapping API request. +// +type SecurityDeleteRoleMappingRequest struct { + Name string + + Refresh string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityDeleteRoleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_security") + 1 + len("role_mapping") + 1 + len(r.Name)) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("role_mapping") + path.WriteString("/") + path.WriteString(r.Name) + + params = make(map[string]string) + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityDeleteRoleMapping) WithContext(v context.Context) func(*SecurityDeleteRoleMappingRequest) { + return func(r *SecurityDeleteRoleMappingRequest) { + r.ctx = v + } +} + +// WithRefresh - if `true` (the default) 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` then do nothing with refreshes.. +// +func (f SecurityDeleteRoleMapping) WithRefresh(v string) func(*SecurityDeleteRoleMappingRequest) { + return func(r *SecurityDeleteRoleMappingRequest) { + r.Refresh = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityDeleteRoleMapping) WithPretty() func(*SecurityDeleteRoleMappingRequest) { + return func(r *SecurityDeleteRoleMappingRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityDeleteRoleMapping) WithHuman() func(*SecurityDeleteRoleMappingRequest) { + return func(r *SecurityDeleteRoleMappingRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityDeleteRoleMapping) WithErrorTrace() func(*SecurityDeleteRoleMappingRequest) { + return func(r *SecurityDeleteRoleMappingRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityDeleteRoleMapping) WithFilterPath(v ...string) func(*SecurityDeleteRoleMappingRequest) { + return func(r *SecurityDeleteRoleMappingRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityDeleteRoleMapping) WithHeader(h map[string]string) func(*SecurityDeleteRoleMappingRequest) { + return func(r *SecurityDeleteRoleMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.delete_user.go b/esapi/api.xpack.security.delete_user.go new file mode 100755 index 0000000000..dbccb082ae --- /dev/null +++ b/esapi/api.xpack.security.delete_user.go @@ -0,0 +1,184 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityDeleteUserFunc(t Transport) SecurityDeleteUser { + return func(username string, o ...func(*SecurityDeleteUserRequest)) (*Response, error) { + var r = SecurityDeleteUserRequest{Username: username} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityDeleteUser - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html +// +type SecurityDeleteUser func(username string, o ...func(*SecurityDeleteUserRequest)) (*Response, error) + +// SecurityDeleteUserRequest configures the Security Delete User API request. +// +type SecurityDeleteUserRequest struct { + Username string + + Refresh string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityDeleteUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_security") + 1 + len("user") + 1 + len(r.Username)) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("user") + path.WriteString("/") + path.WriteString(r.Username) + + params = make(map[string]string) + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityDeleteUser) WithContext(v context.Context) func(*SecurityDeleteUserRequest) { + return func(r *SecurityDeleteUserRequest) { + r.ctx = v + } +} + +// WithRefresh - if `true` (the default) 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` then do nothing with refreshes.. +// +func (f SecurityDeleteUser) WithRefresh(v string) func(*SecurityDeleteUserRequest) { + return func(r *SecurityDeleteUserRequest) { + r.Refresh = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityDeleteUser) WithPretty() func(*SecurityDeleteUserRequest) { + return func(r *SecurityDeleteUserRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityDeleteUser) WithHuman() func(*SecurityDeleteUserRequest) { + return func(r *SecurityDeleteUserRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityDeleteUser) WithErrorTrace() func(*SecurityDeleteUserRequest) { + return func(r *SecurityDeleteUserRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityDeleteUser) WithFilterPath(v ...string) func(*SecurityDeleteUserRequest) { + return func(r *SecurityDeleteUserRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityDeleteUser) WithHeader(h map[string]string) func(*SecurityDeleteUserRequest) { + return func(r *SecurityDeleteUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.disable_user.go b/esapi/api.xpack.security.disable_user.go new file mode 100755 index 0000000000..24e7ae3e87 --- /dev/null +++ b/esapi/api.xpack.security.disable_user.go @@ -0,0 +1,186 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityDisableUserFunc(t Transport) SecurityDisableUser { + return func(username string, o ...func(*SecurityDisableUserRequest)) (*Response, error) { + var r = SecurityDisableUserRequest{Username: username} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityDisableUser - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html +// +type SecurityDisableUser func(username string, o ...func(*SecurityDisableUserRequest)) (*Response, error) + +// SecurityDisableUserRequest configures the Security Disable User API request. +// +type SecurityDisableUserRequest struct { + Username string + + Refresh string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityDisableUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_security") + 1 + len("user") + 1 + len(r.Username) + 1 + len("_disable")) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("user") + path.WriteString("/") + path.WriteString(r.Username) + path.WriteString("/") + path.WriteString("_disable") + + params = make(map[string]string) + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityDisableUser) WithContext(v context.Context) func(*SecurityDisableUserRequest) { + return func(r *SecurityDisableUserRequest) { + r.ctx = v + } +} + +// WithRefresh - if `true` (the default) 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` then do nothing with refreshes.. +// +func (f SecurityDisableUser) WithRefresh(v string) func(*SecurityDisableUserRequest) { + return func(r *SecurityDisableUserRequest) { + r.Refresh = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityDisableUser) WithPretty() func(*SecurityDisableUserRequest) { + return func(r *SecurityDisableUserRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityDisableUser) WithHuman() func(*SecurityDisableUserRequest) { + return func(r *SecurityDisableUserRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityDisableUser) WithErrorTrace() func(*SecurityDisableUserRequest) { + return func(r *SecurityDisableUserRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityDisableUser) WithFilterPath(v ...string) func(*SecurityDisableUserRequest) { + return func(r *SecurityDisableUserRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityDisableUser) WithHeader(h map[string]string) func(*SecurityDisableUserRequest) { + return func(r *SecurityDisableUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.enable_user.go b/esapi/api.xpack.security.enable_user.go new file mode 100755 index 0000000000..a05ecfda04 --- /dev/null +++ b/esapi/api.xpack.security.enable_user.go @@ -0,0 +1,186 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityEnableUserFunc(t Transport) SecurityEnableUser { + return func(username string, o ...func(*SecurityEnableUserRequest)) (*Response, error) { + var r = SecurityEnableUserRequest{Username: username} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityEnableUser - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html +// +type SecurityEnableUser func(username string, o ...func(*SecurityEnableUserRequest)) (*Response, error) + +// SecurityEnableUserRequest configures the Security Enable User API request. +// +type SecurityEnableUserRequest struct { + Username string + + Refresh string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityEnableUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_security") + 1 + len("user") + 1 + len(r.Username) + 1 + len("_enable")) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("user") + path.WriteString("/") + path.WriteString(r.Username) + path.WriteString("/") + path.WriteString("_enable") + + params = make(map[string]string) + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityEnableUser) WithContext(v context.Context) func(*SecurityEnableUserRequest) { + return func(r *SecurityEnableUserRequest) { + r.ctx = v + } +} + +// WithRefresh - if `true` (the default) 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` then do nothing with refreshes.. +// +func (f SecurityEnableUser) WithRefresh(v string) func(*SecurityEnableUserRequest) { + return func(r *SecurityEnableUserRequest) { + r.Refresh = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityEnableUser) WithPretty() func(*SecurityEnableUserRequest) { + return func(r *SecurityEnableUserRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityEnableUser) WithHuman() func(*SecurityEnableUserRequest) { + return func(r *SecurityEnableUserRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityEnableUser) WithErrorTrace() func(*SecurityEnableUserRequest) { + return func(r *SecurityEnableUserRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityEnableUser) WithFilterPath(v ...string) func(*SecurityEnableUserRequest) { + return func(r *SecurityEnableUserRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityEnableUser) WithHeader(h map[string]string) func(*SecurityEnableUserRequest) { + return func(r *SecurityEnableUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.get_api_key.go b/esapi/api.xpack.security.get_api_key.go new file mode 100755 index 0000000000..ac8741e264 --- /dev/null +++ b/esapi/api.xpack.security.get_api_key.go @@ -0,0 +1,216 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityGetAPIKeyFunc(t Transport) SecurityGetAPIKey { + return func(o ...func(*SecurityGetAPIKeyRequest)) (*Response, error) { + var r = SecurityGetAPIKeyRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityGetAPIKey - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html +// +type SecurityGetAPIKey func(o ...func(*SecurityGetAPIKeyRequest)) (*Response, error) + +// SecurityGetAPIKeyRequest configures the Security Get Api Key API request. +// +type SecurityGetAPIKeyRequest struct { + DocumentID string + Name string + RealmName string + Username string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityGetAPIKeyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_security/api_key")) + path.WriteString("/_security/api_key") + + params = make(map[string]string) + + if r.DocumentID != "" { + params["id"] = r.DocumentID + } + + if r.Name != "" { + params["name"] = r.Name + } + + if r.RealmName != "" { + params["realm_name"] = r.RealmName + } + + if r.Username != "" { + params["username"] = r.Username + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityGetAPIKey) WithContext(v context.Context) func(*SecurityGetAPIKeyRequest) { + return func(r *SecurityGetAPIKeyRequest) { + r.ctx = v + } +} + +// WithDocumentID - api key ID of the api key to be retrieved. +// +func (f SecurityGetAPIKey) WithDocumentID(v string) func(*SecurityGetAPIKeyRequest) { + return func(r *SecurityGetAPIKeyRequest) { + r.DocumentID = v + } +} + +// WithName - api key name of the api key to be retrieved. +// +func (f SecurityGetAPIKey) WithName(v string) func(*SecurityGetAPIKeyRequest) { + return func(r *SecurityGetAPIKeyRequest) { + r.Name = v + } +} + +// WithRealmName - realm name of the user who created this api key to be retrieved. +// +func (f SecurityGetAPIKey) WithRealmName(v string) func(*SecurityGetAPIKeyRequest) { + return func(r *SecurityGetAPIKeyRequest) { + r.RealmName = v + } +} + +// WithUsername - user name of the user who created this api key to be retrieved. +// +func (f SecurityGetAPIKey) WithUsername(v string) func(*SecurityGetAPIKeyRequest) { + return func(r *SecurityGetAPIKeyRequest) { + r.Username = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityGetAPIKey) WithPretty() func(*SecurityGetAPIKeyRequest) { + return func(r *SecurityGetAPIKeyRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityGetAPIKey) WithHuman() func(*SecurityGetAPIKeyRequest) { + return func(r *SecurityGetAPIKeyRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityGetAPIKey) WithErrorTrace() func(*SecurityGetAPIKeyRequest) { + return func(r *SecurityGetAPIKeyRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityGetAPIKey) WithFilterPath(v ...string) func(*SecurityGetAPIKeyRequest) { + return func(r *SecurityGetAPIKeyRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityGetAPIKey) WithHeader(h map[string]string) func(*SecurityGetAPIKeyRequest) { + return func(r *SecurityGetAPIKeyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.get_builtin_privileges.go b/esapi/api.xpack.security.get_builtin_privileges.go new file mode 100755 index 0000000000..1d100caddc --- /dev/null +++ b/esapi/api.xpack.security.get_builtin_privileges.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityGetBuiltinPrivilegesFunc(t Transport) SecurityGetBuiltinPrivileges { + return func(o ...func(*SecurityGetBuiltinPrivilegesRequest)) (*Response, error) { + var r = SecurityGetBuiltinPrivilegesRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityGetBuiltinPrivileges - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html +// +type SecurityGetBuiltinPrivileges func(o ...func(*SecurityGetBuiltinPrivilegesRequest)) (*Response, error) + +// SecurityGetBuiltinPrivilegesRequest configures the Security Get Builtin Privileges API request. +// +type SecurityGetBuiltinPrivilegesRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityGetBuiltinPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_security/privilege/_builtin")) + path.WriteString("/_security/privilege/_builtin") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityGetBuiltinPrivileges) WithContext(v context.Context) func(*SecurityGetBuiltinPrivilegesRequest) { + return func(r *SecurityGetBuiltinPrivilegesRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityGetBuiltinPrivileges) WithPretty() func(*SecurityGetBuiltinPrivilegesRequest) { + return func(r *SecurityGetBuiltinPrivilegesRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityGetBuiltinPrivileges) WithHuman() func(*SecurityGetBuiltinPrivilegesRequest) { + return func(r *SecurityGetBuiltinPrivilegesRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityGetBuiltinPrivileges) WithErrorTrace() func(*SecurityGetBuiltinPrivilegesRequest) { + return func(r *SecurityGetBuiltinPrivilegesRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityGetBuiltinPrivileges) WithFilterPath(v ...string) func(*SecurityGetBuiltinPrivilegesRequest) { + return func(r *SecurityGetBuiltinPrivilegesRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityGetBuiltinPrivileges) WithHeader(h map[string]string) func(*SecurityGetBuiltinPrivilegesRequest) { + return func(r *SecurityGetBuiltinPrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.get_privileges.go b/esapi/api.xpack.security.get_privileges.go new file mode 100755 index 0000000000..487705cb52 --- /dev/null +++ b/esapi/api.xpack.security.get_privileges.go @@ -0,0 +1,193 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityGetPrivilegesFunc(t Transport) SecurityGetPrivileges { + return func(o ...func(*SecurityGetPrivilegesRequest)) (*Response, error) { + var r = SecurityGetPrivilegesRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityGetPrivileges - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html +// +type SecurityGetPrivileges func(o ...func(*SecurityGetPrivilegesRequest)) (*Response, error) + +// SecurityGetPrivilegesRequest configures the Security Get Privileges API request. +// +type SecurityGetPrivilegesRequest struct { + Application string + Name string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityGetPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_security") + 1 + len("privilege") + 1 + len(r.Application) + 1 + len(r.Name)) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("privilege") + if r.Application != "" { + path.WriteString("/") + path.WriteString(r.Application) + } + if r.Name != "" { + path.WriteString("/") + path.WriteString(r.Name) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityGetPrivileges) WithContext(v context.Context) func(*SecurityGetPrivilegesRequest) { + return func(r *SecurityGetPrivilegesRequest) { + r.ctx = v + } +} + +// WithApplication - application name. +// +func (f SecurityGetPrivileges) WithApplication(v string) func(*SecurityGetPrivilegesRequest) { + return func(r *SecurityGetPrivilegesRequest) { + r.Application = v + } +} + +// WithName - privilege name. +// +func (f SecurityGetPrivileges) WithName(v string) func(*SecurityGetPrivilegesRequest) { + return func(r *SecurityGetPrivilegesRequest) { + r.Name = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityGetPrivileges) WithPretty() func(*SecurityGetPrivilegesRequest) { + return func(r *SecurityGetPrivilegesRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityGetPrivileges) WithHuman() func(*SecurityGetPrivilegesRequest) { + return func(r *SecurityGetPrivilegesRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityGetPrivileges) WithErrorTrace() func(*SecurityGetPrivilegesRequest) { + return func(r *SecurityGetPrivilegesRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityGetPrivileges) WithFilterPath(v ...string) func(*SecurityGetPrivilegesRequest) { + return func(r *SecurityGetPrivilegesRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityGetPrivileges) WithHeader(h map[string]string) func(*SecurityGetPrivilegesRequest) { + return func(r *SecurityGetPrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.get_role.go b/esapi/api.xpack.security.get_role.go new file mode 100755 index 0000000000..5083607ed8 --- /dev/null +++ b/esapi/api.xpack.security.get_role.go @@ -0,0 +1,180 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityGetRoleFunc(t Transport) SecurityGetRole { + return func(o ...func(*SecurityGetRoleRequest)) (*Response, error) { + var r = SecurityGetRoleRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityGetRole - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html +// +type SecurityGetRole func(o ...func(*SecurityGetRoleRequest)) (*Response, error) + +// SecurityGetRoleRequest configures the Security Get Role API request. +// +type SecurityGetRoleRequest struct { + Name string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityGetRoleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_security") + 1 + len("role") + 1 + len(r.Name)) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("role") + if r.Name != "" { + path.WriteString("/") + path.WriteString(r.Name) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityGetRole) WithContext(v context.Context) func(*SecurityGetRoleRequest) { + return func(r *SecurityGetRoleRequest) { + r.ctx = v + } +} + +// WithName - role name. +// +func (f SecurityGetRole) WithName(v string) func(*SecurityGetRoleRequest) { + return func(r *SecurityGetRoleRequest) { + r.Name = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityGetRole) WithPretty() func(*SecurityGetRoleRequest) { + return func(r *SecurityGetRoleRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityGetRole) WithHuman() func(*SecurityGetRoleRequest) { + return func(r *SecurityGetRoleRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityGetRole) WithErrorTrace() func(*SecurityGetRoleRequest) { + return func(r *SecurityGetRoleRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityGetRole) WithFilterPath(v ...string) func(*SecurityGetRoleRequest) { + return func(r *SecurityGetRoleRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityGetRole) WithHeader(h map[string]string) func(*SecurityGetRoleRequest) { + return func(r *SecurityGetRoleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.get_role_mapping.go b/esapi/api.xpack.security.get_role_mapping.go new file mode 100755 index 0000000000..2a9086e2e2 --- /dev/null +++ b/esapi/api.xpack.security.get_role_mapping.go @@ -0,0 +1,180 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityGetRoleMappingFunc(t Transport) SecurityGetRoleMapping { + return func(o ...func(*SecurityGetRoleMappingRequest)) (*Response, error) { + var r = SecurityGetRoleMappingRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityGetRoleMapping - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html +// +type SecurityGetRoleMapping func(o ...func(*SecurityGetRoleMappingRequest)) (*Response, error) + +// SecurityGetRoleMappingRequest configures the Security Get Role Mapping API request. +// +type SecurityGetRoleMappingRequest struct { + Name string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityGetRoleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_security") + 1 + len("role_mapping") + 1 + len(r.Name)) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("role_mapping") + if r.Name != "" { + path.WriteString("/") + path.WriteString(r.Name) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityGetRoleMapping) WithContext(v context.Context) func(*SecurityGetRoleMappingRequest) { + return func(r *SecurityGetRoleMappingRequest) { + r.ctx = v + } +} + +// WithName - role-mapping name. +// +func (f SecurityGetRoleMapping) WithName(v string) func(*SecurityGetRoleMappingRequest) { + return func(r *SecurityGetRoleMappingRequest) { + r.Name = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityGetRoleMapping) WithPretty() func(*SecurityGetRoleMappingRequest) { + return func(r *SecurityGetRoleMappingRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityGetRoleMapping) WithHuman() func(*SecurityGetRoleMappingRequest) { + return func(r *SecurityGetRoleMappingRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityGetRoleMapping) WithErrorTrace() func(*SecurityGetRoleMappingRequest) { + return func(r *SecurityGetRoleMappingRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityGetRoleMapping) WithFilterPath(v ...string) func(*SecurityGetRoleMappingRequest) { + return func(r *SecurityGetRoleMappingRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityGetRoleMapping) WithHeader(h map[string]string) func(*SecurityGetRoleMappingRequest) { + return func(r *SecurityGetRoleMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.get_token.go b/esapi/api.xpack.security.get_token.go new file mode 100755 index 0000000000..fadb58c082 --- /dev/null +++ b/esapi/api.xpack.security.get_token.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSecurityGetTokenFunc(t Transport) SecurityGetToken { + return func(body io.Reader, o ...func(*SecurityGetTokenRequest)) (*Response, error) { + var r = SecurityGetTokenRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityGetToken - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html +// +type SecurityGetToken func(body io.Reader, o ...func(*SecurityGetTokenRequest)) (*Response, error) + +// SecurityGetTokenRequest configures the Security Get Token API request. +// +type SecurityGetTokenRequest struct { + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityGetTokenRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_security/oauth2/token")) + path.WriteString("/_security/oauth2/token") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityGetToken) WithContext(v context.Context) func(*SecurityGetTokenRequest) { + return func(r *SecurityGetTokenRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityGetToken) WithPretty() func(*SecurityGetTokenRequest) { + return func(r *SecurityGetTokenRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityGetToken) WithHuman() func(*SecurityGetTokenRequest) { + return func(r *SecurityGetTokenRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityGetToken) WithErrorTrace() func(*SecurityGetTokenRequest) { + return func(r *SecurityGetTokenRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityGetToken) WithFilterPath(v ...string) func(*SecurityGetTokenRequest) { + return func(r *SecurityGetTokenRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityGetToken) WithHeader(h map[string]string) func(*SecurityGetTokenRequest) { + return func(r *SecurityGetTokenRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.get_user.go b/esapi/api.xpack.security.get_user.go new file mode 100755 index 0000000000..d6897d3c7e --- /dev/null +++ b/esapi/api.xpack.security.get_user.go @@ -0,0 +1,180 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityGetUserFunc(t Transport) SecurityGetUser { + return func(o ...func(*SecurityGetUserRequest)) (*Response, error) { + var r = SecurityGetUserRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityGetUser - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html +// +type SecurityGetUser func(o ...func(*SecurityGetUserRequest)) (*Response, error) + +// SecurityGetUserRequest configures the Security Get User API request. +// +type SecurityGetUserRequest struct { + Username []string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityGetUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_security") + 1 + len("user") + 1 + len(strings.Join(r.Username, ","))) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("user") + if len(r.Username) > 0 { + path.WriteString("/") + path.WriteString(strings.Join(r.Username, ",")) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityGetUser) WithContext(v context.Context) func(*SecurityGetUserRequest) { + return func(r *SecurityGetUserRequest) { + r.ctx = v + } +} + +// WithUsername - a list of usernames. +// +func (f SecurityGetUser) WithUsername(v ...string) func(*SecurityGetUserRequest) { + return func(r *SecurityGetUserRequest) { + r.Username = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityGetUser) WithPretty() func(*SecurityGetUserRequest) { + return func(r *SecurityGetUserRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityGetUser) WithHuman() func(*SecurityGetUserRequest) { + return func(r *SecurityGetUserRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityGetUser) WithErrorTrace() func(*SecurityGetUserRequest) { + return func(r *SecurityGetUserRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityGetUser) WithFilterPath(v ...string) func(*SecurityGetUserRequest) { + return func(r *SecurityGetUserRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityGetUser) WithHeader(h map[string]string) func(*SecurityGetUserRequest) { + return func(r *SecurityGetUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.get_user_privileges.go b/esapi/api.xpack.security.get_user_privileges.go new file mode 100755 index 0000000000..41d5e81efd --- /dev/null +++ b/esapi/api.xpack.security.get_user_privileges.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSecurityGetUserPrivilegesFunc(t Transport) SecurityGetUserPrivileges { + return func(o ...func(*SecurityGetUserPrivilegesRequest)) (*Response, error) { + var r = SecurityGetUserPrivilegesRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityGetUserPrivileges - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html +// +type SecurityGetUserPrivileges func(o ...func(*SecurityGetUserPrivilegesRequest)) (*Response, error) + +// SecurityGetUserPrivilegesRequest configures the Security Get User Privileges API request. +// +type SecurityGetUserPrivilegesRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityGetUserPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_security/user/_privileges")) + path.WriteString("/_security/user/_privileges") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityGetUserPrivileges) WithContext(v context.Context) func(*SecurityGetUserPrivilegesRequest) { + return func(r *SecurityGetUserPrivilegesRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityGetUserPrivileges) WithPretty() func(*SecurityGetUserPrivilegesRequest) { + return func(r *SecurityGetUserPrivilegesRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityGetUserPrivileges) WithHuman() func(*SecurityGetUserPrivilegesRequest) { + return func(r *SecurityGetUserPrivilegesRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityGetUserPrivileges) WithErrorTrace() func(*SecurityGetUserPrivilegesRequest) { + return func(r *SecurityGetUserPrivilegesRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityGetUserPrivileges) WithFilterPath(v ...string) func(*SecurityGetUserPrivilegesRequest) { + return func(r *SecurityGetUserPrivilegesRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityGetUserPrivileges) WithHeader(h map[string]string) func(*SecurityGetUserPrivilegesRequest) { + return func(r *SecurityGetUserPrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.has_privileges.go b/esapi/api.xpack.security.has_privileges.go new file mode 100755 index 0000000000..515afd75b2 --- /dev/null +++ b/esapi/api.xpack.security.has_privileges.go @@ -0,0 +1,189 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSecurityHasPrivilegesFunc(t Transport) SecurityHasPrivileges { + return func(body io.Reader, o ...func(*SecurityHasPrivilegesRequest)) (*Response, error) { + var r = SecurityHasPrivilegesRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityHasPrivileges - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html +// +type SecurityHasPrivileges func(body io.Reader, o ...func(*SecurityHasPrivilegesRequest)) (*Response, error) + +// SecurityHasPrivilegesRequest configures the Security Has Privileges API request. +// +type SecurityHasPrivilegesRequest struct { + Body io.Reader + + User string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityHasPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_security") + 1 + len("user") + 1 + len(r.User) + 1 + len("_has_privileges")) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("user") + if r.User != "" { + path.WriteString("/") + path.WriteString(r.User) + } + path.WriteString("/") + path.WriteString("_has_privileges") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityHasPrivileges) WithContext(v context.Context) func(*SecurityHasPrivilegesRequest) { + return func(r *SecurityHasPrivilegesRequest) { + r.ctx = v + } +} + +// WithUser - username. +// +func (f SecurityHasPrivileges) WithUser(v string) func(*SecurityHasPrivilegesRequest) { + return func(r *SecurityHasPrivilegesRequest) { + r.User = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityHasPrivileges) WithPretty() func(*SecurityHasPrivilegesRequest) { + return func(r *SecurityHasPrivilegesRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityHasPrivileges) WithHuman() func(*SecurityHasPrivilegesRequest) { + return func(r *SecurityHasPrivilegesRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityHasPrivileges) WithErrorTrace() func(*SecurityHasPrivilegesRequest) { + return func(r *SecurityHasPrivilegesRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityHasPrivileges) WithFilterPath(v ...string) func(*SecurityHasPrivilegesRequest) { + return func(r *SecurityHasPrivilegesRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityHasPrivileges) WithHeader(h map[string]string) func(*SecurityHasPrivilegesRequest) { + return func(r *SecurityHasPrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.invalidate_api_key.go b/esapi/api.xpack.security.invalidate_api_key.go new file mode 100755 index 0000000000..189ce6952e --- /dev/null +++ b/esapi/api.xpack.security.invalidate_api_key.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSecurityInvalidateAPIKeyFunc(t Transport) SecurityInvalidateAPIKey { + return func(body io.Reader, o ...func(*SecurityInvalidateAPIKeyRequest)) (*Response, error) { + var r = SecurityInvalidateAPIKeyRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityInvalidateAPIKey - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html +// +type SecurityInvalidateAPIKey func(body io.Reader, o ...func(*SecurityInvalidateAPIKeyRequest)) (*Response, error) + +// SecurityInvalidateAPIKeyRequest configures the Security Invalidate Api Key API request. +// +type SecurityInvalidateAPIKeyRequest struct { + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityInvalidateAPIKeyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(len("/_security/api_key")) + path.WriteString("/_security/api_key") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityInvalidateAPIKey) WithContext(v context.Context) func(*SecurityInvalidateAPIKeyRequest) { + return func(r *SecurityInvalidateAPIKeyRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityInvalidateAPIKey) WithPretty() func(*SecurityInvalidateAPIKeyRequest) { + return func(r *SecurityInvalidateAPIKeyRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityInvalidateAPIKey) WithHuman() func(*SecurityInvalidateAPIKeyRequest) { + return func(r *SecurityInvalidateAPIKeyRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityInvalidateAPIKey) WithErrorTrace() func(*SecurityInvalidateAPIKeyRequest) { + return func(r *SecurityInvalidateAPIKeyRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityInvalidateAPIKey) WithFilterPath(v ...string) func(*SecurityInvalidateAPIKeyRequest) { + return func(r *SecurityInvalidateAPIKeyRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityInvalidateAPIKey) WithHeader(h map[string]string) func(*SecurityInvalidateAPIKeyRequest) { + return func(r *SecurityInvalidateAPIKeyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.invalidate_token.go b/esapi/api.xpack.security.invalidate_token.go new file mode 100755 index 0000000000..5d2507489d --- /dev/null +++ b/esapi/api.xpack.security.invalidate_token.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSecurityInvalidateTokenFunc(t Transport) SecurityInvalidateToken { + return func(body io.Reader, o ...func(*SecurityInvalidateTokenRequest)) (*Response, error) { + var r = SecurityInvalidateTokenRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityInvalidateToken - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html +// +type SecurityInvalidateToken func(body io.Reader, o ...func(*SecurityInvalidateTokenRequest)) (*Response, error) + +// SecurityInvalidateTokenRequest configures the Security Invalidate Token API request. +// +type SecurityInvalidateTokenRequest struct { + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityInvalidateTokenRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(len("/_security/oauth2/token")) + path.WriteString("/_security/oauth2/token") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityInvalidateToken) WithContext(v context.Context) func(*SecurityInvalidateTokenRequest) { + return func(r *SecurityInvalidateTokenRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityInvalidateToken) WithPretty() func(*SecurityInvalidateTokenRequest) { + return func(r *SecurityInvalidateTokenRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityInvalidateToken) WithHuman() func(*SecurityInvalidateTokenRequest) { + return func(r *SecurityInvalidateTokenRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityInvalidateToken) WithErrorTrace() func(*SecurityInvalidateTokenRequest) { + return func(r *SecurityInvalidateTokenRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityInvalidateToken) WithFilterPath(v ...string) func(*SecurityInvalidateTokenRequest) { + return func(r *SecurityInvalidateTokenRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityInvalidateToken) WithHeader(h map[string]string) func(*SecurityInvalidateTokenRequest) { + return func(r *SecurityInvalidateTokenRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.put_privileges.go b/esapi/api.xpack.security.put_privileges.go new file mode 100755 index 0000000000..200e7bbb2e --- /dev/null +++ b/esapi/api.xpack.security.put_privileges.go @@ -0,0 +1,184 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSecurityPutPrivilegesFunc(t Transport) SecurityPutPrivileges { + return func(body io.Reader, o ...func(*SecurityPutPrivilegesRequest)) (*Response, error) { + var r = SecurityPutPrivilegesRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityPutPrivileges - TODO +// +type SecurityPutPrivileges func(body io.Reader, o ...func(*SecurityPutPrivilegesRequest)) (*Response, error) + +// SecurityPutPrivilegesRequest configures the Security Put Privileges API request. +// +type SecurityPutPrivilegesRequest struct { + Body io.Reader + + Refresh string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityPutPrivilegesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(len("/_security/privilege/")) + path.WriteString("/_security/privilege/") + + params = make(map[string]string) + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityPutPrivileges) WithContext(v context.Context) func(*SecurityPutPrivilegesRequest) { + return func(r *SecurityPutPrivilegesRequest) { + r.ctx = v + } +} + +// WithRefresh - if `true` (the default) 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` then do nothing with refreshes.. +// +func (f SecurityPutPrivileges) WithRefresh(v string) func(*SecurityPutPrivilegesRequest) { + return func(r *SecurityPutPrivilegesRequest) { + r.Refresh = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityPutPrivileges) WithPretty() func(*SecurityPutPrivilegesRequest) { + return func(r *SecurityPutPrivilegesRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityPutPrivileges) WithHuman() func(*SecurityPutPrivilegesRequest) { + return func(r *SecurityPutPrivilegesRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityPutPrivileges) WithErrorTrace() func(*SecurityPutPrivilegesRequest) { + return func(r *SecurityPutPrivilegesRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityPutPrivileges) WithFilterPath(v ...string) func(*SecurityPutPrivilegesRequest) { + return func(r *SecurityPutPrivilegesRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityPutPrivileges) WithHeader(h map[string]string) func(*SecurityPutPrivilegesRequest) { + return func(r *SecurityPutPrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.put_role.go b/esapi/api.xpack.security.put_role.go new file mode 100755 index 0000000000..22372d3878 --- /dev/null +++ b/esapi/api.xpack.security.put_role.go @@ -0,0 +1,191 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSecurityPutRoleFunc(t Transport) SecurityPutRole { + return func(name string, body io.Reader, o ...func(*SecurityPutRoleRequest)) (*Response, error) { + var r = SecurityPutRoleRequest{Name: name, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityPutRole - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html +// +type SecurityPutRole func(name string, body io.Reader, o ...func(*SecurityPutRoleRequest)) (*Response, error) + +// SecurityPutRoleRequest configures the Security Put Role API request. +// +type SecurityPutRoleRequest struct { + Body io.Reader + + Name string + + Refresh string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityPutRoleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_security") + 1 + len("role") + 1 + len(r.Name)) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("role") + path.WriteString("/") + path.WriteString(r.Name) + + params = make(map[string]string) + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityPutRole) WithContext(v context.Context) func(*SecurityPutRoleRequest) { + return func(r *SecurityPutRoleRequest) { + r.ctx = v + } +} + +// WithRefresh - if `true` (the default) 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` then do nothing with refreshes.. +// +func (f SecurityPutRole) WithRefresh(v string) func(*SecurityPutRoleRequest) { + return func(r *SecurityPutRoleRequest) { + r.Refresh = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityPutRole) WithPretty() func(*SecurityPutRoleRequest) { + return func(r *SecurityPutRoleRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityPutRole) WithHuman() func(*SecurityPutRoleRequest) { + return func(r *SecurityPutRoleRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityPutRole) WithErrorTrace() func(*SecurityPutRoleRequest) { + return func(r *SecurityPutRoleRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityPutRole) WithFilterPath(v ...string) func(*SecurityPutRoleRequest) { + return func(r *SecurityPutRoleRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityPutRole) WithHeader(h map[string]string) func(*SecurityPutRoleRequest) { + return func(r *SecurityPutRoleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.put_role_mapping.go b/esapi/api.xpack.security.put_role_mapping.go new file mode 100755 index 0000000000..ec97c45e45 --- /dev/null +++ b/esapi/api.xpack.security.put_role_mapping.go @@ -0,0 +1,191 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSecurityPutRoleMappingFunc(t Transport) SecurityPutRoleMapping { + return func(name string, body io.Reader, o ...func(*SecurityPutRoleMappingRequest)) (*Response, error) { + var r = SecurityPutRoleMappingRequest{Name: name, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityPutRoleMapping - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html +// +type SecurityPutRoleMapping func(name string, body io.Reader, o ...func(*SecurityPutRoleMappingRequest)) (*Response, error) + +// SecurityPutRoleMappingRequest configures the Security Put Role Mapping API request. +// +type SecurityPutRoleMappingRequest struct { + Body io.Reader + + Name string + + Refresh string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityPutRoleMappingRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_security") + 1 + len("role_mapping") + 1 + len(r.Name)) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("role_mapping") + path.WriteString("/") + path.WriteString(r.Name) + + params = make(map[string]string) + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityPutRoleMapping) WithContext(v context.Context) func(*SecurityPutRoleMappingRequest) { + return func(r *SecurityPutRoleMappingRequest) { + r.ctx = v + } +} + +// WithRefresh - if `true` (the default) 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` then do nothing with refreshes.. +// +func (f SecurityPutRoleMapping) WithRefresh(v string) func(*SecurityPutRoleMappingRequest) { + return func(r *SecurityPutRoleMappingRequest) { + r.Refresh = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityPutRoleMapping) WithPretty() func(*SecurityPutRoleMappingRequest) { + return func(r *SecurityPutRoleMappingRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityPutRoleMapping) WithHuman() func(*SecurityPutRoleMappingRequest) { + return func(r *SecurityPutRoleMappingRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityPutRoleMapping) WithErrorTrace() func(*SecurityPutRoleMappingRequest) { + return func(r *SecurityPutRoleMappingRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityPutRoleMapping) WithFilterPath(v ...string) func(*SecurityPutRoleMappingRequest) { + return func(r *SecurityPutRoleMappingRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityPutRoleMapping) WithHeader(h map[string]string) func(*SecurityPutRoleMappingRequest) { + return func(r *SecurityPutRoleMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.security.put_user.go b/esapi/api.xpack.security.put_user.go new file mode 100755 index 0000000000..8a5e15ceb0 --- /dev/null +++ b/esapi/api.xpack.security.put_user.go @@ -0,0 +1,191 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSecurityPutUserFunc(t Transport) SecurityPutUser { + return func(username string, body io.Reader, o ...func(*SecurityPutUserRequest)) (*Response, error) { + var r = SecurityPutUserRequest{Username: username, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SecurityPutUser - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html +// +type SecurityPutUser func(username string, body io.Reader, o ...func(*SecurityPutUserRequest)) (*Response, error) + +// SecurityPutUserRequest configures the Security Put User API request. +// +type SecurityPutUserRequest struct { + Body io.Reader + + Username string + + Refresh string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SecurityPutUserRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_security") + 1 + len("user") + 1 + len(r.Username)) + path.WriteString("/") + path.WriteString("_security") + path.WriteString("/") + path.WriteString("user") + path.WriteString("/") + path.WriteString(r.Username) + + params = make(map[string]string) + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SecurityPutUser) WithContext(v context.Context) func(*SecurityPutUserRequest) { + return func(r *SecurityPutUserRequest) { + r.ctx = v + } +} + +// WithRefresh - if `true` (the default) 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` then do nothing with refreshes.. +// +func (f SecurityPutUser) WithRefresh(v string) func(*SecurityPutUserRequest) { + return func(r *SecurityPutUserRequest) { + r.Refresh = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SecurityPutUser) WithPretty() func(*SecurityPutUserRequest) { + return func(r *SecurityPutUserRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SecurityPutUser) WithHuman() func(*SecurityPutUserRequest) { + return func(r *SecurityPutUserRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SecurityPutUser) WithErrorTrace() func(*SecurityPutUserRequest) { + return func(r *SecurityPutUserRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SecurityPutUser) WithFilterPath(v ...string) func(*SecurityPutUserRequest) { + return func(r *SecurityPutUserRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SecurityPutUser) WithHeader(h map[string]string) func(*SecurityPutUserRequest) { + return func(r *SecurityPutUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.sql.clear_cursor.go b/esapi/api.xpack.sql.clear_cursor.go new file mode 100755 index 0000000000..92b4a876d1 --- /dev/null +++ b/esapi/api.xpack.sql.clear_cursor.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSQLClearCursorFunc(t Transport) SQLClearCursor { + return func(body io.Reader, o ...func(*SQLClearCursorRequest)) (*Response, error) { + var r = SQLClearCursorRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SQLClearCursor - Clear SQL cursor +// +type SQLClearCursor func(body io.Reader, o ...func(*SQLClearCursorRequest)) (*Response, error) + +// SQLClearCursorRequest configures the Sql Clear Cursor API request. +// +type SQLClearCursorRequest struct { + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SQLClearCursorRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_sql/close")) + path.WriteString("/_sql/close") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SQLClearCursor) WithContext(v context.Context) func(*SQLClearCursorRequest) { + return func(r *SQLClearCursorRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SQLClearCursor) WithPretty() func(*SQLClearCursorRequest) { + return func(r *SQLClearCursorRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SQLClearCursor) WithHuman() func(*SQLClearCursorRequest) { + return func(r *SQLClearCursorRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SQLClearCursor) WithErrorTrace() func(*SQLClearCursorRequest) { + return func(r *SQLClearCursorRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SQLClearCursor) WithFilterPath(v ...string) func(*SQLClearCursorRequest) { + return func(r *SQLClearCursorRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SQLClearCursor) WithHeader(h map[string]string) func(*SQLClearCursorRequest) { + return func(r *SQLClearCursorRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.sql.query.go b/esapi/api.xpack.sql.query.go new file mode 100755 index 0000000000..89793a4f20 --- /dev/null +++ b/esapi/api.xpack.sql.query.go @@ -0,0 +1,184 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSQLQueryFunc(t Transport) SQLQuery { + return func(body io.Reader, o ...func(*SQLQueryRequest)) (*Response, error) { + var r = SQLQueryRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SQLQuery - Execute SQL +// +type SQLQuery func(body io.Reader, o ...func(*SQLQueryRequest)) (*Response, error) + +// SQLQueryRequest configures the Sql Query API request. +// +type SQLQueryRequest struct { + Body io.Reader + + Format string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SQLQueryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_sql")) + path.WriteString("/_sql") + + params = make(map[string]string) + + if r.Format != "" { + params["format"] = r.Format + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SQLQuery) WithContext(v context.Context) func(*SQLQueryRequest) { + return func(r *SQLQueryRequest) { + r.ctx = v + } +} + +// WithFormat - a short version of the accept header, e.g. json, yaml. +// +func (f SQLQuery) WithFormat(v string) func(*SQLQueryRequest) { + return func(r *SQLQueryRequest) { + r.Format = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SQLQuery) WithPretty() func(*SQLQueryRequest) { + return func(r *SQLQueryRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SQLQuery) WithHuman() func(*SQLQueryRequest) { + return func(r *SQLQueryRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SQLQuery) WithErrorTrace() func(*SQLQueryRequest) { + return func(r *SQLQueryRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SQLQuery) WithFilterPath(v ...string) func(*SQLQueryRequest) { + return func(r *SQLQueryRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SQLQuery) WithHeader(h map[string]string) func(*SQLQueryRequest) { + return func(r *SQLQueryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.sql.translate.go b/esapi/api.xpack.sql.translate.go new file mode 100755 index 0000000000..b474d02594 --- /dev/null +++ b/esapi/api.xpack.sql.translate.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSQLTranslateFunc(t Transport) SQLTranslate { + return func(body io.Reader, o ...func(*SQLTranslateRequest)) (*Response, error) { + var r = SQLTranslateRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SQLTranslate - Translate SQL into Elasticsearch queries +// +type SQLTranslate func(body io.Reader, o ...func(*SQLTranslateRequest)) (*Response, error) + +// SQLTranslateRequest configures the Sql Translate API request. +// +type SQLTranslateRequest struct { + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SQLTranslateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_sql/translate")) + path.WriteString("/_sql/translate") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SQLTranslate) WithContext(v context.Context) func(*SQLTranslateRequest) { + return func(r *SQLTranslateRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SQLTranslate) WithPretty() func(*SQLTranslateRequest) { + return func(r *SQLTranslateRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SQLTranslate) WithHuman() func(*SQLTranslateRequest) { + return func(r *SQLTranslateRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SQLTranslate) WithErrorTrace() func(*SQLTranslateRequest) { + return func(r *SQLTranslateRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SQLTranslate) WithFilterPath(v ...string) func(*SQLTranslateRequest) { + return func(r *SQLTranslateRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SQLTranslate) WithHeader(h map[string]string) func(*SQLTranslateRequest) { + return func(r *SQLTranslateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ssl.certificates.go b/esapi/api.xpack.ssl.certificates.go new file mode 100755 index 0000000000..8a908f9042 --- /dev/null +++ b/esapi/api.xpack.ssl.certificates.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSSLCertificatesFunc(t Transport) SSLCertificates { + return func(o ...func(*SSLCertificatesRequest)) (*Response, error) { + var r = SSLCertificatesRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SSLCertificates - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html +// +type SSLCertificates func(o ...func(*SSLCertificatesRequest)) (*Response, error) + +// SSLCertificatesRequest configures the Ssl Certificates API request. +// +type SSLCertificatesRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SSLCertificatesRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_ssl/certificates")) + path.WriteString("/_ssl/certificates") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SSLCertificates) WithContext(v context.Context) func(*SSLCertificatesRequest) { + return func(r *SSLCertificatesRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SSLCertificates) WithPretty() func(*SSLCertificatesRequest) { + return func(r *SSLCertificatesRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SSLCertificates) WithHuman() func(*SSLCertificatesRequest) { + return func(r *SSLCertificatesRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SSLCertificates) WithErrorTrace() func(*SSLCertificatesRequest) { + return func(r *SSLCertificatesRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SSLCertificates) WithFilterPath(v ...string) func(*SSLCertificatesRequest) { + return func(r *SSLCertificatesRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SSLCertificates) WithHeader(h map[string]string) func(*SSLCertificatesRequest) { + return func(r *SSLCertificatesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.watcher.ack_watch.go b/esapi/api.xpack.watcher.ack_watch.go new file mode 100755 index 0000000000..c0a863da40 --- /dev/null +++ b/esapi/api.xpack.watcher.ack_watch.go @@ -0,0 +1,185 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newWatcherAckWatchFunc(t Transport) WatcherAckWatch { + return func(watch_id string, o ...func(*WatcherAckWatchRequest)) (*Response, error) { + var r = WatcherAckWatchRequest{WatchID: watch_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// WatcherAckWatch - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html +// +type WatcherAckWatch func(watch_id string, o ...func(*WatcherAckWatchRequest)) (*Response, error) + +// WatcherAckWatchRequest configures the Watcher Ack Watch API request. +// +type WatcherAckWatchRequest struct { + ActionID []string + WatchID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r WatcherAckWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.WatchID) + 1 + len("_ack") + 1 + len(strings.Join(r.ActionID, ","))) + path.WriteString("/") + path.WriteString("_watcher") + path.WriteString("/") + path.WriteString("watch") + path.WriteString("/") + path.WriteString(r.WatchID) + path.WriteString("/") + path.WriteString("_ack") + if len(r.ActionID) > 0 { + path.WriteString("/") + path.WriteString(strings.Join(r.ActionID, ",")) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f WatcherAckWatch) WithContext(v context.Context) func(*WatcherAckWatchRequest) { + return func(r *WatcherAckWatchRequest) { + r.ctx = v + } +} + +// WithActionID - a list of the action ids to be acked. +// +func (f WatcherAckWatch) WithActionID(v ...string) func(*WatcherAckWatchRequest) { + return func(r *WatcherAckWatchRequest) { + r.ActionID = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f WatcherAckWatch) WithPretty() func(*WatcherAckWatchRequest) { + return func(r *WatcherAckWatchRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f WatcherAckWatch) WithHuman() func(*WatcherAckWatchRequest) { + return func(r *WatcherAckWatchRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f WatcherAckWatch) WithErrorTrace() func(*WatcherAckWatchRequest) { + return func(r *WatcherAckWatchRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f WatcherAckWatch) WithFilterPath(v ...string) func(*WatcherAckWatchRequest) { + return func(r *WatcherAckWatchRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f WatcherAckWatch) WithHeader(h map[string]string) func(*WatcherAckWatchRequest) { + return func(r *WatcherAckWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.watcher.activate_watch.go b/esapi/api.xpack.watcher.activate_watch.go new file mode 100755 index 0000000000..aeecee1bcb --- /dev/null +++ b/esapi/api.xpack.watcher.activate_watch.go @@ -0,0 +1,172 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newWatcherActivateWatchFunc(t Transport) WatcherActivateWatch { + return func(watch_id string, o ...func(*WatcherActivateWatchRequest)) (*Response, error) { + var r = WatcherActivateWatchRequest{WatchID: watch_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// WatcherActivateWatch - https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html +// +type WatcherActivateWatch func(watch_id string, o ...func(*WatcherActivateWatchRequest)) (*Response, error) + +// WatcherActivateWatchRequest configures the Watcher Activate Watch API request. +// +type WatcherActivateWatchRequest struct { + WatchID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r WatcherActivateWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.WatchID) + 1 + len("_activate")) + path.WriteString("/") + path.WriteString("_watcher") + path.WriteString("/") + path.WriteString("watch") + path.WriteString("/") + path.WriteString(r.WatchID) + path.WriteString("/") + path.WriteString("_activate") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f WatcherActivateWatch) WithContext(v context.Context) func(*WatcherActivateWatchRequest) { + return func(r *WatcherActivateWatchRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f WatcherActivateWatch) WithPretty() func(*WatcherActivateWatchRequest) { + return func(r *WatcherActivateWatchRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f WatcherActivateWatch) WithHuman() func(*WatcherActivateWatchRequest) { + return func(r *WatcherActivateWatchRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f WatcherActivateWatch) WithErrorTrace() func(*WatcherActivateWatchRequest) { + return func(r *WatcherActivateWatchRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f WatcherActivateWatch) WithFilterPath(v ...string) func(*WatcherActivateWatchRequest) { + return func(r *WatcherActivateWatchRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f WatcherActivateWatch) WithHeader(h map[string]string) func(*WatcherActivateWatchRequest) { + return func(r *WatcherActivateWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.watcher.deactivate_watch.go b/esapi/api.xpack.watcher.deactivate_watch.go new file mode 100755 index 0000000000..c099eefc4a --- /dev/null +++ b/esapi/api.xpack.watcher.deactivate_watch.go @@ -0,0 +1,172 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newWatcherDeactivateWatchFunc(t Transport) WatcherDeactivateWatch { + return func(watch_id string, o ...func(*WatcherDeactivateWatchRequest)) (*Response, error) { + var r = WatcherDeactivateWatchRequest{WatchID: watch_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// WatcherDeactivateWatch - https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html +// +type WatcherDeactivateWatch func(watch_id string, o ...func(*WatcherDeactivateWatchRequest)) (*Response, error) + +// WatcherDeactivateWatchRequest configures the Watcher Deactivate Watch API request. +// +type WatcherDeactivateWatchRequest struct { + WatchID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r WatcherDeactivateWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.WatchID) + 1 + len("_deactivate")) + path.WriteString("/") + path.WriteString("_watcher") + path.WriteString("/") + path.WriteString("watch") + path.WriteString("/") + path.WriteString(r.WatchID) + path.WriteString("/") + path.WriteString("_deactivate") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f WatcherDeactivateWatch) WithContext(v context.Context) func(*WatcherDeactivateWatchRequest) { + return func(r *WatcherDeactivateWatchRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f WatcherDeactivateWatch) WithPretty() func(*WatcherDeactivateWatchRequest) { + return func(r *WatcherDeactivateWatchRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f WatcherDeactivateWatch) WithHuman() func(*WatcherDeactivateWatchRequest) { + return func(r *WatcherDeactivateWatchRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f WatcherDeactivateWatch) WithErrorTrace() func(*WatcherDeactivateWatchRequest) { + return func(r *WatcherDeactivateWatchRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f WatcherDeactivateWatch) WithFilterPath(v ...string) func(*WatcherDeactivateWatchRequest) { + return func(r *WatcherDeactivateWatchRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f WatcherDeactivateWatch) WithHeader(h map[string]string) func(*WatcherDeactivateWatchRequest) { + return func(r *WatcherDeactivateWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.watcher.delete_watch.go b/esapi/api.xpack.watcher.delete_watch.go new file mode 100755 index 0000000000..da760a457b --- /dev/null +++ b/esapi/api.xpack.watcher.delete_watch.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newWatcherDeleteWatchFunc(t Transport) WatcherDeleteWatch { + return func(id string, o ...func(*WatcherDeleteWatchRequest)) (*Response, error) { + var r = WatcherDeleteWatchRequest{DocumentID: id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// WatcherDeleteWatch - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html +// +type WatcherDeleteWatch func(id string, o ...func(*WatcherDeleteWatchRequest)) (*Response, error) + +// WatcherDeleteWatchRequest configures the Watcher Delete Watch API request. +// +type WatcherDeleteWatchRequest struct { + DocumentID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r WatcherDeleteWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.DocumentID)) + path.WriteString("/") + path.WriteString("_watcher") + path.WriteString("/") + path.WriteString("watch") + path.WriteString("/") + path.WriteString(r.DocumentID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f WatcherDeleteWatch) WithContext(v context.Context) func(*WatcherDeleteWatchRequest) { + return func(r *WatcherDeleteWatchRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f WatcherDeleteWatch) WithPretty() func(*WatcherDeleteWatchRequest) { + return func(r *WatcherDeleteWatchRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f WatcherDeleteWatch) WithHuman() func(*WatcherDeleteWatchRequest) { + return func(r *WatcherDeleteWatchRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f WatcherDeleteWatch) WithErrorTrace() func(*WatcherDeleteWatchRequest) { + return func(r *WatcherDeleteWatchRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f WatcherDeleteWatch) WithFilterPath(v ...string) func(*WatcherDeleteWatchRequest) { + return func(r *WatcherDeleteWatchRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f WatcherDeleteWatch) WithHeader(h map[string]string) func(*WatcherDeleteWatchRequest) { + return func(r *WatcherDeleteWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.watcher.execute_watch.go b/esapi/api.xpack.watcher.execute_watch.go new file mode 100755 index 0000000000..ffac7b4908 --- /dev/null +++ b/esapi/api.xpack.watcher.execute_watch.go @@ -0,0 +1,212 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" +) + +func newWatcherExecuteWatchFunc(t Transport) WatcherExecuteWatch { + return func(o ...func(*WatcherExecuteWatchRequest)) (*Response, error) { + var r = WatcherExecuteWatchRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// WatcherExecuteWatch - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html +// +type WatcherExecuteWatch func(o ...func(*WatcherExecuteWatchRequest)) (*Response, error) + +// WatcherExecuteWatchRequest configures the Watcher Execute Watch API request. +// +type WatcherExecuteWatchRequest struct { + DocumentID string + + Body io.Reader + + Debug *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r WatcherExecuteWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.DocumentID) + 1 + len("_execute")) + path.WriteString("/") + path.WriteString("_watcher") + path.WriteString("/") + path.WriteString("watch") + if r.DocumentID != "" { + path.WriteString("/") + path.WriteString(r.DocumentID) + } + path.WriteString("/") + path.WriteString("_execute") + + params = make(map[string]string) + + if r.Debug != nil { + params["debug"] = strconv.FormatBool(*r.Debug) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f WatcherExecuteWatch) WithContext(v context.Context) func(*WatcherExecuteWatchRequest) { + return func(r *WatcherExecuteWatchRequest) { + r.ctx = v + } +} + +// WithBody - Execution control. +// +func (f WatcherExecuteWatch) WithBody(v io.Reader) func(*WatcherExecuteWatchRequest) { + return func(r *WatcherExecuteWatchRequest) { + r.Body = v + } +} + +// WithDocumentID - watch ID. +// +func (f WatcherExecuteWatch) WithDocumentID(v string) func(*WatcherExecuteWatchRequest) { + return func(r *WatcherExecuteWatchRequest) { + r.DocumentID = v + } +} + +// WithDebug - indicates whether the watch should execute in debug mode. +// +func (f WatcherExecuteWatch) WithDebug(v bool) func(*WatcherExecuteWatchRequest) { + return func(r *WatcherExecuteWatchRequest) { + r.Debug = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f WatcherExecuteWatch) WithPretty() func(*WatcherExecuteWatchRequest) { + return func(r *WatcherExecuteWatchRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f WatcherExecuteWatch) WithHuman() func(*WatcherExecuteWatchRequest) { + return func(r *WatcherExecuteWatchRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f WatcherExecuteWatch) WithErrorTrace() func(*WatcherExecuteWatchRequest) { + return func(r *WatcherExecuteWatchRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f WatcherExecuteWatch) WithFilterPath(v ...string) func(*WatcherExecuteWatchRequest) { + return func(r *WatcherExecuteWatchRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f WatcherExecuteWatch) WithHeader(h map[string]string) func(*WatcherExecuteWatchRequest) { + return func(r *WatcherExecuteWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.watcher.get_watch.go b/esapi/api.xpack.watcher.get_watch.go new file mode 100755 index 0000000000..73cc51f944 --- /dev/null +++ b/esapi/api.xpack.watcher.get_watch.go @@ -0,0 +1,170 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newWatcherGetWatchFunc(t Transport) WatcherGetWatch { + return func(id string, o ...func(*WatcherGetWatchRequest)) (*Response, error) { + var r = WatcherGetWatchRequest{DocumentID: id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// WatcherGetWatch - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html +// +type WatcherGetWatch func(id string, o ...func(*WatcherGetWatchRequest)) (*Response, error) + +// WatcherGetWatchRequest configures the Watcher Get Watch API request. +// +type WatcherGetWatchRequest struct { + DocumentID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r WatcherGetWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.DocumentID)) + path.WriteString("/") + path.WriteString("_watcher") + path.WriteString("/") + path.WriteString("watch") + path.WriteString("/") + path.WriteString(r.DocumentID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f WatcherGetWatch) WithContext(v context.Context) func(*WatcherGetWatchRequest) { + return func(r *WatcherGetWatchRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f WatcherGetWatch) WithPretty() func(*WatcherGetWatchRequest) { + return func(r *WatcherGetWatchRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f WatcherGetWatch) WithHuman() func(*WatcherGetWatchRequest) { + return func(r *WatcherGetWatchRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f WatcherGetWatch) WithErrorTrace() func(*WatcherGetWatchRequest) { + return func(r *WatcherGetWatchRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f WatcherGetWatch) WithFilterPath(v ...string) func(*WatcherGetWatchRequest) { + return func(r *WatcherGetWatchRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f WatcherGetWatch) WithHeader(h map[string]string) func(*WatcherGetWatchRequest) { + return func(r *WatcherGetWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.watcher.put_watch.go b/esapi/api.xpack.watcher.put_watch.go new file mode 100755 index 0000000000..a32957e5cb --- /dev/null +++ b/esapi/api.xpack.watcher.put_watch.go @@ -0,0 +1,239 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" +) + +func newWatcherPutWatchFunc(t Transport) WatcherPutWatch { + return func(id string, o ...func(*WatcherPutWatchRequest)) (*Response, error) { + var r = WatcherPutWatchRequest{DocumentID: id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// WatcherPutWatch - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html +// +type WatcherPutWatch func(id string, o ...func(*WatcherPutWatchRequest)) (*Response, error) + +// WatcherPutWatchRequest configures the Watcher Put Watch API request. +// +type WatcherPutWatchRequest struct { + DocumentID string + + Body io.Reader + + Active *bool + IfPrimaryTerm *int + IfSeqNo *int + Version *int + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r WatcherPutWatchRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.DocumentID)) + path.WriteString("/") + path.WriteString("_watcher") + path.WriteString("/") + path.WriteString("watch") + path.WriteString("/") + path.WriteString(r.DocumentID) + + params = make(map[string]string) + + if r.Active != nil { + params["active"] = strconv.FormatBool(*r.Active) + } + + if r.IfPrimaryTerm != nil { + params["if_primary_term"] = strconv.FormatInt(int64(*r.IfPrimaryTerm), 10) + } + + if r.IfSeqNo != nil { + params["if_seq_no"] = strconv.FormatInt(int64(*r.IfSeqNo), 10) + } + + if r.Version != nil { + params["version"] = strconv.FormatInt(int64(*r.Version), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f WatcherPutWatch) WithContext(v context.Context) func(*WatcherPutWatchRequest) { + return func(r *WatcherPutWatchRequest) { + r.ctx = v + } +} + +// WithBody - The watch. +// +func (f WatcherPutWatch) WithBody(v io.Reader) func(*WatcherPutWatchRequest) { + return func(r *WatcherPutWatchRequest) { + r.Body = v + } +} + +// WithActive - specify whether the watch is in/active by default. +// +func (f WatcherPutWatch) WithActive(v bool) func(*WatcherPutWatchRequest) { + return func(r *WatcherPutWatchRequest) { + r.Active = &v + } +} + +// WithIfPrimaryTerm - only update the watch if the last operation that has changed the watch has the specified primary term. +// +func (f WatcherPutWatch) WithIfPrimaryTerm(v int) func(*WatcherPutWatchRequest) { + return func(r *WatcherPutWatchRequest) { + r.IfPrimaryTerm = &v + } +} + +// WithIfSeqNo - only update the watch if the last operation that has changed the watch has the specified sequence number. +// +func (f WatcherPutWatch) WithIfSeqNo(v int) func(*WatcherPutWatchRequest) { + return func(r *WatcherPutWatchRequest) { + r.IfSeqNo = &v + } +} + +// WithVersion - explicit version number for concurrency control. +// +func (f WatcherPutWatch) WithVersion(v int) func(*WatcherPutWatchRequest) { + return func(r *WatcherPutWatchRequest) { + r.Version = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f WatcherPutWatch) WithPretty() func(*WatcherPutWatchRequest) { + return func(r *WatcherPutWatchRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f WatcherPutWatch) WithHuman() func(*WatcherPutWatchRequest) { + return func(r *WatcherPutWatchRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f WatcherPutWatch) WithErrorTrace() func(*WatcherPutWatchRequest) { + return func(r *WatcherPutWatchRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f WatcherPutWatch) WithFilterPath(v ...string) func(*WatcherPutWatchRequest) { + return func(r *WatcherPutWatchRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f WatcherPutWatch) WithHeader(h map[string]string) func(*WatcherPutWatchRequest) { + return func(r *WatcherPutWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.watcher.start.go b/esapi/api.xpack.watcher.start.go new file mode 100755 index 0000000000..efd60eb5be --- /dev/null +++ b/esapi/api.xpack.watcher.start.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newWatcherStartFunc(t Transport) WatcherStart { + return func(o ...func(*WatcherStartRequest)) (*Response, error) { + var r = WatcherStartRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// WatcherStart - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html +// +type WatcherStart func(o ...func(*WatcherStartRequest)) (*Response, error) + +// WatcherStartRequest configures the Watcher Start API request. +// +type WatcherStartRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r WatcherStartRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_watcher/_start")) + path.WriteString("/_watcher/_start") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f WatcherStart) WithContext(v context.Context) func(*WatcherStartRequest) { + return func(r *WatcherStartRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f WatcherStart) WithPretty() func(*WatcherStartRequest) { + return func(r *WatcherStartRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f WatcherStart) WithHuman() func(*WatcherStartRequest) { + return func(r *WatcherStartRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f WatcherStart) WithErrorTrace() func(*WatcherStartRequest) { + return func(r *WatcherStartRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f WatcherStart) WithFilterPath(v ...string) func(*WatcherStartRequest) { + return func(r *WatcherStartRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f WatcherStart) WithHeader(h map[string]string) func(*WatcherStartRequest) { + return func(r *WatcherStartRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.watcher.stats.go b/esapi/api.xpack.watcher.stats.go new file mode 100755 index 0000000000..baa2dd46d0 --- /dev/null +++ b/esapi/api.xpack.watcher.stats.go @@ -0,0 +1,199 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newWatcherStatsFunc(t Transport) WatcherStats { + return func(o ...func(*WatcherStatsRequest)) (*Response, error) { + var r = WatcherStatsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// WatcherStats - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html +// +type WatcherStats func(o ...func(*WatcherStatsRequest)) (*Response, error) + +// WatcherStatsRequest configures the Watcher Stats API request. +// +type WatcherStatsRequest struct { + Metric []string + + EmitStacktraces *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r WatcherStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_watcher") + 1 + len("stats") + 1 + len(strings.Join(r.Metric, ","))) + path.WriteString("/") + path.WriteString("_watcher") + path.WriteString("/") + path.WriteString("stats") + if len(r.Metric) > 0 { + path.WriteString("/") + path.WriteString(strings.Join(r.Metric, ",")) + } + + params = make(map[string]string) + + if r.EmitStacktraces != nil { + params["emit_stacktraces"] = strconv.FormatBool(*r.EmitStacktraces) + } + + if len(r.Metric) > 0 { + params["metric"] = strings.Join(r.Metric, ",") + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f WatcherStats) WithContext(v context.Context) func(*WatcherStatsRequest) { + return func(r *WatcherStatsRequest) { + r.ctx = v + } +} + +// WithMetric - controls what additional stat metrics should be include in the response. +// +func (f WatcherStats) WithMetric(v ...string) func(*WatcherStatsRequest) { + return func(r *WatcherStatsRequest) { + r.Metric = v + } +} + +// WithEmitStacktraces - emits stack traces of currently running watches. +// +func (f WatcherStats) WithEmitStacktraces(v bool) func(*WatcherStatsRequest) { + return func(r *WatcherStatsRequest) { + r.EmitStacktraces = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f WatcherStats) WithPretty() func(*WatcherStatsRequest) { + return func(r *WatcherStatsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f WatcherStats) WithHuman() func(*WatcherStatsRequest) { + return func(r *WatcherStatsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f WatcherStats) WithErrorTrace() func(*WatcherStatsRequest) { + return func(r *WatcherStatsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f WatcherStats) WithFilterPath(v ...string) func(*WatcherStatsRequest) { + return func(r *WatcherStatsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f WatcherStats) WithHeader(h map[string]string) func(*WatcherStatsRequest) { + return func(r *WatcherStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.watcher.stop.go b/esapi/api.xpack.watcher.stop.go new file mode 100755 index 0000000000..15ee3abc6d --- /dev/null +++ b/esapi/api.xpack.watcher.stop.go @@ -0,0 +1,163 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newWatcherStopFunc(t Transport) WatcherStop { + return func(o ...func(*WatcherStopRequest)) (*Response, error) { + var r = WatcherStopRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// WatcherStop - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html +// +type WatcherStop func(o ...func(*WatcherStopRequest)) (*Response, error) + +// WatcherStopRequest configures the Watcher Stop API request. +// +type WatcherStopRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r WatcherStopRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_watcher/_stop")) + path.WriteString("/_watcher/_stop") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f WatcherStop) WithContext(v context.Context) func(*WatcherStopRequest) { + return func(r *WatcherStopRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f WatcherStop) WithPretty() func(*WatcherStopRequest) { + return func(r *WatcherStopRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f WatcherStop) WithHuman() func(*WatcherStopRequest) { + return func(r *WatcherStopRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f WatcherStop) WithErrorTrace() func(*WatcherStopRequest) { + return func(r *WatcherStopRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f WatcherStop) WithFilterPath(v ...string) func(*WatcherStopRequest) { + return func(r *WatcherStopRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f WatcherStop) WithHeader(h map[string]string) func(*WatcherStopRequest) { + return func(r *WatcherStopRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.xpack.info.go b/esapi/api.xpack.xpack.info.go new file mode 100755 index 0000000000..ad7acbf938 --- /dev/null +++ b/esapi/api.xpack.xpack.info.go @@ -0,0 +1,177 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newXPackInfoFunc(t Transport) XPackInfo { + return func(o ...func(*XPackInfoRequest)) (*Response, error) { + var r = XPackInfoRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// XPackInfo - https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html +// +type XPackInfo func(o ...func(*XPackInfoRequest)) (*Response, error) + +// XPackInfoRequest configures the Xpack Info API request. +// +type XPackInfoRequest struct { + Categories []string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r XPackInfoRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_xpack")) + path.WriteString("/_xpack") + + params = make(map[string]string) + + if len(r.Categories) > 0 { + params["categories"] = strings.Join(r.Categories, ",") + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f XPackInfo) WithContext(v context.Context) func(*XPackInfoRequest) { + return func(r *XPackInfoRequest) { + r.ctx = v + } +} + +// WithCategories - comma-separated list of info categories. can be any of: build, license, features. +// +func (f XPackInfo) WithCategories(v ...string) func(*XPackInfoRequest) { + return func(r *XPackInfoRequest) { + r.Categories = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f XPackInfo) WithPretty() func(*XPackInfoRequest) { + return func(r *XPackInfoRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f XPackInfo) WithHuman() func(*XPackInfoRequest) { + return func(r *XPackInfoRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f XPackInfo) WithErrorTrace() func(*XPackInfoRequest) { + return func(r *XPackInfoRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f XPackInfo) WithFilterPath(v ...string) func(*XPackInfoRequest) { + return func(r *XPackInfoRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f XPackInfo) WithHeader(h map[string]string) func(*XPackInfoRequest) { + return func(r *XPackInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.xpack.usage.go b/esapi/api.xpack.xpack.usage.go new file mode 100755 index 0000000000..b09754e2f8 --- /dev/null +++ b/esapi/api.xpack.xpack.usage.go @@ -0,0 +1,178 @@ +// Code generated from specification version 7.3.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" + "time" +) + +func newXPackUsageFunc(t Transport) XPackUsage { + return func(o ...func(*XPackUsageRequest)) (*Response, error) { + var r = XPackUsageRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// XPackUsage - Retrieve information about xpack features usage +// +type XPackUsage func(o ...func(*XPackUsageRequest)) (*Response, error) + +// XPackUsageRequest configures the Xpack Usage API request. +// +type XPackUsageRequest struct { + MasterTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r XPackUsageRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_xpack/usage")) + path.WriteString("/_xpack/usage") + + params = make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f XPackUsage) WithContext(v context.Context) func(*XPackUsageRequest) { + return func(r *XPackUsageRequest) { + r.ctx = v + } +} + +// WithMasterTimeout - specify timeout for watch write operation. +// +func (f XPackUsage) WithMasterTimeout(v time.Duration) func(*XPackUsageRequest) { + return func(r *XPackUsageRequest) { + r.MasterTimeout = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f XPackUsage) WithPretty() func(*XPackUsageRequest) { + return func(r *XPackUsageRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f XPackUsage) WithHuman() func(*XPackUsageRequest) { + return func(r *XPackUsageRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f XPackUsage) WithErrorTrace() func(*XPackUsageRequest) { + return func(r *XPackUsageRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f XPackUsage) WithFilterPath(v ...string) func(*XPackUsageRequest) { + return func(r *XPackUsageRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f XPackUsage) WithHeader(h map[string]string) func(*XPackUsageRequest) { + return func(r *XPackUsageRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} From 935357fb195d41c2e5c72f9aa206578e8a006686 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 5 Jul 2019 15:38:45 +0200 Subject: [PATCH 072/355] API: Update the API constructor for Elasticsearch 7.x (cff607cbd83) --- esapi/api._.go | 694 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 533 insertions(+), 161 deletions(-) diff --git a/esapi/api._.go b/esapi/api._.go index 672fcb9053..1d1765c9cc 100644 --- a/esapi/api._.go +++ b/esapi/api._.go @@ -1,55 +1,75 @@ -// Code generated from specification version 7.0.0 (42d52c016e4): DO NOT EDIT +// Code generated from specification version 7.3.0-SNAPSHOT (cff607cbd83): DO NOT EDIT package esapi // API contains the Elasticsearch APIs // type API struct { - Cat *Cat - Cluster *Cluster - Indices *Indices - Ingest *Ingest - Nodes *Nodes - Remote *Remote - Snapshot *Snapshot - Tasks *Tasks + Cat *Cat + Cluster *Cluster + Indices *Indices + Ingest *Ingest + Nodes *Nodes + Remote *Remote + Snapshot *Snapshot + Tasks *Tasks + CCR *CCR + ILM *ILM + License *License + Migration *Migration + ML *ML + Monitoring *Monitoring + Rollup *Rollup + Security *Security + SQL *SQL + SSL *SSL + Watcher *Watcher + XPack *XPack - Bulk Bulk - ClearScroll ClearScroll - Count Count - Create Create - Delete Delete - DeleteByQuery DeleteByQuery - DeleteByQueryRethrottle DeleteByQueryRethrottle - DeleteScript DeleteScript - Exists Exists - ExistsSource ExistsSource - Explain Explain - FieldCaps FieldCaps - Get Get - GetScript GetScript - GetSource GetSource - Index Index - Info Info - Mget Mget - Msearch Msearch - MsearchTemplate MsearchTemplate - Mtermvectors Mtermvectors - Ping Ping - PutScript PutScript - RankEval RankEval - Reindex Reindex - ReindexRethrottle ReindexRethrottle - RenderSearchTemplate RenderSearchTemplate - ScriptsPainlessExecute ScriptsPainlessExecute - Scroll Scroll - Search Search - SearchShards SearchShards - SearchTemplate SearchTemplate - Termvectors Termvectors - Update Update - UpdateByQuery UpdateByQuery - UpdateByQueryRethrottle UpdateByQueryRethrottle + Bulk Bulk + ClearScroll ClearScroll + Count Count + Create Create + DataFrameDeleteDataFrameTransform DataFrameDeleteDataFrameTransform + DataFrameGetDataFrameTransform DataFrameGetDataFrameTransform + DataFrameGetDataFrameTransformStats DataFrameGetDataFrameTransformStats + DataFramePreviewDataFrameTransform DataFramePreviewDataFrameTransform + DataFramePutDataFrameTransform DataFramePutDataFrameTransform + DataFrameStartDataFrameTransform DataFrameStartDataFrameTransform + DataFrameStopDataFrameTransform DataFrameStopDataFrameTransform + DeleteByQuery DeleteByQuery + DeleteByQueryRethrottle DeleteByQueryRethrottle + Delete Delete + DeleteScript DeleteScript + Exists Exists + ExistsSource ExistsSource + Explain Explain + FieldCaps FieldCaps + Get Get + GetScript GetScript + GetSource GetSource + GraphExplore GraphExplore + Index Index + Info Info + Mget Mget + Msearch Msearch + MsearchTemplate MsearchTemplate + Mtermvectors Mtermvectors + Ping Ping + PutScript PutScript + RankEval RankEval + Reindex Reindex + ReindexRethrottle ReindexRethrottle + RenderSearchTemplate RenderSearchTemplate + ScriptsPainlessExecute ScriptsPainlessExecute + Scroll Scroll + Search Search + SearchShards SearchShards + SearchTemplate SearchTemplate + Termvectors Termvectors + UpdateByQuery UpdateByQuery + UpdateByQueryRethrottle UpdateByQueryRethrottle + Update Update } // Cat contains the Cat APIs @@ -91,43 +111,46 @@ type Cluster struct { // Indices contains the Indices APIs type Indices struct { - Analyze IndicesAnalyze - ClearCache IndicesClearCache - Close IndicesClose - Create IndicesCreate - Delete IndicesDelete - DeleteAlias IndicesDeleteAlias - DeleteTemplate IndicesDeleteTemplate - Exists IndicesExists - ExistsAlias IndicesExistsAlias - ExistsTemplate IndicesExistsTemplate - ExistsType IndicesExistsType - Flush IndicesFlush - FlushSynced IndicesFlushSynced - Forcemerge IndicesForcemerge - Get IndicesGet - GetAlias IndicesGetAlias - GetFieldMapping IndicesGetFieldMapping - GetMapping IndicesGetMapping - GetSettings IndicesGetSettings - GetTemplate IndicesGetTemplate - GetUpgrade IndicesGetUpgrade - Open IndicesOpen - PutAlias IndicesPutAlias - PutMapping IndicesPutMapping - PutSettings IndicesPutSettings - PutTemplate IndicesPutTemplate - Recovery IndicesRecovery - Refresh IndicesRefresh - Rollover IndicesRollover - Segments IndicesSegments - ShardStores IndicesShardStores - Shrink IndicesShrink - Split IndicesSplit - Stats IndicesStats - UpdateAliases IndicesUpdateAliases - Upgrade IndicesUpgrade - ValidateQuery IndicesValidateQuery + Analyze IndicesAnalyze + ClearCache IndicesClearCache + Close IndicesClose + Create IndicesCreate + DeleteAlias IndicesDeleteAlias + Delete IndicesDelete + DeleteTemplate IndicesDeleteTemplate + ExistsAlias IndicesExistsAlias + ExistsDocumentType IndicesExistsDocumentType + Exists IndicesExists + ExistsTemplate IndicesExistsTemplate + Flush IndicesFlush + FlushSynced IndicesFlushSynced + Forcemerge IndicesForcemerge + Freeze IndicesFreeze + GetAlias IndicesGetAlias + GetFieldMapping IndicesGetFieldMapping + GetMapping IndicesGetMapping + Get IndicesGet + GetSettings IndicesGetSettings + GetTemplate IndicesGetTemplate + GetUpgrade IndicesGetUpgrade + Open IndicesOpen + PutAlias IndicesPutAlias + PutMapping IndicesPutMapping + PutSettings IndicesPutSettings + PutTemplate IndicesPutTemplate + Recovery IndicesRecovery + Refresh IndicesRefresh + ReloadSearchAnalyzers IndicesReloadSearchAnalyzers + Rollover IndicesRollover + Segments IndicesSegments + ShardStores IndicesShardStores + Shrink IndicesShrink + Split IndicesSplit + Stats IndicesStats + Unfreeze IndicesUnfreeze + UpdateAliases IndicesUpdateAliases + Upgrade IndicesUpgrade + ValidateQuery IndicesValidateQuery } // Ingest contains the Ingest APIs @@ -154,12 +177,12 @@ type Remote struct { // Snapshot contains the Snapshot APIs type Snapshot struct { - Create SnapshotCreate CreateRepository SnapshotCreateRepository - Delete SnapshotDelete + Create SnapshotCreate DeleteRepository SnapshotDeleteRepository - Get SnapshotGet + Delete SnapshotDelete GetRepository SnapshotGetRepository + Get SnapshotGet Restore SnapshotRestore Status SnapshotStatus VerifyRepository SnapshotVerifyRepository @@ -172,46 +195,235 @@ type Tasks struct { List TasksList } +// CCR contains the CCR APIs +type CCR struct { + DeleteAutoFollowPattern CCRDeleteAutoFollowPattern + FollowInfo CCRFollowInfo + Follow CCRFollow + FollowStats CCRFollowStats + ForgetFollower CCRForgetFollower + GetAutoFollowPattern CCRGetAutoFollowPattern + PauseFollow CCRPauseFollow + PutAutoFollowPattern CCRPutAutoFollowPattern + ResumeFollow CCRResumeFollow + Stats CCRStats + Unfollow CCRUnfollow +} + +// ILM contains the ILM APIs +type ILM struct { + DeleteLifecycle ILMDeleteLifecycle + ExplainLifecycle ILMExplainLifecycle + GetLifecycle ILMGetLifecycle + GetStatus ILMGetStatus + MoveToStep ILMMoveToStep + PutLifecycle ILMPutLifecycle + RemovePolicy ILMRemovePolicy + Retry ILMRetry + Start ILMStart + Stop ILMStop +} + +// License contains the License APIs +type License struct { + Delete LicenseDelete + GetBasicStatus LicenseGetBasicStatus + Get LicenseGet + GetTrialStatus LicenseGetTrialStatus + Post LicensePost + PostStartBasic LicensePostStartBasic + PostStartTrial LicensePostStartTrial +} + +// Migration contains the Migration APIs +type Migration struct { + Deprecations MigrationDeprecations +} + +// ML contains the ML APIs +type ML struct { + CloseJob MLCloseJob + DeleteCalendarEvent MLDeleteCalendarEvent + DeleteCalendarJob MLDeleteCalendarJob + DeleteCalendar MLDeleteCalendar + DeleteDataFrameAnalytics MLDeleteDataFrameAnalytics + DeleteDatafeed MLDeleteDatafeed + DeleteExpiredData MLDeleteExpiredData + DeleteFilter MLDeleteFilter + DeleteForecast MLDeleteForecast + DeleteJob MLDeleteJob + DeleteModelSnapshot MLDeleteModelSnapshot + EvaluateDataFrame MLEvaluateDataFrame + FindFileStructure MLFindFileStructure + FlushJob MLFlushJob + Forecast MLForecast + GetBuckets MLGetBuckets + GetCalendarEvents MLGetCalendarEvents + GetCalendars MLGetCalendars + GetCategories MLGetCategories + GetDataFrameAnalytics MLGetDataFrameAnalytics + GetDataFrameAnalyticsStats MLGetDataFrameAnalyticsStats + GetDatafeedStats MLGetDatafeedStats + GetDatafeeds MLGetDatafeeds + GetFilters MLGetFilters + GetInfluencers MLGetInfluencers + GetJobStats MLGetJobStats + GetJobs MLGetJobs + GetModelSnapshots MLGetModelSnapshots + GetOverallBuckets MLGetOverallBuckets + GetRecords MLGetRecords + Info MLInfo + OpenJob MLOpenJob + PostCalendarEvents MLPostCalendarEvents + PostData MLPostData + PreviewDatafeed MLPreviewDatafeed + PutCalendarJob MLPutCalendarJob + PutCalendar MLPutCalendar + PutDataFrameAnalytics MLPutDataFrameAnalytics + PutDatafeed MLPutDatafeed + PutFilter MLPutFilter + PutJob MLPutJob + RevertModelSnapshot MLRevertModelSnapshot + SetUpgradeMode MLSetUpgradeMode + StartDataFrameAnalytics MLStartDataFrameAnalytics + StartDatafeed MLStartDatafeed + StopDataFrameAnalytics MLStopDataFrameAnalytics + StopDatafeed MLStopDatafeed + UpdateDatafeed MLUpdateDatafeed + UpdateFilter MLUpdateFilter + UpdateJob MLUpdateJob + UpdateModelSnapshot MLUpdateModelSnapshot + ValidateDetector MLValidateDetector + Validate MLValidate +} + +// Monitoring contains the Monitoring APIs +type Monitoring struct { + Bulk MonitoringBulk +} + +// Rollup contains the Rollup APIs +type Rollup struct { + DeleteJob RollupDeleteJob + GetJobs RollupGetJobs + GetCaps RollupGetRollupCaps + GetIndexCaps RollupGetRollupIndexCaps + PutJob RollupPutJob + Search RollupRollupSearch + StartJob RollupStartJob + StopJob RollupStopJob +} + +// Security contains the Security APIs +type Security struct { + Authenticate SecurityAuthenticate + ChangePassword SecurityChangePassword + ClearCachedRealms SecurityClearCachedRealms + ClearCachedRoles SecurityClearCachedRoles + CreateAPIKey SecurityCreateAPIKey + DeletePrivileges SecurityDeletePrivileges + DeleteRoleMapping SecurityDeleteRoleMapping + DeleteRole SecurityDeleteRole + DeleteUser SecurityDeleteUser + DisableUser SecurityDisableUser + EnableUser SecurityEnableUser + GetAPIKey SecurityGetAPIKey + GetBuiltinPrivileges SecurityGetBuiltinPrivileges + GetPrivileges SecurityGetPrivileges + GetRoleMapping SecurityGetRoleMapping + GetRole SecurityGetRole + GetToken SecurityGetToken + GetUserPrivileges SecurityGetUserPrivileges + GetUser SecurityGetUser + HasPrivileges SecurityHasPrivileges + InvalidateAPIKey SecurityInvalidateAPIKey + InvalidateToken SecurityInvalidateToken + PutPrivileges SecurityPutPrivileges + PutRoleMapping SecurityPutRoleMapping + PutRole SecurityPutRole + PutUser SecurityPutUser +} + +// SQL contains the SQL APIs +type SQL struct { + ClearCursor SQLClearCursor + Query SQLQuery + Translate SQLTranslate +} + +// SSL contains the SSL APIs +type SSL struct { + Certificates SSLCertificates +} + +// Watcher contains the Watcher APIs +type Watcher struct { + AckWatch WatcherAckWatch + ActivateWatch WatcherActivateWatch + DeactivateWatch WatcherDeactivateWatch + DeleteWatch WatcherDeleteWatch + ExecuteWatch WatcherExecuteWatch + GetWatch WatcherGetWatch + PutWatch WatcherPutWatch + Start WatcherStart + Stats WatcherStats + Stop WatcherStop +} + +// XPack contains the XPack APIs +type XPack struct { + Info XPackInfo + Usage XPackUsage +} + // New creates new API // func New(t Transport) *API { return &API{ - Bulk: newBulkFunc(t), - ClearScroll: newClearScrollFunc(t), - Count: newCountFunc(t), - Create: newCreateFunc(t), - Delete: newDeleteFunc(t), - DeleteByQuery: newDeleteByQueryFunc(t), - DeleteByQueryRethrottle: newDeleteByQueryRethrottleFunc(t), - DeleteScript: newDeleteScriptFunc(t), - Exists: newExistsFunc(t), - ExistsSource: newExistsSourceFunc(t), - Explain: newExplainFunc(t), - FieldCaps: newFieldCapsFunc(t), - Get: newGetFunc(t), - GetScript: newGetScriptFunc(t), - GetSource: newGetSourceFunc(t), - Index: newIndexFunc(t), - Info: newInfoFunc(t), - Mget: newMgetFunc(t), - Msearch: newMsearchFunc(t), - MsearchTemplate: newMsearchTemplateFunc(t), - Mtermvectors: newMtermvectorsFunc(t), - Ping: newPingFunc(t), - PutScript: newPutScriptFunc(t), - RankEval: newRankEvalFunc(t), - Reindex: newReindexFunc(t), - ReindexRethrottle: newReindexRethrottleFunc(t), - RenderSearchTemplate: newRenderSearchTemplateFunc(t), - ScriptsPainlessExecute: newScriptsPainlessExecuteFunc(t), - Scroll: newScrollFunc(t), - Search: newSearchFunc(t), - SearchShards: newSearchShardsFunc(t), - SearchTemplate: newSearchTemplateFunc(t), - Termvectors: newTermvectorsFunc(t), - Update: newUpdateFunc(t), - UpdateByQuery: newUpdateByQueryFunc(t), - UpdateByQueryRethrottle: newUpdateByQueryRethrottleFunc(t), + Bulk: newBulkFunc(t), + ClearScroll: newClearScrollFunc(t), + Count: newCountFunc(t), + Create: newCreateFunc(t), + DataFrameDeleteDataFrameTransform: newDataFrameDeleteDataFrameTransformFunc(t), + DataFrameGetDataFrameTransform: newDataFrameGetDataFrameTransformFunc(t), + DataFrameGetDataFrameTransformStats: newDataFrameGetDataFrameTransformStatsFunc(t), + DataFramePreviewDataFrameTransform: newDataFramePreviewDataFrameTransformFunc(t), + DataFramePutDataFrameTransform: newDataFramePutDataFrameTransformFunc(t), + DataFrameStartDataFrameTransform: newDataFrameStartDataFrameTransformFunc(t), + DataFrameStopDataFrameTransform: newDataFrameStopDataFrameTransformFunc(t), + DeleteByQuery: newDeleteByQueryFunc(t), + DeleteByQueryRethrottle: newDeleteByQueryRethrottleFunc(t), + Delete: newDeleteFunc(t), + DeleteScript: newDeleteScriptFunc(t), + Exists: newExistsFunc(t), + ExistsSource: newExistsSourceFunc(t), + Explain: newExplainFunc(t), + FieldCaps: newFieldCapsFunc(t), + Get: newGetFunc(t), + GetScript: newGetScriptFunc(t), + GetSource: newGetSourceFunc(t), + GraphExplore: newGraphExploreFunc(t), + Index: newIndexFunc(t), + Info: newInfoFunc(t), + Mget: newMgetFunc(t), + Msearch: newMsearchFunc(t), + MsearchTemplate: newMsearchTemplateFunc(t), + Mtermvectors: newMtermvectorsFunc(t), + Ping: newPingFunc(t), + PutScript: newPutScriptFunc(t), + RankEval: newRankEvalFunc(t), + Reindex: newReindexFunc(t), + ReindexRethrottle: newReindexRethrottleFunc(t), + RenderSearchTemplate: newRenderSearchTemplateFunc(t), + ScriptsPainlessExecute: newScriptsPainlessExecuteFunc(t), + Scroll: newScrollFunc(t), + Search: newSearchFunc(t), + SearchShards: newSearchShardsFunc(t), + SearchTemplate: newSearchTemplateFunc(t), + Termvectors: newTermvectorsFunc(t), + UpdateByQuery: newUpdateByQueryFunc(t), + UpdateByQueryRethrottle: newUpdateByQueryRethrottleFunc(t), + Update: newUpdateFunc(t), Cat: &Cat{ Aliases: newCatAliasesFunc(t), Allocation: newCatAllocationFunc(t), @@ -246,43 +458,46 @@ func New(t Transport) *API { Stats: newClusterStatsFunc(t), }, Indices: &Indices{ - Analyze: newIndicesAnalyzeFunc(t), - ClearCache: newIndicesClearCacheFunc(t), - Close: newIndicesCloseFunc(t), - Create: newIndicesCreateFunc(t), - Delete: newIndicesDeleteFunc(t), - DeleteAlias: newIndicesDeleteAliasFunc(t), - DeleteTemplate: newIndicesDeleteTemplateFunc(t), - Exists: newIndicesExistsFunc(t), - ExistsAlias: newIndicesExistsAliasFunc(t), - ExistsTemplate: newIndicesExistsTemplateFunc(t), - ExistsType: newIndicesExistsTypeFunc(t), - Flush: newIndicesFlushFunc(t), - FlushSynced: newIndicesFlushSyncedFunc(t), - Forcemerge: newIndicesForcemergeFunc(t), - Get: newIndicesGetFunc(t), - GetAlias: newIndicesGetAliasFunc(t), - GetFieldMapping: newIndicesGetFieldMappingFunc(t), - GetMapping: newIndicesGetMappingFunc(t), - GetSettings: newIndicesGetSettingsFunc(t), - GetTemplate: newIndicesGetTemplateFunc(t), - GetUpgrade: newIndicesGetUpgradeFunc(t), - Open: newIndicesOpenFunc(t), - PutAlias: newIndicesPutAliasFunc(t), - PutMapping: newIndicesPutMappingFunc(t), - PutSettings: newIndicesPutSettingsFunc(t), - PutTemplate: newIndicesPutTemplateFunc(t), - Recovery: newIndicesRecoveryFunc(t), - Refresh: newIndicesRefreshFunc(t), - Rollover: newIndicesRolloverFunc(t), - Segments: newIndicesSegmentsFunc(t), - ShardStores: newIndicesShardStoresFunc(t), - Shrink: newIndicesShrinkFunc(t), - Split: newIndicesSplitFunc(t), - Stats: newIndicesStatsFunc(t), - UpdateAliases: newIndicesUpdateAliasesFunc(t), - Upgrade: newIndicesUpgradeFunc(t), - ValidateQuery: newIndicesValidateQueryFunc(t), + Analyze: newIndicesAnalyzeFunc(t), + ClearCache: newIndicesClearCacheFunc(t), + Close: newIndicesCloseFunc(t), + Create: newIndicesCreateFunc(t), + DeleteAlias: newIndicesDeleteAliasFunc(t), + Delete: newIndicesDeleteFunc(t), + DeleteTemplate: newIndicesDeleteTemplateFunc(t), + ExistsAlias: newIndicesExistsAliasFunc(t), + ExistsDocumentType: newIndicesExistsDocumentTypeFunc(t), + Exists: newIndicesExistsFunc(t), + ExistsTemplate: newIndicesExistsTemplateFunc(t), + Flush: newIndicesFlushFunc(t), + FlushSynced: newIndicesFlushSyncedFunc(t), + Forcemerge: newIndicesForcemergeFunc(t), + Freeze: newIndicesFreezeFunc(t), + GetAlias: newIndicesGetAliasFunc(t), + GetFieldMapping: newIndicesGetFieldMappingFunc(t), + GetMapping: newIndicesGetMappingFunc(t), + Get: newIndicesGetFunc(t), + GetSettings: newIndicesGetSettingsFunc(t), + GetTemplate: newIndicesGetTemplateFunc(t), + GetUpgrade: newIndicesGetUpgradeFunc(t), + Open: newIndicesOpenFunc(t), + PutAlias: newIndicesPutAliasFunc(t), + PutMapping: newIndicesPutMappingFunc(t), + PutSettings: newIndicesPutSettingsFunc(t), + PutTemplate: newIndicesPutTemplateFunc(t), + Recovery: newIndicesRecoveryFunc(t), + Refresh: newIndicesRefreshFunc(t), + ReloadSearchAnalyzers: newIndicesReloadSearchAnalyzersFunc(t), + Rollover: newIndicesRolloverFunc(t), + Segments: newIndicesSegmentsFunc(t), + ShardStores: newIndicesShardStoresFunc(t), + Shrink: newIndicesShrinkFunc(t), + Split: newIndicesSplitFunc(t), + Stats: newIndicesStatsFunc(t), + Unfreeze: newIndicesUnfreezeFunc(t), + UpdateAliases: newIndicesUpdateAliasesFunc(t), + Upgrade: newIndicesUpgradeFunc(t), + ValidateQuery: newIndicesValidateQueryFunc(t), }, Ingest: &Ingest{ DeletePipeline: newIngestDeletePipelineFunc(t), @@ -300,12 +515,12 @@ func New(t Transport) *API { }, Remote: &Remote{}, Snapshot: &Snapshot{ - Create: newSnapshotCreateFunc(t), CreateRepository: newSnapshotCreateRepositoryFunc(t), - Delete: newSnapshotDeleteFunc(t), + Create: newSnapshotCreateFunc(t), DeleteRepository: newSnapshotDeleteRepositoryFunc(t), - Get: newSnapshotGetFunc(t), + Delete: newSnapshotDeleteFunc(t), GetRepository: newSnapshotGetRepositoryFunc(t), + Get: newSnapshotGetFunc(t), Restore: newSnapshotRestoreFunc(t), Status: newSnapshotStatusFunc(t), VerifyRepository: newSnapshotVerifyRepositoryFunc(t), @@ -315,5 +530,162 @@ func New(t Transport) *API { Get: newTasksGetFunc(t), List: newTasksListFunc(t), }, + CCR: &CCR{ + DeleteAutoFollowPattern: newCCRDeleteAutoFollowPatternFunc(t), + FollowInfo: newCCRFollowInfoFunc(t), + Follow: newCCRFollowFunc(t), + FollowStats: newCCRFollowStatsFunc(t), + ForgetFollower: newCCRForgetFollowerFunc(t), + GetAutoFollowPattern: newCCRGetAutoFollowPatternFunc(t), + PauseFollow: newCCRPauseFollowFunc(t), + PutAutoFollowPattern: newCCRPutAutoFollowPatternFunc(t), + ResumeFollow: newCCRResumeFollowFunc(t), + Stats: newCCRStatsFunc(t), + Unfollow: newCCRUnfollowFunc(t), + }, + ILM: &ILM{ + DeleteLifecycle: newILMDeleteLifecycleFunc(t), + ExplainLifecycle: newILMExplainLifecycleFunc(t), + GetLifecycle: newILMGetLifecycleFunc(t), + GetStatus: newILMGetStatusFunc(t), + MoveToStep: newILMMoveToStepFunc(t), + PutLifecycle: newILMPutLifecycleFunc(t), + RemovePolicy: newILMRemovePolicyFunc(t), + Retry: newILMRetryFunc(t), + Start: newILMStartFunc(t), + Stop: newILMStopFunc(t), + }, + License: &License{ + Delete: newLicenseDeleteFunc(t), + GetBasicStatus: newLicenseGetBasicStatusFunc(t), + Get: newLicenseGetFunc(t), + GetTrialStatus: newLicenseGetTrialStatusFunc(t), + Post: newLicensePostFunc(t), + PostStartBasic: newLicensePostStartBasicFunc(t), + PostStartTrial: newLicensePostStartTrialFunc(t), + }, + Migration: &Migration{ + Deprecations: newMigrationDeprecationsFunc(t), + }, + ML: &ML{ + CloseJob: newMLCloseJobFunc(t), + DeleteCalendarEvent: newMLDeleteCalendarEventFunc(t), + DeleteCalendarJob: newMLDeleteCalendarJobFunc(t), + DeleteCalendar: newMLDeleteCalendarFunc(t), + DeleteDataFrameAnalytics: newMLDeleteDataFrameAnalyticsFunc(t), + DeleteDatafeed: newMLDeleteDatafeedFunc(t), + DeleteExpiredData: newMLDeleteExpiredDataFunc(t), + DeleteFilter: newMLDeleteFilterFunc(t), + DeleteForecast: newMLDeleteForecastFunc(t), + DeleteJob: newMLDeleteJobFunc(t), + DeleteModelSnapshot: newMLDeleteModelSnapshotFunc(t), + EvaluateDataFrame: newMLEvaluateDataFrameFunc(t), + FindFileStructure: newMLFindFileStructureFunc(t), + FlushJob: newMLFlushJobFunc(t), + Forecast: newMLForecastFunc(t), + GetBuckets: newMLGetBucketsFunc(t), + GetCalendarEvents: newMLGetCalendarEventsFunc(t), + GetCalendars: newMLGetCalendarsFunc(t), + GetCategories: newMLGetCategoriesFunc(t), + GetDataFrameAnalytics: newMLGetDataFrameAnalyticsFunc(t), + GetDataFrameAnalyticsStats: newMLGetDataFrameAnalyticsStatsFunc(t), + GetDatafeedStats: newMLGetDatafeedStatsFunc(t), + GetDatafeeds: newMLGetDatafeedsFunc(t), + GetFilters: newMLGetFiltersFunc(t), + GetInfluencers: newMLGetInfluencersFunc(t), + GetJobStats: newMLGetJobStatsFunc(t), + GetJobs: newMLGetJobsFunc(t), + GetModelSnapshots: newMLGetModelSnapshotsFunc(t), + GetOverallBuckets: newMLGetOverallBucketsFunc(t), + GetRecords: newMLGetRecordsFunc(t), + Info: newMLInfoFunc(t), + OpenJob: newMLOpenJobFunc(t), + PostCalendarEvents: newMLPostCalendarEventsFunc(t), + PostData: newMLPostDataFunc(t), + PreviewDatafeed: newMLPreviewDatafeedFunc(t), + PutCalendarJob: newMLPutCalendarJobFunc(t), + PutCalendar: newMLPutCalendarFunc(t), + PutDataFrameAnalytics: newMLPutDataFrameAnalyticsFunc(t), + PutDatafeed: newMLPutDatafeedFunc(t), + PutFilter: newMLPutFilterFunc(t), + PutJob: newMLPutJobFunc(t), + RevertModelSnapshot: newMLRevertModelSnapshotFunc(t), + SetUpgradeMode: newMLSetUpgradeModeFunc(t), + StartDataFrameAnalytics: newMLStartDataFrameAnalyticsFunc(t), + StartDatafeed: newMLStartDatafeedFunc(t), + StopDataFrameAnalytics: newMLStopDataFrameAnalyticsFunc(t), + StopDatafeed: newMLStopDatafeedFunc(t), + UpdateDatafeed: newMLUpdateDatafeedFunc(t), + UpdateFilter: newMLUpdateFilterFunc(t), + UpdateJob: newMLUpdateJobFunc(t), + UpdateModelSnapshot: newMLUpdateModelSnapshotFunc(t), + ValidateDetector: newMLValidateDetectorFunc(t), + Validate: newMLValidateFunc(t), + }, + Monitoring: &Monitoring{ + Bulk: newMonitoringBulkFunc(t), + }, + Rollup: &Rollup{ + DeleteJob: newRollupDeleteJobFunc(t), + GetJobs: newRollupGetJobsFunc(t), + GetCaps: newRollupGetRollupCapsFunc(t), + GetIndexCaps: newRollupGetRollupIndexCapsFunc(t), + PutJob: newRollupPutJobFunc(t), + Search: newRollupRollupSearchFunc(t), + StartJob: newRollupStartJobFunc(t), + StopJob: newRollupStopJobFunc(t), + }, + Security: &Security{ + Authenticate: newSecurityAuthenticateFunc(t), + ChangePassword: newSecurityChangePasswordFunc(t), + ClearCachedRealms: newSecurityClearCachedRealmsFunc(t), + ClearCachedRoles: newSecurityClearCachedRolesFunc(t), + CreateAPIKey: newSecurityCreateAPIKeyFunc(t), + DeletePrivileges: newSecurityDeletePrivilegesFunc(t), + DeleteRoleMapping: newSecurityDeleteRoleMappingFunc(t), + DeleteRole: newSecurityDeleteRoleFunc(t), + DeleteUser: newSecurityDeleteUserFunc(t), + DisableUser: newSecurityDisableUserFunc(t), + EnableUser: newSecurityEnableUserFunc(t), + GetAPIKey: newSecurityGetAPIKeyFunc(t), + GetBuiltinPrivileges: newSecurityGetBuiltinPrivilegesFunc(t), + GetPrivileges: newSecurityGetPrivilegesFunc(t), + GetRoleMapping: newSecurityGetRoleMappingFunc(t), + GetRole: newSecurityGetRoleFunc(t), + GetToken: newSecurityGetTokenFunc(t), + GetUserPrivileges: newSecurityGetUserPrivilegesFunc(t), + GetUser: newSecurityGetUserFunc(t), + HasPrivileges: newSecurityHasPrivilegesFunc(t), + InvalidateAPIKey: newSecurityInvalidateAPIKeyFunc(t), + InvalidateToken: newSecurityInvalidateTokenFunc(t), + PutPrivileges: newSecurityPutPrivilegesFunc(t), + PutRoleMapping: newSecurityPutRoleMappingFunc(t), + PutRole: newSecurityPutRoleFunc(t), + PutUser: newSecurityPutUserFunc(t), + }, + SQL: &SQL{ + ClearCursor: newSQLClearCursorFunc(t), + Query: newSQLQueryFunc(t), + Translate: newSQLTranslateFunc(t), + }, + SSL: &SSL{ + Certificates: newSSLCertificatesFunc(t), + }, + Watcher: &Watcher{ + AckWatch: newWatcherAckWatchFunc(t), + ActivateWatch: newWatcherActivateWatchFunc(t), + DeactivateWatch: newWatcherDeactivateWatchFunc(t), + DeleteWatch: newWatcherDeleteWatchFunc(t), + ExecuteWatch: newWatcherExecuteWatchFunc(t), + GetWatch: newWatcherGetWatchFunc(t), + PutWatch: newWatcherPutWatchFunc(t), + Start: newWatcherStartFunc(t), + Stats: newWatcherStatsFunc(t), + Stop: newWatcherStopFunc(t), + }, + XPack: &XPack{ + Info: newXPackInfoFunc(t), + Usage: newXPackUsageFunc(t), + }, } } From b125be332cd02e1235dc209482c9a41f2c2342ad Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 5 Jul 2019 15:39:09 +0200 Subject: [PATCH 073/355] CI: Update the Elasticsearch version in matrix to 7.3-SNAPSHOT --- .jenkins/test-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jenkins/test-matrix.yml b/.jenkins/test-matrix.yml index 63b3012d18..7f62207640 100755 --- a/.jenkins/test-matrix.yml +++ b/.jenkins/test-matrix.yml @@ -1,7 +1,7 @@ --- ELASTICSEARCH_VERSION: -- 7.0.0-SNAPSHOT +- 7.3-SNAPSHOT GO_VERSION: - 1-alpine From 73eaf2263f800a2b7ee5140ad4f1e93f6131d309 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 5 Jul 2019 15:39:42 +0200 Subject: [PATCH 074/355] CI: Update the Elasticsearch version in test runners to 7.3-SNAPSHOT --- .jenkins/run-tests | 8 ++++---- .jenkins/tests-xpack.sh | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.jenkins/run-tests b/.jenkins/run-tests index d474524ddd..abd0b4a194 100755 --- a/.jenkins/run-tests +++ b/.jenkins/run-tests @@ -12,19 +12,19 @@ if [[ $TEST_SUITE != "core" && $TEST_SUITE != "xpack" ]]; then exit 1 fi -# Run X-Pack tests only on the "master" and "xpack" branches, and skip Core tests on the "xpack" branch -if [[ (($branch_specifier != "refs/heads/xpack" && $branch_specifier != "refs/heads/master") && $TEST_SUITE == "xpack") || ($branch_specifier == "refs/heads/xpack" && $TEST_SUITE == "core") ]]; then +# Skip Core tests on the "xpack" branch +if [[ ($branch_specifier == "refs/heads/xpack" && $TEST_SUITE == "core") ]]; then echo -e "\033[33;1mSkipping [$TEST_SUITE] tests on the [$branch_specifier] branch.\033[0m" exit 0 fi if [[ $TEST_SUITE == "core" ]]; then - elasticsearch_image=elasticsearch-oss:8.0.0-SNAPSHOT + elasticsearch_image=elasticsearch-oss:7.3-SNAPSHOT elasticsearch_url=http://es1:9200 fi if [[ $TEST_SUITE == "xpack" ]]; then - elasticsearch_image=elasticsearch:8.0.0-SNAPSHOT + elasticsearch_image=elasticsearch:7.3-SNAPSHOT elasticsearch_url=https://elastic:elastic@es1:9200 fi diff --git a/.jenkins/tests-xpack.sh b/.jenkins/tests-xpack.sh index 64ba4e8302..87e69934a2 100644 --- a/.jenkins/tests-xpack.sh +++ b/.jenkins/tests-xpack.sh @@ -31,7 +31,7 @@ time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch / status1=$? docker container rm --force --volumes es1 > /dev/null 2>&1 -make cluster-clean cluster version=elasticsearch:8.0.0-SNAPSHOT detached=true +make cluster-clean cluster version=elasticsearch:7.3-SNAPSHOT detached=true echo -e "\033[1m>>>>> Running tests: XPACK ML >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" @@ -39,7 +39,7 @@ time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch / status2=$? docker container rm --force --volumes es1 > /dev/null 2>&1 -make cluster-clean cluster version=elasticsearch:8.0.0-SNAPSHOT detached=true +make cluster-clean cluster version=elasticsearch:7.3-SNAPSHOT detached=true echo -e "\033[1m>>>>> Running tests: XPACK ML CRUD >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" From c246475eabe4f95d93bcad5e42ef3ef8e53a1bf3 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 5 Jul 2019 10:56:28 +0200 Subject: [PATCH 075/355] Makefile: Add the "backport" target Example: $ make backport branches=5.x commits=fc0c996,459ba74,0e2ee8d,a975430,2ba64f0 (cherry picked from commit 350836efd880aab6e9c62c3e77385c4fceea4471) (cherry picked from commit 684bf02f66e0a23301da91546031d9f0f1c613b0) --- Makefile | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3494c47f16..52b3f326c4 100755 --- a/Makefile +++ b/Makefile @@ -147,6 +147,39 @@ apidiff: ## Display API incompabilities fi; \ } +backport: ## Backport one or more commits from master into version branches +ifeq ($(origin commits), undefined) + @echo "Missing commit(s), exiting..." + @exit 2 +endif +ifndef branches + $(eval branches_list = '7.x' '6.x' '5.x') +else + $(eval branches_list = $(shell echo $(branches) | tr ',' ' ') ) +endif + $(eval commits_list = $(shell echo $(commits) | tr ',' ' ')) + @echo "\033[2m→ Backporting commits [$(commits)]\033[0m" + @{ \ + set -e -o pipefail; \ + for commit in $(commits_list); do \ + git show --pretty='%h | %s' --no-patch $$commit; \ + done; \ + echo ""; \ + for branch in $(branches_list); do \ + echo "\033[2m→ $$branch\033[0m"; \ + git checkout $$branch; \ + for commit in $(commits_list); do \ + git cherry-pick -x $$commit; \ + done; \ + git status --short --branch; \ + echo ""; \ + done; \ + echo "\033[2m→ Push updates to Github:\033[0m"; \ + for branch in $(branches_list); do \ + echo "git push --verbose origin $$branch"; \ + done; \ + } + godoc: ## Display documentation for the package @echo "\033[2m→ Generating documentation...\033[0m" @echo "open http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/\n" @@ -313,4 +346,4 @@ help: ## Display help #------------- -------------- .DEFAULT_GOAL := help -.PHONY: help apidiff cluster cluster-clean cluster-update coverage docker examples gen-api gen-tests godoc lint test test-api test-bench test-integ test-unit +.PHONY: help apidiff backport cluster cluster-clean cluster-update coverage docker examples gen-api gen-tests godoc lint test test-api test-bench test-integ test-unit From 20d5638635c3fb6fbe61d237d2f1e617561b1c4e Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 7 Jul 2019 09:37:17 +0200 Subject: [PATCH 076/355] Makefile: Fix the "apidiff" target (cherry picked from commit 253d59f34398ba9cb7852f6bd04d27deeacf4bb9) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 52b3f326c4..c5e4b53b38 100755 --- a/Makefile +++ b/Makefile @@ -139,7 +139,7 @@ apidiff: ## Display API incompabilities set -e ; \ output=$$(apidiff tmp/apidiff-OLD/esapi tmp/apidiff-NEW/esapi); \ echo "\n$$output\n"; \ - if echo $$output | grep -e 'incompatible' -; then \ + if echo $$output | grep -i -e 'incompatible' - > /dev/null 2>&1; then \ echo "\n\033[31;1mFAILURE\033[0m\n"; \ false; \ else \ From 57d992a043a26c48267bfb37fa37959173e16f9a Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 7 Jul 2019 14:44:32 +0200 Subject: [PATCH 077/355] Generator: Tests: Update the list of skipped tests (cherry picked from commit 4e8def0fff19837767e209213905ab87bd6494cb) --- internal/cmd/generate/commands/gentests/skips.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/cmd/generate/commands/gentests/skips.go b/internal/cmd/generate/commands/gentests/skips.go index 7d04066b5c..6da980099e 100755 --- a/internal/cmd/generate/commands/gentests/skips.go +++ b/internal/cmd/generate/commands/gentests/skips.go @@ -151,6 +151,10 @@ users/10_basic.yml: security/authz/13_index_datemath.yml: - Test indexing documents with datemath, when permitted +# Possibly a cluster health color mismatch... +security/authz/14_cat_indices.yml: + - Test empty request while single authorized index + # Test looks for "testnode.crt", but "ca.crt" is returned first ssl/10_basic.yml: - Test get SSL certificates From bd217d2fd1cfddeb321a85d92eef6434d74ba469 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 7 Jul 2019 15:08:24 +0200 Subject: [PATCH 078/355] Generator: Utils: Improve the NameToGo() method and add the APIToGo() method * In order to properly handle the "id" parameter across the APIs, add the `specialMappingsForID` mapping, so an API can re-define the naming, eg. `ScriptID` for the script-related APIs. * Extract the translation of the API name in the specification (`cluster.health`) to the corresponding Go naming (`Cluster.Health`) into a utility method. (cherry picked from commit 41531b59d509d94cad030eb4134735b6c37a768d) --- internal/cmd/generate/utils/naming.go | 54 ++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/internal/cmd/generate/utils/naming.go b/internal/cmd/generate/utils/naming.go index 1a4c767220..c39642a411 100755 --- a/internal/cmd/generate/utils/naming.go +++ b/internal/cmd/generate/utils/naming.go @@ -16,9 +16,25 @@ var ( } ) +// APIToGo returns the Go version of API call, eg. cluster.health => ClusterHealth +// +func APIToGo(s string) string { + ep := strings.Split(s, ".") + ns := make([]string, len(ep)) + for _, v := range ep { + m := strings.Split(v, "_") + mn := make([]string, len(m)) + for _, vv := range m { + mn = append(mn, NameToGo(vv)) + } + ns = append(ns, strings.Join(mn, "")) + } + return strings.Join(ns, "") +} + // NameToGo returns a Go version of name, eg. node_id => NodeID. // -func NameToGo(s string) string { +func NameToGo(s string, api ...string) string { exceptions := map[string]string{ "index": "Index", "id": "DocumentID", @@ -38,6 +54,42 @@ func NameToGo(s string) string { "xpack": "XPack", } + specialMappingsForID := map[string]string{ + "DeleteScript": "ScriptID", + "GetScript": "ScriptID", + "PutScript": "ScriptID", + "IngestDeletePipeline": "PipelineID", + "IngestGetPipeline": "PipelineID", + "IngestPutPipeline": "PipelineID", + "IngestSimulate": "PipelineID", + "RenderSearchTemplate": "TemplateID", + + "MLDeleteDataFrameAnalytics": "ID", + "MLGetDataFrameAnalytics": "ID", + "MLGetDataFrameAnalyticsStats": "ID", + "MLPutDataFrameAnalytics": "ID", + "MLStartDataFrameAnalytics": "ID", + "MLStopDataFrameAnalytics": "ID", + + "RollupDeleteJob": "JobID", + "RollupGetJobs": "JobID", + "RollupGetRollupCaps": "Index", + "RollupPutJob": "JobID", + "RollupStartJob": "JobID", + "RollupStopJob": "JobID", + + "SecurityGetAPIKey": "ID", + + "WatcherDeleteWatch": "WatchID", + "WatcherExecuteWatch": "WatchID", + "WatcherGetWatch": "WatchID", + "WatcherPutWatch": "WatchID", + } + + if s == "id" && api != nil && len(api) > 0 && api[0] != "" && specialMappingsForID[api[0]] != "" { + return specialMappingsForID[api[0]] + } + if value, ok := exceptions[s]; ok { return value } From 99f6ec3c21da75aedd1d7bfb13dae9e273b05a63 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 7 Jul 2019 15:12:15 +0200 Subject: [PATCH 079/355] Generator: API: Add API names to GoName() calls and fix the HumanMethodWithNamespace() method * Add the API names to the GoName() calls, leveraging the NameToGo() method improvements. * Fix the HumanMethodWithNamespace() method to return correctly formatted string, with no extra whitespace and proper acronym handling. * Use the new utils.APIToGo() method in MethodWithNamespace(). (cherry picked from commit 466943693fe342e9086e12381c2605f98a28895c) --- .../generate/commands/gensource/generator.go | 1 - .../cmd/generate/commands/gensource/model.go | 43 ++++++++----------- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/internal/cmd/generate/commands/gensource/generator.go b/internal/cmd/generate/commands/gensource/generator.go index 0874eac3ea..98993aee47 100755 --- a/internal/cmd/generate/commands/gensource/generator.go +++ b/internal/cmd/generate/commands/gensource/generator.go @@ -172,7 +172,6 @@ func (g *Generator) genRequestStruct() { // ` + g.Endpoint.MethodWithNamespace() + `Request configures the ` + g.Endpoint.HumanMethodWithNamespace() + ` API request. // type ` + g.Endpoint.MethodWithNamespace() + `Request struct {`) - specialFields := []string{"index", "type", "id"} for _, n := range specialFields { if param, ok := g.Endpoint.URL.Parts[n]; ok { diff --git a/internal/cmd/generate/commands/gensource/model.go b/internal/cmd/generate/commands/gensource/model.go index 4de236ae1f..53bc5d3294 100755 --- a/internal/cmd/generate/commands/gensource/model.go +++ b/internal/cmd/generate/commands/gensource/model.go @@ -7,6 +7,7 @@ import ( "os" "sort" "strings" + "unicode" "gopkg.in/yaml.v2" @@ -214,34 +215,28 @@ func (e *Endpoint) MethodName() string { // MethodWithNamespace returns the API endpoint method name with namespace. // func (e *Endpoint) MethodWithNamespace() string { - ep := strings.Split(e.Name, ".") - ns := make([]string, len(ep)) - for _, v := range ep { - m := strings.Split(v, "_") - mn := make([]string, len(m)) - for _, vv := range m { - // mn = append(mn, strings.Title(vv)) - mn = append(mn, utils.NameToGo(vv)) - } - ns = append(ns, strings.Join(mn, "")) - } - return strings.Join(ns, "") + return utils.APIToGo(e.Name) } // HumanMethodWithNamespace returns the API endpoint method name in humanized form. // func (e *Endpoint) HumanMethodWithNamespace() string { - ep := strings.Split(e.Name, ".") - ns := make([]string, len(ep)) - for _, v := range ep { - m := strings.Split(v, "_") - mn := make([]string, len(m)) - for _, vv := range m { - mn = append(mn, strings.Title(vv)) + var ( + src = e.MethodWithNamespace() + out string + ) + for i, l := range src { + if unicode.IsUpper(l) && i > 0 { + if i+2 <= len(src) && unicode.IsUpper([]rune(src[i+1 : i+2])[0]) { + out += string(l) + } else { + out += " " + string(l) + } + } else { + out += string(l) } - ns = append(ns, strings.Join(mn, " ")) } - return strings.TrimSpace(strings.Join(ns, "")) + return out } // RequiredArguments return the list of required method arguments. @@ -346,7 +341,7 @@ func (p *Part) GoName() string { case p.Name == "context": return "ScriptContext" default: - return utils.NameToGo(p.Name) + return utils.NameToGo(p.Name, p.Endpoint.MethodWithNamespace()) } } @@ -365,7 +360,7 @@ func (p *Param) GoName() string { case p.Name == "q": return "Query" default: - return utils.NameToGo(p.Name) + return utils.NameToGo(p.Name, p.Endpoint.MethodWithNamespace()) } } @@ -383,7 +378,7 @@ func (p *Param) GoType(comment ...bool) string { // GoName returns a Go name for method argument. // func (p *MethodArgument) GoName() string { - return utils.NameToGo(p.Name) + return utils.NameToGo(p.Name, p.Endpoint.MethodWithNamespace()) } // GoType returns a Go type for method argument. From fd765350cd7b0ef5dc8e7f98a5d1c27db9f229ad Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 7 Jul 2019 15:15:14 +0200 Subject: [PATCH 080/355] Generator: API: Add reference to endpoint in RequiredArguments() (cherry picked from commit fba86bc3b2abcf39b681a92da621690d5d75f411) --- internal/cmd/generate/commands/gensource/model.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/cmd/generate/commands/gensource/model.go b/internal/cmd/generate/commands/gensource/model.go index 53bc5d3294..83f007511a 100755 --- a/internal/cmd/generate/commands/gensource/model.go +++ b/internal/cmd/generate/commands/gensource/model.go @@ -273,6 +273,7 @@ func (e *Endpoint) RequiredArguments() []MethodArgument { } if p.Required { args = append(args, MethodArgument{ + Endpoint: e, Name: p.Name, Type: p.Type, Description: p.Description, @@ -282,6 +283,7 @@ func (e *Endpoint) RequiredArguments() []MethodArgument { // Make the 'type' required for selected APIs if p.Name == "type" && (e.Name == "index" || e.Name == "create") { args = append(args, MethodArgument{ + Endpoint: e, Name: p.Name, Type: p.Type, Description: p.Description, @@ -294,6 +296,7 @@ func (e *Endpoint) RequiredArguments() []MethodArgument { // Return the body after prominent arguments if e.Body != nil && e.Body.Required { args = append(args, MethodArgument{ + Endpoint: e, Name: "body", Description: e.Body.Description, }) @@ -306,6 +309,7 @@ func (e *Endpoint) RequiredArguments() []MethodArgument { } if p.Required { args = append(args, MethodArgument{ + Endpoint: e, Name: p.Name, Type: p.Type, Description: p.Description, @@ -321,6 +325,7 @@ func (e *Endpoint) RequiredArguments() []MethodArgument { } if p.Required { args = append(args, MethodArgument{ + Endpoint: e, Name: p.Name, Type: p.Type, Description: p.Description, From 4170343e9da551c5a7ab03a3d7aefba78b5d1043 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 7 Jul 2019 15:16:34 +0200 Subject: [PATCH 081/355] Generator: Tests: Add API name to NameToGo() call in Action.Params() (cherry picked from commit 1f9d90e4e1999273fc702ac76b91bdfa454820ba) --- internal/cmd/generate/commands/gentests/model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cmd/generate/commands/gentests/model.go b/internal/cmd/generate/commands/gentests/model.go index 558f40712a..0308dfb203 100755 --- a/internal/cmd/generate/commands/gentests/model.go +++ b/internal/cmd/generate/commands/gentests/model.go @@ -392,7 +392,7 @@ func (a Action) Params() map[string]interface{} { // TODO: Properly handle ignoring status codes continue default: - kk = utils.NameToGo(k.(string)) + kk = utils.NameToGo(k.(string), utils.APIToGo(a.method)) } switch v.(type) { case bool: From 34e3e402f8cc7fc86855d17fa4732162cf2fe0b8 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 7 Jul 2019 15:52:12 +0200 Subject: [PATCH 082/355] Generator: Tests: Fix the X-Pack test setup (cherry picked from commit bdc4e8bdd46b945a8532e9f4bb2380f41fca9822) --- internal/cmd/generate/commands/gentests/generator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cmd/generate/commands/gentests/generator.go b/internal/cmd/generate/commands/gentests/generator.go index 5d25111ac0..691001d22e 100755 --- a/internal/cmd/generate/commands/gentests/generator.go +++ b/internal/cmd/generate/commands/gentests/generator.go @@ -481,7 +481,7 @@ func (g *Generator) genXPackSetup() { { var r map[string]interface{} - res, _ = es.Rollup.GetJobs(es.Rollup.GetJobs.WithDocumentID("_all")) + res, _ = es.Rollup.GetJobs(es.Rollup.GetJobs.WithJobID("_all")) if res != nil && res.Body != nil { defer res.Body.Close() json.NewDecoder(res.Body).Decode(&r) From 486bf5323a4b4c3d6f5ef3e00b84d8391b7319a4 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 7 Jul 2019 16:36:01 +0200 Subject: [PATCH 083/355] API: Update the APIs for Elasticsearch 7.x (1e367b67175) --- esapi/api._.go | 2 +- esapi/api.cat.pending_tasks.go | 2 +- esapi/api.cat.thread_pool.go | 2 +- esapi/api.cluster.allocation_explain.go | 2 +- esapi/api.cluster.get_settings.go | 2 +- esapi/api.cluster.pending_tasks.go | 2 +- esapi/api.cluster.put_settings.go | 2 +- esapi/api.cluster.remote_info.go | 2 +- esapi/api.delete_script.go | 8 ++++---- esapi/api.get_script.go | 8 ++++---- esapi/api.indices.clear_cache.go | 2 +- esapi/api.indices.delete_alias.go | 2 +- esapi/api.indices.delete_template.go | 2 +- esapi/api.indices.exists_alias.go | 2 +- esapi/api.indices.exists_template.go | 2 +- esapi/api.indices.exists_type.go | 2 +- esapi/api.indices.flush_synced.go | 2 +- esapi/api.indices.get_alias.go | 2 +- esapi/api.indices.get_field_mapping.go | 2 +- esapi/api.indices.get_mapping.go | 2 +- esapi/api.indices.get_settings.go | 2 +- esapi/api.indices.get_template.go | 2 +- esapi/api.indices.get_upgrade.go | 2 +- esapi/api.indices.put_alias.go | 2 +- esapi/api.indices.put_mapping.go | 2 +- esapi/api.indices.put_settings.go | 2 +- esapi/api.indices.put_template.go | 2 +- esapi/api.indices.shard_stores.go | 2 +- esapi/api.indices.update_aliases.go | 2 +- esapi/api.indices.validate_query.go | 2 +- esapi/api.ingest.delete_pipeline.go | 10 +++++----- esapi/api.ingest.get_pipeline.go | 16 +++++++-------- esapi/api.ingest.processor_grok.go | 2 +- esapi/api.ingest.put_pipeline.go | 10 +++++----- esapi/api.ingest.simulate.go | 14 ++++++------- esapi/api.nodes.hot_threads.go | 2 +- esapi/api.nodes.reload_secure_settings.go | 2 +- esapi/api.put_script.go | 8 ++++---- esapi/api.render_search_template.go | 14 ++++++------- esapi/api.snapshot.create_repository.go | 2 +- esapi/api.snapshot.delete_repository.go | 2 +- esapi/api.snapshot.get_repository.go | 2 +- esapi/api.snapshot.verify_repository.go | 2 +- ...pi.xpack.ccr.delete_auto_follow_pattern.go | 2 +- esapi/api.xpack.ccr.follow.go | 2 +- esapi/api.xpack.ccr.follow_info.go | 2 +- esapi/api.xpack.ccr.follow_stats.go | 2 +- esapi/api.xpack.ccr.forget_follower.go | 2 +- .../api.xpack.ccr.get_auto_follow_pattern.go | 2 +- esapi/api.xpack.ccr.pause_follow.go | 2 +- .../api.xpack.ccr.put_auto_follow_pattern.go | 2 +- esapi/api.xpack.ccr.resume_follow.go | 2 +- esapi/api.xpack.ccr.stats.go | 2 +- esapi/api.xpack.ccr.unfollow.go | 2 +- ....data_frame.delete_data_frame_transform.go | 2 +- ...ack.data_frame.get_data_frame_transform.go | 2 +- ...ta_frame.get_data_frame_transform_stats.go | 2 +- ...data_frame.preview_data_frame_transform.go | 2 +- ...ack.data_frame.put_data_frame_transform.go | 2 +- ...k.data_frame.start_data_frame_transform.go | 2 +- ...ck.data_frame.stop_data_frame_transform.go | 2 +- esapi/api.xpack.ilm.delete_lifecycle.go | 2 +- esapi/api.xpack.ilm.explain_lifecycle.go | 2 +- esapi/api.xpack.ilm.get_lifecycle.go | 2 +- esapi/api.xpack.ilm.get_status.go | 2 +- esapi/api.xpack.ilm.move_to_step.go | 2 +- esapi/api.xpack.ilm.put_lifecycle.go | 2 +- esapi/api.xpack.ilm.remove_policy.go | 2 +- esapi/api.xpack.ilm.retry.go | 2 +- esapi/api.xpack.ilm.start.go | 2 +- esapi/api.xpack.ilm.stop.go | 2 +- ...i.xpack.indices.reload_search_analyzers.go | 2 +- esapi/api.xpack.license.get_basic_status.go | 2 +- esapi/api.xpack.license.get_trial_status.go | 2 +- esapi/api.xpack.license.post_start_basic.go | 2 +- esapi/api.xpack.license.post_start_trial.go | 2 +- esapi/api.xpack.ml.close_job.go | 2 +- esapi/api.xpack.ml.delete_calendar.go | 2 +- esapi/api.xpack.ml.delete_calendar_event.go | 2 +- esapi/api.xpack.ml.delete_calendar_job.go | 2 +- ...pi.xpack.ml.delete_data_frame_analytics.go | 12 +++++------ esapi/api.xpack.ml.delete_datafeed.go | 2 +- esapi/api.xpack.ml.delete_expired_data.go | 2 +- esapi/api.xpack.ml.delete_filter.go | 2 +- esapi/api.xpack.ml.delete_forecast.go | 2 +- esapi/api.xpack.ml.delete_job.go | 2 +- esapi/api.xpack.ml.delete_model_snapshot.go | 2 +- esapi/api.xpack.ml.evaluate_data_frame.go | 4 ++-- esapi/api.xpack.ml.find_file_structure.go | 2 +- esapi/api.xpack.ml.flush_job.go | 2 +- esapi/api.xpack.ml.forecast.go | 2 +- esapi/api.xpack.ml.get_buckets.go | 2 +- esapi/api.xpack.ml.get_calendar_events.go | 2 +- esapi/api.xpack.ml.get_calendars.go | 2 +- esapi/api.xpack.ml.get_categories.go | 2 +- .../api.xpack.ml.get_data_frame_analytics.go | 18 ++++++++--------- ...xpack.ml.get_data_frame_analytics_stats.go | 18 ++++++++--------- esapi/api.xpack.ml.get_datafeed_stats.go | 2 +- esapi/api.xpack.ml.get_datafeeds.go | 2 +- esapi/api.xpack.ml.get_filters.go | 2 +- esapi/api.xpack.ml.get_influencers.go | 2 +- esapi/api.xpack.ml.get_job_stats.go | 2 +- esapi/api.xpack.ml.get_jobs.go | 2 +- esapi/api.xpack.ml.get_model_snapshots.go | 2 +- esapi/api.xpack.ml.get_overall_buckets.go | 2 +- esapi/api.xpack.ml.get_records.go | 2 +- esapi/api.xpack.ml.info.go | 2 +- esapi/api.xpack.ml.open_job.go | 2 +- esapi/api.xpack.ml.post_calendar_events.go | 2 +- esapi/api.xpack.ml.post_data.go | 2 +- esapi/api.xpack.ml.preview_datafeed.go | 2 +- esapi/api.xpack.ml.put_calendar.go | 2 +- esapi/api.xpack.ml.put_calendar_job.go | 2 +- .../api.xpack.ml.put_data_frame_analytics.go | 12 +++++------ esapi/api.xpack.ml.put_datafeed.go | 2 +- esapi/api.xpack.ml.put_filter.go | 2 +- esapi/api.xpack.ml.put_job.go | 2 +- esapi/api.xpack.ml.revert_model_snapshot.go | 2 +- esapi/api.xpack.ml.set_upgrade_mode.go | 2 +- ...api.xpack.ml.start_data_frame_analytics.go | 12 +++++------ esapi/api.xpack.ml.start_datafeed.go | 2 +- .../api.xpack.ml.stop_data_frame_analytics.go | 12 +++++------ esapi/api.xpack.ml.stop_datafeed.go | 2 +- esapi/api.xpack.ml.update_datafeed.go | 2 +- esapi/api.xpack.ml.update_filter.go | 2 +- esapi/api.xpack.ml.update_job.go | 2 +- esapi/api.xpack.ml.update_model_snapshot.go | 2 +- esapi/api.xpack.ml.validate.go | 2 +- esapi/api.xpack.ml.validate_detector.go | 2 +- esapi/api.xpack.rollup.delete_job.go | 10 +++++----- esapi/api.xpack.rollup.get_jobs.go | 16 +++++++-------- esapi/api.xpack.rollup.get_rollup_caps.go | 16 +++++++-------- .../api.xpack.rollup.get_rollup_index_caps.go | 2 +- esapi/api.xpack.rollup.put_job.go | 10 +++++----- esapi/api.xpack.rollup.rollup_search.go | 2 +- esapi/api.xpack.rollup.start_job.go | 10 +++++----- esapi/api.xpack.rollup.stop_job.go | 10 +++++----- esapi/api.xpack.security.change_password.go | 2 +- .../api.xpack.security.clear_cached_realms.go | 2 +- .../api.xpack.security.clear_cached_roles.go | 2 +- esapi/api.xpack.security.create_api_key.go | 2 +- esapi/api.xpack.security.delete_privileges.go | 2 +- esapi/api.xpack.security.delete_role.go | 2 +- .../api.xpack.security.delete_role_mapping.go | 2 +- esapi/api.xpack.security.delete_user.go | 2 +- esapi/api.xpack.security.disable_user.go | 2 +- esapi/api.xpack.security.enable_user.go | 2 +- esapi/api.xpack.security.get_api_key.go | 20 +++++++++---------- ...i.xpack.security.get_builtin_privileges.go | 2 +- esapi/api.xpack.security.get_privileges.go | 2 +- esapi/api.xpack.security.get_role.go | 2 +- esapi/api.xpack.security.get_role_mapping.go | 2 +- esapi/api.xpack.security.get_token.go | 2 +- esapi/api.xpack.security.get_user.go | 2 +- .../api.xpack.security.get_user_privileges.go | 2 +- esapi/api.xpack.security.has_privileges.go | 2 +- .../api.xpack.security.invalidate_api_key.go | 2 +- esapi/api.xpack.security.invalidate_token.go | 2 +- esapi/api.xpack.security.put_privileges.go | 2 +- esapi/api.xpack.security.put_role.go | 2 +- esapi/api.xpack.security.put_role_mapping.go | 2 +- esapi/api.xpack.security.put_user.go | 2 +- esapi/api.xpack.sql.clear_cursor.go | 2 +- esapi/api.xpack.sql.query.go | 2 +- esapi/api.xpack.sql.translate.go | 2 +- esapi/api.xpack.ssl.certificates.go | 2 +- esapi/api.xpack.watcher.ack_watch.go | 2 +- esapi/api.xpack.watcher.activate_watch.go | 2 +- esapi/api.xpack.watcher.deactivate_watch.go | 2 +- esapi/api.xpack.watcher.delete_watch.go | 10 +++++----- esapi/api.xpack.watcher.execute_watch.go | 16 +++++++-------- esapi/api.xpack.watcher.get_watch.go | 10 +++++----- esapi/api.xpack.watcher.put_watch.go | 10 +++++----- esapi/api.xpack.xpack.info.go | 2 +- esapi/api.xpack.xpack.usage.go | 2 +- 175 files changed, 306 insertions(+), 306 deletions(-) diff --git a/esapi/api._.go b/esapi/api._.go index 1d1765c9cc..f345138469 100644 --- a/esapi/api._.go +++ b/esapi/api._.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0-SNAPSHOT (cff607cbd83): DO NOT EDIT +// Code generated from specification version 7.3.0-SNAPSHOT (1e367b67175): DO NOT EDIT package esapi diff --git a/esapi/api.cat.pending_tasks.go b/esapi/api.cat.pending_tasks.go index 615b1f7053..b4484cbdbb 100755 --- a/esapi/api.cat.pending_tasks.go +++ b/esapi/api.cat.pending_tasks.go @@ -28,7 +28,7 @@ func newCatPendingTasksFunc(t Transport) CatPendingTasks { // type CatPendingTasks func(o ...func(*CatPendingTasksRequest)) (*Response, error) -// CatPendingTasksRequest configures the Cat Pending Tasks API request. +// CatPendingTasksRequest configures the Cat Pending Tasks API request. // type CatPendingTasksRequest struct { Format string diff --git a/esapi/api.cat.thread_pool.go b/esapi/api.cat.thread_pool.go index 3f5eea66b2..37e82f38fa 100755 --- a/esapi/api.cat.thread_pool.go +++ b/esapi/api.cat.thread_pool.go @@ -29,7 +29,7 @@ func newCatThreadPoolFunc(t Transport) CatThreadPool { // type CatThreadPool func(o ...func(*CatThreadPoolRequest)) (*Response, error) -// CatThreadPoolRequest configures the Cat Thread Pool API request. +// CatThreadPoolRequest configures the Cat Thread Pool API request. // type CatThreadPoolRequest struct { ThreadPoolPatterns []string diff --git a/esapi/api.cluster.allocation_explain.go b/esapi/api.cluster.allocation_explain.go index d95805ff3e..88a726194f 100755 --- a/esapi/api.cluster.allocation_explain.go +++ b/esapi/api.cluster.allocation_explain.go @@ -28,7 +28,7 @@ func newClusterAllocationExplainFunc(t Transport) ClusterAllocationExplain { // type ClusterAllocationExplain func(o ...func(*ClusterAllocationExplainRequest)) (*Response, error) -// ClusterAllocationExplainRequest configures the Cluster Allocation Explain API request. +// ClusterAllocationExplainRequest configures the Cluster Allocation Explain API request. // type ClusterAllocationExplainRequest struct { Body io.Reader diff --git a/esapi/api.cluster.get_settings.go b/esapi/api.cluster.get_settings.go index 0e268ae1d9..88ad3787d1 100755 --- a/esapi/api.cluster.get_settings.go +++ b/esapi/api.cluster.get_settings.go @@ -28,7 +28,7 @@ func newClusterGetSettingsFunc(t Transport) ClusterGetSettings { // type ClusterGetSettings func(o ...func(*ClusterGetSettingsRequest)) (*Response, error) -// ClusterGetSettingsRequest configures the Cluster Get Settings API request. +// ClusterGetSettingsRequest configures the Cluster Get Settings API request. // type ClusterGetSettingsRequest struct { FlatSettings *bool diff --git a/esapi/api.cluster.pending_tasks.go b/esapi/api.cluster.pending_tasks.go index 6d2ce2700d..d0858b1383 100755 --- a/esapi/api.cluster.pending_tasks.go +++ b/esapi/api.cluster.pending_tasks.go @@ -29,7 +29,7 @@ func newClusterPendingTasksFunc(t Transport) ClusterPendingTasks { // type ClusterPendingTasks func(o ...func(*ClusterPendingTasksRequest)) (*Response, error) -// ClusterPendingTasksRequest configures the Cluster Pending Tasks API request. +// ClusterPendingTasksRequest configures the Cluster Pending Tasks API request. // type ClusterPendingTasksRequest struct { Local *bool diff --git a/esapi/api.cluster.put_settings.go b/esapi/api.cluster.put_settings.go index 1bf4d4a72c..9b7a7635df 100755 --- a/esapi/api.cluster.put_settings.go +++ b/esapi/api.cluster.put_settings.go @@ -29,7 +29,7 @@ func newClusterPutSettingsFunc(t Transport) ClusterPutSettings { // type ClusterPutSettings func(body io.Reader, o ...func(*ClusterPutSettingsRequest)) (*Response, error) -// ClusterPutSettingsRequest configures the Cluster Put Settings API request. +// ClusterPutSettingsRequest configures the Cluster Put Settings API request. // type ClusterPutSettingsRequest struct { Body io.Reader diff --git a/esapi/api.cluster.remote_info.go b/esapi/api.cluster.remote_info.go index 776abbba16..65df4b97fd 100755 --- a/esapi/api.cluster.remote_info.go +++ b/esapi/api.cluster.remote_info.go @@ -26,7 +26,7 @@ func newClusterRemoteInfoFunc(t Transport) ClusterRemoteInfo { // type ClusterRemoteInfo func(o ...func(*ClusterRemoteInfoRequest)) (*Response, error) -// ClusterRemoteInfoRequest configures the Cluster Remote Info API request. +// ClusterRemoteInfoRequest configures the Cluster Remote Info API request. // type ClusterRemoteInfoRequest struct { Pretty bool diff --git a/esapi/api.delete_script.go b/esapi/api.delete_script.go index ee1cf07ece..bf3b1df63a 100755 --- a/esapi/api.delete_script.go +++ b/esapi/api.delete_script.go @@ -11,7 +11,7 @@ import ( func newDeleteScriptFunc(t Transport) DeleteScript { return func(id string, o ...func(*DeleteScriptRequest)) (*Response, error) { - var r = DeleteScriptRequest{DocumentID: id} + var r = DeleteScriptRequest{ScriptID: id} for _, f := range o { f(&r) } @@ -30,7 +30,7 @@ type DeleteScript func(id string, o ...func(*DeleteScriptRequest)) (*Response, e // DeleteScriptRequest configures the Delete Script API request. // type DeleteScriptRequest struct { - DocumentID string + ScriptID string MasterTimeout time.Duration Timeout time.Duration @@ -56,11 +56,11 @@ func (r DeleteScriptRequest) Do(ctx context.Context, transport Transport) (*Resp method = "DELETE" - path.Grow(1 + len("_scripts") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_scripts") + 1 + len(r.ScriptID)) path.WriteString("/") path.WriteString("_scripts") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.ScriptID) params = make(map[string]string) diff --git a/esapi/api.get_script.go b/esapi/api.get_script.go index b4a7786d17..78d50d1ddb 100755 --- a/esapi/api.get_script.go +++ b/esapi/api.get_script.go @@ -11,7 +11,7 @@ import ( func newGetScriptFunc(t Transport) GetScript { return func(id string, o ...func(*GetScriptRequest)) (*Response, error) { - var r = GetScriptRequest{DocumentID: id} + var r = GetScriptRequest{ScriptID: id} for _, f := range o { f(&r) } @@ -30,7 +30,7 @@ type GetScript func(id string, o ...func(*GetScriptRequest)) (*Response, error) // GetScriptRequest configures the Get Script API request. // type GetScriptRequest struct { - DocumentID string + ScriptID string MasterTimeout time.Duration @@ -55,11 +55,11 @@ func (r GetScriptRequest) Do(ctx context.Context, transport Transport) (*Respons method = "GET" - path.Grow(1 + len("_scripts") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_scripts") + 1 + len(r.ScriptID)) path.WriteString("/") path.WriteString("_scripts") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.ScriptID) params = make(map[string]string) diff --git a/esapi/api.indices.clear_cache.go b/esapi/api.indices.clear_cache.go index f95fcb8491..3650b3fb3f 100755 --- a/esapi/api.indices.clear_cache.go +++ b/esapi/api.indices.clear_cache.go @@ -27,7 +27,7 @@ func newIndicesClearCacheFunc(t Transport) IndicesClearCache { // type IndicesClearCache func(o ...func(*IndicesClearCacheRequest)) (*Response, error) -// IndicesClearCacheRequest configures the Indices Clear Cache API request. +// IndicesClearCacheRequest configures the Indices Clear Cache API request. // type IndicesClearCacheRequest struct { Index []string diff --git a/esapi/api.indices.delete_alias.go b/esapi/api.indices.delete_alias.go index 56c9ef7610..f9fc8dfcd9 100755 --- a/esapi/api.indices.delete_alias.go +++ b/esapi/api.indices.delete_alias.go @@ -27,7 +27,7 @@ func newIndicesDeleteAliasFunc(t Transport) IndicesDeleteAlias { // type IndicesDeleteAlias func(index []string, name []string, o ...func(*IndicesDeleteAliasRequest)) (*Response, error) -// IndicesDeleteAliasRequest configures the Indices Delete Alias API request. +// IndicesDeleteAliasRequest configures the Indices Delete Alias API request. // type IndicesDeleteAliasRequest struct { Index []string diff --git a/esapi/api.indices.delete_template.go b/esapi/api.indices.delete_template.go index 25faed6b80..81fcc310b2 100755 --- a/esapi/api.indices.delete_template.go +++ b/esapi/api.indices.delete_template.go @@ -27,7 +27,7 @@ func newIndicesDeleteTemplateFunc(t Transport) IndicesDeleteTemplate { // type IndicesDeleteTemplate func(name string, o ...func(*IndicesDeleteTemplateRequest)) (*Response, error) -// IndicesDeleteTemplateRequest configures the Indices Delete Template API request. +// IndicesDeleteTemplateRequest configures the Indices Delete Template API request. // type IndicesDeleteTemplateRequest struct { Name string diff --git a/esapi/api.indices.exists_alias.go b/esapi/api.indices.exists_alias.go index 228e3fc210..30c66b550d 100755 --- a/esapi/api.indices.exists_alias.go +++ b/esapi/api.indices.exists_alias.go @@ -27,7 +27,7 @@ func newIndicesExistsAliasFunc(t Transport) IndicesExistsAlias { // type IndicesExistsAlias func(name []string, o ...func(*IndicesExistsAliasRequest)) (*Response, error) -// IndicesExistsAliasRequest configures the Indices Exists Alias API request. +// IndicesExistsAliasRequest configures the Indices Exists Alias API request. // type IndicesExistsAliasRequest struct { Index []string diff --git a/esapi/api.indices.exists_template.go b/esapi/api.indices.exists_template.go index 995d9eeefd..20fc904485 100755 --- a/esapi/api.indices.exists_template.go +++ b/esapi/api.indices.exists_template.go @@ -28,7 +28,7 @@ func newIndicesExistsTemplateFunc(t Transport) IndicesExistsTemplate { // type IndicesExistsTemplate func(name []string, o ...func(*IndicesExistsTemplateRequest)) (*Response, error) -// IndicesExistsTemplateRequest configures the Indices Exists Template API request. +// IndicesExistsTemplateRequest configures the Indices Exists Template API request. // type IndicesExistsTemplateRequest struct { Name []string diff --git a/esapi/api.indices.exists_type.go b/esapi/api.indices.exists_type.go index b3eea0f71f..dcc2b5cd11 100755 --- a/esapi/api.indices.exists_type.go +++ b/esapi/api.indices.exists_type.go @@ -27,7 +27,7 @@ func newIndicesExistsDocumentTypeFunc(t Transport) IndicesExistsDocumentType { // type IndicesExistsDocumentType func(index []string, o ...func(*IndicesExistsDocumentTypeRequest)) (*Response, error) -// IndicesExistsDocumentTypeRequest configures the Indices Exists Type API request. +// IndicesExistsDocumentTypeRequest configures the Indices Exists Document Type API request. // type IndicesExistsDocumentTypeRequest struct { Index []string diff --git a/esapi/api.indices.flush_synced.go b/esapi/api.indices.flush_synced.go index 948e432f46..a1f6a9c874 100755 --- a/esapi/api.indices.flush_synced.go +++ b/esapi/api.indices.flush_synced.go @@ -27,7 +27,7 @@ func newIndicesFlushSyncedFunc(t Transport) IndicesFlushSynced { // type IndicesFlushSynced func(o ...func(*IndicesFlushSyncedRequest)) (*Response, error) -// IndicesFlushSyncedRequest configures the Indices Flush Synced API request. +// IndicesFlushSyncedRequest configures the Indices Flush Synced API request. // type IndicesFlushSyncedRequest struct { Index []string diff --git a/esapi/api.indices.get_alias.go b/esapi/api.indices.get_alias.go index efaf092109..2a1563d938 100755 --- a/esapi/api.indices.get_alias.go +++ b/esapi/api.indices.get_alias.go @@ -27,7 +27,7 @@ func newIndicesGetAliasFunc(t Transport) IndicesGetAlias { // type IndicesGetAlias func(o ...func(*IndicesGetAliasRequest)) (*Response, error) -// IndicesGetAliasRequest configures the Indices Get Alias API request. +// IndicesGetAliasRequest configures the Indices Get Alias API request. // type IndicesGetAliasRequest struct { Index []string diff --git a/esapi/api.indices.get_field_mapping.go b/esapi/api.indices.get_field_mapping.go index c836db70e6..978cf54ae0 100755 --- a/esapi/api.indices.get_field_mapping.go +++ b/esapi/api.indices.get_field_mapping.go @@ -27,7 +27,7 @@ func newIndicesGetFieldMappingFunc(t Transport) IndicesGetFieldMapping { // type IndicesGetFieldMapping func(fields []string, o ...func(*IndicesGetFieldMappingRequest)) (*Response, error) -// IndicesGetFieldMappingRequest configures the Indices Get Field Mapping API request. +// IndicesGetFieldMappingRequest configures the Indices Get Field Mapping API request. // type IndicesGetFieldMappingRequest struct { Index []string diff --git a/esapi/api.indices.get_mapping.go b/esapi/api.indices.get_mapping.go index e06d158654..35e1472eb3 100755 --- a/esapi/api.indices.get_mapping.go +++ b/esapi/api.indices.get_mapping.go @@ -28,7 +28,7 @@ func newIndicesGetMappingFunc(t Transport) IndicesGetMapping { // type IndicesGetMapping func(o ...func(*IndicesGetMappingRequest)) (*Response, error) -// IndicesGetMappingRequest configures the Indices Get Mapping API request. +// IndicesGetMappingRequest configures the Indices Get Mapping API request. // type IndicesGetMappingRequest struct { Index []string diff --git a/esapi/api.indices.get_settings.go b/esapi/api.indices.get_settings.go index 4b382d7f15..2fb9fd8133 100755 --- a/esapi/api.indices.get_settings.go +++ b/esapi/api.indices.get_settings.go @@ -28,7 +28,7 @@ func newIndicesGetSettingsFunc(t Transport) IndicesGetSettings { // type IndicesGetSettings func(o ...func(*IndicesGetSettingsRequest)) (*Response, error) -// IndicesGetSettingsRequest configures the Indices Get Settings API request. +// IndicesGetSettingsRequest configures the Indices Get Settings API request. // type IndicesGetSettingsRequest struct { Index []string diff --git a/esapi/api.indices.get_template.go b/esapi/api.indices.get_template.go index 150c6902a9..0ceeed2d1f 100755 --- a/esapi/api.indices.get_template.go +++ b/esapi/api.indices.get_template.go @@ -28,7 +28,7 @@ func newIndicesGetTemplateFunc(t Transport) IndicesGetTemplate { // type IndicesGetTemplate func(o ...func(*IndicesGetTemplateRequest)) (*Response, error) -// IndicesGetTemplateRequest configures the Indices Get Template API request. +// IndicesGetTemplateRequest configures the Indices Get Template API request. // type IndicesGetTemplateRequest struct { Name []string diff --git a/esapi/api.indices.get_upgrade.go b/esapi/api.indices.get_upgrade.go index 237dda45d2..f7a0584e6e 100755 --- a/esapi/api.indices.get_upgrade.go +++ b/esapi/api.indices.get_upgrade.go @@ -27,7 +27,7 @@ func newIndicesGetUpgradeFunc(t Transport) IndicesGetUpgrade { // type IndicesGetUpgrade func(o ...func(*IndicesGetUpgradeRequest)) (*Response, error) -// IndicesGetUpgradeRequest configures the Indices Get Upgrade API request. +// IndicesGetUpgradeRequest configures the Indices Get Upgrade API request. // type IndicesGetUpgradeRequest struct { Index []string diff --git a/esapi/api.indices.put_alias.go b/esapi/api.indices.put_alias.go index 2d551cd59b..416689dd81 100755 --- a/esapi/api.indices.put_alias.go +++ b/esapi/api.indices.put_alias.go @@ -28,7 +28,7 @@ func newIndicesPutAliasFunc(t Transport) IndicesPutAlias { // type IndicesPutAlias func(index []string, name string, o ...func(*IndicesPutAliasRequest)) (*Response, error) -// IndicesPutAliasRequest configures the Indices Put Alias API request. +// IndicesPutAliasRequest configures the Indices Put Alias API request. // type IndicesPutAliasRequest struct { Index []string diff --git a/esapi/api.indices.put_mapping.go b/esapi/api.indices.put_mapping.go index 7cb0f4a3b6..d5d329205e 100755 --- a/esapi/api.indices.put_mapping.go +++ b/esapi/api.indices.put_mapping.go @@ -29,7 +29,7 @@ func newIndicesPutMappingFunc(t Transport) IndicesPutMapping { // type IndicesPutMapping func(body io.Reader, o ...func(*IndicesPutMappingRequest)) (*Response, error) -// IndicesPutMappingRequest configures the Indices Put Mapping API request. +// IndicesPutMappingRequest configures the Indices Put Mapping API request. // type IndicesPutMappingRequest struct { Index []string diff --git a/esapi/api.indices.put_settings.go b/esapi/api.indices.put_settings.go index 776207e77f..2f71cf04df 100755 --- a/esapi/api.indices.put_settings.go +++ b/esapi/api.indices.put_settings.go @@ -29,7 +29,7 @@ func newIndicesPutSettingsFunc(t Transport) IndicesPutSettings { // type IndicesPutSettings func(body io.Reader, o ...func(*IndicesPutSettingsRequest)) (*Response, error) -// IndicesPutSettingsRequest configures the Indices Put Settings API request. +// IndicesPutSettingsRequest configures the Indices Put Settings API request. // type IndicesPutSettingsRequest struct { Index []string diff --git a/esapi/api.indices.put_template.go b/esapi/api.indices.put_template.go index 441e28a8e3..c7cf384172 100755 --- a/esapi/api.indices.put_template.go +++ b/esapi/api.indices.put_template.go @@ -29,7 +29,7 @@ func newIndicesPutTemplateFunc(t Transport) IndicesPutTemplate { // type IndicesPutTemplate func(name string, body io.Reader, o ...func(*IndicesPutTemplateRequest)) (*Response, error) -// IndicesPutTemplateRequest configures the Indices Put Template API request. +// IndicesPutTemplateRequest configures the Indices Put Template API request. // type IndicesPutTemplateRequest struct { Body io.Reader diff --git a/esapi/api.indices.shard_stores.go b/esapi/api.indices.shard_stores.go index 62ebd22225..f4fbc7e90f 100755 --- a/esapi/api.indices.shard_stores.go +++ b/esapi/api.indices.shard_stores.go @@ -27,7 +27,7 @@ func newIndicesShardStoresFunc(t Transport) IndicesShardStores { // type IndicesShardStores func(o ...func(*IndicesShardStoresRequest)) (*Response, error) -// IndicesShardStoresRequest configures the Indices Shard Stores API request. +// IndicesShardStoresRequest configures the Indices Shard Stores API request. // type IndicesShardStoresRequest struct { Index []string diff --git a/esapi/api.indices.update_aliases.go b/esapi/api.indices.update_aliases.go index e70735ad68..ddd32538f9 100755 --- a/esapi/api.indices.update_aliases.go +++ b/esapi/api.indices.update_aliases.go @@ -28,7 +28,7 @@ func newIndicesUpdateAliasesFunc(t Transport) IndicesUpdateAliases { // type IndicesUpdateAliases func(body io.Reader, o ...func(*IndicesUpdateAliasesRequest)) (*Response, error) -// IndicesUpdateAliasesRequest configures the Indices Update Aliases API request. +// IndicesUpdateAliasesRequest configures the Indices Update Aliases API request. // type IndicesUpdateAliasesRequest struct { Body io.Reader diff --git a/esapi/api.indices.validate_query.go b/esapi/api.indices.validate_query.go index 5c0f8f8cf5..70b2e6498b 100755 --- a/esapi/api.indices.validate_query.go +++ b/esapi/api.indices.validate_query.go @@ -28,7 +28,7 @@ func newIndicesValidateQueryFunc(t Transport) IndicesValidateQuery { // type IndicesValidateQuery func(o ...func(*IndicesValidateQueryRequest)) (*Response, error) -// IndicesValidateQueryRequest configures the Indices Validate Query API request. +// IndicesValidateQueryRequest configures the Indices Validate Query API request. // type IndicesValidateQueryRequest struct { Index []string diff --git a/esapi/api.ingest.delete_pipeline.go b/esapi/api.ingest.delete_pipeline.go index f60c31203a..d6df545a00 100755 --- a/esapi/api.ingest.delete_pipeline.go +++ b/esapi/api.ingest.delete_pipeline.go @@ -11,7 +11,7 @@ import ( func newIngestDeletePipelineFunc(t Transport) IngestDeletePipeline { return func(id string, o ...func(*IngestDeletePipelineRequest)) (*Response, error) { - var r = IngestDeletePipelineRequest{DocumentID: id} + var r = IngestDeletePipelineRequest{PipelineID: id} for _, f := range o { f(&r) } @@ -27,10 +27,10 @@ func newIngestDeletePipelineFunc(t Transport) IngestDeletePipeline { // type IngestDeletePipeline func(id string, o ...func(*IngestDeletePipelineRequest)) (*Response, error) -// IngestDeletePipelineRequest configures the Ingest Delete Pipeline API request. +// IngestDeletePipelineRequest configures the Ingest Delete Pipeline API request. // type IngestDeletePipelineRequest struct { - DocumentID string + PipelineID string MasterTimeout time.Duration Timeout time.Duration @@ -56,13 +56,13 @@ func (r IngestDeletePipelineRequest) Do(ctx context.Context, transport Transport method = "DELETE" - path.Grow(1 + len("_ingest") + 1 + len("pipeline") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_ingest") + 1 + len("pipeline") + 1 + len(r.PipelineID)) path.WriteString("/") path.WriteString("_ingest") path.WriteString("/") path.WriteString("pipeline") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.PipelineID) params = make(map[string]string) diff --git a/esapi/api.ingest.get_pipeline.go b/esapi/api.ingest.get_pipeline.go index 258f86e6c8..4b0b6d6e2f 100755 --- a/esapi/api.ingest.get_pipeline.go +++ b/esapi/api.ingest.get_pipeline.go @@ -27,10 +27,10 @@ func newIngestGetPipelineFunc(t Transport) IngestGetPipeline { // type IngestGetPipeline func(o ...func(*IngestGetPipelineRequest)) (*Response, error) -// IngestGetPipelineRequest configures the Ingest Get Pipeline API request. +// IngestGetPipelineRequest configures the Ingest Get Pipeline API request. // type IngestGetPipelineRequest struct { - DocumentID string + PipelineID string MasterTimeout time.Duration @@ -55,14 +55,14 @@ func (r IngestGetPipelineRequest) Do(ctx context.Context, transport Transport) ( method = "GET" - path.Grow(1 + len("_ingest") + 1 + len("pipeline") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_ingest") + 1 + len("pipeline") + 1 + len(r.PipelineID)) path.WriteString("/") path.WriteString("_ingest") path.WriteString("/") path.WriteString("pipeline") - if r.DocumentID != "" { + if r.PipelineID != "" { path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.PipelineID) } params = make(map[string]string) @@ -135,11 +135,11 @@ func (f IngestGetPipeline) WithContext(v context.Context) func(*IngestGetPipelin } } -// WithDocumentID - comma separated list of pipeline ids. wildcards supported. +// WithPipelineID - comma separated list of pipeline ids. wildcards supported. // -func (f IngestGetPipeline) WithDocumentID(v string) func(*IngestGetPipelineRequest) { +func (f IngestGetPipeline) WithPipelineID(v string) func(*IngestGetPipelineRequest) { return func(r *IngestGetPipelineRequest) { - r.DocumentID = v + r.PipelineID = v } } diff --git a/esapi/api.ingest.processor_grok.go b/esapi/api.ingest.processor_grok.go index 3b63cc6750..9b3521d86b 100755 --- a/esapi/api.ingest.processor_grok.go +++ b/esapi/api.ingest.processor_grok.go @@ -26,7 +26,7 @@ func newIngestProcessorGrokFunc(t Transport) IngestProcessorGrok { // type IngestProcessorGrok func(o ...func(*IngestProcessorGrokRequest)) (*Response, error) -// IngestProcessorGrokRequest configures the Ingest Processor Grok API request. +// IngestProcessorGrokRequest configures the Ingest Processor Grok API request. // type IngestProcessorGrokRequest struct { Pretty bool diff --git a/esapi/api.ingest.put_pipeline.go b/esapi/api.ingest.put_pipeline.go index 2e38c8f0bd..fe0953bd63 100755 --- a/esapi/api.ingest.put_pipeline.go +++ b/esapi/api.ingest.put_pipeline.go @@ -12,7 +12,7 @@ import ( func newIngestPutPipelineFunc(t Transport) IngestPutPipeline { return func(id string, body io.Reader, o ...func(*IngestPutPipelineRequest)) (*Response, error) { - var r = IngestPutPipelineRequest{DocumentID: id, Body: body} + var r = IngestPutPipelineRequest{PipelineID: id, Body: body} for _, f := range o { f(&r) } @@ -28,10 +28,10 @@ func newIngestPutPipelineFunc(t Transport) IngestPutPipeline { // type IngestPutPipeline func(id string, body io.Reader, o ...func(*IngestPutPipelineRequest)) (*Response, error) -// IngestPutPipelineRequest configures the Ingest Put Pipeline API request. +// IngestPutPipelineRequest configures the Ingest Put Pipeline API request. // type IngestPutPipelineRequest struct { - DocumentID string + PipelineID string Body io.Reader @@ -59,13 +59,13 @@ func (r IngestPutPipelineRequest) Do(ctx context.Context, transport Transport) ( method = "PUT" - path.Grow(1 + len("_ingest") + 1 + len("pipeline") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_ingest") + 1 + len("pipeline") + 1 + len(r.PipelineID)) path.WriteString("/") path.WriteString("_ingest") path.WriteString("/") path.WriteString("pipeline") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.PipelineID) params = make(map[string]string) diff --git a/esapi/api.ingest.simulate.go b/esapi/api.ingest.simulate.go index b1b6ea648d..8935eb403b 100755 --- a/esapi/api.ingest.simulate.go +++ b/esapi/api.ingest.simulate.go @@ -31,7 +31,7 @@ type IngestSimulate func(body io.Reader, o ...func(*IngestSimulateRequest)) (*Re // IngestSimulateRequest configures the Ingest Simulate API request. // type IngestSimulateRequest struct { - DocumentID string + PipelineID string Body io.Reader @@ -58,14 +58,14 @@ func (r IngestSimulateRequest) Do(ctx context.Context, transport Transport) (*Re method = "GET" - path.Grow(1 + len("_ingest") + 1 + len("pipeline") + 1 + len(r.DocumentID) + 1 + len("_simulate")) + path.Grow(1 + len("_ingest") + 1 + len("pipeline") + 1 + len(r.PipelineID) + 1 + len("_simulate")) path.WriteString("/") path.WriteString("_ingest") path.WriteString("/") path.WriteString("pipeline") - if r.DocumentID != "" { + if r.PipelineID != "" { path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.PipelineID) } path.WriteString("/") path.WriteString("_simulate") @@ -144,11 +144,11 @@ func (f IngestSimulate) WithContext(v context.Context) func(*IngestSimulateReque } } -// WithDocumentID - pipeline ID. +// WithPipelineID - pipeline ID. // -func (f IngestSimulate) WithDocumentID(v string) func(*IngestSimulateRequest) { +func (f IngestSimulate) WithPipelineID(v string) func(*IngestSimulateRequest) { return func(r *IngestSimulateRequest) { - r.DocumentID = v + r.PipelineID = v } } diff --git a/esapi/api.nodes.hot_threads.go b/esapi/api.nodes.hot_threads.go index 3bb128ec01..552284c568 100755 --- a/esapi/api.nodes.hot_threads.go +++ b/esapi/api.nodes.hot_threads.go @@ -28,7 +28,7 @@ func newNodesHotThreadsFunc(t Transport) NodesHotThreads { // type NodesHotThreads func(o ...func(*NodesHotThreadsRequest)) (*Response, error) -// NodesHotThreadsRequest configures the Nodes Hot Threads API request. +// NodesHotThreadsRequest configures the Nodes Hot Threads API request. // type NodesHotThreadsRequest struct { NodeID []string diff --git a/esapi/api.nodes.reload_secure_settings.go b/esapi/api.nodes.reload_secure_settings.go index 306588e1f2..159ee6008b 100755 --- a/esapi/api.nodes.reload_secure_settings.go +++ b/esapi/api.nodes.reload_secure_settings.go @@ -27,7 +27,7 @@ func newNodesReloadSecureSettingsFunc(t Transport) NodesReloadSecureSettings { // type NodesReloadSecureSettings func(o ...func(*NodesReloadSecureSettingsRequest)) (*Response, error) -// NodesReloadSecureSettingsRequest configures the Nodes Reload Secure Settings API request. +// NodesReloadSecureSettingsRequest configures the Nodes Reload Secure Settings API request. // type NodesReloadSecureSettingsRequest struct { NodeID []string diff --git a/esapi/api.put_script.go b/esapi/api.put_script.go index 6f7f6863a7..77989513a6 100755 --- a/esapi/api.put_script.go +++ b/esapi/api.put_script.go @@ -12,7 +12,7 @@ import ( func newPutScriptFunc(t Transport) PutScript { return func(id string, body io.Reader, o ...func(*PutScriptRequest)) (*Response, error) { - var r = PutScriptRequest{DocumentID: id, Body: body} + var r = PutScriptRequest{ScriptID: id, Body: body} for _, f := range o { f(&r) } @@ -31,7 +31,7 @@ type PutScript func(id string, body io.Reader, o ...func(*PutScriptRequest)) (*R // PutScriptRequest configures the Put Script API request. // type PutScriptRequest struct { - DocumentID string + ScriptID string Body io.Reader @@ -61,11 +61,11 @@ func (r PutScriptRequest) Do(ctx context.Context, transport Transport) (*Respons method = "PUT" - path.Grow(1 + len("_scripts") + 1 + len(r.DocumentID) + 1 + len(r.ScriptContext)) + path.Grow(1 + len("_scripts") + 1 + len(r.ScriptID) + 1 + len(r.ScriptContext)) path.WriteString("/") path.WriteString("_scripts") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.ScriptID) if r.ScriptContext != "" { path.WriteString("/") path.WriteString(r.ScriptContext) diff --git a/esapi/api.render_search_template.go b/esapi/api.render_search_template.go index c53d3a0974..4911c91f57 100755 --- a/esapi/api.render_search_template.go +++ b/esapi/api.render_search_template.go @@ -30,7 +30,7 @@ type RenderSearchTemplate func(o ...func(*RenderSearchTemplateRequest)) (*Respon // RenderSearchTemplateRequest configures the Render Search Template API request. // type RenderSearchTemplateRequest struct { - DocumentID string + TemplateID string Body io.Reader @@ -55,14 +55,14 @@ func (r RenderSearchTemplateRequest) Do(ctx context.Context, transport Transport method = "GET" - path.Grow(1 + len("_render") + 1 + len("template") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_render") + 1 + len("template") + 1 + len(r.TemplateID)) path.WriteString("/") path.WriteString("_render") path.WriteString("/") path.WriteString("template") - if r.DocumentID != "" { + if r.TemplateID != "" { path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.TemplateID) } params = make(map[string]string) @@ -143,11 +143,11 @@ func (f RenderSearchTemplate) WithBody(v io.Reader) func(*RenderSearchTemplateRe } } -// WithDocumentID - the ID of the stored search template. +// WithTemplateID - the ID of the stored search template. // -func (f RenderSearchTemplate) WithDocumentID(v string) func(*RenderSearchTemplateRequest) { +func (f RenderSearchTemplate) WithTemplateID(v string) func(*RenderSearchTemplateRequest) { return func(r *RenderSearchTemplateRequest) { - r.DocumentID = v + r.TemplateID = v } } diff --git a/esapi/api.snapshot.create_repository.go b/esapi/api.snapshot.create_repository.go index baee1d2602..4ac6664222 100755 --- a/esapi/api.snapshot.create_repository.go +++ b/esapi/api.snapshot.create_repository.go @@ -29,7 +29,7 @@ func newSnapshotCreateRepositoryFunc(t Transport) SnapshotCreateRepository { // type SnapshotCreateRepository func(repository string, body io.Reader, o ...func(*SnapshotCreateRepositoryRequest)) (*Response, error) -// SnapshotCreateRepositoryRequest configures the Snapshot Create Repository API request. +// SnapshotCreateRepositoryRequest configures the Snapshot Create Repository API request. // type SnapshotCreateRepositoryRequest struct { Body io.Reader diff --git a/esapi/api.snapshot.delete_repository.go b/esapi/api.snapshot.delete_repository.go index 4c52ce6690..e2a4a32e53 100755 --- a/esapi/api.snapshot.delete_repository.go +++ b/esapi/api.snapshot.delete_repository.go @@ -27,7 +27,7 @@ func newSnapshotDeleteRepositoryFunc(t Transport) SnapshotDeleteRepository { // type SnapshotDeleteRepository func(repository []string, o ...func(*SnapshotDeleteRepositoryRequest)) (*Response, error) -// SnapshotDeleteRepositoryRequest configures the Snapshot Delete Repository API request. +// SnapshotDeleteRepositoryRequest configures the Snapshot Delete Repository API request. // type SnapshotDeleteRepositoryRequest struct { Repository []string diff --git a/esapi/api.snapshot.get_repository.go b/esapi/api.snapshot.get_repository.go index b7540406db..2410cc4385 100755 --- a/esapi/api.snapshot.get_repository.go +++ b/esapi/api.snapshot.get_repository.go @@ -28,7 +28,7 @@ func newSnapshotGetRepositoryFunc(t Transport) SnapshotGetRepository { // type SnapshotGetRepository func(o ...func(*SnapshotGetRepositoryRequest)) (*Response, error) -// SnapshotGetRepositoryRequest configures the Snapshot Get Repository API request. +// SnapshotGetRepositoryRequest configures the Snapshot Get Repository API request. // type SnapshotGetRepositoryRequest struct { Repository []string diff --git a/esapi/api.snapshot.verify_repository.go b/esapi/api.snapshot.verify_repository.go index 6f28b1c0f9..5b5d5d6bb5 100755 --- a/esapi/api.snapshot.verify_repository.go +++ b/esapi/api.snapshot.verify_repository.go @@ -27,7 +27,7 @@ func newSnapshotVerifyRepositoryFunc(t Transport) SnapshotVerifyRepository { // type SnapshotVerifyRepository func(repository string, o ...func(*SnapshotVerifyRepositoryRequest)) (*Response, error) -// SnapshotVerifyRepositoryRequest configures the Snapshot Verify Repository API request. +// SnapshotVerifyRepositoryRequest configures the Snapshot Verify Repository API request. // type SnapshotVerifyRepositoryRequest struct { Repository string diff --git a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go index 566ec528ed..2559019ed8 100755 --- a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go @@ -24,7 +24,7 @@ func newCCRDeleteAutoFollowPatternFunc(t Transport) CCRDeleteAutoFollowPattern { // type CCRDeleteAutoFollowPattern func(name string, o ...func(*CCRDeleteAutoFollowPatternRequest)) (*Response, error) -// CCRDeleteAutoFollowPatternRequest configures the Ccr Delete Auto Follow Pattern API request. +// CCRDeleteAutoFollowPatternRequest configures the CCR Delete Auto Follow Pattern API request. // type CCRDeleteAutoFollowPatternRequest struct { Name string diff --git a/esapi/api.xpack.ccr.follow.go b/esapi/api.xpack.ccr.follow.go index 1ca28fec71..de6062e294 100755 --- a/esapi/api.xpack.ccr.follow.go +++ b/esapi/api.xpack.ccr.follow.go @@ -25,7 +25,7 @@ func newCCRFollowFunc(t Transport) CCRFollow { // type CCRFollow func(index string, body io.Reader, o ...func(*CCRFollowRequest)) (*Response, error) -// CCRFollowRequest configures the Ccr Follow API request. +// CCRFollowRequest configures the CCR Follow API request. // type CCRFollowRequest struct { Index string diff --git a/esapi/api.xpack.ccr.follow_info.go b/esapi/api.xpack.ccr.follow_info.go index 5e0a838151..f0cfdcc784 100755 --- a/esapi/api.xpack.ccr.follow_info.go +++ b/esapi/api.xpack.ccr.follow_info.go @@ -24,7 +24,7 @@ func newCCRFollowInfoFunc(t Transport) CCRFollowInfo { // type CCRFollowInfo func(o ...func(*CCRFollowInfoRequest)) (*Response, error) -// CCRFollowInfoRequest configures the Ccr Follow Info API request. +// CCRFollowInfoRequest configures the CCR Follow Info API request. // type CCRFollowInfoRequest struct { Index []string diff --git a/esapi/api.xpack.ccr.follow_stats.go b/esapi/api.xpack.ccr.follow_stats.go index 7d3260a63a..bb21788aca 100755 --- a/esapi/api.xpack.ccr.follow_stats.go +++ b/esapi/api.xpack.ccr.follow_stats.go @@ -24,7 +24,7 @@ func newCCRFollowStatsFunc(t Transport) CCRFollowStats { // type CCRFollowStats func(index []string, o ...func(*CCRFollowStatsRequest)) (*Response, error) -// CCRFollowStatsRequest configures the Ccr Follow Stats API request. +// CCRFollowStatsRequest configures the CCR Follow Stats API request. // type CCRFollowStatsRequest struct { Index []string diff --git a/esapi/api.xpack.ccr.forget_follower.go b/esapi/api.xpack.ccr.forget_follower.go index 602e5507c8..8e7524d9e9 100755 --- a/esapi/api.xpack.ccr.forget_follower.go +++ b/esapi/api.xpack.ccr.forget_follower.go @@ -25,7 +25,7 @@ func newCCRForgetFollowerFunc(t Transport) CCRForgetFollower { // type CCRForgetFollower func(index string, body io.Reader, o ...func(*CCRForgetFollowerRequest)) (*Response, error) -// CCRForgetFollowerRequest configures the Ccr Forget Follower API request. +// CCRForgetFollowerRequest configures the CCR Forget Follower API request. // type CCRForgetFollowerRequest struct { Index string diff --git a/esapi/api.xpack.ccr.get_auto_follow_pattern.go b/esapi/api.xpack.ccr.get_auto_follow_pattern.go index b921ef5e36..eda929992c 100755 --- a/esapi/api.xpack.ccr.get_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.get_auto_follow_pattern.go @@ -24,7 +24,7 @@ func newCCRGetAutoFollowPatternFunc(t Transport) CCRGetAutoFollowPattern { // type CCRGetAutoFollowPattern func(o ...func(*CCRGetAutoFollowPatternRequest)) (*Response, error) -// CCRGetAutoFollowPatternRequest configures the Ccr Get Auto Follow Pattern API request. +// CCRGetAutoFollowPatternRequest configures the CCR Get Auto Follow Pattern API request. // type CCRGetAutoFollowPatternRequest struct { Name string diff --git a/esapi/api.xpack.ccr.pause_follow.go b/esapi/api.xpack.ccr.pause_follow.go index 58604a163d..bdf5e70aa2 100755 --- a/esapi/api.xpack.ccr.pause_follow.go +++ b/esapi/api.xpack.ccr.pause_follow.go @@ -24,7 +24,7 @@ func newCCRPauseFollowFunc(t Transport) CCRPauseFollow { // type CCRPauseFollow func(index string, o ...func(*CCRPauseFollowRequest)) (*Response, error) -// CCRPauseFollowRequest configures the Ccr Pause Follow API request. +// CCRPauseFollowRequest configures the CCR Pause Follow API request. // type CCRPauseFollowRequest struct { Index string diff --git a/esapi/api.xpack.ccr.put_auto_follow_pattern.go b/esapi/api.xpack.ccr.put_auto_follow_pattern.go index 938d8d47ce..f872f01733 100755 --- a/esapi/api.xpack.ccr.put_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.put_auto_follow_pattern.go @@ -25,7 +25,7 @@ func newCCRPutAutoFollowPatternFunc(t Transport) CCRPutAutoFollowPattern { // type CCRPutAutoFollowPattern func(name string, body io.Reader, o ...func(*CCRPutAutoFollowPatternRequest)) (*Response, error) -// CCRPutAutoFollowPatternRequest configures the Ccr Put Auto Follow Pattern API request. +// CCRPutAutoFollowPatternRequest configures the CCR Put Auto Follow Pattern API request. // type CCRPutAutoFollowPatternRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ccr.resume_follow.go b/esapi/api.xpack.ccr.resume_follow.go index e59c257d2a..a1cc1d2b4b 100755 --- a/esapi/api.xpack.ccr.resume_follow.go +++ b/esapi/api.xpack.ccr.resume_follow.go @@ -25,7 +25,7 @@ func newCCRResumeFollowFunc(t Transport) CCRResumeFollow { // type CCRResumeFollow func(index string, o ...func(*CCRResumeFollowRequest)) (*Response, error) -// CCRResumeFollowRequest configures the Ccr Resume Follow API request. +// CCRResumeFollowRequest configures the CCR Resume Follow API request. // type CCRResumeFollowRequest struct { Index string diff --git a/esapi/api.xpack.ccr.stats.go b/esapi/api.xpack.ccr.stats.go index 6738eef493..f53e9cb3b6 100755 --- a/esapi/api.xpack.ccr.stats.go +++ b/esapi/api.xpack.ccr.stats.go @@ -24,7 +24,7 @@ func newCCRStatsFunc(t Transport) CCRStats { // type CCRStats func(o ...func(*CCRStatsRequest)) (*Response, error) -// CCRStatsRequest configures the Ccr Stats API request. +// CCRStatsRequest configures the CCR Stats API request. // type CCRStatsRequest struct { Pretty bool diff --git a/esapi/api.xpack.ccr.unfollow.go b/esapi/api.xpack.ccr.unfollow.go index 4eae26d523..917141d2d9 100755 --- a/esapi/api.xpack.ccr.unfollow.go +++ b/esapi/api.xpack.ccr.unfollow.go @@ -24,7 +24,7 @@ func newCCRUnfollowFunc(t Transport) CCRUnfollow { // type CCRUnfollow func(index string, o ...func(*CCRUnfollowRequest)) (*Response, error) -// CCRUnfollowRequest configures the Ccr Unfollow API request. +// CCRUnfollowRequest configures the CCR Unfollow API request. // type CCRUnfollowRequest struct { Index string diff --git a/esapi/api.xpack.data_frame.delete_data_frame_transform.go b/esapi/api.xpack.data_frame.delete_data_frame_transform.go index 24181ce8d1..d2d33f060d 100755 --- a/esapi/api.xpack.data_frame.delete_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.delete_data_frame_transform.go @@ -24,7 +24,7 @@ func newDataFrameDeleteDataFrameTransformFunc(t Transport) DataFrameDeleteDataFr // type DataFrameDeleteDataFrameTransform func(transform_id string, o ...func(*DataFrameDeleteDataFrameTransformRequest)) (*Response, error) -// DataFrameDeleteDataFrameTransformRequest configures the Data Frame Delete Data Frame Transform API request. +// DataFrameDeleteDataFrameTransformRequest configures the Data Frame Delete Data Frame Transform API request. // type DataFrameDeleteDataFrameTransformRequest struct { TransformID string diff --git a/esapi/api.xpack.data_frame.get_data_frame_transform.go b/esapi/api.xpack.data_frame.get_data_frame_transform.go index 061b3b2cef..8063a1fad1 100755 --- a/esapi/api.xpack.data_frame.get_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.get_data_frame_transform.go @@ -25,7 +25,7 @@ func newDataFrameGetDataFrameTransformFunc(t Transport) DataFrameGetDataFrameTra // type DataFrameGetDataFrameTransform func(o ...func(*DataFrameGetDataFrameTransformRequest)) (*Response, error) -// DataFrameGetDataFrameTransformRequest configures the Data Frame Get Data Frame Transform API request. +// DataFrameGetDataFrameTransformRequest configures the Data Frame Get Data Frame Transform API request. // type DataFrameGetDataFrameTransformRequest struct { TransformID string diff --git a/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go b/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go index d5f9bb9fd7..67774c296c 100755 --- a/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go +++ b/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go @@ -25,7 +25,7 @@ func newDataFrameGetDataFrameTransformStatsFunc(t Transport) DataFrameGetDataFra // type DataFrameGetDataFrameTransformStats func(o ...func(*DataFrameGetDataFrameTransformStatsRequest)) (*Response, error) -// DataFrameGetDataFrameTransformStatsRequest configures the Data Frame Get Data Frame Transform Stats API request. +// DataFrameGetDataFrameTransformStatsRequest configures the Data Frame Get Data Frame Transform Stats API request. // type DataFrameGetDataFrameTransformStatsRequest struct { TransformID string diff --git a/esapi/api.xpack.data_frame.preview_data_frame_transform.go b/esapi/api.xpack.data_frame.preview_data_frame_transform.go index c7f9788f7f..1cb3df7509 100755 --- a/esapi/api.xpack.data_frame.preview_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.preview_data_frame_transform.go @@ -25,7 +25,7 @@ func newDataFramePreviewDataFrameTransformFunc(t Transport) DataFramePreviewData // type DataFramePreviewDataFrameTransform func(body io.Reader, o ...func(*DataFramePreviewDataFrameTransformRequest)) (*Response, error) -// DataFramePreviewDataFrameTransformRequest configures the Data Frame Preview Data Frame Transform API request. +// DataFramePreviewDataFrameTransformRequest configures the Data Frame Preview Data Frame Transform API request. // type DataFramePreviewDataFrameTransformRequest struct { Body io.Reader diff --git a/esapi/api.xpack.data_frame.put_data_frame_transform.go b/esapi/api.xpack.data_frame.put_data_frame_transform.go index 41252e9732..9dee91e4ee 100755 --- a/esapi/api.xpack.data_frame.put_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.put_data_frame_transform.go @@ -25,7 +25,7 @@ func newDataFramePutDataFrameTransformFunc(t Transport) DataFramePutDataFrameTra // type DataFramePutDataFrameTransform func(body io.Reader, transform_id string, o ...func(*DataFramePutDataFrameTransformRequest)) (*Response, error) -// DataFramePutDataFrameTransformRequest configures the Data Frame Put Data Frame Transform API request. +// DataFramePutDataFrameTransformRequest configures the Data Frame Put Data Frame Transform API request. // type DataFramePutDataFrameTransformRequest struct { Body io.Reader diff --git a/esapi/api.xpack.data_frame.start_data_frame_transform.go b/esapi/api.xpack.data_frame.start_data_frame_transform.go index 01de9a95e3..d92f1d85a5 100755 --- a/esapi/api.xpack.data_frame.start_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.start_data_frame_transform.go @@ -25,7 +25,7 @@ func newDataFrameStartDataFrameTransformFunc(t Transport) DataFrameStartDataFram // type DataFrameStartDataFrameTransform func(transform_id string, o ...func(*DataFrameStartDataFrameTransformRequest)) (*Response, error) -// DataFrameStartDataFrameTransformRequest configures the Data Frame Start Data Frame Transform API request. +// DataFrameStartDataFrameTransformRequest configures the Data Frame Start Data Frame Transform API request. // type DataFrameStartDataFrameTransformRequest struct { TransformID string diff --git a/esapi/api.xpack.data_frame.stop_data_frame_transform.go b/esapi/api.xpack.data_frame.stop_data_frame_transform.go index dd781b5d6e..1632001d2d 100755 --- a/esapi/api.xpack.data_frame.stop_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.stop_data_frame_transform.go @@ -26,7 +26,7 @@ func newDataFrameStopDataFrameTransformFunc(t Transport) DataFrameStopDataFrameT // type DataFrameStopDataFrameTransform func(transform_id string, o ...func(*DataFrameStopDataFrameTransformRequest)) (*Response, error) -// DataFrameStopDataFrameTransformRequest configures the Data Frame Stop Data Frame Transform API request. +// DataFrameStopDataFrameTransformRequest configures the Data Frame Stop Data Frame Transform API request. // type DataFrameStopDataFrameTransformRequest struct { TransformID string diff --git a/esapi/api.xpack.ilm.delete_lifecycle.go b/esapi/api.xpack.ilm.delete_lifecycle.go index deb08dff22..b69d08c256 100755 --- a/esapi/api.xpack.ilm.delete_lifecycle.go +++ b/esapi/api.xpack.ilm.delete_lifecycle.go @@ -24,7 +24,7 @@ func newILMDeleteLifecycleFunc(t Transport) ILMDeleteLifecycle { // type ILMDeleteLifecycle func(o ...func(*ILMDeleteLifecycleRequest)) (*Response, error) -// ILMDeleteLifecycleRequest configures the Ilm Delete Lifecycle API request. +// ILMDeleteLifecycleRequest configures the ILM Delete Lifecycle API request. // type ILMDeleteLifecycleRequest struct { Policy string diff --git a/esapi/api.xpack.ilm.explain_lifecycle.go b/esapi/api.xpack.ilm.explain_lifecycle.go index 8fa886a252..eac7287a35 100755 --- a/esapi/api.xpack.ilm.explain_lifecycle.go +++ b/esapi/api.xpack.ilm.explain_lifecycle.go @@ -24,7 +24,7 @@ func newILMExplainLifecycleFunc(t Transport) ILMExplainLifecycle { // type ILMExplainLifecycle func(o ...func(*ILMExplainLifecycleRequest)) (*Response, error) -// ILMExplainLifecycleRequest configures the Ilm Explain Lifecycle API request. +// ILMExplainLifecycleRequest configures the ILM Explain Lifecycle API request. // type ILMExplainLifecycleRequest struct { Index string diff --git a/esapi/api.xpack.ilm.get_lifecycle.go b/esapi/api.xpack.ilm.get_lifecycle.go index f37c89927e..d50d752b7b 100755 --- a/esapi/api.xpack.ilm.get_lifecycle.go +++ b/esapi/api.xpack.ilm.get_lifecycle.go @@ -24,7 +24,7 @@ func newILMGetLifecycleFunc(t Transport) ILMGetLifecycle { // type ILMGetLifecycle func(o ...func(*ILMGetLifecycleRequest)) (*Response, error) -// ILMGetLifecycleRequest configures the Ilm Get Lifecycle API request. +// ILMGetLifecycleRequest configures the ILM Get Lifecycle API request. // type ILMGetLifecycleRequest struct { Policy string diff --git a/esapi/api.xpack.ilm.get_status.go b/esapi/api.xpack.ilm.get_status.go index 3c2a52827b..9141b70ff0 100755 --- a/esapi/api.xpack.ilm.get_status.go +++ b/esapi/api.xpack.ilm.get_status.go @@ -24,7 +24,7 @@ func newILMGetStatusFunc(t Transport) ILMGetStatus { // type ILMGetStatus func(o ...func(*ILMGetStatusRequest)) (*Response, error) -// ILMGetStatusRequest configures the Ilm Get Status API request. +// ILMGetStatusRequest configures the ILM Get Status API request. // type ILMGetStatusRequest struct { Pretty bool diff --git a/esapi/api.xpack.ilm.move_to_step.go b/esapi/api.xpack.ilm.move_to_step.go index 92f1f07317..b0e4df0999 100755 --- a/esapi/api.xpack.ilm.move_to_step.go +++ b/esapi/api.xpack.ilm.move_to_step.go @@ -25,7 +25,7 @@ func newILMMoveToStepFunc(t Transport) ILMMoveToStep { // type ILMMoveToStep func(o ...func(*ILMMoveToStepRequest)) (*Response, error) -// ILMMoveToStepRequest configures the Ilm Move To Step API request. +// ILMMoveToStepRequest configures the ILM Move To Step API request. // type ILMMoveToStepRequest struct { Index string diff --git a/esapi/api.xpack.ilm.put_lifecycle.go b/esapi/api.xpack.ilm.put_lifecycle.go index 2283ae6c3f..ea406ac070 100755 --- a/esapi/api.xpack.ilm.put_lifecycle.go +++ b/esapi/api.xpack.ilm.put_lifecycle.go @@ -25,7 +25,7 @@ func newILMPutLifecycleFunc(t Transport) ILMPutLifecycle { // type ILMPutLifecycle func(o ...func(*ILMPutLifecycleRequest)) (*Response, error) -// ILMPutLifecycleRequest configures the Ilm Put Lifecycle API request. +// ILMPutLifecycleRequest configures the ILM Put Lifecycle API request. // type ILMPutLifecycleRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ilm.remove_policy.go b/esapi/api.xpack.ilm.remove_policy.go index 5609b33796..84f4642a6a 100755 --- a/esapi/api.xpack.ilm.remove_policy.go +++ b/esapi/api.xpack.ilm.remove_policy.go @@ -24,7 +24,7 @@ func newILMRemovePolicyFunc(t Transport) ILMRemovePolicy { // type ILMRemovePolicy func(o ...func(*ILMRemovePolicyRequest)) (*Response, error) -// ILMRemovePolicyRequest configures the Ilm Remove Policy API request. +// ILMRemovePolicyRequest configures the ILM Remove Policy API request. // type ILMRemovePolicyRequest struct { Index string diff --git a/esapi/api.xpack.ilm.retry.go b/esapi/api.xpack.ilm.retry.go index 8a193478c3..4f71e7a0d4 100755 --- a/esapi/api.xpack.ilm.retry.go +++ b/esapi/api.xpack.ilm.retry.go @@ -24,7 +24,7 @@ func newILMRetryFunc(t Transport) ILMRetry { // type ILMRetry func(o ...func(*ILMRetryRequest)) (*Response, error) -// ILMRetryRequest configures the Ilm Retry API request. +// ILMRetryRequest configures the ILM Retry API request. // type ILMRetryRequest struct { Index string diff --git a/esapi/api.xpack.ilm.start.go b/esapi/api.xpack.ilm.start.go index 68aea2032e..e0ed81429a 100755 --- a/esapi/api.xpack.ilm.start.go +++ b/esapi/api.xpack.ilm.start.go @@ -24,7 +24,7 @@ func newILMStartFunc(t Transport) ILMStart { // type ILMStart func(o ...func(*ILMStartRequest)) (*Response, error) -// ILMStartRequest configures the Ilm Start API request. +// ILMStartRequest configures the ILM Start API request. // type ILMStartRequest struct { Pretty bool diff --git a/esapi/api.xpack.ilm.stop.go b/esapi/api.xpack.ilm.stop.go index febea07257..3657b7f9e5 100755 --- a/esapi/api.xpack.ilm.stop.go +++ b/esapi/api.xpack.ilm.stop.go @@ -24,7 +24,7 @@ func newILMStopFunc(t Transport) ILMStop { // type ILMStop func(o ...func(*ILMStopRequest)) (*Response, error) -// ILMStopRequest configures the Ilm Stop API request. +// ILMStopRequest configures the ILM Stop API request. // type ILMStopRequest struct { Pretty bool diff --git a/esapi/api.xpack.indices.reload_search_analyzers.go b/esapi/api.xpack.indices.reload_search_analyzers.go index 957865b7f9..99a780235d 100755 --- a/esapi/api.xpack.indices.reload_search_analyzers.go +++ b/esapi/api.xpack.indices.reload_search_analyzers.go @@ -25,7 +25,7 @@ func newIndicesReloadSearchAnalyzersFunc(t Transport) IndicesReloadSearchAnalyze // type IndicesReloadSearchAnalyzers func(o ...func(*IndicesReloadSearchAnalyzersRequest)) (*Response, error) -// IndicesReloadSearchAnalyzersRequest configures the Indices Reload Search Analyzers API request. +// IndicesReloadSearchAnalyzersRequest configures the Indices Reload Search Analyzers API request. // type IndicesReloadSearchAnalyzersRequest struct { Index []string diff --git a/esapi/api.xpack.license.get_basic_status.go b/esapi/api.xpack.license.get_basic_status.go index dd42415548..61b9e14074 100755 --- a/esapi/api.xpack.license.get_basic_status.go +++ b/esapi/api.xpack.license.get_basic_status.go @@ -24,7 +24,7 @@ func newLicenseGetBasicStatusFunc(t Transport) LicenseGetBasicStatus { // type LicenseGetBasicStatus func(o ...func(*LicenseGetBasicStatusRequest)) (*Response, error) -// LicenseGetBasicStatusRequest configures the License Get Basic Status API request. +// LicenseGetBasicStatusRequest configures the License Get Basic Status API request. // type LicenseGetBasicStatusRequest struct { Pretty bool diff --git a/esapi/api.xpack.license.get_trial_status.go b/esapi/api.xpack.license.get_trial_status.go index d7f494e123..1c9eca55eb 100755 --- a/esapi/api.xpack.license.get_trial_status.go +++ b/esapi/api.xpack.license.get_trial_status.go @@ -24,7 +24,7 @@ func newLicenseGetTrialStatusFunc(t Transport) LicenseGetTrialStatus { // type LicenseGetTrialStatus func(o ...func(*LicenseGetTrialStatusRequest)) (*Response, error) -// LicenseGetTrialStatusRequest configures the License Get Trial Status API request. +// LicenseGetTrialStatusRequest configures the License Get Trial Status API request. // type LicenseGetTrialStatusRequest struct { Pretty bool diff --git a/esapi/api.xpack.license.post_start_basic.go b/esapi/api.xpack.license.post_start_basic.go index da199d92c0..f2def664c9 100755 --- a/esapi/api.xpack.license.post_start_basic.go +++ b/esapi/api.xpack.license.post_start_basic.go @@ -25,7 +25,7 @@ func newLicensePostStartBasicFunc(t Transport) LicensePostStartBasic { // type LicensePostStartBasic func(o ...func(*LicensePostStartBasicRequest)) (*Response, error) -// LicensePostStartBasicRequest configures the License Post Start Basic API request. +// LicensePostStartBasicRequest configures the License Post Start Basic API request. // type LicensePostStartBasicRequest struct { Acknowledge *bool diff --git a/esapi/api.xpack.license.post_start_trial.go b/esapi/api.xpack.license.post_start_trial.go index a66aca3652..efbc93d9a0 100755 --- a/esapi/api.xpack.license.post_start_trial.go +++ b/esapi/api.xpack.license.post_start_trial.go @@ -25,7 +25,7 @@ func newLicensePostStartTrialFunc(t Transport) LicensePostStartTrial { // type LicensePostStartTrial func(o ...func(*LicensePostStartTrialRequest)) (*Response, error) -// LicensePostStartTrialRequest configures the License Post Start Trial API request. +// LicensePostStartTrialRequest configures the License Post Start Trial API request. // type LicensePostStartTrialRequest struct { Acknowledge *bool diff --git a/esapi/api.xpack.ml.close_job.go b/esapi/api.xpack.ml.close_job.go index 9b2c75616b..587a37e1d2 100755 --- a/esapi/api.xpack.ml.close_job.go +++ b/esapi/api.xpack.ml.close_job.go @@ -27,7 +27,7 @@ func newMLCloseJobFunc(t Transport) MLCloseJob { // type MLCloseJob func(job_id string, o ...func(*MLCloseJobRequest)) (*Response, error) -// MLCloseJobRequest configures the Ml Close Job API request. +// MLCloseJobRequest configures the ML Close Job API request. // type MLCloseJobRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.delete_calendar.go b/esapi/api.xpack.ml.delete_calendar.go index fc676c2da0..de655ff307 100755 --- a/esapi/api.xpack.ml.delete_calendar.go +++ b/esapi/api.xpack.ml.delete_calendar.go @@ -24,7 +24,7 @@ func newMLDeleteCalendarFunc(t Transport) MLDeleteCalendar { // type MLDeleteCalendar func(calendar_id string, o ...func(*MLDeleteCalendarRequest)) (*Response, error) -// MLDeleteCalendarRequest configures the Ml Delete Calendar API request. +// MLDeleteCalendarRequest configures the ML Delete Calendar API request. // type MLDeleteCalendarRequest struct { CalendarID string diff --git a/esapi/api.xpack.ml.delete_calendar_event.go b/esapi/api.xpack.ml.delete_calendar_event.go index 32a6caf51b..11b36dc2d2 100755 --- a/esapi/api.xpack.ml.delete_calendar_event.go +++ b/esapi/api.xpack.ml.delete_calendar_event.go @@ -24,7 +24,7 @@ func newMLDeleteCalendarEventFunc(t Transport) MLDeleteCalendarEvent { // type MLDeleteCalendarEvent func(calendar_id string, event_id string, o ...func(*MLDeleteCalendarEventRequest)) (*Response, error) -// MLDeleteCalendarEventRequest configures the Ml Delete Calendar Event API request. +// MLDeleteCalendarEventRequest configures the ML Delete Calendar Event API request. // type MLDeleteCalendarEventRequest struct { CalendarID string diff --git a/esapi/api.xpack.ml.delete_calendar_job.go b/esapi/api.xpack.ml.delete_calendar_job.go index 54a18c11e3..a70345603f 100755 --- a/esapi/api.xpack.ml.delete_calendar_job.go +++ b/esapi/api.xpack.ml.delete_calendar_job.go @@ -24,7 +24,7 @@ func newMLDeleteCalendarJobFunc(t Transport) MLDeleteCalendarJob { // type MLDeleteCalendarJob func(calendar_id string, job_id string, o ...func(*MLDeleteCalendarJobRequest)) (*Response, error) -// MLDeleteCalendarJobRequest configures the Ml Delete Calendar Job API request. +// MLDeleteCalendarJobRequest configures the ML Delete Calendar Job API request. // type MLDeleteCalendarJobRequest struct { CalendarID string diff --git a/esapi/api.xpack.ml.delete_data_frame_analytics.go b/esapi/api.xpack.ml.delete_data_frame_analytics.go index 97f6af3f2f..8e8cc68b99 100755 --- a/esapi/api.xpack.ml.delete_data_frame_analytics.go +++ b/esapi/api.xpack.ml.delete_data_frame_analytics.go @@ -10,7 +10,7 @@ import ( func newMLDeleteDataFrameAnalyticsFunc(t Transport) MLDeleteDataFrameAnalytics { return func(id string, o ...func(*MLDeleteDataFrameAnalyticsRequest)) (*Response, error) { - var r = MLDeleteDataFrameAnalyticsRequest{DocumentID: id} + var r = MLDeleteDataFrameAnalyticsRequest{ID: id} for _, f := range o { f(&r) } @@ -20,14 +20,14 @@ func newMLDeleteDataFrameAnalyticsFunc(t Transport) MLDeleteDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLDeleteDataFrameAnalytics - +// MLDeleteDataFrameAnalytics - http://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html // type MLDeleteDataFrameAnalytics func(id string, o ...func(*MLDeleteDataFrameAnalyticsRequest)) (*Response, error) -// MLDeleteDataFrameAnalyticsRequest configures the Ml Delete Data Frame Analytics API request. +// MLDeleteDataFrameAnalyticsRequest configures the ML Delete Data Frame Analytics API request. // type MLDeleteDataFrameAnalyticsRequest struct { - DocumentID string + ID string Pretty bool Human bool @@ -50,7 +50,7 @@ func (r MLDeleteDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tra method = "DELETE" - path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.ID)) path.WriteString("/") path.WriteString("_ml") path.WriteString("/") @@ -58,7 +58,7 @@ func (r MLDeleteDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tra path.WriteString("/") path.WriteString("analytics") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.ID) params = make(map[string]string) diff --git a/esapi/api.xpack.ml.delete_datafeed.go b/esapi/api.xpack.ml.delete_datafeed.go index 25e3d28d1d..c4655ef005 100755 --- a/esapi/api.xpack.ml.delete_datafeed.go +++ b/esapi/api.xpack.ml.delete_datafeed.go @@ -25,7 +25,7 @@ func newMLDeleteDatafeedFunc(t Transport) MLDeleteDatafeed { // type MLDeleteDatafeed func(datafeed_id string, o ...func(*MLDeleteDatafeedRequest)) (*Response, error) -// MLDeleteDatafeedRequest configures the Ml Delete Datafeed API request. +// MLDeleteDatafeedRequest configures the ML Delete Datafeed API request. // type MLDeleteDatafeedRequest struct { DatafeedID string diff --git a/esapi/api.xpack.ml.delete_expired_data.go b/esapi/api.xpack.ml.delete_expired_data.go index 532ae68a68..fbfceea6bc 100755 --- a/esapi/api.xpack.ml.delete_expired_data.go +++ b/esapi/api.xpack.ml.delete_expired_data.go @@ -24,7 +24,7 @@ func newMLDeleteExpiredDataFunc(t Transport) MLDeleteExpiredData { // type MLDeleteExpiredData func(o ...func(*MLDeleteExpiredDataRequest)) (*Response, error) -// MLDeleteExpiredDataRequest configures the Ml Delete Expired Data API request. +// MLDeleteExpiredDataRequest configures the ML Delete Expired Data API request. // type MLDeleteExpiredDataRequest struct { Pretty bool diff --git a/esapi/api.xpack.ml.delete_filter.go b/esapi/api.xpack.ml.delete_filter.go index 128332738f..696e78742f 100755 --- a/esapi/api.xpack.ml.delete_filter.go +++ b/esapi/api.xpack.ml.delete_filter.go @@ -24,7 +24,7 @@ func newMLDeleteFilterFunc(t Transport) MLDeleteFilter { // type MLDeleteFilter func(filter_id string, o ...func(*MLDeleteFilterRequest)) (*Response, error) -// MLDeleteFilterRequest configures the Ml Delete Filter API request. +// MLDeleteFilterRequest configures the ML Delete Filter API request. // type MLDeleteFilterRequest struct { FilterID string diff --git a/esapi/api.xpack.ml.delete_forecast.go b/esapi/api.xpack.ml.delete_forecast.go index b3f6524d64..3f974a7cf1 100755 --- a/esapi/api.xpack.ml.delete_forecast.go +++ b/esapi/api.xpack.ml.delete_forecast.go @@ -26,7 +26,7 @@ func newMLDeleteForecastFunc(t Transport) MLDeleteForecast { // type MLDeleteForecast func(job_id string, o ...func(*MLDeleteForecastRequest)) (*Response, error) -// MLDeleteForecastRequest configures the Ml Delete Forecast API request. +// MLDeleteForecastRequest configures the ML Delete Forecast API request. // type MLDeleteForecastRequest struct { ForecastID string diff --git a/esapi/api.xpack.ml.delete_job.go b/esapi/api.xpack.ml.delete_job.go index 4ce93fbf59..d656c2ab68 100755 --- a/esapi/api.xpack.ml.delete_job.go +++ b/esapi/api.xpack.ml.delete_job.go @@ -25,7 +25,7 @@ func newMLDeleteJobFunc(t Transport) MLDeleteJob { // type MLDeleteJob func(job_id string, o ...func(*MLDeleteJobRequest)) (*Response, error) -// MLDeleteJobRequest configures the Ml Delete Job API request. +// MLDeleteJobRequest configures the ML Delete Job API request. // type MLDeleteJobRequest struct { JobID string diff --git a/esapi/api.xpack.ml.delete_model_snapshot.go b/esapi/api.xpack.ml.delete_model_snapshot.go index c4f46f6e72..41298e0c95 100755 --- a/esapi/api.xpack.ml.delete_model_snapshot.go +++ b/esapi/api.xpack.ml.delete_model_snapshot.go @@ -24,7 +24,7 @@ func newMLDeleteModelSnapshotFunc(t Transport) MLDeleteModelSnapshot { // type MLDeleteModelSnapshot func(snapshot_id string, job_id string, o ...func(*MLDeleteModelSnapshotRequest)) (*Response, error) -// MLDeleteModelSnapshotRequest configures the Ml Delete Model Snapshot API request. +// MLDeleteModelSnapshotRequest configures the ML Delete Model Snapshot API request. // type MLDeleteModelSnapshotRequest struct { JobID string diff --git a/esapi/api.xpack.ml.evaluate_data_frame.go b/esapi/api.xpack.ml.evaluate_data_frame.go index a1f275c6bb..6e9827302a 100755 --- a/esapi/api.xpack.ml.evaluate_data_frame.go +++ b/esapi/api.xpack.ml.evaluate_data_frame.go @@ -21,11 +21,11 @@ func newMLEvaluateDataFrameFunc(t Transport) MLEvaluateDataFrame { // ----- API Definition ------------------------------------------------------- -// MLEvaluateDataFrame - +// MLEvaluateDataFrame - http://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html // type MLEvaluateDataFrame func(body io.Reader, o ...func(*MLEvaluateDataFrameRequest)) (*Response, error) -// MLEvaluateDataFrameRequest configures the Ml Evaluate Data Frame API request. +// MLEvaluateDataFrameRequest configures the ML Evaluate Data Frame API request. // type MLEvaluateDataFrameRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.find_file_structure.go b/esapi/api.xpack.ml.find_file_structure.go index 093535c6df..568e3c5b3b 100755 --- a/esapi/api.xpack.ml.find_file_structure.go +++ b/esapi/api.xpack.ml.find_file_structure.go @@ -27,7 +27,7 @@ func newMLFindFileStructureFunc(t Transport) MLFindFileStructure { // type MLFindFileStructure func(body io.Reader, o ...func(*MLFindFileStructureRequest)) (*Response, error) -// MLFindFileStructureRequest configures the Ml Find File Structure API request. +// MLFindFileStructureRequest configures the ML Find File Structure API request. // type MLFindFileStructureRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.flush_job.go b/esapi/api.xpack.ml.flush_job.go index 2570eeb60a..ea877bcfd8 100755 --- a/esapi/api.xpack.ml.flush_job.go +++ b/esapi/api.xpack.ml.flush_job.go @@ -26,7 +26,7 @@ func newMLFlushJobFunc(t Transport) MLFlushJob { // type MLFlushJob func(job_id string, o ...func(*MLFlushJobRequest)) (*Response, error) -// MLFlushJobRequest configures the Ml Flush Job API request. +// MLFlushJobRequest configures the ML Flush Job API request. // type MLFlushJobRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.forecast.go b/esapi/api.xpack.ml.forecast.go index bb94891fce..2b454044c7 100755 --- a/esapi/api.xpack.ml.forecast.go +++ b/esapi/api.xpack.ml.forecast.go @@ -25,7 +25,7 @@ func newMLForecastFunc(t Transport) MLForecast { // type MLForecast func(job_id string, o ...func(*MLForecastRequest)) (*Response, error) -// MLForecastRequest configures the Ml Forecast API request. +// MLForecastRequest configures the ML Forecast API request. // type MLForecastRequest struct { JobID string diff --git a/esapi/api.xpack.ml.get_buckets.go b/esapi/api.xpack.ml.get_buckets.go index 01a05eb4b4..5f1c777fab 100755 --- a/esapi/api.xpack.ml.get_buckets.go +++ b/esapi/api.xpack.ml.get_buckets.go @@ -27,7 +27,7 @@ func newMLGetBucketsFunc(t Transport) MLGetBuckets { // type MLGetBuckets func(job_id string, o ...func(*MLGetBucketsRequest)) (*Response, error) -// MLGetBucketsRequest configures the Ml Get Buckets API request. +// MLGetBucketsRequest configures the ML Get Buckets API request. // type MLGetBucketsRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.get_calendar_events.go b/esapi/api.xpack.ml.get_calendar_events.go index a2a119fa16..d4fb8c1d3b 100755 --- a/esapi/api.xpack.ml.get_calendar_events.go +++ b/esapi/api.xpack.ml.get_calendar_events.go @@ -26,7 +26,7 @@ func newMLGetCalendarEventsFunc(t Transport) MLGetCalendarEvents { // type MLGetCalendarEvents func(calendar_id string, o ...func(*MLGetCalendarEventsRequest)) (*Response, error) -// MLGetCalendarEventsRequest configures the Ml Get Calendar Events API request. +// MLGetCalendarEventsRequest configures the ML Get Calendar Events API request. // type MLGetCalendarEventsRequest struct { CalendarID string diff --git a/esapi/api.xpack.ml.get_calendars.go b/esapi/api.xpack.ml.get_calendars.go index f43831d4ed..20e81e90b3 100755 --- a/esapi/api.xpack.ml.get_calendars.go +++ b/esapi/api.xpack.ml.get_calendars.go @@ -26,7 +26,7 @@ func newMLGetCalendarsFunc(t Transport) MLGetCalendars { // type MLGetCalendars func(o ...func(*MLGetCalendarsRequest)) (*Response, error) -// MLGetCalendarsRequest configures the Ml Get Calendars API request. +// MLGetCalendarsRequest configures the ML Get Calendars API request. // type MLGetCalendarsRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.get_categories.go b/esapi/api.xpack.ml.get_categories.go index cf61eba98d..ce0ccb3f25 100755 --- a/esapi/api.xpack.ml.get_categories.go +++ b/esapi/api.xpack.ml.get_categories.go @@ -26,7 +26,7 @@ func newMLGetCategoriesFunc(t Transport) MLGetCategories { // type MLGetCategories func(job_id string, o ...func(*MLGetCategoriesRequest)) (*Response, error) -// MLGetCategoriesRequest configures the Ml Get Categories API request. +// MLGetCategoriesRequest configures the ML Get Categories API request. // type MLGetCategoriesRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.get_data_frame_analytics.go b/esapi/api.xpack.ml.get_data_frame_analytics.go index b208028350..c481929b47 100755 --- a/esapi/api.xpack.ml.get_data_frame_analytics.go +++ b/esapi/api.xpack.ml.get_data_frame_analytics.go @@ -21,14 +21,14 @@ func newMLGetDataFrameAnalyticsFunc(t Transport) MLGetDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLGetDataFrameAnalytics - +// MLGetDataFrameAnalytics - http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html // type MLGetDataFrameAnalytics func(o ...func(*MLGetDataFrameAnalyticsRequest)) (*Response, error) -// MLGetDataFrameAnalyticsRequest configures the Ml Get Data Frame Analytics API request. +// MLGetDataFrameAnalyticsRequest configures the ML Get Data Frame Analytics API request. // type MLGetDataFrameAnalyticsRequest struct { - DocumentID string + ID string AllowNoMatch *bool From *int @@ -55,16 +55,16 @@ func (r MLGetDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp method = "GET" - path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.ID)) path.WriteString("/") path.WriteString("_ml") path.WriteString("/") path.WriteString("data_frame") path.WriteString("/") path.WriteString("analytics") - if r.DocumentID != "" { + if r.ID != "" { path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.ID) } params = make(map[string]string) @@ -145,11 +145,11 @@ func (f MLGetDataFrameAnalytics) WithContext(v context.Context) func(*MLGetDataF } } -// WithDocumentID - the ID of the data frame analytics to fetch. +// WithID - the ID of the data frame analytics to fetch. // -func (f MLGetDataFrameAnalytics) WithDocumentID(v string) func(*MLGetDataFrameAnalyticsRequest) { +func (f MLGetDataFrameAnalytics) WithID(v string) func(*MLGetDataFrameAnalyticsRequest) { return func(r *MLGetDataFrameAnalyticsRequest) { - r.DocumentID = v + r.ID = v } } diff --git a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go index b38c177aef..0f5d5c90e0 100755 --- a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go +++ b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go @@ -21,14 +21,14 @@ func newMLGetDataFrameAnalyticsStatsFunc(t Transport) MLGetDataFrameAnalyticsSta // ----- API Definition ------------------------------------------------------- -// MLGetDataFrameAnalyticsStats - +// MLGetDataFrameAnalyticsStats - http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html // type MLGetDataFrameAnalyticsStats func(o ...func(*MLGetDataFrameAnalyticsStatsRequest)) (*Response, error) -// MLGetDataFrameAnalyticsStatsRequest configures the Ml Get Data Frame Analytics Stats API request. +// MLGetDataFrameAnalyticsStatsRequest configures the ML Get Data Frame Analytics Stats API request. // type MLGetDataFrameAnalyticsStatsRequest struct { - DocumentID string + ID string AllowNoMatch *bool From *int @@ -55,16 +55,16 @@ func (r MLGetDataFrameAnalyticsStatsRequest) Do(ctx context.Context, transport T method = "GET" - path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID) + 1 + len("_stats")) + path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.ID) + 1 + len("_stats")) path.WriteString("/") path.WriteString("_ml") path.WriteString("/") path.WriteString("data_frame") path.WriteString("/") path.WriteString("analytics") - if r.DocumentID != "" { + if r.ID != "" { path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.ID) } path.WriteString("/") path.WriteString("_stats") @@ -147,11 +147,11 @@ func (f MLGetDataFrameAnalyticsStats) WithContext(v context.Context) func(*MLGet } } -// WithDocumentID - the ID of the data frame analytics stats to fetch. +// WithID - the ID of the data frame analytics stats to fetch. // -func (f MLGetDataFrameAnalyticsStats) WithDocumentID(v string) func(*MLGetDataFrameAnalyticsStatsRequest) { +func (f MLGetDataFrameAnalyticsStats) WithID(v string) func(*MLGetDataFrameAnalyticsStatsRequest) { return func(r *MLGetDataFrameAnalyticsStatsRequest) { - r.DocumentID = v + r.ID = v } } diff --git a/esapi/api.xpack.ml.get_datafeed_stats.go b/esapi/api.xpack.ml.get_datafeed_stats.go index 52fcc5f5f7..25a5ba6172 100755 --- a/esapi/api.xpack.ml.get_datafeed_stats.go +++ b/esapi/api.xpack.ml.get_datafeed_stats.go @@ -25,7 +25,7 @@ func newMLGetDatafeedStatsFunc(t Transport) MLGetDatafeedStats { // type MLGetDatafeedStats func(o ...func(*MLGetDatafeedStatsRequest)) (*Response, error) -// MLGetDatafeedStatsRequest configures the Ml Get Datafeed Stats API request. +// MLGetDatafeedStatsRequest configures the ML Get Datafeed Stats API request. // type MLGetDatafeedStatsRequest struct { DatafeedID string diff --git a/esapi/api.xpack.ml.get_datafeeds.go b/esapi/api.xpack.ml.get_datafeeds.go index a72c9a2362..ec52494352 100755 --- a/esapi/api.xpack.ml.get_datafeeds.go +++ b/esapi/api.xpack.ml.get_datafeeds.go @@ -25,7 +25,7 @@ func newMLGetDatafeedsFunc(t Transport) MLGetDatafeeds { // type MLGetDatafeeds func(o ...func(*MLGetDatafeedsRequest)) (*Response, error) -// MLGetDatafeedsRequest configures the Ml Get Datafeeds API request. +// MLGetDatafeedsRequest configures the ML Get Datafeeds API request. // type MLGetDatafeedsRequest struct { DatafeedID string diff --git a/esapi/api.xpack.ml.get_filters.go b/esapi/api.xpack.ml.get_filters.go index a3eaa4d962..1426d3109f 100755 --- a/esapi/api.xpack.ml.get_filters.go +++ b/esapi/api.xpack.ml.get_filters.go @@ -25,7 +25,7 @@ func newMLGetFiltersFunc(t Transport) MLGetFilters { // type MLGetFilters func(o ...func(*MLGetFiltersRequest)) (*Response, error) -// MLGetFiltersRequest configures the Ml Get Filters API request. +// MLGetFiltersRequest configures the ML Get Filters API request. // type MLGetFiltersRequest struct { FilterID string diff --git a/esapi/api.xpack.ml.get_influencers.go b/esapi/api.xpack.ml.get_influencers.go index 5c1011744f..0b0d325f70 100755 --- a/esapi/api.xpack.ml.get_influencers.go +++ b/esapi/api.xpack.ml.get_influencers.go @@ -27,7 +27,7 @@ func newMLGetInfluencersFunc(t Transport) MLGetInfluencers { // type MLGetInfluencers func(job_id string, o ...func(*MLGetInfluencersRequest)) (*Response, error) -// MLGetInfluencersRequest configures the Ml Get Influencers API request. +// MLGetInfluencersRequest configures the ML Get Influencers API request. // type MLGetInfluencersRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.get_job_stats.go b/esapi/api.xpack.ml.get_job_stats.go index c406025e32..b7107a735c 100755 --- a/esapi/api.xpack.ml.get_job_stats.go +++ b/esapi/api.xpack.ml.get_job_stats.go @@ -25,7 +25,7 @@ func newMLGetJobStatsFunc(t Transport) MLGetJobStats { // type MLGetJobStats func(o ...func(*MLGetJobStatsRequest)) (*Response, error) -// MLGetJobStatsRequest configures the Ml Get Job Stats API request. +// MLGetJobStatsRequest configures the ML Get Job Stats API request. // type MLGetJobStatsRequest struct { JobID string diff --git a/esapi/api.xpack.ml.get_jobs.go b/esapi/api.xpack.ml.get_jobs.go index d81b8360ec..6042ec190c 100755 --- a/esapi/api.xpack.ml.get_jobs.go +++ b/esapi/api.xpack.ml.get_jobs.go @@ -25,7 +25,7 @@ func newMLGetJobsFunc(t Transport) MLGetJobs { // type MLGetJobs func(o ...func(*MLGetJobsRequest)) (*Response, error) -// MLGetJobsRequest configures the Ml Get Jobs API request. +// MLGetJobsRequest configures the ML Get Jobs API request. // type MLGetJobsRequest struct { JobID string diff --git a/esapi/api.xpack.ml.get_model_snapshots.go b/esapi/api.xpack.ml.get_model_snapshots.go index 4156be0911..88e342df78 100755 --- a/esapi/api.xpack.ml.get_model_snapshots.go +++ b/esapi/api.xpack.ml.get_model_snapshots.go @@ -27,7 +27,7 @@ func newMLGetModelSnapshotsFunc(t Transport) MLGetModelSnapshots { // type MLGetModelSnapshots func(job_id string, o ...func(*MLGetModelSnapshotsRequest)) (*Response, error) -// MLGetModelSnapshotsRequest configures the Ml Get Model Snapshots API request. +// MLGetModelSnapshotsRequest configures the ML Get Model Snapshots API request. // type MLGetModelSnapshotsRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.get_overall_buckets.go b/esapi/api.xpack.ml.get_overall_buckets.go index 266944c21e..9a539190d6 100755 --- a/esapi/api.xpack.ml.get_overall_buckets.go +++ b/esapi/api.xpack.ml.get_overall_buckets.go @@ -27,7 +27,7 @@ func newMLGetOverallBucketsFunc(t Transport) MLGetOverallBuckets { // type MLGetOverallBuckets func(job_id string, o ...func(*MLGetOverallBucketsRequest)) (*Response, error) -// MLGetOverallBucketsRequest configures the Ml Get Overall Buckets API request. +// MLGetOverallBucketsRequest configures the ML Get Overall Buckets API request. // type MLGetOverallBucketsRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.get_records.go b/esapi/api.xpack.ml.get_records.go index 6015b11aee..ce7ca67a25 100755 --- a/esapi/api.xpack.ml.get_records.go +++ b/esapi/api.xpack.ml.get_records.go @@ -27,7 +27,7 @@ func newMLGetRecordsFunc(t Transport) MLGetRecords { // type MLGetRecords func(job_id string, o ...func(*MLGetRecordsRequest)) (*Response, error) -// MLGetRecordsRequest configures the Ml Get Records API request. +// MLGetRecordsRequest configures the ML Get Records API request. // type MLGetRecordsRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.info.go b/esapi/api.xpack.ml.info.go index bd61b92269..6fe4993841 100755 --- a/esapi/api.xpack.ml.info.go +++ b/esapi/api.xpack.ml.info.go @@ -24,7 +24,7 @@ func newMLInfoFunc(t Transport) MLInfo { // type MLInfo func(o ...func(*MLInfoRequest)) (*Response, error) -// MLInfoRequest configures the Ml Info API request. +// MLInfoRequest configures the ML Info API request. // type MLInfoRequest struct { Pretty bool diff --git a/esapi/api.xpack.ml.open_job.go b/esapi/api.xpack.ml.open_job.go index 9438b84c7d..afce8936d9 100755 --- a/esapi/api.xpack.ml.open_job.go +++ b/esapi/api.xpack.ml.open_job.go @@ -25,7 +25,7 @@ func newMLOpenJobFunc(t Transport) MLOpenJob { // type MLOpenJob func(job_id string, o ...func(*MLOpenJobRequest)) (*Response, error) -// MLOpenJobRequest configures the Ml Open Job API request. +// MLOpenJobRequest configures the ML Open Job API request. // type MLOpenJobRequest struct { IgnoreDowntime *bool diff --git a/esapi/api.xpack.ml.post_calendar_events.go b/esapi/api.xpack.ml.post_calendar_events.go index 0c66f10ad4..ebe7a5c12f 100755 --- a/esapi/api.xpack.ml.post_calendar_events.go +++ b/esapi/api.xpack.ml.post_calendar_events.go @@ -25,7 +25,7 @@ func newMLPostCalendarEventsFunc(t Transport) MLPostCalendarEvents { // type MLPostCalendarEvents func(calendar_id string, body io.Reader, o ...func(*MLPostCalendarEventsRequest)) (*Response, error) -// MLPostCalendarEventsRequest configures the Ml Post Calendar Events API request. +// MLPostCalendarEventsRequest configures the ML Post Calendar Events API request. // type MLPostCalendarEventsRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.post_data.go b/esapi/api.xpack.ml.post_data.go index ff4df45105..b0cce1268c 100755 --- a/esapi/api.xpack.ml.post_data.go +++ b/esapi/api.xpack.ml.post_data.go @@ -25,7 +25,7 @@ func newMLPostDataFunc(t Transport) MLPostData { // type MLPostData func(job_id string, body io.Reader, o ...func(*MLPostDataRequest)) (*Response, error) -// MLPostDataRequest configures the Ml Post Data API request. +// MLPostDataRequest configures the ML Post Data API request. // type MLPostDataRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.preview_datafeed.go b/esapi/api.xpack.ml.preview_datafeed.go index 3e32006a7e..00eca63e3e 100755 --- a/esapi/api.xpack.ml.preview_datafeed.go +++ b/esapi/api.xpack.ml.preview_datafeed.go @@ -24,7 +24,7 @@ func newMLPreviewDatafeedFunc(t Transport) MLPreviewDatafeed { // type MLPreviewDatafeed func(datafeed_id string, o ...func(*MLPreviewDatafeedRequest)) (*Response, error) -// MLPreviewDatafeedRequest configures the Ml Preview Datafeed API request. +// MLPreviewDatafeedRequest configures the ML Preview Datafeed API request. // type MLPreviewDatafeedRequest struct { DatafeedID string diff --git a/esapi/api.xpack.ml.put_calendar.go b/esapi/api.xpack.ml.put_calendar.go index 2b7b6349d3..84958837fd 100755 --- a/esapi/api.xpack.ml.put_calendar.go +++ b/esapi/api.xpack.ml.put_calendar.go @@ -25,7 +25,7 @@ func newMLPutCalendarFunc(t Transport) MLPutCalendar { // type MLPutCalendar func(calendar_id string, o ...func(*MLPutCalendarRequest)) (*Response, error) -// MLPutCalendarRequest configures the Ml Put Calendar API request. +// MLPutCalendarRequest configures the ML Put Calendar API request. // type MLPutCalendarRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.put_calendar_job.go b/esapi/api.xpack.ml.put_calendar_job.go index 9cce8f3652..15f7296e53 100755 --- a/esapi/api.xpack.ml.put_calendar_job.go +++ b/esapi/api.xpack.ml.put_calendar_job.go @@ -24,7 +24,7 @@ func newMLPutCalendarJobFunc(t Transport) MLPutCalendarJob { // type MLPutCalendarJob func(calendar_id string, job_id string, o ...func(*MLPutCalendarJobRequest)) (*Response, error) -// MLPutCalendarJobRequest configures the Ml Put Calendar Job API request. +// MLPutCalendarJobRequest configures the ML Put Calendar Job API request. // type MLPutCalendarJobRequest struct { CalendarID string diff --git a/esapi/api.xpack.ml.put_data_frame_analytics.go b/esapi/api.xpack.ml.put_data_frame_analytics.go index 452317493f..f07fa02498 100755 --- a/esapi/api.xpack.ml.put_data_frame_analytics.go +++ b/esapi/api.xpack.ml.put_data_frame_analytics.go @@ -11,7 +11,7 @@ import ( func newMLPutDataFrameAnalyticsFunc(t Transport) MLPutDataFrameAnalytics { return func(id string, body io.Reader, o ...func(*MLPutDataFrameAnalyticsRequest)) (*Response, error) { - var r = MLPutDataFrameAnalyticsRequest{DocumentID: id, Body: body} + var r = MLPutDataFrameAnalyticsRequest{ID: id, Body: body} for _, f := range o { f(&r) } @@ -21,14 +21,14 @@ func newMLPutDataFrameAnalyticsFunc(t Transport) MLPutDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLPutDataFrameAnalytics - +// MLPutDataFrameAnalytics - http://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html // type MLPutDataFrameAnalytics func(id string, body io.Reader, o ...func(*MLPutDataFrameAnalyticsRequest)) (*Response, error) -// MLPutDataFrameAnalyticsRequest configures the Ml Put Data Frame Analytics API request. +// MLPutDataFrameAnalyticsRequest configures the ML Put Data Frame Analytics API request. // type MLPutDataFrameAnalyticsRequest struct { - DocumentID string + ID string Body io.Reader @@ -53,7 +53,7 @@ func (r MLPutDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp method = "PUT" - path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.ID)) path.WriteString("/") path.WriteString("_ml") path.WriteString("/") @@ -61,7 +61,7 @@ func (r MLPutDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp path.WriteString("/") path.WriteString("analytics") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.ID) params = make(map[string]string) diff --git a/esapi/api.xpack.ml.put_datafeed.go b/esapi/api.xpack.ml.put_datafeed.go index 12e2560df2..323d3ef799 100755 --- a/esapi/api.xpack.ml.put_datafeed.go +++ b/esapi/api.xpack.ml.put_datafeed.go @@ -25,7 +25,7 @@ func newMLPutDatafeedFunc(t Transport) MLPutDatafeed { // type MLPutDatafeed func(body io.Reader, datafeed_id string, o ...func(*MLPutDatafeedRequest)) (*Response, error) -// MLPutDatafeedRequest configures the Ml Put Datafeed API request. +// MLPutDatafeedRequest configures the ML Put Datafeed API request. // type MLPutDatafeedRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.put_filter.go b/esapi/api.xpack.ml.put_filter.go index c8c3f2defa..caa4e4698b 100755 --- a/esapi/api.xpack.ml.put_filter.go +++ b/esapi/api.xpack.ml.put_filter.go @@ -25,7 +25,7 @@ func newMLPutFilterFunc(t Transport) MLPutFilter { // type MLPutFilter func(body io.Reader, filter_id string, o ...func(*MLPutFilterRequest)) (*Response, error) -// MLPutFilterRequest configures the Ml Put Filter API request. +// MLPutFilterRequest configures the ML Put Filter API request. // type MLPutFilterRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.put_job.go b/esapi/api.xpack.ml.put_job.go index bc0d6f1a9f..24078bc434 100755 --- a/esapi/api.xpack.ml.put_job.go +++ b/esapi/api.xpack.ml.put_job.go @@ -25,7 +25,7 @@ func newMLPutJobFunc(t Transport) MLPutJob { // type MLPutJob func(job_id string, body io.Reader, o ...func(*MLPutJobRequest)) (*Response, error) -// MLPutJobRequest configures the Ml Put Job API request. +// MLPutJobRequest configures the ML Put Job API request. // type MLPutJobRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.revert_model_snapshot.go b/esapi/api.xpack.ml.revert_model_snapshot.go index 0b9a03a1e0..62170ec2db 100755 --- a/esapi/api.xpack.ml.revert_model_snapshot.go +++ b/esapi/api.xpack.ml.revert_model_snapshot.go @@ -26,7 +26,7 @@ func newMLRevertModelSnapshotFunc(t Transport) MLRevertModelSnapshot { // type MLRevertModelSnapshot func(snapshot_id string, job_id string, o ...func(*MLRevertModelSnapshotRequest)) (*Response, error) -// MLRevertModelSnapshotRequest configures the Ml Revert Model Snapshot API request. +// MLRevertModelSnapshotRequest configures the ML Revert Model Snapshot API request. // type MLRevertModelSnapshotRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.set_upgrade_mode.go b/esapi/api.xpack.ml.set_upgrade_mode.go index 7c3920779b..ac4d3cd3f8 100755 --- a/esapi/api.xpack.ml.set_upgrade_mode.go +++ b/esapi/api.xpack.ml.set_upgrade_mode.go @@ -26,7 +26,7 @@ func newMLSetUpgradeModeFunc(t Transport) MLSetUpgradeMode { // type MLSetUpgradeMode func(o ...func(*MLSetUpgradeModeRequest)) (*Response, error) -// MLSetUpgradeModeRequest configures the Ml Set Upgrade Mode API request. +// MLSetUpgradeModeRequest configures the ML Set Upgrade Mode API request. // type MLSetUpgradeModeRequest struct { Enabled *bool diff --git a/esapi/api.xpack.ml.start_data_frame_analytics.go b/esapi/api.xpack.ml.start_data_frame_analytics.go index 12fb460b66..c98dad4534 100755 --- a/esapi/api.xpack.ml.start_data_frame_analytics.go +++ b/esapi/api.xpack.ml.start_data_frame_analytics.go @@ -12,7 +12,7 @@ import ( func newMLStartDataFrameAnalyticsFunc(t Transport) MLStartDataFrameAnalytics { return func(id string, o ...func(*MLStartDataFrameAnalyticsRequest)) (*Response, error) { - var r = MLStartDataFrameAnalyticsRequest{DocumentID: id} + var r = MLStartDataFrameAnalyticsRequest{ID: id} for _, f := range o { f(&r) } @@ -22,14 +22,14 @@ func newMLStartDataFrameAnalyticsFunc(t Transport) MLStartDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLStartDataFrameAnalytics - +// MLStartDataFrameAnalytics - http://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html // type MLStartDataFrameAnalytics func(id string, o ...func(*MLStartDataFrameAnalyticsRequest)) (*Response, error) -// MLStartDataFrameAnalyticsRequest configures the Ml Start Data Frame Analytics API request. +// MLStartDataFrameAnalyticsRequest configures the ML Start Data Frame Analytics API request. // type MLStartDataFrameAnalyticsRequest struct { - DocumentID string + ID string Body io.Reader @@ -56,7 +56,7 @@ func (r MLStartDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tran method = "POST" - path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID) + 1 + len("_start")) + path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.ID) + 1 + len("_start")) path.WriteString("/") path.WriteString("_ml") path.WriteString("/") @@ -64,7 +64,7 @@ func (r MLStartDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tran path.WriteString("/") path.WriteString("analytics") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.ID) path.WriteString("/") path.WriteString("_start") diff --git a/esapi/api.xpack.ml.start_datafeed.go b/esapi/api.xpack.ml.start_datafeed.go index 44b273c882..9d4744464e 100755 --- a/esapi/api.xpack.ml.start_datafeed.go +++ b/esapi/api.xpack.ml.start_datafeed.go @@ -26,7 +26,7 @@ func newMLStartDatafeedFunc(t Transport) MLStartDatafeed { // type MLStartDatafeed func(datafeed_id string, o ...func(*MLStartDatafeedRequest)) (*Response, error) -// MLStartDatafeedRequest configures the Ml Start Datafeed API request. +// MLStartDatafeedRequest configures the ML Start Datafeed API request. // type MLStartDatafeedRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.stop_data_frame_analytics.go b/esapi/api.xpack.ml.stop_data_frame_analytics.go index 20b7981763..d1b9455f43 100755 --- a/esapi/api.xpack.ml.stop_data_frame_analytics.go +++ b/esapi/api.xpack.ml.stop_data_frame_analytics.go @@ -13,7 +13,7 @@ import ( func newMLStopDataFrameAnalyticsFunc(t Transport) MLStopDataFrameAnalytics { return func(id string, o ...func(*MLStopDataFrameAnalyticsRequest)) (*Response, error) { - var r = MLStopDataFrameAnalyticsRequest{DocumentID: id} + var r = MLStopDataFrameAnalyticsRequest{ID: id} for _, f := range o { f(&r) } @@ -23,14 +23,14 @@ func newMLStopDataFrameAnalyticsFunc(t Transport) MLStopDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLStopDataFrameAnalytics - +// MLStopDataFrameAnalytics - http://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html // type MLStopDataFrameAnalytics func(id string, o ...func(*MLStopDataFrameAnalyticsRequest)) (*Response, error) -// MLStopDataFrameAnalyticsRequest configures the Ml Stop Data Frame Analytics API request. +// MLStopDataFrameAnalyticsRequest configures the ML Stop Data Frame Analytics API request. // type MLStopDataFrameAnalyticsRequest struct { - DocumentID string + ID string Body io.Reader @@ -59,7 +59,7 @@ func (r MLStopDataFrameAnalyticsRequest) Do(ctx context.Context, transport Trans method = "POST" - path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.DocumentID) + 1 + len("_stop")) + path.Grow(1 + len("_ml") + 1 + len("data_frame") + 1 + len("analytics") + 1 + len(r.ID) + 1 + len("_stop")) path.WriteString("/") path.WriteString("_ml") path.WriteString("/") @@ -67,7 +67,7 @@ func (r MLStopDataFrameAnalyticsRequest) Do(ctx context.Context, transport Trans path.WriteString("/") path.WriteString("analytics") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.ID) path.WriteString("/") path.WriteString("_stop") diff --git a/esapi/api.xpack.ml.stop_datafeed.go b/esapi/api.xpack.ml.stop_datafeed.go index ea9e56e85f..e29a06eb5e 100755 --- a/esapi/api.xpack.ml.stop_datafeed.go +++ b/esapi/api.xpack.ml.stop_datafeed.go @@ -26,7 +26,7 @@ func newMLStopDatafeedFunc(t Transport) MLStopDatafeed { // type MLStopDatafeed func(datafeed_id string, o ...func(*MLStopDatafeedRequest)) (*Response, error) -// MLStopDatafeedRequest configures the Ml Stop Datafeed API request. +// MLStopDatafeedRequest configures the ML Stop Datafeed API request. // type MLStopDatafeedRequest struct { DatafeedID string diff --git a/esapi/api.xpack.ml.update_datafeed.go b/esapi/api.xpack.ml.update_datafeed.go index 017acee166..c7d6d4ae51 100755 --- a/esapi/api.xpack.ml.update_datafeed.go +++ b/esapi/api.xpack.ml.update_datafeed.go @@ -25,7 +25,7 @@ func newMLUpdateDatafeedFunc(t Transport) MLUpdateDatafeed { // type MLUpdateDatafeed func(body io.Reader, datafeed_id string, o ...func(*MLUpdateDatafeedRequest)) (*Response, error) -// MLUpdateDatafeedRequest configures the Ml Update Datafeed API request. +// MLUpdateDatafeedRequest configures the ML Update Datafeed API request. // type MLUpdateDatafeedRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.update_filter.go b/esapi/api.xpack.ml.update_filter.go index 21a8f634f3..be9bc62b65 100755 --- a/esapi/api.xpack.ml.update_filter.go +++ b/esapi/api.xpack.ml.update_filter.go @@ -25,7 +25,7 @@ func newMLUpdateFilterFunc(t Transport) MLUpdateFilter { // type MLUpdateFilter func(body io.Reader, filter_id string, o ...func(*MLUpdateFilterRequest)) (*Response, error) -// MLUpdateFilterRequest configures the Ml Update Filter API request. +// MLUpdateFilterRequest configures the ML Update Filter API request. // type MLUpdateFilterRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.update_job.go b/esapi/api.xpack.ml.update_job.go index ff8c21e3d2..1f1763c288 100755 --- a/esapi/api.xpack.ml.update_job.go +++ b/esapi/api.xpack.ml.update_job.go @@ -25,7 +25,7 @@ func newMLUpdateJobFunc(t Transport) MLUpdateJob { // type MLUpdateJob func(job_id string, body io.Reader, o ...func(*MLUpdateJobRequest)) (*Response, error) -// MLUpdateJobRequest configures the Ml Update Job API request. +// MLUpdateJobRequest configures the ML Update Job API request. // type MLUpdateJobRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.update_model_snapshot.go b/esapi/api.xpack.ml.update_model_snapshot.go index e1d1bb71ca..cb4f669a00 100755 --- a/esapi/api.xpack.ml.update_model_snapshot.go +++ b/esapi/api.xpack.ml.update_model_snapshot.go @@ -25,7 +25,7 @@ func newMLUpdateModelSnapshotFunc(t Transport) MLUpdateModelSnapshot { // type MLUpdateModelSnapshot func(snapshot_id string, job_id string, body io.Reader, o ...func(*MLUpdateModelSnapshotRequest)) (*Response, error) -// MLUpdateModelSnapshotRequest configures the Ml Update Model Snapshot API request. +// MLUpdateModelSnapshotRequest configures the ML Update Model Snapshot API request. // type MLUpdateModelSnapshotRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.validate.go b/esapi/api.xpack.ml.validate.go index 4f2f8451bd..9b27251018 100755 --- a/esapi/api.xpack.ml.validate.go +++ b/esapi/api.xpack.ml.validate.go @@ -25,7 +25,7 @@ func newMLValidateFunc(t Transport) MLValidate { // type MLValidate func(body io.Reader, o ...func(*MLValidateRequest)) (*Response, error) -// MLValidateRequest configures the Ml Validate API request. +// MLValidateRequest configures the ML Validate API request. // type MLValidateRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ml.validate_detector.go b/esapi/api.xpack.ml.validate_detector.go index e69b1aff3f..09b76282b3 100755 --- a/esapi/api.xpack.ml.validate_detector.go +++ b/esapi/api.xpack.ml.validate_detector.go @@ -25,7 +25,7 @@ func newMLValidateDetectorFunc(t Transport) MLValidateDetector { // type MLValidateDetector func(body io.Reader, o ...func(*MLValidateDetectorRequest)) (*Response, error) -// MLValidateDetectorRequest configures the Ml Validate Detector API request. +// MLValidateDetectorRequest configures the ML Validate Detector API request. // type MLValidateDetectorRequest struct { Body io.Reader diff --git a/esapi/api.xpack.rollup.delete_job.go b/esapi/api.xpack.rollup.delete_job.go index 29d9b8034f..b47121c9bd 100755 --- a/esapi/api.xpack.rollup.delete_job.go +++ b/esapi/api.xpack.rollup.delete_job.go @@ -10,7 +10,7 @@ import ( func newRollupDeleteJobFunc(t Transport) RollupDeleteJob { return func(id string, o ...func(*RollupDeleteJobRequest)) (*Response, error) { - var r = RollupDeleteJobRequest{DocumentID: id} + var r = RollupDeleteJobRequest{JobID: id} for _, f := range o { f(&r) } @@ -24,10 +24,10 @@ func newRollupDeleteJobFunc(t Transport) RollupDeleteJob { // type RollupDeleteJob func(id string, o ...func(*RollupDeleteJobRequest)) (*Response, error) -// RollupDeleteJobRequest configures the Rollup Delete Job API request. +// RollupDeleteJobRequest configures the Rollup Delete Job API request. // type RollupDeleteJobRequest struct { - DocumentID string + JobID string Pretty bool Human bool @@ -50,13 +50,13 @@ func (r RollupDeleteJobRequest) Do(ctx context.Context, transport Transport) (*R method = "DELETE" - path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.JobID)) path.WriteString("/") path.WriteString("_rollup") path.WriteString("/") path.WriteString("job") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.JobID) params = make(map[string]string) diff --git a/esapi/api.xpack.rollup.get_jobs.go b/esapi/api.xpack.rollup.get_jobs.go index e08933ea49..ebced53e2f 100755 --- a/esapi/api.xpack.rollup.get_jobs.go +++ b/esapi/api.xpack.rollup.get_jobs.go @@ -24,10 +24,10 @@ func newRollupGetJobsFunc(t Transport) RollupGetJobs { // type RollupGetJobs func(o ...func(*RollupGetJobsRequest)) (*Response, error) -// RollupGetJobsRequest configures the Rollup Get Jobs API request. +// RollupGetJobsRequest configures the Rollup Get Jobs API request. // type RollupGetJobsRequest struct { - DocumentID string + JobID string Pretty bool Human bool @@ -50,14 +50,14 @@ func (r RollupGetJobsRequest) Do(ctx context.Context, transport Transport) (*Res method = "GET" - path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.JobID)) path.WriteString("/") path.WriteString("_rollup") path.WriteString("/") path.WriteString("job") - if r.DocumentID != "" { + if r.JobID != "" { path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.JobID) } params = make(map[string]string) @@ -126,11 +126,11 @@ func (f RollupGetJobs) WithContext(v context.Context) func(*RollupGetJobsRequest } } -// WithDocumentID - the ID of the job(s) to fetch. accepts glob patterns, or left blank for all jobs. +// WithJobID - the ID of the job(s) to fetch. accepts glob patterns, or left blank for all jobs. // -func (f RollupGetJobs) WithDocumentID(v string) func(*RollupGetJobsRequest) { +func (f RollupGetJobs) WithJobID(v string) func(*RollupGetJobsRequest) { return func(r *RollupGetJobsRequest) { - r.DocumentID = v + r.JobID = v } } diff --git a/esapi/api.xpack.rollup.get_rollup_caps.go b/esapi/api.xpack.rollup.get_rollup_caps.go index 4b69266ef6..73f19c5190 100755 --- a/esapi/api.xpack.rollup.get_rollup_caps.go +++ b/esapi/api.xpack.rollup.get_rollup_caps.go @@ -24,10 +24,10 @@ func newRollupGetRollupCapsFunc(t Transport) RollupGetRollupCaps { // type RollupGetRollupCaps func(o ...func(*RollupGetRollupCapsRequest)) (*Response, error) -// RollupGetRollupCapsRequest configures the Rollup Get Rollup Caps API request. +// RollupGetRollupCapsRequest configures the Rollup Get Rollup Caps API request. // type RollupGetRollupCapsRequest struct { - DocumentID string + Index string Pretty bool Human bool @@ -50,14 +50,14 @@ func (r RollupGetRollupCapsRequest) Do(ctx context.Context, transport Transport) method = "GET" - path.Grow(1 + len("_rollup") + 1 + len("data") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_rollup") + 1 + len("data") + 1 + len(r.Index)) path.WriteString("/") path.WriteString("_rollup") path.WriteString("/") path.WriteString("data") - if r.DocumentID != "" { + if r.Index != "" { path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.Index) } params = make(map[string]string) @@ -126,11 +126,11 @@ func (f RollupGetRollupCaps) WithContext(v context.Context) func(*RollupGetRollu } } -// WithDocumentID - the ID of the index to check rollup capabilities on, or left blank for all jobs. +// WithIndex - the ID of the index to check rollup capabilities on, or left blank for all jobs. // -func (f RollupGetRollupCaps) WithDocumentID(v string) func(*RollupGetRollupCapsRequest) { +func (f RollupGetRollupCaps) WithIndex(v string) func(*RollupGetRollupCapsRequest) { return func(r *RollupGetRollupCapsRequest) { - r.DocumentID = v + r.Index = v } } diff --git a/esapi/api.xpack.rollup.get_rollup_index_caps.go b/esapi/api.xpack.rollup.get_rollup_index_caps.go index 683e082030..c97b7dfc23 100755 --- a/esapi/api.xpack.rollup.get_rollup_index_caps.go +++ b/esapi/api.xpack.rollup.get_rollup_index_caps.go @@ -24,7 +24,7 @@ func newRollupGetRollupIndexCapsFunc(t Transport) RollupGetRollupIndexCaps { // type RollupGetRollupIndexCaps func(index string, o ...func(*RollupGetRollupIndexCapsRequest)) (*Response, error) -// RollupGetRollupIndexCapsRequest configures the Rollup Get Rollup Index Caps API request. +// RollupGetRollupIndexCapsRequest configures the Rollup Get Rollup Index Caps API request. // type RollupGetRollupIndexCapsRequest struct { Index string diff --git a/esapi/api.xpack.rollup.put_job.go b/esapi/api.xpack.rollup.put_job.go index f205ff7275..a68f5a7cef 100755 --- a/esapi/api.xpack.rollup.put_job.go +++ b/esapi/api.xpack.rollup.put_job.go @@ -11,7 +11,7 @@ import ( func newRollupPutJobFunc(t Transport) RollupPutJob { return func(id string, body io.Reader, o ...func(*RollupPutJobRequest)) (*Response, error) { - var r = RollupPutJobRequest{DocumentID: id, Body: body} + var r = RollupPutJobRequest{JobID: id, Body: body} for _, f := range o { f(&r) } @@ -25,10 +25,10 @@ func newRollupPutJobFunc(t Transport) RollupPutJob { // type RollupPutJob func(id string, body io.Reader, o ...func(*RollupPutJobRequest)) (*Response, error) -// RollupPutJobRequest configures the Rollup Put Job API request. +// RollupPutJobRequest configures the Rollup Put Job API request. // type RollupPutJobRequest struct { - DocumentID string + JobID string Body io.Reader @@ -53,13 +53,13 @@ func (r RollupPutJobRequest) Do(ctx context.Context, transport Transport) (*Resp method = "PUT" - path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.JobID)) path.WriteString("/") path.WriteString("_rollup") path.WriteString("/") path.WriteString("job") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.JobID) params = make(map[string]string) diff --git a/esapi/api.xpack.rollup.rollup_search.go b/esapi/api.xpack.rollup.rollup_search.go index f7d4f6638d..c24d746569 100755 --- a/esapi/api.xpack.rollup.rollup_search.go +++ b/esapi/api.xpack.rollup.rollup_search.go @@ -26,7 +26,7 @@ func newRollupRollupSearchFunc(t Transport) RollupRollupSearch { // type RollupRollupSearch func(index []string, body io.Reader, o ...func(*RollupRollupSearchRequest)) (*Response, error) -// RollupRollupSearchRequest configures the Rollup Rollup Search API request. +// RollupRollupSearchRequest configures the Rollup Rollup Search API request. // type RollupRollupSearchRequest struct { Index []string diff --git a/esapi/api.xpack.rollup.start_job.go b/esapi/api.xpack.rollup.start_job.go index 12f029ca48..23ebde47f7 100755 --- a/esapi/api.xpack.rollup.start_job.go +++ b/esapi/api.xpack.rollup.start_job.go @@ -10,7 +10,7 @@ import ( func newRollupStartJobFunc(t Transport) RollupStartJob { return func(id string, o ...func(*RollupStartJobRequest)) (*Response, error) { - var r = RollupStartJobRequest{DocumentID: id} + var r = RollupStartJobRequest{JobID: id} for _, f := range o { f(&r) } @@ -24,10 +24,10 @@ func newRollupStartJobFunc(t Transport) RollupStartJob { // type RollupStartJob func(id string, o ...func(*RollupStartJobRequest)) (*Response, error) -// RollupStartJobRequest configures the Rollup Start Job API request. +// RollupStartJobRequest configures the Rollup Start Job API request. // type RollupStartJobRequest struct { - DocumentID string + JobID string Pretty bool Human bool @@ -50,13 +50,13 @@ func (r RollupStartJobRequest) Do(ctx context.Context, transport Transport) (*Re method = "POST" - path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.DocumentID) + 1 + len("_start")) + path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.JobID) + 1 + len("_start")) path.WriteString("/") path.WriteString("_rollup") path.WriteString("/") path.WriteString("job") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.JobID) path.WriteString("/") path.WriteString("_start") diff --git a/esapi/api.xpack.rollup.stop_job.go b/esapi/api.xpack.rollup.stop_job.go index 4a35e47bf0..73256c4ab3 100755 --- a/esapi/api.xpack.rollup.stop_job.go +++ b/esapi/api.xpack.rollup.stop_job.go @@ -12,7 +12,7 @@ import ( func newRollupStopJobFunc(t Transport) RollupStopJob { return func(id string, o ...func(*RollupStopJobRequest)) (*Response, error) { - var r = RollupStopJobRequest{DocumentID: id} + var r = RollupStopJobRequest{JobID: id} for _, f := range o { f(&r) } @@ -26,10 +26,10 @@ func newRollupStopJobFunc(t Transport) RollupStopJob { // type RollupStopJob func(id string, o ...func(*RollupStopJobRequest)) (*Response, error) -// RollupStopJobRequest configures the Rollup Stop Job API request. +// RollupStopJobRequest configures the Rollup Stop Job API request. // type RollupStopJobRequest struct { - DocumentID string + JobID string Timeout time.Duration WaitForCompletion *bool @@ -55,13 +55,13 @@ func (r RollupStopJobRequest) Do(ctx context.Context, transport Transport) (*Res method = "POST" - path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.DocumentID) + 1 + len("_stop")) + path.Grow(1 + len("_rollup") + 1 + len("job") + 1 + len(r.JobID) + 1 + len("_stop")) path.WriteString("/") path.WriteString("_rollup") path.WriteString("/") path.WriteString("job") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.JobID) path.WriteString("/") path.WriteString("_stop") diff --git a/esapi/api.xpack.security.change_password.go b/esapi/api.xpack.security.change_password.go index a4e19a44d2..91ebedb79e 100755 --- a/esapi/api.xpack.security.change_password.go +++ b/esapi/api.xpack.security.change_password.go @@ -25,7 +25,7 @@ func newSecurityChangePasswordFunc(t Transport) SecurityChangePassword { // type SecurityChangePassword func(body io.Reader, o ...func(*SecurityChangePasswordRequest)) (*Response, error) -// SecurityChangePasswordRequest configures the Security Change Password API request. +// SecurityChangePasswordRequest configures the Security Change Password API request. // type SecurityChangePasswordRequest struct { Body io.Reader diff --git a/esapi/api.xpack.security.clear_cached_realms.go b/esapi/api.xpack.security.clear_cached_realms.go index 796494cce0..04e945f58c 100755 --- a/esapi/api.xpack.security.clear_cached_realms.go +++ b/esapi/api.xpack.security.clear_cached_realms.go @@ -24,7 +24,7 @@ func newSecurityClearCachedRealmsFunc(t Transport) SecurityClearCachedRealms { // type SecurityClearCachedRealms func(realms []string, o ...func(*SecurityClearCachedRealmsRequest)) (*Response, error) -// SecurityClearCachedRealmsRequest configures the Security Clear Cached Realms API request. +// SecurityClearCachedRealmsRequest configures the Security Clear Cached Realms API request. // type SecurityClearCachedRealmsRequest struct { Realms []string diff --git a/esapi/api.xpack.security.clear_cached_roles.go b/esapi/api.xpack.security.clear_cached_roles.go index f1602cebbd..c818f2ec63 100755 --- a/esapi/api.xpack.security.clear_cached_roles.go +++ b/esapi/api.xpack.security.clear_cached_roles.go @@ -24,7 +24,7 @@ func newSecurityClearCachedRolesFunc(t Transport) SecurityClearCachedRoles { // type SecurityClearCachedRoles func(name []string, o ...func(*SecurityClearCachedRolesRequest)) (*Response, error) -// SecurityClearCachedRolesRequest configures the Security Clear Cached Roles API request. +// SecurityClearCachedRolesRequest configures the Security Clear Cached Roles API request. // type SecurityClearCachedRolesRequest struct { Name []string diff --git a/esapi/api.xpack.security.create_api_key.go b/esapi/api.xpack.security.create_api_key.go index fff9315cc2..b4b7a48663 100755 --- a/esapi/api.xpack.security.create_api_key.go +++ b/esapi/api.xpack.security.create_api_key.go @@ -25,7 +25,7 @@ func newSecurityCreateAPIKeyFunc(t Transport) SecurityCreateAPIKey { // type SecurityCreateAPIKey func(body io.Reader, o ...func(*SecurityCreateAPIKeyRequest)) (*Response, error) -// SecurityCreateAPIKeyRequest configures the Security Create Api Key API request. +// SecurityCreateAPIKeyRequest configures the Security CreateAPI Key API request. // type SecurityCreateAPIKeyRequest struct { Body io.Reader diff --git a/esapi/api.xpack.security.delete_privileges.go b/esapi/api.xpack.security.delete_privileges.go index fee8cff949..5e62a653ac 100755 --- a/esapi/api.xpack.security.delete_privileges.go +++ b/esapi/api.xpack.security.delete_privileges.go @@ -24,7 +24,7 @@ func newSecurityDeletePrivilegesFunc(t Transport) SecurityDeletePrivileges { // type SecurityDeletePrivileges func(name string, application string, o ...func(*SecurityDeletePrivilegesRequest)) (*Response, error) -// SecurityDeletePrivilegesRequest configures the Security Delete Privileges API request. +// SecurityDeletePrivilegesRequest configures the Security Delete Privileges API request. // type SecurityDeletePrivilegesRequest struct { Application string diff --git a/esapi/api.xpack.security.delete_role.go b/esapi/api.xpack.security.delete_role.go index 67efed5fd8..8112c5ddd4 100755 --- a/esapi/api.xpack.security.delete_role.go +++ b/esapi/api.xpack.security.delete_role.go @@ -24,7 +24,7 @@ func newSecurityDeleteRoleFunc(t Transport) SecurityDeleteRole { // type SecurityDeleteRole func(name string, o ...func(*SecurityDeleteRoleRequest)) (*Response, error) -// SecurityDeleteRoleRequest configures the Security Delete Role API request. +// SecurityDeleteRoleRequest configures the Security Delete Role API request. // type SecurityDeleteRoleRequest struct { Name string diff --git a/esapi/api.xpack.security.delete_role_mapping.go b/esapi/api.xpack.security.delete_role_mapping.go index addd627259..c9daf20cab 100755 --- a/esapi/api.xpack.security.delete_role_mapping.go +++ b/esapi/api.xpack.security.delete_role_mapping.go @@ -24,7 +24,7 @@ func newSecurityDeleteRoleMappingFunc(t Transport) SecurityDeleteRoleMapping { // type SecurityDeleteRoleMapping func(name string, o ...func(*SecurityDeleteRoleMappingRequest)) (*Response, error) -// SecurityDeleteRoleMappingRequest configures the Security Delete Role Mapping API request. +// SecurityDeleteRoleMappingRequest configures the Security Delete Role Mapping API request. // type SecurityDeleteRoleMappingRequest struct { Name string diff --git a/esapi/api.xpack.security.delete_user.go b/esapi/api.xpack.security.delete_user.go index dbccb082ae..9bfd9be084 100755 --- a/esapi/api.xpack.security.delete_user.go +++ b/esapi/api.xpack.security.delete_user.go @@ -24,7 +24,7 @@ func newSecurityDeleteUserFunc(t Transport) SecurityDeleteUser { // type SecurityDeleteUser func(username string, o ...func(*SecurityDeleteUserRequest)) (*Response, error) -// SecurityDeleteUserRequest configures the Security Delete User API request. +// SecurityDeleteUserRequest configures the Security Delete User API request. // type SecurityDeleteUserRequest struct { Username string diff --git a/esapi/api.xpack.security.disable_user.go b/esapi/api.xpack.security.disable_user.go index 24e7ae3e87..9403e7baa3 100755 --- a/esapi/api.xpack.security.disable_user.go +++ b/esapi/api.xpack.security.disable_user.go @@ -24,7 +24,7 @@ func newSecurityDisableUserFunc(t Transport) SecurityDisableUser { // type SecurityDisableUser func(username string, o ...func(*SecurityDisableUserRequest)) (*Response, error) -// SecurityDisableUserRequest configures the Security Disable User API request. +// SecurityDisableUserRequest configures the Security Disable User API request. // type SecurityDisableUserRequest struct { Username string diff --git a/esapi/api.xpack.security.enable_user.go b/esapi/api.xpack.security.enable_user.go index a05ecfda04..bd03d9b187 100755 --- a/esapi/api.xpack.security.enable_user.go +++ b/esapi/api.xpack.security.enable_user.go @@ -24,7 +24,7 @@ func newSecurityEnableUserFunc(t Transport) SecurityEnableUser { // type SecurityEnableUser func(username string, o ...func(*SecurityEnableUserRequest)) (*Response, error) -// SecurityEnableUserRequest configures the Security Enable User API request. +// SecurityEnableUserRequest configures the Security Enable User API request. // type SecurityEnableUserRequest struct { Username string diff --git a/esapi/api.xpack.security.get_api_key.go b/esapi/api.xpack.security.get_api_key.go index ac8741e264..70e6f375b3 100755 --- a/esapi/api.xpack.security.get_api_key.go +++ b/esapi/api.xpack.security.get_api_key.go @@ -24,13 +24,13 @@ func newSecurityGetAPIKeyFunc(t Transport) SecurityGetAPIKey { // type SecurityGetAPIKey func(o ...func(*SecurityGetAPIKeyRequest)) (*Response, error) -// SecurityGetAPIKeyRequest configures the Security Get Api Key API request. +// SecurityGetAPIKeyRequest configures the Security GetAPI Key API request. // type SecurityGetAPIKeyRequest struct { - DocumentID string - Name string - RealmName string - Username string + ID string + Name string + RealmName string + Username string Pretty bool Human bool @@ -58,8 +58,8 @@ func (r SecurityGetAPIKeyRequest) Do(ctx context.Context, transport Transport) ( params = make(map[string]string) - if r.DocumentID != "" { - params["id"] = r.DocumentID + if r.ID != "" { + params["id"] = r.ID } if r.Name != "" { @@ -138,11 +138,11 @@ func (f SecurityGetAPIKey) WithContext(v context.Context) func(*SecurityGetAPIKe } } -// WithDocumentID - api key ID of the api key to be retrieved. +// WithID - api key ID of the api key to be retrieved. // -func (f SecurityGetAPIKey) WithDocumentID(v string) func(*SecurityGetAPIKeyRequest) { +func (f SecurityGetAPIKey) WithID(v string) func(*SecurityGetAPIKeyRequest) { return func(r *SecurityGetAPIKeyRequest) { - r.DocumentID = v + r.ID = v } } diff --git a/esapi/api.xpack.security.get_builtin_privileges.go b/esapi/api.xpack.security.get_builtin_privileges.go index 1d100caddc..0ec002052c 100755 --- a/esapi/api.xpack.security.get_builtin_privileges.go +++ b/esapi/api.xpack.security.get_builtin_privileges.go @@ -24,7 +24,7 @@ func newSecurityGetBuiltinPrivilegesFunc(t Transport) SecurityGetBuiltinPrivileg // type SecurityGetBuiltinPrivileges func(o ...func(*SecurityGetBuiltinPrivilegesRequest)) (*Response, error) -// SecurityGetBuiltinPrivilegesRequest configures the Security Get Builtin Privileges API request. +// SecurityGetBuiltinPrivilegesRequest configures the Security Get Builtin Privileges API request. // type SecurityGetBuiltinPrivilegesRequest struct { Pretty bool diff --git a/esapi/api.xpack.security.get_privileges.go b/esapi/api.xpack.security.get_privileges.go index 487705cb52..d41e9ba084 100755 --- a/esapi/api.xpack.security.get_privileges.go +++ b/esapi/api.xpack.security.get_privileges.go @@ -24,7 +24,7 @@ func newSecurityGetPrivilegesFunc(t Transport) SecurityGetPrivileges { // type SecurityGetPrivileges func(o ...func(*SecurityGetPrivilegesRequest)) (*Response, error) -// SecurityGetPrivilegesRequest configures the Security Get Privileges API request. +// SecurityGetPrivilegesRequest configures the Security Get Privileges API request. // type SecurityGetPrivilegesRequest struct { Application string diff --git a/esapi/api.xpack.security.get_role.go b/esapi/api.xpack.security.get_role.go index 5083607ed8..5a32dd2f0a 100755 --- a/esapi/api.xpack.security.get_role.go +++ b/esapi/api.xpack.security.get_role.go @@ -24,7 +24,7 @@ func newSecurityGetRoleFunc(t Transport) SecurityGetRole { // type SecurityGetRole func(o ...func(*SecurityGetRoleRequest)) (*Response, error) -// SecurityGetRoleRequest configures the Security Get Role API request. +// SecurityGetRoleRequest configures the Security Get Role API request. // type SecurityGetRoleRequest struct { Name string diff --git a/esapi/api.xpack.security.get_role_mapping.go b/esapi/api.xpack.security.get_role_mapping.go index 2a9086e2e2..d346621dcf 100755 --- a/esapi/api.xpack.security.get_role_mapping.go +++ b/esapi/api.xpack.security.get_role_mapping.go @@ -24,7 +24,7 @@ func newSecurityGetRoleMappingFunc(t Transport) SecurityGetRoleMapping { // type SecurityGetRoleMapping func(o ...func(*SecurityGetRoleMappingRequest)) (*Response, error) -// SecurityGetRoleMappingRequest configures the Security Get Role Mapping API request. +// SecurityGetRoleMappingRequest configures the Security Get Role Mapping API request. // type SecurityGetRoleMappingRequest struct { Name string diff --git a/esapi/api.xpack.security.get_token.go b/esapi/api.xpack.security.get_token.go index fadb58c082..98a1bd443b 100755 --- a/esapi/api.xpack.security.get_token.go +++ b/esapi/api.xpack.security.get_token.go @@ -25,7 +25,7 @@ func newSecurityGetTokenFunc(t Transport) SecurityGetToken { // type SecurityGetToken func(body io.Reader, o ...func(*SecurityGetTokenRequest)) (*Response, error) -// SecurityGetTokenRequest configures the Security Get Token API request. +// SecurityGetTokenRequest configures the Security Get Token API request. // type SecurityGetTokenRequest struct { Body io.Reader diff --git a/esapi/api.xpack.security.get_user.go b/esapi/api.xpack.security.get_user.go index d6897d3c7e..6af93a3035 100755 --- a/esapi/api.xpack.security.get_user.go +++ b/esapi/api.xpack.security.get_user.go @@ -24,7 +24,7 @@ func newSecurityGetUserFunc(t Transport) SecurityGetUser { // type SecurityGetUser func(o ...func(*SecurityGetUserRequest)) (*Response, error) -// SecurityGetUserRequest configures the Security Get User API request. +// SecurityGetUserRequest configures the Security Get User API request. // type SecurityGetUserRequest struct { Username []string diff --git a/esapi/api.xpack.security.get_user_privileges.go b/esapi/api.xpack.security.get_user_privileges.go index 41d5e81efd..fe6eccf695 100755 --- a/esapi/api.xpack.security.get_user_privileges.go +++ b/esapi/api.xpack.security.get_user_privileges.go @@ -24,7 +24,7 @@ func newSecurityGetUserPrivilegesFunc(t Transport) SecurityGetUserPrivileges { // type SecurityGetUserPrivileges func(o ...func(*SecurityGetUserPrivilegesRequest)) (*Response, error) -// SecurityGetUserPrivilegesRequest configures the Security Get User Privileges API request. +// SecurityGetUserPrivilegesRequest configures the Security Get User Privileges API request. // type SecurityGetUserPrivilegesRequest struct { Pretty bool diff --git a/esapi/api.xpack.security.has_privileges.go b/esapi/api.xpack.security.has_privileges.go index 515afd75b2..158314fd0d 100755 --- a/esapi/api.xpack.security.has_privileges.go +++ b/esapi/api.xpack.security.has_privileges.go @@ -25,7 +25,7 @@ func newSecurityHasPrivilegesFunc(t Transport) SecurityHasPrivileges { // type SecurityHasPrivileges func(body io.Reader, o ...func(*SecurityHasPrivilegesRequest)) (*Response, error) -// SecurityHasPrivilegesRequest configures the Security Has Privileges API request. +// SecurityHasPrivilegesRequest configures the Security Has Privileges API request. // type SecurityHasPrivilegesRequest struct { Body io.Reader diff --git a/esapi/api.xpack.security.invalidate_api_key.go b/esapi/api.xpack.security.invalidate_api_key.go index 189ce6952e..a2a7c668b9 100755 --- a/esapi/api.xpack.security.invalidate_api_key.go +++ b/esapi/api.xpack.security.invalidate_api_key.go @@ -25,7 +25,7 @@ func newSecurityInvalidateAPIKeyFunc(t Transport) SecurityInvalidateAPIKey { // type SecurityInvalidateAPIKey func(body io.Reader, o ...func(*SecurityInvalidateAPIKeyRequest)) (*Response, error) -// SecurityInvalidateAPIKeyRequest configures the Security Invalidate Api Key API request. +// SecurityInvalidateAPIKeyRequest configures the Security InvalidateAPI Key API request. // type SecurityInvalidateAPIKeyRequest struct { Body io.Reader diff --git a/esapi/api.xpack.security.invalidate_token.go b/esapi/api.xpack.security.invalidate_token.go index 5d2507489d..9b40c5e29d 100755 --- a/esapi/api.xpack.security.invalidate_token.go +++ b/esapi/api.xpack.security.invalidate_token.go @@ -25,7 +25,7 @@ func newSecurityInvalidateTokenFunc(t Transport) SecurityInvalidateToken { // type SecurityInvalidateToken func(body io.Reader, o ...func(*SecurityInvalidateTokenRequest)) (*Response, error) -// SecurityInvalidateTokenRequest configures the Security Invalidate Token API request. +// SecurityInvalidateTokenRequest configures the Security Invalidate Token API request. // type SecurityInvalidateTokenRequest struct { Body io.Reader diff --git a/esapi/api.xpack.security.put_privileges.go b/esapi/api.xpack.security.put_privileges.go index 200e7bbb2e..80a08771ef 100755 --- a/esapi/api.xpack.security.put_privileges.go +++ b/esapi/api.xpack.security.put_privileges.go @@ -25,7 +25,7 @@ func newSecurityPutPrivilegesFunc(t Transport) SecurityPutPrivileges { // type SecurityPutPrivileges func(body io.Reader, o ...func(*SecurityPutPrivilegesRequest)) (*Response, error) -// SecurityPutPrivilegesRequest configures the Security Put Privileges API request. +// SecurityPutPrivilegesRequest configures the Security Put Privileges API request. // type SecurityPutPrivilegesRequest struct { Body io.Reader diff --git a/esapi/api.xpack.security.put_role.go b/esapi/api.xpack.security.put_role.go index 22372d3878..4987c71641 100755 --- a/esapi/api.xpack.security.put_role.go +++ b/esapi/api.xpack.security.put_role.go @@ -25,7 +25,7 @@ func newSecurityPutRoleFunc(t Transport) SecurityPutRole { // type SecurityPutRole func(name string, body io.Reader, o ...func(*SecurityPutRoleRequest)) (*Response, error) -// SecurityPutRoleRequest configures the Security Put Role API request. +// SecurityPutRoleRequest configures the Security Put Role API request. // type SecurityPutRoleRequest struct { Body io.Reader diff --git a/esapi/api.xpack.security.put_role_mapping.go b/esapi/api.xpack.security.put_role_mapping.go index ec97c45e45..456dcc6377 100755 --- a/esapi/api.xpack.security.put_role_mapping.go +++ b/esapi/api.xpack.security.put_role_mapping.go @@ -25,7 +25,7 @@ func newSecurityPutRoleMappingFunc(t Transport) SecurityPutRoleMapping { // type SecurityPutRoleMapping func(name string, body io.Reader, o ...func(*SecurityPutRoleMappingRequest)) (*Response, error) -// SecurityPutRoleMappingRequest configures the Security Put Role Mapping API request. +// SecurityPutRoleMappingRequest configures the Security Put Role Mapping API request. // type SecurityPutRoleMappingRequest struct { Body io.Reader diff --git a/esapi/api.xpack.security.put_user.go b/esapi/api.xpack.security.put_user.go index 8a5e15ceb0..c073ada1ec 100755 --- a/esapi/api.xpack.security.put_user.go +++ b/esapi/api.xpack.security.put_user.go @@ -25,7 +25,7 @@ func newSecurityPutUserFunc(t Transport) SecurityPutUser { // type SecurityPutUser func(username string, body io.Reader, o ...func(*SecurityPutUserRequest)) (*Response, error) -// SecurityPutUserRequest configures the Security Put User API request. +// SecurityPutUserRequest configures the Security Put User API request. // type SecurityPutUserRequest struct { Body io.Reader diff --git a/esapi/api.xpack.sql.clear_cursor.go b/esapi/api.xpack.sql.clear_cursor.go index 92b4a876d1..fdfc44ba1c 100755 --- a/esapi/api.xpack.sql.clear_cursor.go +++ b/esapi/api.xpack.sql.clear_cursor.go @@ -25,7 +25,7 @@ func newSQLClearCursorFunc(t Transport) SQLClearCursor { // type SQLClearCursor func(body io.Reader, o ...func(*SQLClearCursorRequest)) (*Response, error) -// SQLClearCursorRequest configures the Sql Clear Cursor API request. +// SQLClearCursorRequest configures the SQL Clear Cursor API request. // type SQLClearCursorRequest struct { Body io.Reader diff --git a/esapi/api.xpack.sql.query.go b/esapi/api.xpack.sql.query.go index 89793a4f20..1e1c953331 100755 --- a/esapi/api.xpack.sql.query.go +++ b/esapi/api.xpack.sql.query.go @@ -25,7 +25,7 @@ func newSQLQueryFunc(t Transport) SQLQuery { // type SQLQuery func(body io.Reader, o ...func(*SQLQueryRequest)) (*Response, error) -// SQLQueryRequest configures the Sql Query API request. +// SQLQueryRequest configures the SQL Query API request. // type SQLQueryRequest struct { Body io.Reader diff --git a/esapi/api.xpack.sql.translate.go b/esapi/api.xpack.sql.translate.go index b474d02594..f6d7af994c 100755 --- a/esapi/api.xpack.sql.translate.go +++ b/esapi/api.xpack.sql.translate.go @@ -25,7 +25,7 @@ func newSQLTranslateFunc(t Transport) SQLTranslate { // type SQLTranslate func(body io.Reader, o ...func(*SQLTranslateRequest)) (*Response, error) -// SQLTranslateRequest configures the Sql Translate API request. +// SQLTranslateRequest configures the SQL Translate API request. // type SQLTranslateRequest struct { Body io.Reader diff --git a/esapi/api.xpack.ssl.certificates.go b/esapi/api.xpack.ssl.certificates.go index 8a908f9042..136fba3a3d 100755 --- a/esapi/api.xpack.ssl.certificates.go +++ b/esapi/api.xpack.ssl.certificates.go @@ -24,7 +24,7 @@ func newSSLCertificatesFunc(t Transport) SSLCertificates { // type SSLCertificates func(o ...func(*SSLCertificatesRequest)) (*Response, error) -// SSLCertificatesRequest configures the Ssl Certificates API request. +// SSLCertificatesRequest configures the SSL Certificates API request. // type SSLCertificatesRequest struct { Pretty bool diff --git a/esapi/api.xpack.watcher.ack_watch.go b/esapi/api.xpack.watcher.ack_watch.go index c0a863da40..bd01b9c466 100755 --- a/esapi/api.xpack.watcher.ack_watch.go +++ b/esapi/api.xpack.watcher.ack_watch.go @@ -24,7 +24,7 @@ func newWatcherAckWatchFunc(t Transport) WatcherAckWatch { // type WatcherAckWatch func(watch_id string, o ...func(*WatcherAckWatchRequest)) (*Response, error) -// WatcherAckWatchRequest configures the Watcher Ack Watch API request. +// WatcherAckWatchRequest configures the Watcher Ack Watch API request. // type WatcherAckWatchRequest struct { ActionID []string diff --git a/esapi/api.xpack.watcher.activate_watch.go b/esapi/api.xpack.watcher.activate_watch.go index aeecee1bcb..d0035c6c75 100755 --- a/esapi/api.xpack.watcher.activate_watch.go +++ b/esapi/api.xpack.watcher.activate_watch.go @@ -24,7 +24,7 @@ func newWatcherActivateWatchFunc(t Transport) WatcherActivateWatch { // type WatcherActivateWatch func(watch_id string, o ...func(*WatcherActivateWatchRequest)) (*Response, error) -// WatcherActivateWatchRequest configures the Watcher Activate Watch API request. +// WatcherActivateWatchRequest configures the Watcher Activate Watch API request. // type WatcherActivateWatchRequest struct { WatchID string diff --git a/esapi/api.xpack.watcher.deactivate_watch.go b/esapi/api.xpack.watcher.deactivate_watch.go index c099eefc4a..76081d7398 100755 --- a/esapi/api.xpack.watcher.deactivate_watch.go +++ b/esapi/api.xpack.watcher.deactivate_watch.go @@ -24,7 +24,7 @@ func newWatcherDeactivateWatchFunc(t Transport) WatcherDeactivateWatch { // type WatcherDeactivateWatch func(watch_id string, o ...func(*WatcherDeactivateWatchRequest)) (*Response, error) -// WatcherDeactivateWatchRequest configures the Watcher Deactivate Watch API request. +// WatcherDeactivateWatchRequest configures the Watcher Deactivate Watch API request. // type WatcherDeactivateWatchRequest struct { WatchID string diff --git a/esapi/api.xpack.watcher.delete_watch.go b/esapi/api.xpack.watcher.delete_watch.go index da760a457b..c500f97285 100755 --- a/esapi/api.xpack.watcher.delete_watch.go +++ b/esapi/api.xpack.watcher.delete_watch.go @@ -10,7 +10,7 @@ import ( func newWatcherDeleteWatchFunc(t Transport) WatcherDeleteWatch { return func(id string, o ...func(*WatcherDeleteWatchRequest)) (*Response, error) { - var r = WatcherDeleteWatchRequest{DocumentID: id} + var r = WatcherDeleteWatchRequest{WatchID: id} for _, f := range o { f(&r) } @@ -24,10 +24,10 @@ func newWatcherDeleteWatchFunc(t Transport) WatcherDeleteWatch { // type WatcherDeleteWatch func(id string, o ...func(*WatcherDeleteWatchRequest)) (*Response, error) -// WatcherDeleteWatchRequest configures the Watcher Delete Watch API request. +// WatcherDeleteWatchRequest configures the Watcher Delete Watch API request. // type WatcherDeleteWatchRequest struct { - DocumentID string + WatchID string Pretty bool Human bool @@ -50,13 +50,13 @@ func (r WatcherDeleteWatchRequest) Do(ctx context.Context, transport Transport) method = "DELETE" - path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.WatchID)) path.WriteString("/") path.WriteString("_watcher") path.WriteString("/") path.WriteString("watch") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.WatchID) params = make(map[string]string) diff --git a/esapi/api.xpack.watcher.execute_watch.go b/esapi/api.xpack.watcher.execute_watch.go index ffac7b4908..7fecec92be 100755 --- a/esapi/api.xpack.watcher.execute_watch.go +++ b/esapi/api.xpack.watcher.execute_watch.go @@ -26,10 +26,10 @@ func newWatcherExecuteWatchFunc(t Transport) WatcherExecuteWatch { // type WatcherExecuteWatch func(o ...func(*WatcherExecuteWatchRequest)) (*Response, error) -// WatcherExecuteWatchRequest configures the Watcher Execute Watch API request. +// WatcherExecuteWatchRequest configures the Watcher Execute Watch API request. // type WatcherExecuteWatchRequest struct { - DocumentID string + WatchID string Body io.Reader @@ -56,14 +56,14 @@ func (r WatcherExecuteWatchRequest) Do(ctx context.Context, transport Transport) method = "PUT" - path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.DocumentID) + 1 + len("_execute")) + path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.WatchID) + 1 + len("_execute")) path.WriteString("/") path.WriteString("_watcher") path.WriteString("/") path.WriteString("watch") - if r.DocumentID != "" { + if r.WatchID != "" { path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.WatchID) } path.WriteString("/") path.WriteString("_execute") @@ -150,11 +150,11 @@ func (f WatcherExecuteWatch) WithBody(v io.Reader) func(*WatcherExecuteWatchRequ } } -// WithDocumentID - watch ID. +// WithWatchID - watch ID. // -func (f WatcherExecuteWatch) WithDocumentID(v string) func(*WatcherExecuteWatchRequest) { +func (f WatcherExecuteWatch) WithWatchID(v string) func(*WatcherExecuteWatchRequest) { return func(r *WatcherExecuteWatchRequest) { - r.DocumentID = v + r.WatchID = v } } diff --git a/esapi/api.xpack.watcher.get_watch.go b/esapi/api.xpack.watcher.get_watch.go index 73cc51f944..1f4370c565 100755 --- a/esapi/api.xpack.watcher.get_watch.go +++ b/esapi/api.xpack.watcher.get_watch.go @@ -10,7 +10,7 @@ import ( func newWatcherGetWatchFunc(t Transport) WatcherGetWatch { return func(id string, o ...func(*WatcherGetWatchRequest)) (*Response, error) { - var r = WatcherGetWatchRequest{DocumentID: id} + var r = WatcherGetWatchRequest{WatchID: id} for _, f := range o { f(&r) } @@ -24,10 +24,10 @@ func newWatcherGetWatchFunc(t Transport) WatcherGetWatch { // type WatcherGetWatch func(id string, o ...func(*WatcherGetWatchRequest)) (*Response, error) -// WatcherGetWatchRequest configures the Watcher Get Watch API request. +// WatcherGetWatchRequest configures the Watcher Get Watch API request. // type WatcherGetWatchRequest struct { - DocumentID string + WatchID string Pretty bool Human bool @@ -50,13 +50,13 @@ func (r WatcherGetWatchRequest) Do(ctx context.Context, transport Transport) (*R method = "GET" - path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.WatchID)) path.WriteString("/") path.WriteString("_watcher") path.WriteString("/") path.WriteString("watch") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.WatchID) params = make(map[string]string) diff --git a/esapi/api.xpack.watcher.put_watch.go b/esapi/api.xpack.watcher.put_watch.go index a32957e5cb..e7daed3e4f 100755 --- a/esapi/api.xpack.watcher.put_watch.go +++ b/esapi/api.xpack.watcher.put_watch.go @@ -12,7 +12,7 @@ import ( func newWatcherPutWatchFunc(t Transport) WatcherPutWatch { return func(id string, o ...func(*WatcherPutWatchRequest)) (*Response, error) { - var r = WatcherPutWatchRequest{DocumentID: id} + var r = WatcherPutWatchRequest{WatchID: id} for _, f := range o { f(&r) } @@ -26,10 +26,10 @@ func newWatcherPutWatchFunc(t Transport) WatcherPutWatch { // type WatcherPutWatch func(id string, o ...func(*WatcherPutWatchRequest)) (*Response, error) -// WatcherPutWatchRequest configures the Watcher Put Watch API request. +// WatcherPutWatchRequest configures the Watcher Put Watch API request. // type WatcherPutWatchRequest struct { - DocumentID string + WatchID string Body io.Reader @@ -59,13 +59,13 @@ func (r WatcherPutWatchRequest) Do(ctx context.Context, transport Transport) (*R method = "PUT" - path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.DocumentID)) + path.Grow(1 + len("_watcher") + 1 + len("watch") + 1 + len(r.WatchID)) path.WriteString("/") path.WriteString("_watcher") path.WriteString("/") path.WriteString("watch") path.WriteString("/") - path.WriteString(r.DocumentID) + path.WriteString(r.WatchID) params = make(map[string]string) diff --git a/esapi/api.xpack.xpack.info.go b/esapi/api.xpack.xpack.info.go index ad7acbf938..0084fcd81c 100755 --- a/esapi/api.xpack.xpack.info.go +++ b/esapi/api.xpack.xpack.info.go @@ -24,7 +24,7 @@ func newXPackInfoFunc(t Transport) XPackInfo { // type XPackInfo func(o ...func(*XPackInfoRequest)) (*Response, error) -// XPackInfoRequest configures the Xpack Info API request. +// XPackInfoRequest configures the X Pack Info API request. // type XPackInfoRequest struct { Categories []string diff --git a/esapi/api.xpack.xpack.usage.go b/esapi/api.xpack.xpack.usage.go index b09754e2f8..035e91f67e 100755 --- a/esapi/api.xpack.xpack.usage.go +++ b/esapi/api.xpack.xpack.usage.go @@ -25,7 +25,7 @@ func newXPackUsageFunc(t Transport) XPackUsage { // type XPackUsage func(o ...func(*XPackUsageRequest)) (*Response, error) -// XPackUsageRequest configures the Xpack Usage API request. +// XPackUsageRequest configures the X Pack Usage API request. // type XPackUsageRequest struct { MasterTimeout time.Duration From 162db43e120b2a27843236141b4dc2a47a905a23 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 7 Jul 2019 19:14:58 +0200 Subject: [PATCH 084/355] Makefile: Add the "release" target (cherry picked from commit f9efc1b1de3a18ad8e036c6aba24385730b05334) --- Makefile | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c5e4b53b38..822073e2d4 100755 --- a/Makefile +++ b/Makefile @@ -180,6 +180,39 @@ endif done; \ } +release: ## Release a new version to Github +ifndef version + @echo "Missing version argument, exiting..." + @exit 2 +endif +ifeq ($(version), "") + @echo "Empty version argument, exiting..." + @exit 2 +endif + @echo "\033[2m→ Creating version $(version)...\033[0m" + @{ \ + cp internal/version/version.go internal/version/version.go.OLD && \ + cat internal/version/version.go.OLD | sed -e 's/Client = ".*"/Client = "$(version)"/' > internal/version/version.go && \ + rm internal/version/version.go.OLD && \ + go vet internal/version/version.go && \ + go fmt internal/version/version.go && \ + git diff --color-words internal/version/version.go | tail -n 1; \ + } + @{ \ + echo "\033[2m→ Commit and create Git tag? (y/n): \033[0m\c"; \ + read continue; \ + if [[ $$continue == "y" ]]; then \ + git add internal/version/version.go && \ + git commit --no-status --quiet --message "Release $(version)" && \ + git tag --annotate v$(version) --message 'Release $(version)'; \ + echo "\033[2m→ Push `git show --pretty='%h (%s)' --no-patch HEAD` to Github:\033[0m\n"; \ + echo "\033[1m git push origin v$(version)\033[0m\n"; \ + else \ + echo "Aborting..."; \ + exit 1; \ + fi; \ + } + godoc: ## Display documentation for the package @echo "\033[2m→ Generating documentation...\033[0m" @echo "open http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/\n" @@ -346,4 +379,4 @@ help: ## Display help #------------- -------------- .DEFAULT_GOAL := help -.PHONY: help apidiff backport cluster cluster-clean cluster-update coverage docker examples gen-api gen-tests godoc lint test test-api test-bench test-integ test-unit +.PHONY: help apidiff backport cluster cluster-clean cluster-update coverage docker examples gen-api gen-tests godoc lint release test test-api test-bench test-integ test-unit From 880773b3b5fc573c595caac2512bd8b73fc25787 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 8 Jul 2019 09:13:42 +0200 Subject: [PATCH 085/355] Release 7.2.0 --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index f218ddcd1c..78d1335872 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -2,4 +2,4 @@ package version // Client returns the client version as a string. // -const Client = "7.1.1-SNAPSHOT" +const Client = "7.2.0" From f4bb70147d0dfabab9b5b499eee987483d882f89 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 8 Jul 2019 09:14:28 +0200 Subject: [PATCH 086/355] Update version to 7.2.0-SNAPSHOT --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index 78d1335872..e56130d38b 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -2,4 +2,4 @@ package version // Client returns the client version as a string. // -const Client = "7.2.0" +const Client = "7.2.0-SNAPSHOT" From 5704beb86d5d7deb7704c9feee3eeaeca4cd224c Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 8 Jul 2019 15:38:38 +0200 Subject: [PATCH 087/355] Makefile: Improve the "release" target (cherry picked from commit 4ec050682b64784fd2ea595b0698a818b826cedb) --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 822073e2d4..ecd86e1379 100755 --- a/Makefile +++ b/Makefile @@ -189,8 +189,10 @@ ifeq ($(version), "") @echo "Empty version argument, exiting..." @exit 2 endif - @echo "\033[2m→ Creating version $(version)...\033[0m" + $(eval branch = $(shell git rev-parse --abbrev-ref HEAD)) + @echo "\033[2m→ [$(branch)] Creating version $(version)...\033[0m" @{ \ + set -e -o pipefail; \ cp internal/version/version.go internal/version/version.go.OLD && \ cat internal/version/version.go.OLD | sed -e 's/Client = ".*"/Client = "$(version)"/' > internal/version/version.go && \ rm internal/version/version.go.OLD && \ @@ -199,6 +201,7 @@ endif git diff --color-words internal/version/version.go | tail -n 1; \ } @{ \ + set -e -o pipefail; \ echo "\033[2m→ Commit and create Git tag? (y/n): \033[0m\c"; \ read continue; \ if [[ $$continue == "y" ]]; then \ @@ -206,7 +209,7 @@ endif git commit --no-status --quiet --message "Release $(version)" && \ git tag --annotate v$(version) --message 'Release $(version)'; \ echo "\033[2m→ Push `git show --pretty='%h (%s)' --no-patch HEAD` to Github:\033[0m\n"; \ - echo "\033[1m git push origin v$(version)\033[0m\n"; \ + echo "\033[1m git push origin HEAD && git push origin v$(version)\033[0m\n"; \ else \ echo "Aborting..."; \ exit 1; \ From dfc641c67e7a6a73f005618e345f410c6cf51fba Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 12 Jul 2019 08:28:54 +0200 Subject: [PATCH 088/355] Generator: Tests: Update the list of skipped tests (cherry picked from commit 4739503ab4710ff8181d66a78e392e554328d960) --- internal/cmd/generate/commands/gentests/skips.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/cmd/generate/commands/gentests/skips.go b/internal/cmd/generate/commands/gentests/skips.go index 6da980099e..966b3e50b3 100755 --- a/internal/cmd/generate/commands/gentests/skips.go +++ b/internal/cmd/generate/commands/gentests/skips.go @@ -154,6 +154,7 @@ security/authz/13_index_datemath.yml: # Possibly a cluster health color mismatch... security/authz/14_cat_indices.yml: - Test empty request while single authorized index + - Test empty request while single closed authorized index # Test looks for "testnode.crt", but "ca.crt" is returned first ssl/10_basic.yml: From 64f4339e6b59e684bee42efdd722352c001b4a20 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 13 Jul 2019 07:46:43 +0200 Subject: [PATCH 089/355] Add support for CloudID To facilitate connecting to the Elastic Service (https://elastic.co/cloud), add a configuration option to take the CloudID (https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html), which is parsed and transformed into a regular address. (cherry picked from commit ddd19548f7ff5a80cddbf6c4bddc3c0650e64e6e) --- doc.go | 2 + elasticsearch.go | 48 ++++++++++++++++++++- elasticsearch_internal_test.go | 78 ++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+), 1 deletion(-) diff --git a/doc.go b/doc.go index dd1ce83601..57fb06da81 100755 --- a/doc.go +++ b/doc.go @@ -29,6 +29,8 @@ To configure the client, pass a Config object to the NewClient function: elasticsearch.NewClient(cfg) +When using the Elastic Service (https://elastic.co/cloud), you can use CloudID instead of Addresses. + See the elasticsearch_integration_test.go file and the _examples folder for more information. Call the Elasticsearch APIs by invoking the corresponding methods on the client: diff --git a/elasticsearch.go b/elasticsearch.go index 42e08ab020..b0ec51c0c9 100755 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -1,6 +1,7 @@ package elasticsearch import ( + "encoding/base64" "errors" "fmt" "net/http" @@ -28,6 +29,7 @@ type Config struct { Username string // Username for HTTP Basic Authentication. Password string // Password for HTTP Basic Authentication. + CloudID string // Endpoint for the Elastic Service (https://elastic.co/cloud). Transport http.RoundTripper // The HTTP transport object. Logger estransport.Logger // The logger object. } @@ -61,13 +63,36 @@ func NewDefaultClient() (*Client, error) { // environment variable. // func NewClient(cfg Config) (*Client, error) { + var addrs []string + envAddrs := addrsFromEnvironment() if len(envAddrs) > 0 && len(cfg.Addresses) > 0 { return nil, errors.New("cannot create client: both ELASTICSEARCH_URL and Addresses are set") } - addrs := append(envAddrs, cfg.Addresses...) + if len(envAddrs) > 0 && cfg.CloudID != "" { + return nil, errors.New("cannot create client: both ELASTICSEARCH_URL and CloudID are set") + } + + if len(cfg.Addresses) > 0 && cfg.CloudID != "" { + return nil, errors.New("cannot create client: both Adresses and CloudID are set") + } + + if cfg.CloudID != "" { + cloudAddrs, err := addrFromCloudID(cfg.CloudID) + if err != nil { + return nil, fmt.Errorf("cannot create client: cannot parse CloudID: %s", err) + } + addrs = append(addrs, cloudAddrs) + } else { + if len(envAddrs) > 0 { + addrs = append(envAddrs, envAddrs...) + } + if len(cfg.Addresses) > 0 { + addrs = append(envAddrs, cfg.Addresses...) + } + } urls, err := addrsToURLs(addrs) if err != nil { @@ -127,3 +152,24 @@ func addrsToURLs(addrs []string) ([]*url.URL, error) { } return urls, nil } + +// addrFromCloudID extracts the Elasticsearch URL from CloudID. +// See: https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html +// +func addrFromCloudID(input string) (string, error) { + var ( + port = 9243 + scheme = "https://" + ) + + values := strings.Split(input, ":") + if len(values) != 2 { + return "", fmt.Errorf("unexpected format: %q", input) + } + data, err := base64.StdEncoding.DecodeString(values[1]) + if err != nil { + return "", err + } + parts := strings.Split(string(data), "$") + return fmt.Sprintf("%s%s.%s:%d", scheme, parts[1], parts[0], port), nil +} diff --git a/elasticsearch_internal_test.go b/elasticsearch_internal_test.go index 7811d90c14..1c90acbfb3 100755 --- a/elasticsearch_internal_test.go +++ b/elasticsearch_internal_test.go @@ -3,6 +3,7 @@ package elasticsearch import ( + "encoding/base64" "errors" "net/http" "net/url" @@ -67,6 +68,44 @@ func TestClientConfiguration(t *testing.T) { } }) + t.Run("With URL from environment and cfg.CloudID", func(t *testing.T) { + os.Setenv("ELASTICSEARCH_URL", "http://example.com") + defer func() { os.Setenv("ELASTICSEARCH_URL", "") }() + + _, err := NewClient(Config{CloudID: "foobar="}) + if err == nil { + t.Fatalf("Expected error, got: %v", err) + } + match, _ := regexp.MatchString("both .* are set", err.Error()) + if !match { + t.Errorf("Expected error when addresses from environment and configuration are used together, got: %v", err) + } + }) + + t.Run("With cfg.Addresses and cfg.CloudID", func(t *testing.T) { + _, err := NewClient(Config{Addresses: []string{"http://localhost:8080//"}, CloudID: "foobar="}) + if err == nil { + t.Fatalf("Expected error, got: %v", err) + } + match, _ := regexp.MatchString("both .* are set", err.Error()) + if !match { + t.Errorf("Expected error when addresses from environment and configuration are used together, got: %v", err) + } + }) + + t.Run("With CloudID", func(t *testing.T) { + c, err := NewClient(Config{CloudID: "foo:YmFyLmNsb3VkLmVzLmlvJGFiYzEyMyRkZWY0NTY="}) + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + u := c.Transport.(*estransport.Client).URLs()[0].String() + + if u != "https://abc123.bar.cloud.es.io:9243" { + t.Errorf("Unexpected URL, want=https://abc123.bar.cloud.es.io:9243, got=%s", u) + } + }) + t.Run("With invalid URL", func(t *testing.T) { u := ":foo" _, err := NewClient(Config{Addresses: []string{u}}) @@ -192,6 +231,45 @@ func TestAddrsToURLs(t *testing.T) { } } +func TestCloudID(t *testing.T) { + t.Run("Parse", func(t *testing.T) { + input := "name:" + base64.StdEncoding.EncodeToString([]byte("host$es$kibana")) + expected := "https://es.host:9243" + + actual, err := addrFromCloudID(input) + if err != nil { + t.Errorf("Unexpected error: %s", err) + } + if actual != expected { + t.Errorf("Unexpected output, want=%q, got=%q", expected, actual) + } + }) + + t.Run("Invalid format", func(t *testing.T) { + input := "foobar" + _, err := addrFromCloudID(input) + if err == nil { + t.Errorf("Expected error for input %q, got %v", input, err) + } + match, _ := regexp.MatchString("unexpected format", err.Error()) + if !match { + t.Errorf("Unexpected error string: %s", err) + } + }) + + t.Run("Invalid base64 value", func(t *testing.T) { + input := "foobar:xxxxx" + _, err := addrFromCloudID(input) + if err == nil { + t.Errorf("Expected error for input %q, got %v", input, err) + } + match, _ := regexp.MatchString("illegal base64 data", err.Error()) + if !match { + t.Errorf("Unexpected error string: %s", err) + } + }) +} + func TestVersion(t *testing.T) { if Version == "" { t.Error("Version is empty") From 5c657a3b3abc9717a31ae24ce04ad2e2a852fd2e Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 13 Jul 2019 07:56:21 +0200 Subject: [PATCH 090/355] Add support for APIKey authentication In order to facilitate connecting to clusters with API Key (https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-create-api-key.html), add the corresponding configuration option. Takes precedence over username/password. (cherry picked from commit 3b68c0f89287c1bd3dd03d810217de06d7616c9c) --- elasticsearch.go | 3 +++ estransport/estransport.go | 16 ++++++++++++++-- estransport/estransport_internal_test.go | 21 +++++++++++++++++++-- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/elasticsearch.go b/elasticsearch.go index b0ec51c0c9..e67bccd0de 100755 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -30,6 +30,8 @@ type Config struct { Password string // Password for HTTP Basic Authentication. CloudID string // Endpoint for the Elastic Service (https://elastic.co/cloud). + APIKey string // Base64-encoded token for authorization; if set, overrides username and password. + Transport http.RoundTripper // The HTTP transport object. Logger estransport.Logger // The logger object. } @@ -108,6 +110,7 @@ func NewClient(cfg Config) (*Client, error) { URLs: urls, Username: cfg.Username, Password: cfg.Password, + APIKey: cfg.APIKey, Transport: cfg.Transport, Logger: cfg.Logger, diff --git a/estransport/estransport.go b/estransport/estransport.go index 59de2da046..5fddeab7ba 100755 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -39,6 +39,7 @@ type Config struct { URLs []*url.URL Username string Password string + APIKey string Transport http.RoundTripper Logger Logger @@ -50,6 +51,7 @@ type Client struct { urls []*url.URL username string password string + apikey string transport http.RoundTripper selector Selector @@ -69,6 +71,7 @@ func New(cfg Config) *Client { urls: cfg.URLs, username: cfg.Username, password: cfg.Password, + apikey: cfg.APIKey, transport: cfg.Transport, selector: NewRoundRobinSelector(cfg.URLs...), @@ -89,7 +92,7 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { c.setUserAgent(req) if _, ok := req.Header["Authorization"]; !ok { - c.setBasicAuth(u, req) + c.setAuthorization(u, req) } var dupReqBody *bytes.Buffer @@ -154,13 +157,22 @@ func (c *Client) setURL(u *url.URL, req *http.Request) *http.Request { return req } -func (c *Client) setBasicAuth(u *url.URL, req *http.Request) *http.Request { +func (c *Client) setAuthorization(u *url.URL, req *http.Request) *http.Request { if u.User != nil { password, _ := u.User.Password() req.SetBasicAuth(u.User.Username(), password) return req } + if c.apikey != "" { + var b bytes.Buffer + b.Grow(len("APIKey ") + len(c.apikey)) + b.WriteString("APIKey ") + b.WriteString(c.apikey) + req.Header.Set("Authorization", b.String()) + return req + } + if c.username != "" && c.password != "" { req.SetBasicAuth(c.username, c.password) return req diff --git a/estransport/estransport_internal_test.go b/estransport/estransport_internal_test.go index 29e0f7724b..5fcc9dff46 100755 --- a/estransport/estransport_internal_test.go +++ b/estransport/estransport_internal_test.go @@ -97,7 +97,7 @@ func TestTransportPerform(t *testing.T) { tp := New(Config{URLs: []*url.URL{u}}) req, _ := http.NewRequest("GET", "/", nil) - tp.setBasicAuth(u, req) + tp.setAuthorization(u, req) username, password, ok := req.BasicAuth() if !ok { @@ -114,7 +114,7 @@ func TestTransportPerform(t *testing.T) { tp := New(Config{URLs: []*url.URL{u}, Username: "foo", Password: "bar"}) req, _ := http.NewRequest("GET", "/", nil) - tp.setBasicAuth(u, req) + tp.setAuthorization(u, req) username, password, ok := req.BasicAuth() if !ok { @@ -126,6 +126,23 @@ func TestTransportPerform(t *testing.T) { } }) + t.Run("Sets APIKey Authentication from configuration", func(t *testing.T) { + u, _ := url.Parse("http://example.com") + tp := New(Config{URLs: []*url.URL{u}, APIKey: "Zm9vYmFy"}) // foobar + + req, _ := http.NewRequest("GET", "/", nil) + tp.setAuthorization(u, req) + + value := req.Header.Get("Authorization") + if value == "" { + t.Errorf("Expected the request to have the Authorization header set") + } + + if value != "APIKey Zm9vYmFy" { + t.Errorf(`Unexpected value for Authorization: want="APIKey Zm9vYmFy", got="%s"`, value) + } + }) + t.Run("Sets UserAgent", func(t *testing.T) { u, _ := url.Parse("http://example.com") tp := New(Config{URLs: []*url.URL{u}}) From f1e755531ff485ea8777f24068aaa4c170cb2d82 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 14 Jul 2019 16:28:58 +0200 Subject: [PATCH 091/355] Transport: Clean up the Perform() method Extract the logging code into a separate method, use duplicateBody() helper method, annotate the code. (cherry picked from commit 7afe9bd9f47c4fc4efe00b7e7b948f66fbc33063) --- estransport/estransport.go | 104 ++++++++++++++++++++++--------------- 1 file changed, 63 insertions(+), 41 deletions(-) diff --git a/estransport/estransport.go b/estransport/estransport.go index 5fddeab7ba..80b0885b81 100755 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -3,6 +3,7 @@ package estransport import ( "bytes" "fmt" + "io" "io/ioutil" "net/http" "net/url" @@ -82,50 +83,42 @@ func New(cfg Config) *Client { // Perform executes the request and returns a response or error. // func (c *Client) Perform(req *http.Request) (*http.Response, error) { + var ( + dupReqBody io.Reader + ) + + // Get URL from the Selector + // u, err := c.getURL() if err != nil { // TODO(karmi): Log error return nil, fmt.Errorf("cannot get URL: %s", err) } + // Update request + // c.setURL(u, req) c.setUserAgent(req) + c.setAuthorization(u, req) - if _, ok := req.Header["Authorization"]; !ok { - c.setAuthorization(u, req) - } - - var dupReqBody *bytes.Buffer + // Duplicate request body for logger + // if c.logger != nil && c.logger.RequestBodyEnabled() { if req.Body != nil && req.Body != http.NoBody { - dupReqBody = bytes.NewBuffer(make([]byte, 0, int(req.ContentLength))) - dupReqBody.ReadFrom(req.Body) - req.Body = ioutil.NopCloser(bytes.NewBuffer(dupReqBody.Bytes())) + dupReqBody, req.Body, _ = duplicateBody(req.Body) } } + // Set up time measures and execute the request + // start := time.Now().UTC() res, err := c.transport.RoundTrip(req) dur := time.Since(start) + // Log request and response + // if c.logger != nil { - var dupRes http.Response - if res != nil { - dupRes = *res - } - if c.logger.RequestBodyEnabled() { - if req.Body != nil && req.Body != http.NoBody { - req.Body = ioutil.NopCloser(dupReqBody) - } - } - if c.logger.ResponseBodyEnabled() { - if res != nil && res.Body != nil && res.Body != http.NoBody { - b1, b2, _ := duplicateBody(res.Body) - dupRes.Body = b1 - res.Body = b2 - } - } - c.logger.LogRoundTrip(req, &dupRes, err, start, dur) // errcheck exclude + c.logRoundTrip(req, res, dupReqBody, err, start, dur) } // TODO(karmi): Wrap error @@ -158,24 +151,26 @@ func (c *Client) setURL(u *url.URL, req *http.Request) *http.Request { } func (c *Client) setAuthorization(u *url.URL, req *http.Request) *http.Request { - if u.User != nil { - password, _ := u.User.Password() - req.SetBasicAuth(u.User.Username(), password) - return req - } + if _, ok := req.Header["Authorization"]; !ok { + if u.User != nil { + password, _ := u.User.Password() + req.SetBasicAuth(u.User.Username(), password) + return req + } - if c.apikey != "" { - var b bytes.Buffer - b.Grow(len("APIKey ") + len(c.apikey)) - b.WriteString("APIKey ") - b.WriteString(c.apikey) - req.Header.Set("Authorization", b.String()) - return req - } + if c.apikey != "" { + var b bytes.Buffer + b.Grow(len("APIKey ") + len(c.apikey)) + b.WriteString("APIKey ") + b.WriteString(c.apikey) + req.Header.Set("Authorization", b.String()) + return req + } - if c.username != "" && c.password != "" { - req.SetBasicAuth(c.username, c.password) - return req + if c.username != "" && c.password != "" { + req.SetBasicAuth(c.username, c.password) + return req + } } return req @@ -186,6 +181,33 @@ func (c *Client) setUserAgent(req *http.Request) *http.Request { return req } +func (c *Client) logRoundTrip( + req *http.Request, + res *http.Response, + reqBody io.Reader, + err error, + start time.Time, + dur time.Duration, +) { + var dupRes http.Response + if res != nil { + dupRes = *res + } + if c.logger.RequestBodyEnabled() { + if req.Body != nil && req.Body != http.NoBody { + req.Body = ioutil.NopCloser(reqBody) + } + } + if c.logger.ResponseBodyEnabled() { + if res != nil && res.Body != nil && res.Body != http.NoBody { + b1, b2, _ := duplicateBody(res.Body) + dupRes.Body = b1 + res.Body = b2 + } + } + c.logger.LogRoundTrip(req, &dupRes, err, start, dur) // errcheck exclude +} + func initUserAgent() string { var b strings.Builder From 1bf29ccb7fa54fcbaf7420bb1a8a3ccd804cfc8c Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 19 Jul 2019 15:45:12 +0200 Subject: [PATCH 092/355] API: Fix (*esapi.Response).String() to prevent panic when response is nil (cherry picked from commit ee4dede054b1bd0f214790cc46171f354a518322) --- esapi/esapi.response.go | 38 ++++++++++++++++++--------- esapi/esapi_response_internal_test.go | 28 +++++++++++++++----- estransport/logger_internal_test.go | 7 +++-- 3 files changed, 53 insertions(+), 20 deletions(-) diff --git a/esapi/esapi.response.go b/esapi/esapi.response.go index dae6785bfc..4f8cea128d 100755 --- a/esapi/esapi.response.go +++ b/esapi/esapi.response.go @@ -27,20 +27,32 @@ func (r *Response) String() string { out = new(bytes.Buffer) b1 = bytes.NewBuffer([]byte{}) b2 = bytes.NewBuffer([]byte{}) - tr = io.TeeReader(r.Body, b1) + tr io.Reader ) - defer r.Body.Close() + if r != nil && r.Body != nil { + tr = io.TeeReader(r.Body, b1) + defer r.Body.Close() - if _, err := io.Copy(b2, tr); err != nil { - out.WriteString(fmt.Sprintf("", err)) - return out.String() + if _, err := io.Copy(b2, tr); err != nil { + out.WriteString(fmt.Sprintf("", err)) + return out.String() + } + defer func() { r.Body = ioutil.NopCloser(b1) }() } - defer func() { r.Body = ioutil.NopCloser(b1) }() - out.WriteString(fmt.Sprintf("[%d %s]", r.StatusCode, http.StatusText(r.StatusCode))) - out.WriteRune(' ') - out.ReadFrom(b2) // errcheck exclude (*bytes.Buffer).ReadFrom + if r != nil { + out.WriteString(fmt.Sprintf("[%d %s]", r.StatusCode, http.StatusText(r.StatusCode))) + if r.StatusCode > 0 { + out.WriteRune(' ') + } + } else { + out.WriteString("[0 ]") + } + + if r != nil && r.Body != nil { + out.ReadFrom(b2) // errcheck exclude (*bytes.Buffer).ReadFrom + } return out.String() } @@ -49,9 +61,11 @@ func (r *Response) String() string { // func (r *Response) Status() string { var b strings.Builder - b.WriteString(strconv.Itoa(r.StatusCode)) - b.WriteString(" ") - b.WriteString(http.StatusText(r.StatusCode)) + if r != nil { + b.WriteString(strconv.Itoa(r.StatusCode)) + b.WriteString(" ") + b.WriteString(http.StatusText(r.StatusCode)) + } return b.String() } diff --git a/esapi/esapi_response_internal_test.go b/esapi/esapi_response_internal_test.go index 4819b639f9..5f4df6735b 100755 --- a/esapi/esapi_response_internal_test.go +++ b/esapi/esapi_response_internal_test.go @@ -16,13 +16,13 @@ func (errReader) Read(p []byte) (n int, err error) { return 1, errors.New("MOCK func TestAPIResponse(t *testing.T) { var ( body string - res Response + res *Response ) t.Run("String", func(t *testing.T) { body = `{"foo":"bar"}` - res = Response{StatusCode: 200, Body: ioutil.NopCloser(strings.NewReader(body))} + res = &Response{StatusCode: 200, Body: ioutil.NopCloser(strings.NewReader(body))} expected := `[200 OK]` + ` ` + body if res.String() != expected { @@ -30,8 +30,24 @@ func TestAPIResponse(t *testing.T) { } }) + t.Run("String with empty response", func(t *testing.T) { + res = &Response{} + + if res.String() != "[0 ]" { + t.Errorf("Unexpected response: %s", res.String()) + } + }) + + t.Run("String with nil response", func(t *testing.T) { + res = nil + + if res.String() != "[0 ]" { + t.Errorf("Unexpected response: %s", res.String()) + } + }) + t.Run("String Error", func(t *testing.T) { - res = Response{StatusCode: 200, Body: ioutil.NopCloser(errReader{})} + res = &Response{StatusCode: 200, Body: ioutil.NopCloser(errReader{})} t.Log(res.String()) t.Log(res.String()) @@ -42,7 +58,7 @@ func TestAPIResponse(t *testing.T) { }) t.Run("Status", func(t *testing.T) { - res = Response{StatusCode: 404} + res = &Response{StatusCode: 404} if res.Status() != `404 Not Found` { t.Errorf("Unexpected response status text: %s, want: 404 Not Found", res.Status()) @@ -50,13 +66,13 @@ func TestAPIResponse(t *testing.T) { }) t.Run("IsError", func(t *testing.T) { - res = Response{StatusCode: 201} + res = &Response{StatusCode: 201} if res.IsError() { t.Errorf("Unexpected error for response: %s", res.Status()) } - res = Response{StatusCode: 403} + res = &Response{StatusCode: 403} if !res.IsError() { t.Errorf("Expected error for response: %s", res.Status()) diff --git a/estransport/logger_internal_test.go b/estransport/logger_internal_test.go index 7b12d8bd0c..a546a8763c 100644 --- a/estransport/logger_internal_test.go +++ b/estransport/logger_internal_test.go @@ -88,9 +88,12 @@ func TestTransportLogger(t *testing.T) { }) req, _ := http.NewRequest("GET", "/abc", nil) - _, err := tp.Perform(req) + res, err := tp.Perform(req) if err == nil { - t.Fatalf("Expected error: %s", err) + t.Errorf("Expected error: %v", err) + } + if res != nil { + t.Errorf("Expected nil response, got: %v", err) } }) From de749e0549a360b3f1b93bc7a0b373d88d7752b0 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 21 Jul 2019 08:24:57 +0200 Subject: [PATCH 093/355] Generator: Tests: Update the list of skipped tests (cherry picked from commit c49377020e092848a3af5737ab122df131199632) --- internal/cmd/generate/commands/gentests/skips.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/cmd/generate/commands/gentests/skips.go b/internal/cmd/generate/commands/gentests/skips.go index 966b3e50b3..8073f00bd5 100755 --- a/internal/cmd/generate/commands/gentests/skips.go +++ b/internal/cmd/generate/commands/gentests/skips.go @@ -153,8 +153,6 @@ security/authz/13_index_datemath.yml: # Possibly a cluster health color mismatch... security/authz/14_cat_indices.yml: - - Test empty request while single authorized index - - Test empty request while single closed authorized index # Test looks for "testnode.crt", but "ca.crt" is returned first ssl/10_basic.yml: From 6034f8eeccc50489fbe93deb5f926a04a9c7f2f2 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 30 Jul 2019 11:12:27 +0200 Subject: [PATCH 094/355] Generator: API: Update descriptions list (cherry picked from commit 02540a4b9875e587ee664ccca27650eadd94c5a5) --- internal/cmd/generate/commands/gensource/descriptions.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/cmd/generate/commands/gensource/descriptions.go b/internal/cmd/generate/commands/gensource/descriptions.go index ece5cc3732..a0f42fbad5 100755 --- a/internal/cmd/generate/commands/gensource/descriptions.go +++ b/internal/cmd/generate/commands/gensource/descriptions.go @@ -241,6 +241,11 @@ indices.clear_cache: description: |- Clears all or specific caches for one or more indices. +indices.clone: + # https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html + description: |- + Clones an existing index into a new index. + indices.close: # http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html description: |- From 074fc0fdc1de0fdecda82f0a53183532c1d24db0 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 30 Jul 2019 11:17:42 +0200 Subject: [PATCH 095/355] API: Update the APIs for Elasticsearch 7.x (14cedbfa60a) --- esapi/api._.go | 2 +- esapi/api.clear_scroll.go | 2 +- esapi/api.indices.flush_synced.go | 2 +- esapi/api.scroll.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/esapi/api._.go b/esapi/api._.go index f345138469..70efc3e9e4 100644 --- a/esapi/api._.go +++ b/esapi/api._.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0-SNAPSHOT (1e367b67175): DO NOT EDIT +// Code generated from specification version 7.3.0 (14cedbfa60a): DO NOT EDIT package esapi diff --git a/esapi/api.clear_scroll.go b/esapi/api.clear_scroll.go index a035da603f..48c9ac2c35 100755 --- a/esapi/api.clear_scroll.go +++ b/esapi/api.clear_scroll.go @@ -23,7 +23,7 @@ func newClearScrollFunc(t Transport) ClearScroll { // ClearScroll explicitly clears the search context for a scroll. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html. +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll. // type ClearScroll func(o ...func(*ClearScrollRequest)) (*Response, error) diff --git a/esapi/api.indices.flush_synced.go b/esapi/api.indices.flush_synced.go index a1f6a9c874..fa46020550 100755 --- a/esapi/api.indices.flush_synced.go +++ b/esapi/api.indices.flush_synced.go @@ -23,7 +23,7 @@ func newIndicesFlushSyncedFunc(t Transport) IndicesFlushSynced { // IndicesFlushSynced performs a synced flush operation on one or more indices. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush.html. +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html#synced-flush-api. // type IndicesFlushSynced func(o ...func(*IndicesFlushSyncedRequest)) (*Response, error) diff --git a/esapi/api.scroll.go b/esapi/api.scroll.go index 1ab3f3a205..1fb1ffc86e 100755 --- a/esapi/api.scroll.go +++ b/esapi/api.scroll.go @@ -25,7 +25,7 @@ func newScrollFunc(t Transport) Scroll { // Scroll allows to retrieve a large numbers of results from a single search request. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html. +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll. // type Scroll func(o ...func(*ScrollRequest)) (*Response, error) From d86e1c0d161a2183ab15d54703f6ba8b241ddad4 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 30 Jul 2019 14:36:19 +0200 Subject: [PATCH 096/355] Makefile: Improve the "release" target (cherry picked from commit 7285751abb59d1f90b0ab60b454bde2f64a8ff73) --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ecd86e1379..106e1501fb 100755 --- a/Makefile +++ b/Makefile @@ -181,15 +181,17 @@ endif } release: ## Release a new version to Github + $(eval branch = $(shell git rev-parse --abbrev-ref HEAD)) + $(eval current_version = $(shell cat internal/version/version.go | sed -Ee 's/const Client = "(.*)"/\1/' | tail -1)) + @echo "\033[2m→ [$(branch)] Current version: $(current_version)...\033[0m" ifndef version - @echo "Missing version argument, exiting..." + @echo "\033[31m[!] Missing version argument, exiting...\033[0m" @exit 2 endif ifeq ($(version), "") - @echo "Empty version argument, exiting..." + @echo "\033[31m[!] Empty version argument, exiting...\033[0m" @exit 2 endif - $(eval branch = $(shell git rev-parse --abbrev-ref HEAD)) @echo "\033[2m→ [$(branch)] Creating version $(version)...\033[0m" @{ \ set -e -o pipefail; \ From a265bbe6fda6258bc33e55f61824cf8ddaf74e54 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 30 Jul 2019 15:35:55 +0200 Subject: [PATCH 097/355] Makefile: Reset go.mod files after running targets (cherry picked from commit 8e91ccf3e24e3b0c1d12d0e08bbfde5cfb43eb71) --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 106e1501fb..cb5aedf9fa 100755 --- a/Makefile +++ b/Makefile @@ -48,6 +48,8 @@ endif @echo "\033[2m→ Running API integration tests for [$(flavor)]...\033[0m" ifeq ($(flavor), xpack) @{ \ + set -e ; \ + trap "git checkout $(PWD)/esapi/test/go.mod" SIGINT SIGTERM EXIT; \ export ELASTICSEARCH_URL='https://elastic:elastic@localhost:9200' && \ if which gotestsum > /dev/null 2>&1 ; then \ cd esapi/test && \ @@ -65,6 +67,8 @@ ifeq ($(flavor), xpack) else $(eval testapiargs += $(PWD)/esapi/test/*_test.go) @{ \ + set -e ; \ + trap "git checkout $(PWD)/esapi/test/go.mod" SIGINT SIGTERM EXIT; \ if which gotestsum > /dev/null 2>&1 ; then \ cd esapi/test && gotestsum --format=short-verbose --junitfile=$(PWD)/tmp/integration-api-report.xml -- $(testapiargs); \ else \ @@ -82,6 +86,7 @@ test-examples: ## Execute the _examples @echo "\033[2m→ Testing the examples...\033[0m" @{ \ set -e ; \ + trap "git checkout _examples/**/go.mod" SIGINT SIGTERM EXIT; \ for f in _examples/*.go; do \ echo "\033[2m────────────────────────────────────────────────────────────────────────────────"; \ echo "\033[1m$$f\033[0m"; \ @@ -336,6 +341,8 @@ else endif @echo "\033[2m→ Generating API package from specification ($(version):$(build_hash))...\033[0m" @{ \ + set -e; \ + trap "git checkout $(PWD)/internal/cmd/generate/go.mod" SIGINT SIGTERM EXIT; \ export ELASTICSEARCH_VERSION=$(version) && \ export ELASTICSEARCH_BUILD_HASH=$(build_hash) && \ cd internal/cmd/generate && \ @@ -362,6 +369,8 @@ else endif @echo "\033[2m→ Generating API tests from specification ($(version):$(build_hash))...\033[0m" @{ \ + set -e; \ + trap "git checkout $(PWD)/internal/cmd/generate/go.mod" SIGINT SIGTERM EXIT; \ export ELASTICSEARCH_VERSION=$(version) && \ export ELASTICSEARCH_BUILD_HASH=$(build_hash) && \ rm -rf $(output)/*_test.go && \ From efa210aa6f9822e2352e9c779f3c33f9d778ddc5 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 31 Jul 2019 08:19:00 +0200 Subject: [PATCH 098/355] Examples: Update esutil.JSONReader (cherry picked from commit ea052088db25bb87db9ce22b8191a5205665ee99) --- _examples/encoding/Makefile | 1 + _examples/encoding/README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/_examples/encoding/Makefile b/_examples/encoding/Makefile index 9c0e596cd5..6469698542 100644 --- a/_examples/encoding/Makefile +++ b/_examples/encoding/Makefile @@ -3,6 +3,7 @@ GO_TEST_CMD = $(if $(shell which richgo),richgo test,go test) test: clean setup ## Run tests go run gjson.go go run easyjson.go + go run jsonreader.go bench: clean setup # Run benchmarks go test -run=none -bench=. -benchmem benchmark_test.go diff --git a/_examples/encoding/README.md b/_examples/encoding/README.md index 9d48fd4c83..2c05213b17 100644 --- a/_examples/encoding/README.md +++ b/_examples/encoding/README.md @@ -45,7 +45,7 @@ passing to the `WithBody()` methods: ```golang type Document struct{ Title string } doc := Document{Title: "Test"} -es.Search(es.Search.WithBody(esutil.JSONReader(&doc))) +es.Search(es.Search.WithBody(esutil.NewJSONReader(&doc))) ``` ----- From 968b8b18481a8443d7b437bcf86cc8be2fc14440 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 1 Aug 2019 08:51:37 +0200 Subject: [PATCH 099/355] API: Update the APIs for Elasticsearch 7.3.0 (de777fa3ccb) --- esapi/api._.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esapi/api._.go b/esapi/api._.go index 70efc3e9e4..dfa0e46122 100644 --- a/esapi/api._.go +++ b/esapi/api._.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0 (14cedbfa60a): DO NOT EDIT +// Code generated from specification version 7.3.0 (de777fa3ccb): DO NOT EDIT package esapi From c4f5181f50ff885d9b4dff06b06600bf84aa141b Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 1 Aug 2019 08:53:27 +0200 Subject: [PATCH 100/355] Release 7.3.0 --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index e56130d38b..7a21f9ecfd 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -2,4 +2,4 @@ package version // Client returns the client version as a string. // -const Client = "7.2.0-SNAPSHOT" +const Client = "7.3.0" From 10f497055081ca2166a9ee2dae170a97133227cb Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 1 Aug 2019 08:56:20 +0200 Subject: [PATCH 101/355] API: Update the APIs for Elasticsearch 7.3.1 (a92f36162e5) --- esapi/api._.go | 2 +- esapi/api.bulk.go | 2 +- esapi/api.cat.aliases.go | 2 +- esapi/api.cat.allocation.go | 2 +- esapi/api.cat.count.go | 2 +- esapi/api.cat.fielddata.go | 2 +- esapi/api.cat.health.go | 2 +- esapi/api.cat.help.go | 2 +- esapi/api.cat.indices.go | 2 +- esapi/api.cat.master.go | 2 +- esapi/api.cat.nodeattrs.go | 2 +- esapi/api.cat.nodes.go | 2 +- esapi/api.cat.pending_tasks.go | 2 +- esapi/api.cat.plugins.go | 2 +- esapi/api.cat.recovery.go | 2 +- esapi/api.cat.repositories.go | 2 +- esapi/api.cat.segments.go | 2 +- esapi/api.cat.shards.go | 2 +- esapi/api.cat.snapshots.go | 2 +- esapi/api.cat.tasks.go | 2 +- esapi/api.cat.templates.go | 2 +- esapi/api.cat.thread_pool.go | 2 +- esapi/api.clear_scroll.go | 2 +- esapi/api.cluster.allocation_explain.go | 2 +- esapi/api.cluster.get_settings.go | 2 +- esapi/api.cluster.health.go | 2 +- esapi/api.cluster.pending_tasks.go | 2 +- esapi/api.cluster.put_settings.go | 2 +- esapi/api.cluster.remote_info.go | 2 +- esapi/api.cluster.reroute.go | 2 +- esapi/api.cluster.state.go | 2 +- esapi/api.cluster.stats.go | 2 +- esapi/api.count.go | 2 +- esapi/api.create.go | 2 +- esapi/api.delete.go | 2 +- esapi/api.delete_by_query.go | 2 +- esapi/api.delete_by_query_rethrottle.go | 2 +- esapi/api.delete_script.go | 2 +- esapi/api.exists.go | 2 +- esapi/api.exists_source.go | 2 +- esapi/api.explain.go | 2 +- esapi/api.field_caps.go | 2 +- esapi/api.get.go | 2 +- esapi/api.get_script.go | 2 +- esapi/api.get_source.go | 2 +- esapi/api.index.go | 2 +- esapi/api.indices.analyze.go | 2 +- esapi/api.indices.clear_cache.go | 2 +- esapi/api.indices.close.go | 2 +- esapi/api.indices.create.go | 2 +- esapi/api.indices.delete.go | 2 +- esapi/api.indices.delete_alias.go | 2 +- esapi/api.indices.delete_template.go | 2 +- esapi/api.indices.exists.go | 2 +- esapi/api.indices.exists_alias.go | 2 +- esapi/api.indices.exists_template.go | 2 +- esapi/api.indices.exists_type.go | 2 +- esapi/api.indices.flush.go | 2 +- esapi/api.indices.flush_synced.go | 2 +- esapi/api.indices.forcemerge.go | 2 +- esapi/api.indices.get.go | 2 +- esapi/api.indices.get_alias.go | 2 +- esapi/api.indices.get_field_mapping.go | 2 +- esapi/api.indices.get_mapping.go | 2 +- esapi/api.indices.get_settings.go | 2 +- esapi/api.indices.get_template.go | 2 +- esapi/api.indices.get_upgrade.go | 2 +- esapi/api.indices.open.go | 2 +- esapi/api.indices.put_alias.go | 2 +- esapi/api.indices.put_mapping.go | 2 +- esapi/api.indices.put_settings.go | 2 +- esapi/api.indices.put_template.go | 2 +- esapi/api.indices.recovery.go | 2 +- esapi/api.indices.refresh.go | 2 +- esapi/api.indices.rollover.go | 2 +- esapi/api.indices.segments.go | 2 +- esapi/api.indices.shard_stores.go | 2 +- esapi/api.indices.shrink.go | 2 +- esapi/api.indices.split.go | 2 +- esapi/api.indices.stats.go | 2 +- esapi/api.indices.update_aliases.go | 2 +- esapi/api.indices.upgrade.go | 2 +- esapi/api.indices.validate_query.go | 2 +- esapi/api.info.go | 2 +- esapi/api.ingest.delete_pipeline.go | 2 +- esapi/api.ingest.get_pipeline.go | 2 +- esapi/api.ingest.processor_grok.go | 2 +- esapi/api.ingest.put_pipeline.go | 2 +- esapi/api.ingest.simulate.go | 2 +- esapi/api.mget.go | 2 +- esapi/api.msearch.go | 2 +- esapi/api.msearch_template.go | 2 +- esapi/api.mtermvectors.go | 2 +- esapi/api.nodes.hot_threads.go | 2 +- esapi/api.nodes.info.go | 2 +- esapi/api.nodes.reload_secure_settings.go | 2 +- esapi/api.nodes.stats.go | 2 +- esapi/api.nodes.usage.go | 2 +- esapi/api.ping.go | 2 +- esapi/api.put_script.go | 2 +- esapi/api.rank_eval.go | 2 +- esapi/api.reindex.go | 2 +- esapi/api.reindex_rethrottle.go | 2 +- esapi/api.render_search_template.go | 2 +- esapi/api.scripts_painless_execute.go | 2 +- esapi/api.scroll.go | 2 +- esapi/api.search.go | 2 +- esapi/api.search_shards.go | 2 +- esapi/api.search_template.go | 2 +- esapi/api.snapshot.create.go | 2 +- esapi/api.snapshot.create_repository.go | 2 +- esapi/api.snapshot.delete.go | 2 +- esapi/api.snapshot.delete_repository.go | 2 +- esapi/api.snapshot.get.go | 2 +- esapi/api.snapshot.get_repository.go | 2 +- esapi/api.snapshot.restore.go | 2 +- esapi/api.snapshot.status.go | 2 +- esapi/api.snapshot.verify_repository.go | 2 +- esapi/api.tasks.cancel.go | 2 +- esapi/api.tasks.get.go | 2 +- esapi/api.tasks.list.go | 2 +- esapi/api.termvectors.go | 2 +- esapi/api.update.go | 2 +- esapi/api.update_by_query.go | 2 +- esapi/api.update_by_query_rethrottle.go | 2 +- esapi/api.xpack.ccr.delete_auto_follow_pattern.go | 2 +- esapi/api.xpack.ccr.follow.go | 2 +- esapi/api.xpack.ccr.follow_info.go | 2 +- esapi/api.xpack.ccr.follow_stats.go | 2 +- esapi/api.xpack.ccr.forget_follower.go | 2 +- esapi/api.xpack.ccr.get_auto_follow_pattern.go | 2 +- esapi/api.xpack.ccr.pause_follow.go | 2 +- esapi/api.xpack.ccr.put_auto_follow_pattern.go | 2 +- esapi/api.xpack.ccr.resume_follow.go | 2 +- esapi/api.xpack.ccr.stats.go | 2 +- esapi/api.xpack.ccr.unfollow.go | 2 +- esapi/api.xpack.data_frame.delete_data_frame_transform.go | 2 +- esapi/api.xpack.data_frame.get_data_frame_transform.go | 2 +- esapi/api.xpack.data_frame.get_data_frame_transform_stats.go | 2 +- esapi/api.xpack.data_frame.preview_data_frame_transform.go | 2 +- esapi/api.xpack.data_frame.put_data_frame_transform.go | 2 +- esapi/api.xpack.data_frame.start_data_frame_transform.go | 2 +- esapi/api.xpack.data_frame.stop_data_frame_transform.go | 2 +- esapi/api.xpack.graph.explore.go | 2 +- esapi/api.xpack.ilm.delete_lifecycle.go | 2 +- esapi/api.xpack.ilm.explain_lifecycle.go | 2 +- esapi/api.xpack.ilm.get_lifecycle.go | 2 +- esapi/api.xpack.ilm.get_status.go | 2 +- esapi/api.xpack.ilm.move_to_step.go | 2 +- esapi/api.xpack.ilm.put_lifecycle.go | 2 +- esapi/api.xpack.ilm.remove_policy.go | 2 +- esapi/api.xpack.ilm.retry.go | 2 +- esapi/api.xpack.ilm.start.go | 2 +- esapi/api.xpack.ilm.stop.go | 2 +- esapi/api.xpack.indices.freeze.go | 2 +- esapi/api.xpack.indices.reload_search_analyzers.go | 2 +- esapi/api.xpack.indices.unfreeze.go | 2 +- esapi/api.xpack.license.delete.go | 2 +- esapi/api.xpack.license.get.go | 2 +- esapi/api.xpack.license.get_basic_status.go | 2 +- esapi/api.xpack.license.get_trial_status.go | 2 +- esapi/api.xpack.license.post.go | 2 +- esapi/api.xpack.license.post_start_basic.go | 2 +- esapi/api.xpack.license.post_start_trial.go | 2 +- esapi/api.xpack.migration.deprecations.go | 2 +- esapi/api.xpack.ml.close_job.go | 2 +- esapi/api.xpack.ml.delete_calendar.go | 2 +- esapi/api.xpack.ml.delete_calendar_event.go | 2 +- esapi/api.xpack.ml.delete_calendar_job.go | 2 +- esapi/api.xpack.ml.delete_data_frame_analytics.go | 2 +- esapi/api.xpack.ml.delete_datafeed.go | 2 +- esapi/api.xpack.ml.delete_expired_data.go | 2 +- esapi/api.xpack.ml.delete_filter.go | 2 +- esapi/api.xpack.ml.delete_forecast.go | 2 +- esapi/api.xpack.ml.delete_job.go | 2 +- esapi/api.xpack.ml.delete_model_snapshot.go | 2 +- esapi/api.xpack.ml.evaluate_data_frame.go | 2 +- esapi/api.xpack.ml.find_file_structure.go | 2 +- esapi/api.xpack.ml.flush_job.go | 2 +- esapi/api.xpack.ml.forecast.go | 2 +- esapi/api.xpack.ml.get_buckets.go | 2 +- esapi/api.xpack.ml.get_calendar_events.go | 2 +- esapi/api.xpack.ml.get_calendars.go | 2 +- esapi/api.xpack.ml.get_categories.go | 2 +- esapi/api.xpack.ml.get_data_frame_analytics.go | 2 +- esapi/api.xpack.ml.get_data_frame_analytics_stats.go | 2 +- esapi/api.xpack.ml.get_datafeed_stats.go | 2 +- esapi/api.xpack.ml.get_datafeeds.go | 2 +- esapi/api.xpack.ml.get_filters.go | 2 +- esapi/api.xpack.ml.get_influencers.go | 2 +- esapi/api.xpack.ml.get_job_stats.go | 2 +- esapi/api.xpack.ml.get_jobs.go | 2 +- esapi/api.xpack.ml.get_model_snapshots.go | 2 +- esapi/api.xpack.ml.get_overall_buckets.go | 2 +- esapi/api.xpack.ml.get_records.go | 2 +- esapi/api.xpack.ml.info.go | 2 +- esapi/api.xpack.ml.open_job.go | 2 +- esapi/api.xpack.ml.post_calendar_events.go | 2 +- esapi/api.xpack.ml.post_data.go | 2 +- esapi/api.xpack.ml.preview_datafeed.go | 2 +- esapi/api.xpack.ml.put_calendar.go | 2 +- esapi/api.xpack.ml.put_calendar_job.go | 2 +- esapi/api.xpack.ml.put_data_frame_analytics.go | 2 +- esapi/api.xpack.ml.put_datafeed.go | 2 +- esapi/api.xpack.ml.put_filter.go | 2 +- esapi/api.xpack.ml.put_job.go | 2 +- esapi/api.xpack.ml.revert_model_snapshot.go | 2 +- esapi/api.xpack.ml.set_upgrade_mode.go | 2 +- esapi/api.xpack.ml.start_data_frame_analytics.go | 2 +- esapi/api.xpack.ml.start_datafeed.go | 2 +- esapi/api.xpack.ml.stop_data_frame_analytics.go | 2 +- esapi/api.xpack.ml.stop_datafeed.go | 2 +- esapi/api.xpack.ml.update_datafeed.go | 2 +- esapi/api.xpack.ml.update_filter.go | 2 +- esapi/api.xpack.ml.update_job.go | 2 +- esapi/api.xpack.ml.update_model_snapshot.go | 2 +- esapi/api.xpack.ml.validate.go | 2 +- esapi/api.xpack.ml.validate_detector.go | 2 +- esapi/api.xpack.monitoring.bulk.go | 2 +- esapi/api.xpack.rollup.delete_job.go | 2 +- esapi/api.xpack.rollup.get_jobs.go | 2 +- esapi/api.xpack.rollup.get_rollup_caps.go | 2 +- esapi/api.xpack.rollup.get_rollup_index_caps.go | 2 +- esapi/api.xpack.rollup.put_job.go | 2 +- esapi/api.xpack.rollup.rollup_search.go | 2 +- esapi/api.xpack.rollup.start_job.go | 2 +- esapi/api.xpack.rollup.stop_job.go | 2 +- esapi/api.xpack.security.authenticate.go | 2 +- esapi/api.xpack.security.change_password.go | 2 +- esapi/api.xpack.security.clear_cached_realms.go | 2 +- esapi/api.xpack.security.clear_cached_roles.go | 2 +- esapi/api.xpack.security.create_api_key.go | 2 +- esapi/api.xpack.security.delete_privileges.go | 2 +- esapi/api.xpack.security.delete_role.go | 2 +- esapi/api.xpack.security.delete_role_mapping.go | 2 +- esapi/api.xpack.security.delete_user.go | 2 +- esapi/api.xpack.security.disable_user.go | 2 +- esapi/api.xpack.security.enable_user.go | 2 +- esapi/api.xpack.security.get_api_key.go | 2 +- esapi/api.xpack.security.get_builtin_privileges.go | 2 +- esapi/api.xpack.security.get_privileges.go | 2 +- esapi/api.xpack.security.get_role.go | 2 +- esapi/api.xpack.security.get_role_mapping.go | 2 +- esapi/api.xpack.security.get_token.go | 2 +- esapi/api.xpack.security.get_user.go | 2 +- esapi/api.xpack.security.get_user_privileges.go | 2 +- esapi/api.xpack.security.has_privileges.go | 2 +- esapi/api.xpack.security.invalidate_api_key.go | 2 +- esapi/api.xpack.security.invalidate_token.go | 2 +- esapi/api.xpack.security.put_privileges.go | 2 +- esapi/api.xpack.security.put_role.go | 2 +- esapi/api.xpack.security.put_role_mapping.go | 2 +- esapi/api.xpack.security.put_user.go | 2 +- esapi/api.xpack.sql.clear_cursor.go | 2 +- esapi/api.xpack.sql.query.go | 2 +- esapi/api.xpack.sql.translate.go | 2 +- esapi/api.xpack.ssl.certificates.go | 2 +- esapi/api.xpack.watcher.ack_watch.go | 2 +- esapi/api.xpack.watcher.activate_watch.go | 2 +- esapi/api.xpack.watcher.deactivate_watch.go | 2 +- esapi/api.xpack.watcher.delete_watch.go | 2 +- esapi/api.xpack.watcher.execute_watch.go | 2 +- esapi/api.xpack.watcher.get_watch.go | 2 +- esapi/api.xpack.watcher.put_watch.go | 2 +- esapi/api.xpack.watcher.start.go | 2 +- esapi/api.xpack.watcher.stats.go | 2 +- esapi/api.xpack.watcher.stop.go | 2 +- esapi/api.xpack.xpack.info.go | 2 +- esapi/api.xpack.xpack.usage.go | 2 +- 269 files changed, 269 insertions(+), 269 deletions(-) diff --git a/esapi/api._.go b/esapi/api._.go index dfa0e46122..d5178e9c15 100644 --- a/esapi/api._.go +++ b/esapi/api._.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0 (de777fa3ccb): DO NOT EDIT +// Code generated from specification version 7.3.1 (a92f36162e5): DO NOT EDIT package esapi diff --git a/esapi/api.bulk.go b/esapi/api.bulk.go index 88e839ed50..1aedac7c3e 100755 --- a/esapi/api.bulk.go +++ b/esapi/api.bulk.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.aliases.go b/esapi/api.cat.aliases.go index 97d81bf8aa..adc01bb96a 100755 --- a/esapi/api.cat.aliases.go +++ b/esapi/api.cat.aliases.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.allocation.go b/esapi/api.cat.allocation.go index b9b6189499..6782545a1a 100755 --- a/esapi/api.cat.allocation.go +++ b/esapi/api.cat.allocation.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.count.go b/esapi/api.cat.count.go index 11a6a7ae64..288444f4bc 100755 --- a/esapi/api.cat.count.go +++ b/esapi/api.cat.count.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.fielddata.go b/esapi/api.cat.fielddata.go index 2eabd078f0..358d5a53e4 100755 --- a/esapi/api.cat.fielddata.go +++ b/esapi/api.cat.fielddata.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.health.go b/esapi/api.cat.health.go index 1bcad6d87b..6b92fbfc9d 100755 --- a/esapi/api.cat.health.go +++ b/esapi/api.cat.health.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.help.go b/esapi/api.cat.help.go index 787498e532..96ca4df3f8 100755 --- a/esapi/api.cat.help.go +++ b/esapi/api.cat.help.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.indices.go b/esapi/api.cat.indices.go index da0430cffe..c021910f0e 100755 --- a/esapi/api.cat.indices.go +++ b/esapi/api.cat.indices.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.master.go b/esapi/api.cat.master.go index 2b8078b3a0..657c5279d1 100755 --- a/esapi/api.cat.master.go +++ b/esapi/api.cat.master.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.nodeattrs.go b/esapi/api.cat.nodeattrs.go index 2d1961a50e..f99c5a158a 100755 --- a/esapi/api.cat.nodeattrs.go +++ b/esapi/api.cat.nodeattrs.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.nodes.go b/esapi/api.cat.nodes.go index 56ddd23de3..9ec4463c11 100755 --- a/esapi/api.cat.nodes.go +++ b/esapi/api.cat.nodes.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.pending_tasks.go b/esapi/api.cat.pending_tasks.go index b4484cbdbb..2fdeda8dd4 100755 --- a/esapi/api.cat.pending_tasks.go +++ b/esapi/api.cat.pending_tasks.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.plugins.go b/esapi/api.cat.plugins.go index 9d68b8b2de..360d14ca79 100755 --- a/esapi/api.cat.plugins.go +++ b/esapi/api.cat.plugins.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.recovery.go b/esapi/api.cat.recovery.go index 1953ffad3c..e036b1c13d 100755 --- a/esapi/api.cat.recovery.go +++ b/esapi/api.cat.recovery.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.repositories.go b/esapi/api.cat.repositories.go index f13b8a5fa6..b365005850 100755 --- a/esapi/api.cat.repositories.go +++ b/esapi/api.cat.repositories.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.segments.go b/esapi/api.cat.segments.go index a535adae1b..df17671154 100755 --- a/esapi/api.cat.segments.go +++ b/esapi/api.cat.segments.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.shards.go b/esapi/api.cat.shards.go index 4d2fe658a0..1c7fae468a 100755 --- a/esapi/api.cat.shards.go +++ b/esapi/api.cat.shards.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.snapshots.go b/esapi/api.cat.snapshots.go index c59a736a34..11c5ff6c18 100755 --- a/esapi/api.cat.snapshots.go +++ b/esapi/api.cat.snapshots.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.tasks.go b/esapi/api.cat.tasks.go index af27a07953..74fd9fd553 100755 --- a/esapi/api.cat.tasks.go +++ b/esapi/api.cat.tasks.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.templates.go b/esapi/api.cat.templates.go index 8ff7684cc2..7ff39fdb85 100755 --- a/esapi/api.cat.templates.go +++ b/esapi/api.cat.templates.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.thread_pool.go b/esapi/api.cat.thread_pool.go index 37e82f38fa..7ff60c2101 100755 --- a/esapi/api.cat.thread_pool.go +++ b/esapi/api.cat.thread_pool.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.clear_scroll.go b/esapi/api.clear_scroll.go index 48c9ac2c35..cbd332c1bc 100755 --- a/esapi/api.clear_scroll.go +++ b/esapi/api.clear_scroll.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.allocation_explain.go b/esapi/api.cluster.allocation_explain.go index 88a726194f..6af1a54946 100755 --- a/esapi/api.cluster.allocation_explain.go +++ b/esapi/api.cluster.allocation_explain.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.get_settings.go b/esapi/api.cluster.get_settings.go index 88ad3787d1..e6b056299b 100755 --- a/esapi/api.cluster.get_settings.go +++ b/esapi/api.cluster.get_settings.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.health.go b/esapi/api.cluster.health.go index ee5aabf162..04854bae6f 100755 --- a/esapi/api.cluster.health.go +++ b/esapi/api.cluster.health.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.pending_tasks.go b/esapi/api.cluster.pending_tasks.go index d0858b1383..ca8e546584 100755 --- a/esapi/api.cluster.pending_tasks.go +++ b/esapi/api.cluster.pending_tasks.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.put_settings.go b/esapi/api.cluster.put_settings.go index 9b7a7635df..c35bbb3682 100755 --- a/esapi/api.cluster.put_settings.go +++ b/esapi/api.cluster.put_settings.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.remote_info.go b/esapi/api.cluster.remote_info.go index 65df4b97fd..481b31f4ee 100755 --- a/esapi/api.cluster.remote_info.go +++ b/esapi/api.cluster.remote_info.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.reroute.go b/esapi/api.cluster.reroute.go index 858042ec14..f2daf593ba 100755 --- a/esapi/api.cluster.reroute.go +++ b/esapi/api.cluster.reroute.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.state.go b/esapi/api.cluster.state.go index ac00afc01e..a18e21385d 100755 --- a/esapi/api.cluster.state.go +++ b/esapi/api.cluster.state.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.stats.go b/esapi/api.cluster.stats.go index 88fe9413c2..f1a05f0554 100755 --- a/esapi/api.cluster.stats.go +++ b/esapi/api.cluster.stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.count.go b/esapi/api.count.go index 0ce54a5883..bf355fd6e0 100755 --- a/esapi/api.count.go +++ b/esapi/api.count.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.create.go b/esapi/api.create.go index 74d13ef341..c4a8afcdad 100755 --- a/esapi/api.create.go +++ b/esapi/api.create.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.delete.go b/esapi/api.delete.go index b21c1be807..3d81785db4 100755 --- a/esapi/api.delete.go +++ b/esapi/api.delete.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.delete_by_query.go b/esapi/api.delete_by_query.go index 4b884bc655..078498e948 100755 --- a/esapi/api.delete_by_query.go +++ b/esapi/api.delete_by_query.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.delete_by_query_rethrottle.go b/esapi/api.delete_by_query_rethrottle.go index bce7d1e35a..eb98133cb6 100755 --- a/esapi/api.delete_by_query_rethrottle.go +++ b/esapi/api.delete_by_query_rethrottle.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.delete_script.go b/esapi/api.delete_script.go index bf3b1df63a..9ae607451e 100755 --- a/esapi/api.delete_script.go +++ b/esapi/api.delete_script.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.exists.go b/esapi/api.exists.go index dca47ac034..c876981243 100755 --- a/esapi/api.exists.go +++ b/esapi/api.exists.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.exists_source.go b/esapi/api.exists_source.go index d423f8e66f..38388f2a31 100755 --- a/esapi/api.exists_source.go +++ b/esapi/api.exists_source.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.explain.go b/esapi/api.explain.go index 7362564c71..70d9351387 100755 --- a/esapi/api.explain.go +++ b/esapi/api.explain.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.field_caps.go b/esapi/api.field_caps.go index 88f3f454da..5e042ae339 100755 --- a/esapi/api.field_caps.go +++ b/esapi/api.field_caps.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.get.go b/esapi/api.get.go index d0dc3eb2b2..61f391e8ce 100755 --- a/esapi/api.get.go +++ b/esapi/api.get.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.get_script.go b/esapi/api.get_script.go index 78d50d1ddb..2fec520736 100755 --- a/esapi/api.get_script.go +++ b/esapi/api.get_script.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.get_source.go b/esapi/api.get_source.go index fedd41a3b1..ec02899bc0 100755 --- a/esapi/api.get_source.go +++ b/esapi/api.get_source.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.index.go b/esapi/api.index.go index 62442005e2..f0c71d0769 100755 --- a/esapi/api.index.go +++ b/esapi/api.index.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.analyze.go b/esapi/api.indices.analyze.go index f48c706b42..e7a156af9f 100755 --- a/esapi/api.indices.analyze.go +++ b/esapi/api.indices.analyze.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.clear_cache.go b/esapi/api.indices.clear_cache.go index 3650b3fb3f..6e3ac8d849 100755 --- a/esapi/api.indices.clear_cache.go +++ b/esapi/api.indices.clear_cache.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.close.go b/esapi/api.indices.close.go index 57ed34ec77..c972350083 100755 --- a/esapi/api.indices.close.go +++ b/esapi/api.indices.close.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.create.go b/esapi/api.indices.create.go index 1d78896163..4555972b05 100755 --- a/esapi/api.indices.create.go +++ b/esapi/api.indices.create.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.delete.go b/esapi/api.indices.delete.go index b85f6e8b86..9a693c42d3 100755 --- a/esapi/api.indices.delete.go +++ b/esapi/api.indices.delete.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.delete_alias.go b/esapi/api.indices.delete_alias.go index f9fc8dfcd9..545a169415 100755 --- a/esapi/api.indices.delete_alias.go +++ b/esapi/api.indices.delete_alias.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.delete_template.go b/esapi/api.indices.delete_template.go index 81fcc310b2..2cc6995ef4 100755 --- a/esapi/api.indices.delete_template.go +++ b/esapi/api.indices.delete_template.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.exists.go b/esapi/api.indices.exists.go index f744d8beec..2cb4e585eb 100755 --- a/esapi/api.indices.exists.go +++ b/esapi/api.indices.exists.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.exists_alias.go b/esapi/api.indices.exists_alias.go index 30c66b550d..e00f703d4b 100755 --- a/esapi/api.indices.exists_alias.go +++ b/esapi/api.indices.exists_alias.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.exists_template.go b/esapi/api.indices.exists_template.go index 20fc904485..0b80ffeb1d 100755 --- a/esapi/api.indices.exists_template.go +++ b/esapi/api.indices.exists_template.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.exists_type.go b/esapi/api.indices.exists_type.go index dcc2b5cd11..b1533c33f8 100755 --- a/esapi/api.indices.exists_type.go +++ b/esapi/api.indices.exists_type.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.flush.go b/esapi/api.indices.flush.go index 08ac5f97e7..f103878054 100755 --- a/esapi/api.indices.flush.go +++ b/esapi/api.indices.flush.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.flush_synced.go b/esapi/api.indices.flush_synced.go index fa46020550..3c181dad68 100755 --- a/esapi/api.indices.flush_synced.go +++ b/esapi/api.indices.flush_synced.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.forcemerge.go b/esapi/api.indices.forcemerge.go index 6697a205fc..87ff59fdd8 100755 --- a/esapi/api.indices.forcemerge.go +++ b/esapi/api.indices.forcemerge.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get.go b/esapi/api.indices.get.go index 38a92af5f2..4919f0217b 100755 --- a/esapi/api.indices.get.go +++ b/esapi/api.indices.get.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_alias.go b/esapi/api.indices.get_alias.go index 2a1563d938..098da99909 100755 --- a/esapi/api.indices.get_alias.go +++ b/esapi/api.indices.get_alias.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_field_mapping.go b/esapi/api.indices.get_field_mapping.go index 978cf54ae0..10b84b7143 100755 --- a/esapi/api.indices.get_field_mapping.go +++ b/esapi/api.indices.get_field_mapping.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_mapping.go b/esapi/api.indices.get_mapping.go index 35e1472eb3..ea662a9f25 100755 --- a/esapi/api.indices.get_mapping.go +++ b/esapi/api.indices.get_mapping.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_settings.go b/esapi/api.indices.get_settings.go index 2fb9fd8133..22d9726455 100755 --- a/esapi/api.indices.get_settings.go +++ b/esapi/api.indices.get_settings.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_template.go b/esapi/api.indices.get_template.go index 0ceeed2d1f..a9e7001be9 100755 --- a/esapi/api.indices.get_template.go +++ b/esapi/api.indices.get_template.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_upgrade.go b/esapi/api.indices.get_upgrade.go index f7a0584e6e..db5771e50c 100755 --- a/esapi/api.indices.get_upgrade.go +++ b/esapi/api.indices.get_upgrade.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.open.go b/esapi/api.indices.open.go index 1ab90efc66..2d8e5be187 100755 --- a/esapi/api.indices.open.go +++ b/esapi/api.indices.open.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.put_alias.go b/esapi/api.indices.put_alias.go index 416689dd81..a1582047f7 100755 --- a/esapi/api.indices.put_alias.go +++ b/esapi/api.indices.put_alias.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.put_mapping.go b/esapi/api.indices.put_mapping.go index d5d329205e..0f6e8e2454 100755 --- a/esapi/api.indices.put_mapping.go +++ b/esapi/api.indices.put_mapping.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.put_settings.go b/esapi/api.indices.put_settings.go index 2f71cf04df..33122be92b 100755 --- a/esapi/api.indices.put_settings.go +++ b/esapi/api.indices.put_settings.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.put_template.go b/esapi/api.indices.put_template.go index c7cf384172..7ff01fb369 100755 --- a/esapi/api.indices.put_template.go +++ b/esapi/api.indices.put_template.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.recovery.go b/esapi/api.indices.recovery.go index 923e11c994..6f2b99cd68 100755 --- a/esapi/api.indices.recovery.go +++ b/esapi/api.indices.recovery.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.refresh.go b/esapi/api.indices.refresh.go index dcb2722a27..d973d6eec1 100755 --- a/esapi/api.indices.refresh.go +++ b/esapi/api.indices.refresh.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.rollover.go b/esapi/api.indices.rollover.go index ceb0e735be..f4fd7f55f4 100755 --- a/esapi/api.indices.rollover.go +++ b/esapi/api.indices.rollover.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.segments.go b/esapi/api.indices.segments.go index e4be81606c..9ec885cb53 100755 --- a/esapi/api.indices.segments.go +++ b/esapi/api.indices.segments.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.shard_stores.go b/esapi/api.indices.shard_stores.go index f4fbc7e90f..d3dafce548 100755 --- a/esapi/api.indices.shard_stores.go +++ b/esapi/api.indices.shard_stores.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.shrink.go b/esapi/api.indices.shrink.go index b81ab72065..a8ac4ef688 100755 --- a/esapi/api.indices.shrink.go +++ b/esapi/api.indices.shrink.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.split.go b/esapi/api.indices.split.go index b455f5effc..514e045bad 100755 --- a/esapi/api.indices.split.go +++ b/esapi/api.indices.split.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.stats.go b/esapi/api.indices.stats.go index c906dc525f..84f7a4db00 100755 --- a/esapi/api.indices.stats.go +++ b/esapi/api.indices.stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.update_aliases.go b/esapi/api.indices.update_aliases.go index ddd32538f9..fc1e2c0b70 100755 --- a/esapi/api.indices.update_aliases.go +++ b/esapi/api.indices.update_aliases.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.upgrade.go b/esapi/api.indices.upgrade.go index f1e5051cb0..26136d4d9d 100755 --- a/esapi/api.indices.upgrade.go +++ b/esapi/api.indices.upgrade.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.validate_query.go b/esapi/api.indices.validate_query.go index 70b2e6498b..125833c996 100755 --- a/esapi/api.indices.validate_query.go +++ b/esapi/api.indices.validate_query.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.info.go b/esapi/api.info.go index 2b29438846..56a18a6e9c 100755 --- a/esapi/api.info.go +++ b/esapi/api.info.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.delete_pipeline.go b/esapi/api.ingest.delete_pipeline.go index d6df545a00..479d3e310f 100755 --- a/esapi/api.ingest.delete_pipeline.go +++ b/esapi/api.ingest.delete_pipeline.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.get_pipeline.go b/esapi/api.ingest.get_pipeline.go index 4b0b6d6e2f..baaf94bfb0 100755 --- a/esapi/api.ingest.get_pipeline.go +++ b/esapi/api.ingest.get_pipeline.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.processor_grok.go b/esapi/api.ingest.processor_grok.go index 9b3521d86b..9166d37df1 100755 --- a/esapi/api.ingest.processor_grok.go +++ b/esapi/api.ingest.processor_grok.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.put_pipeline.go b/esapi/api.ingest.put_pipeline.go index fe0953bd63..71f0f15197 100755 --- a/esapi/api.ingest.put_pipeline.go +++ b/esapi/api.ingest.put_pipeline.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.simulate.go b/esapi/api.ingest.simulate.go index 8935eb403b..5bb782e0be 100755 --- a/esapi/api.ingest.simulate.go +++ b/esapi/api.ingest.simulate.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.mget.go b/esapi/api.mget.go index e253316252..436bc40218 100755 --- a/esapi/api.mget.go +++ b/esapi/api.mget.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.msearch.go b/esapi/api.msearch.go index 47117e85e7..b23b4f0a46 100755 --- a/esapi/api.msearch.go +++ b/esapi/api.msearch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.msearch_template.go b/esapi/api.msearch_template.go index b67bebfdeb..5a6c3d8832 100755 --- a/esapi/api.msearch_template.go +++ b/esapi/api.msearch_template.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.mtermvectors.go b/esapi/api.mtermvectors.go index 580d254ee5..6bd950ddc1 100755 --- a/esapi/api.mtermvectors.go +++ b/esapi/api.mtermvectors.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.hot_threads.go b/esapi/api.nodes.hot_threads.go index 552284c568..5b69f6f5e2 100755 --- a/esapi/api.nodes.hot_threads.go +++ b/esapi/api.nodes.hot_threads.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.info.go b/esapi/api.nodes.info.go index 15ee9234b6..d9335711eb 100755 --- a/esapi/api.nodes.info.go +++ b/esapi/api.nodes.info.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.reload_secure_settings.go b/esapi/api.nodes.reload_secure_settings.go index 159ee6008b..9af0794b5d 100755 --- a/esapi/api.nodes.reload_secure_settings.go +++ b/esapi/api.nodes.reload_secure_settings.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.stats.go b/esapi/api.nodes.stats.go index 0db813896c..c6fad59a6e 100755 --- a/esapi/api.nodes.stats.go +++ b/esapi/api.nodes.stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.usage.go b/esapi/api.nodes.usage.go index 720b8a9173..ffe6a9eac8 100755 --- a/esapi/api.nodes.usage.go +++ b/esapi/api.nodes.usage.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.ping.go b/esapi/api.ping.go index 062850f4cd..c207e80bf6 100755 --- a/esapi/api.ping.go +++ b/esapi/api.ping.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.put_script.go b/esapi/api.put_script.go index 77989513a6..cd95734c05 100755 --- a/esapi/api.put_script.go +++ b/esapi/api.put_script.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.rank_eval.go b/esapi/api.rank_eval.go index 2efb2e697c..1771f26753 100755 --- a/esapi/api.rank_eval.go +++ b/esapi/api.rank_eval.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.reindex.go b/esapi/api.reindex.go index 4eaa923021..b174cf5b9e 100755 --- a/esapi/api.reindex.go +++ b/esapi/api.reindex.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.reindex_rethrottle.go b/esapi/api.reindex_rethrottle.go index cc31fb4e02..7cf01d1f1c 100755 --- a/esapi/api.reindex_rethrottle.go +++ b/esapi/api.reindex_rethrottle.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.render_search_template.go b/esapi/api.render_search_template.go index 4911c91f57..6c7bb50d01 100755 --- a/esapi/api.render_search_template.go +++ b/esapi/api.render_search_template.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.scripts_painless_execute.go b/esapi/api.scripts_painless_execute.go index dd457b48cc..70f0fd76f1 100755 --- a/esapi/api.scripts_painless_execute.go +++ b/esapi/api.scripts_painless_execute.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.scroll.go b/esapi/api.scroll.go index 1fb1ffc86e..16388160f9 100755 --- a/esapi/api.scroll.go +++ b/esapi/api.scroll.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.search.go b/esapi/api.search.go index cd44866962..254ded79ce 100755 --- a/esapi/api.search.go +++ b/esapi/api.search.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.search_shards.go b/esapi/api.search_shards.go index c2fb18d81d..c5e7fe0742 100755 --- a/esapi/api.search_shards.go +++ b/esapi/api.search_shards.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.search_template.go b/esapi/api.search_template.go index 8c49e7b331..33caf6fd4c 100755 --- a/esapi/api.search_template.go +++ b/esapi/api.search_template.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.create.go b/esapi/api.snapshot.create.go index c856b06397..f0e7a1a330 100755 --- a/esapi/api.snapshot.create.go +++ b/esapi/api.snapshot.create.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.create_repository.go b/esapi/api.snapshot.create_repository.go index 4ac6664222..4da5f4c82d 100755 --- a/esapi/api.snapshot.create_repository.go +++ b/esapi/api.snapshot.create_repository.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.delete.go b/esapi/api.snapshot.delete.go index 4a2e47e8a5..dde7a9c042 100755 --- a/esapi/api.snapshot.delete.go +++ b/esapi/api.snapshot.delete.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.delete_repository.go b/esapi/api.snapshot.delete_repository.go index e2a4a32e53..710aef1e41 100755 --- a/esapi/api.snapshot.delete_repository.go +++ b/esapi/api.snapshot.delete_repository.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.get.go b/esapi/api.snapshot.get.go index cfeaafc7df..120bd3aa62 100755 --- a/esapi/api.snapshot.get.go +++ b/esapi/api.snapshot.get.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.get_repository.go b/esapi/api.snapshot.get_repository.go index 2410cc4385..d03ad3df3c 100755 --- a/esapi/api.snapshot.get_repository.go +++ b/esapi/api.snapshot.get_repository.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.restore.go b/esapi/api.snapshot.restore.go index 8b52e9e7c4..5f6f2d3878 100755 --- a/esapi/api.snapshot.restore.go +++ b/esapi/api.snapshot.restore.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.status.go b/esapi/api.snapshot.status.go index 7defd57838..725e820e26 100755 --- a/esapi/api.snapshot.status.go +++ b/esapi/api.snapshot.status.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.verify_repository.go b/esapi/api.snapshot.verify_repository.go index 5b5d5d6bb5..ab55dcff67 100755 --- a/esapi/api.snapshot.verify_repository.go +++ b/esapi/api.snapshot.verify_repository.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.tasks.cancel.go b/esapi/api.tasks.cancel.go index 6a94df2c29..c9dfffd04e 100755 --- a/esapi/api.tasks.cancel.go +++ b/esapi/api.tasks.cancel.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.tasks.get.go b/esapi/api.tasks.get.go index d9d81ff2a5..490d0be71f 100755 --- a/esapi/api.tasks.get.go +++ b/esapi/api.tasks.get.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.tasks.list.go b/esapi/api.tasks.list.go index 30720db57d..15b945d1a8 100755 --- a/esapi/api.tasks.list.go +++ b/esapi/api.tasks.list.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.termvectors.go b/esapi/api.termvectors.go index 3ca9878215..6d248f241e 100755 --- a/esapi/api.termvectors.go +++ b/esapi/api.termvectors.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.update.go b/esapi/api.update.go index c9864c0995..b677616479 100755 --- a/esapi/api.update.go +++ b/esapi/api.update.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.update_by_query.go b/esapi/api.update_by_query.go index 0c57bc7507..404cc0be25 100755 --- a/esapi/api.update_by_query.go +++ b/esapi/api.update_by_query.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.update_by_query_rethrottle.go b/esapi/api.update_by_query_rethrottle.go index d1a8341724..1aa8b47fce 100755 --- a/esapi/api.update_by_query_rethrottle.go +++ b/esapi/api.update_by_query_rethrottle.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go index 2559019ed8..cbaa10d99d 100755 --- a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.follow.go b/esapi/api.xpack.ccr.follow.go index de6062e294..dd1f25dd20 100755 --- a/esapi/api.xpack.ccr.follow.go +++ b/esapi/api.xpack.ccr.follow.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.follow_info.go b/esapi/api.xpack.ccr.follow_info.go index f0cfdcc784..a4fd5411f2 100755 --- a/esapi/api.xpack.ccr.follow_info.go +++ b/esapi/api.xpack.ccr.follow_info.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.follow_stats.go b/esapi/api.xpack.ccr.follow_stats.go index bb21788aca..e6ae84e7f5 100755 --- a/esapi/api.xpack.ccr.follow_stats.go +++ b/esapi/api.xpack.ccr.follow_stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.forget_follower.go b/esapi/api.xpack.ccr.forget_follower.go index 8e7524d9e9..bca9ce1ed1 100755 --- a/esapi/api.xpack.ccr.forget_follower.go +++ b/esapi/api.xpack.ccr.forget_follower.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.get_auto_follow_pattern.go b/esapi/api.xpack.ccr.get_auto_follow_pattern.go index eda929992c..39f20cd59d 100755 --- a/esapi/api.xpack.ccr.get_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.get_auto_follow_pattern.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.pause_follow.go b/esapi/api.xpack.ccr.pause_follow.go index bdf5e70aa2..a81d94b820 100755 --- a/esapi/api.xpack.ccr.pause_follow.go +++ b/esapi/api.xpack.ccr.pause_follow.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.put_auto_follow_pattern.go b/esapi/api.xpack.ccr.put_auto_follow_pattern.go index f872f01733..62a5d70365 100755 --- a/esapi/api.xpack.ccr.put_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.put_auto_follow_pattern.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.resume_follow.go b/esapi/api.xpack.ccr.resume_follow.go index a1cc1d2b4b..8c4e17147c 100755 --- a/esapi/api.xpack.ccr.resume_follow.go +++ b/esapi/api.xpack.ccr.resume_follow.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.stats.go b/esapi/api.xpack.ccr.stats.go index f53e9cb3b6..e9312d18f0 100755 --- a/esapi/api.xpack.ccr.stats.go +++ b/esapi/api.xpack.ccr.stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.unfollow.go b/esapi/api.xpack.ccr.unfollow.go index 917141d2d9..ed661327c0 100755 --- a/esapi/api.xpack.ccr.unfollow.go +++ b/esapi/api.xpack.ccr.unfollow.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.delete_data_frame_transform.go b/esapi/api.xpack.data_frame.delete_data_frame_transform.go index d2d33f060d..b817981a91 100755 --- a/esapi/api.xpack.data_frame.delete_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.delete_data_frame_transform.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.get_data_frame_transform.go b/esapi/api.xpack.data_frame.get_data_frame_transform.go index 8063a1fad1..4e07989d17 100755 --- a/esapi/api.xpack.data_frame.get_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.get_data_frame_transform.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go b/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go index 67774c296c..e18d2d9810 100755 --- a/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go +++ b/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.preview_data_frame_transform.go b/esapi/api.xpack.data_frame.preview_data_frame_transform.go index 1cb3df7509..c8be8bef82 100755 --- a/esapi/api.xpack.data_frame.preview_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.preview_data_frame_transform.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.put_data_frame_transform.go b/esapi/api.xpack.data_frame.put_data_frame_transform.go index 9dee91e4ee..18c409db4b 100755 --- a/esapi/api.xpack.data_frame.put_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.put_data_frame_transform.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.start_data_frame_transform.go b/esapi/api.xpack.data_frame.start_data_frame_transform.go index d92f1d85a5..1dcd1e648f 100755 --- a/esapi/api.xpack.data_frame.start_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.start_data_frame_transform.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.stop_data_frame_transform.go b/esapi/api.xpack.data_frame.stop_data_frame_transform.go index 1632001d2d..0f9c6b2e87 100755 --- a/esapi/api.xpack.data_frame.stop_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.stop_data_frame_transform.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.graph.explore.go b/esapi/api.xpack.graph.explore.go index 2ea3360c60..03a84fa123 100755 --- a/esapi/api.xpack.graph.explore.go +++ b/esapi/api.xpack.graph.explore.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.delete_lifecycle.go b/esapi/api.xpack.ilm.delete_lifecycle.go index b69d08c256..ed0ea5c3be 100755 --- a/esapi/api.xpack.ilm.delete_lifecycle.go +++ b/esapi/api.xpack.ilm.delete_lifecycle.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.explain_lifecycle.go b/esapi/api.xpack.ilm.explain_lifecycle.go index eac7287a35..fdcecbdf85 100755 --- a/esapi/api.xpack.ilm.explain_lifecycle.go +++ b/esapi/api.xpack.ilm.explain_lifecycle.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.get_lifecycle.go b/esapi/api.xpack.ilm.get_lifecycle.go index d50d752b7b..c8991ee1db 100755 --- a/esapi/api.xpack.ilm.get_lifecycle.go +++ b/esapi/api.xpack.ilm.get_lifecycle.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.get_status.go b/esapi/api.xpack.ilm.get_status.go index 9141b70ff0..2069f8565e 100755 --- a/esapi/api.xpack.ilm.get_status.go +++ b/esapi/api.xpack.ilm.get_status.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.move_to_step.go b/esapi/api.xpack.ilm.move_to_step.go index b0e4df0999..e0c01f20cb 100755 --- a/esapi/api.xpack.ilm.move_to_step.go +++ b/esapi/api.xpack.ilm.move_to_step.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.put_lifecycle.go b/esapi/api.xpack.ilm.put_lifecycle.go index ea406ac070..9bf6784568 100755 --- a/esapi/api.xpack.ilm.put_lifecycle.go +++ b/esapi/api.xpack.ilm.put_lifecycle.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.remove_policy.go b/esapi/api.xpack.ilm.remove_policy.go index 84f4642a6a..e025994fc0 100755 --- a/esapi/api.xpack.ilm.remove_policy.go +++ b/esapi/api.xpack.ilm.remove_policy.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.retry.go b/esapi/api.xpack.ilm.retry.go index 4f71e7a0d4..469c8e9732 100755 --- a/esapi/api.xpack.ilm.retry.go +++ b/esapi/api.xpack.ilm.retry.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.start.go b/esapi/api.xpack.ilm.start.go index e0ed81429a..b3dbf9370f 100755 --- a/esapi/api.xpack.ilm.start.go +++ b/esapi/api.xpack.ilm.start.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.stop.go b/esapi/api.xpack.ilm.stop.go index 3657b7f9e5..9acfc4be40 100755 --- a/esapi/api.xpack.ilm.stop.go +++ b/esapi/api.xpack.ilm.stop.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.indices.freeze.go b/esapi/api.xpack.indices.freeze.go index 2c2a0b2cac..23c8c733df 100755 --- a/esapi/api.xpack.indices.freeze.go +++ b/esapi/api.xpack.indices.freeze.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.indices.reload_search_analyzers.go b/esapi/api.xpack.indices.reload_search_analyzers.go index 99a780235d..aa76738251 100755 --- a/esapi/api.xpack.indices.reload_search_analyzers.go +++ b/esapi/api.xpack.indices.reload_search_analyzers.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.indices.unfreeze.go b/esapi/api.xpack.indices.unfreeze.go index e6df3b7e7a..b0892fcda3 100755 --- a/esapi/api.xpack.indices.unfreeze.go +++ b/esapi/api.xpack.indices.unfreeze.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.delete.go b/esapi/api.xpack.license.delete.go index 37c85c244a..71b569a861 100755 --- a/esapi/api.xpack.license.delete.go +++ b/esapi/api.xpack.license.delete.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.get.go b/esapi/api.xpack.license.get.go index 5e46d22030..2f92f855d0 100755 --- a/esapi/api.xpack.license.get.go +++ b/esapi/api.xpack.license.get.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.get_basic_status.go b/esapi/api.xpack.license.get_basic_status.go index 61b9e14074..f121699f60 100755 --- a/esapi/api.xpack.license.get_basic_status.go +++ b/esapi/api.xpack.license.get_basic_status.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.get_trial_status.go b/esapi/api.xpack.license.get_trial_status.go index 1c9eca55eb..ee93125567 100755 --- a/esapi/api.xpack.license.get_trial_status.go +++ b/esapi/api.xpack.license.get_trial_status.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.post.go b/esapi/api.xpack.license.post.go index b7ed5877af..1e2ba44f83 100755 --- a/esapi/api.xpack.license.post.go +++ b/esapi/api.xpack.license.post.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.post_start_basic.go b/esapi/api.xpack.license.post_start_basic.go index f2def664c9..70b3483dde 100755 --- a/esapi/api.xpack.license.post_start_basic.go +++ b/esapi/api.xpack.license.post_start_basic.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.post_start_trial.go b/esapi/api.xpack.license.post_start_trial.go index efbc93d9a0..c85b30a29e 100755 --- a/esapi/api.xpack.license.post_start_trial.go +++ b/esapi/api.xpack.license.post_start_trial.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.migration.deprecations.go b/esapi/api.xpack.migration.deprecations.go index f08857a8ff..511e13287f 100755 --- a/esapi/api.xpack.migration.deprecations.go +++ b/esapi/api.xpack.migration.deprecations.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.close_job.go b/esapi/api.xpack.ml.close_job.go index 587a37e1d2..6eadd6e7aa 100755 --- a/esapi/api.xpack.ml.close_job.go +++ b/esapi/api.xpack.ml.close_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_calendar.go b/esapi/api.xpack.ml.delete_calendar.go index de655ff307..9d1a4d8739 100755 --- a/esapi/api.xpack.ml.delete_calendar.go +++ b/esapi/api.xpack.ml.delete_calendar.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_calendar_event.go b/esapi/api.xpack.ml.delete_calendar_event.go index 11b36dc2d2..8172cc32ec 100755 --- a/esapi/api.xpack.ml.delete_calendar_event.go +++ b/esapi/api.xpack.ml.delete_calendar_event.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_calendar_job.go b/esapi/api.xpack.ml.delete_calendar_job.go index a70345603f..cf7e152cd5 100755 --- a/esapi/api.xpack.ml.delete_calendar_job.go +++ b/esapi/api.xpack.ml.delete_calendar_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_data_frame_analytics.go b/esapi/api.xpack.ml.delete_data_frame_analytics.go index 8e8cc68b99..a929bf4798 100755 --- a/esapi/api.xpack.ml.delete_data_frame_analytics.go +++ b/esapi/api.xpack.ml.delete_data_frame_analytics.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_datafeed.go b/esapi/api.xpack.ml.delete_datafeed.go index c4655ef005..e208bf8819 100755 --- a/esapi/api.xpack.ml.delete_datafeed.go +++ b/esapi/api.xpack.ml.delete_datafeed.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_expired_data.go b/esapi/api.xpack.ml.delete_expired_data.go index fbfceea6bc..06783deee3 100755 --- a/esapi/api.xpack.ml.delete_expired_data.go +++ b/esapi/api.xpack.ml.delete_expired_data.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_filter.go b/esapi/api.xpack.ml.delete_filter.go index 696e78742f..a18fae0aeb 100755 --- a/esapi/api.xpack.ml.delete_filter.go +++ b/esapi/api.xpack.ml.delete_filter.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_forecast.go b/esapi/api.xpack.ml.delete_forecast.go index 3f974a7cf1..8b7a8f91f3 100755 --- a/esapi/api.xpack.ml.delete_forecast.go +++ b/esapi/api.xpack.ml.delete_forecast.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_job.go b/esapi/api.xpack.ml.delete_job.go index d656c2ab68..432d248b2a 100755 --- a/esapi/api.xpack.ml.delete_job.go +++ b/esapi/api.xpack.ml.delete_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_model_snapshot.go b/esapi/api.xpack.ml.delete_model_snapshot.go index 41298e0c95..83855201aa 100755 --- a/esapi/api.xpack.ml.delete_model_snapshot.go +++ b/esapi/api.xpack.ml.delete_model_snapshot.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.evaluate_data_frame.go b/esapi/api.xpack.ml.evaluate_data_frame.go index 6e9827302a..74400e8475 100755 --- a/esapi/api.xpack.ml.evaluate_data_frame.go +++ b/esapi/api.xpack.ml.evaluate_data_frame.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.find_file_structure.go b/esapi/api.xpack.ml.find_file_structure.go index 568e3c5b3b..8acf3b87dc 100755 --- a/esapi/api.xpack.ml.find_file_structure.go +++ b/esapi/api.xpack.ml.find_file_structure.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.flush_job.go b/esapi/api.xpack.ml.flush_job.go index ea877bcfd8..8bf46f47c0 100755 --- a/esapi/api.xpack.ml.flush_job.go +++ b/esapi/api.xpack.ml.flush_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.forecast.go b/esapi/api.xpack.ml.forecast.go index 2b454044c7..80ccfdafce 100755 --- a/esapi/api.xpack.ml.forecast.go +++ b/esapi/api.xpack.ml.forecast.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_buckets.go b/esapi/api.xpack.ml.get_buckets.go index 5f1c777fab..97ceeea81f 100755 --- a/esapi/api.xpack.ml.get_buckets.go +++ b/esapi/api.xpack.ml.get_buckets.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_calendar_events.go b/esapi/api.xpack.ml.get_calendar_events.go index d4fb8c1d3b..3ceca76330 100755 --- a/esapi/api.xpack.ml.get_calendar_events.go +++ b/esapi/api.xpack.ml.get_calendar_events.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_calendars.go b/esapi/api.xpack.ml.get_calendars.go index 20e81e90b3..d1b0c9a00f 100755 --- a/esapi/api.xpack.ml.get_calendars.go +++ b/esapi/api.xpack.ml.get_calendars.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_categories.go b/esapi/api.xpack.ml.get_categories.go index ce0ccb3f25..26db463729 100755 --- a/esapi/api.xpack.ml.get_categories.go +++ b/esapi/api.xpack.ml.get_categories.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_data_frame_analytics.go b/esapi/api.xpack.ml.get_data_frame_analytics.go index c481929b47..5f50e612c1 100755 --- a/esapi/api.xpack.ml.get_data_frame_analytics.go +++ b/esapi/api.xpack.ml.get_data_frame_analytics.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go index 0f5d5c90e0..336b0a5fa5 100755 --- a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go +++ b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_datafeed_stats.go b/esapi/api.xpack.ml.get_datafeed_stats.go index 25a5ba6172..bb7dab00fd 100755 --- a/esapi/api.xpack.ml.get_datafeed_stats.go +++ b/esapi/api.xpack.ml.get_datafeed_stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_datafeeds.go b/esapi/api.xpack.ml.get_datafeeds.go index ec52494352..0e32643be8 100755 --- a/esapi/api.xpack.ml.get_datafeeds.go +++ b/esapi/api.xpack.ml.get_datafeeds.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_filters.go b/esapi/api.xpack.ml.get_filters.go index 1426d3109f..84b8430c8c 100755 --- a/esapi/api.xpack.ml.get_filters.go +++ b/esapi/api.xpack.ml.get_filters.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_influencers.go b/esapi/api.xpack.ml.get_influencers.go index 0b0d325f70..fe21f0e691 100755 --- a/esapi/api.xpack.ml.get_influencers.go +++ b/esapi/api.xpack.ml.get_influencers.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_job_stats.go b/esapi/api.xpack.ml.get_job_stats.go index b7107a735c..2143870a71 100755 --- a/esapi/api.xpack.ml.get_job_stats.go +++ b/esapi/api.xpack.ml.get_job_stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_jobs.go b/esapi/api.xpack.ml.get_jobs.go index 6042ec190c..aad7c9056d 100755 --- a/esapi/api.xpack.ml.get_jobs.go +++ b/esapi/api.xpack.ml.get_jobs.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_model_snapshots.go b/esapi/api.xpack.ml.get_model_snapshots.go index 88e342df78..4d4300ff73 100755 --- a/esapi/api.xpack.ml.get_model_snapshots.go +++ b/esapi/api.xpack.ml.get_model_snapshots.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_overall_buckets.go b/esapi/api.xpack.ml.get_overall_buckets.go index 9a539190d6..c8ddfa2269 100755 --- a/esapi/api.xpack.ml.get_overall_buckets.go +++ b/esapi/api.xpack.ml.get_overall_buckets.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_records.go b/esapi/api.xpack.ml.get_records.go index ce7ca67a25..6d47e9b054 100755 --- a/esapi/api.xpack.ml.get_records.go +++ b/esapi/api.xpack.ml.get_records.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.info.go b/esapi/api.xpack.ml.info.go index 6fe4993841..fc4362b8b0 100755 --- a/esapi/api.xpack.ml.info.go +++ b/esapi/api.xpack.ml.info.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.open_job.go b/esapi/api.xpack.ml.open_job.go index afce8936d9..e994dea553 100755 --- a/esapi/api.xpack.ml.open_job.go +++ b/esapi/api.xpack.ml.open_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.post_calendar_events.go b/esapi/api.xpack.ml.post_calendar_events.go index ebe7a5c12f..17b8e1a7c8 100755 --- a/esapi/api.xpack.ml.post_calendar_events.go +++ b/esapi/api.xpack.ml.post_calendar_events.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.post_data.go b/esapi/api.xpack.ml.post_data.go index b0cce1268c..99e07068d5 100755 --- a/esapi/api.xpack.ml.post_data.go +++ b/esapi/api.xpack.ml.post_data.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.preview_datafeed.go b/esapi/api.xpack.ml.preview_datafeed.go index 00eca63e3e..2df8836a02 100755 --- a/esapi/api.xpack.ml.preview_datafeed.go +++ b/esapi/api.xpack.ml.preview_datafeed.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_calendar.go b/esapi/api.xpack.ml.put_calendar.go index 84958837fd..a501c821a9 100755 --- a/esapi/api.xpack.ml.put_calendar.go +++ b/esapi/api.xpack.ml.put_calendar.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_calendar_job.go b/esapi/api.xpack.ml.put_calendar_job.go index 15f7296e53..9bb61433e7 100755 --- a/esapi/api.xpack.ml.put_calendar_job.go +++ b/esapi/api.xpack.ml.put_calendar_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_data_frame_analytics.go b/esapi/api.xpack.ml.put_data_frame_analytics.go index f07fa02498..a472021421 100755 --- a/esapi/api.xpack.ml.put_data_frame_analytics.go +++ b/esapi/api.xpack.ml.put_data_frame_analytics.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_datafeed.go b/esapi/api.xpack.ml.put_datafeed.go index 323d3ef799..6d77bb1446 100755 --- a/esapi/api.xpack.ml.put_datafeed.go +++ b/esapi/api.xpack.ml.put_datafeed.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_filter.go b/esapi/api.xpack.ml.put_filter.go index caa4e4698b..52cd702edf 100755 --- a/esapi/api.xpack.ml.put_filter.go +++ b/esapi/api.xpack.ml.put_filter.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_job.go b/esapi/api.xpack.ml.put_job.go index 24078bc434..e62a828e7e 100755 --- a/esapi/api.xpack.ml.put_job.go +++ b/esapi/api.xpack.ml.put_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.revert_model_snapshot.go b/esapi/api.xpack.ml.revert_model_snapshot.go index 62170ec2db..4ff73b528f 100755 --- a/esapi/api.xpack.ml.revert_model_snapshot.go +++ b/esapi/api.xpack.ml.revert_model_snapshot.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.set_upgrade_mode.go b/esapi/api.xpack.ml.set_upgrade_mode.go index ac4d3cd3f8..f68b2fd505 100755 --- a/esapi/api.xpack.ml.set_upgrade_mode.go +++ b/esapi/api.xpack.ml.set_upgrade_mode.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.start_data_frame_analytics.go b/esapi/api.xpack.ml.start_data_frame_analytics.go index c98dad4534..1b469e6dd2 100755 --- a/esapi/api.xpack.ml.start_data_frame_analytics.go +++ b/esapi/api.xpack.ml.start_data_frame_analytics.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.start_datafeed.go b/esapi/api.xpack.ml.start_datafeed.go index 9d4744464e..c22fdd9447 100755 --- a/esapi/api.xpack.ml.start_datafeed.go +++ b/esapi/api.xpack.ml.start_datafeed.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.stop_data_frame_analytics.go b/esapi/api.xpack.ml.stop_data_frame_analytics.go index d1b9455f43..fa1f3d56a1 100755 --- a/esapi/api.xpack.ml.stop_data_frame_analytics.go +++ b/esapi/api.xpack.ml.stop_data_frame_analytics.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.stop_datafeed.go b/esapi/api.xpack.ml.stop_datafeed.go index e29a06eb5e..8f54478495 100755 --- a/esapi/api.xpack.ml.stop_datafeed.go +++ b/esapi/api.xpack.ml.stop_datafeed.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.update_datafeed.go b/esapi/api.xpack.ml.update_datafeed.go index c7d6d4ae51..343e013157 100755 --- a/esapi/api.xpack.ml.update_datafeed.go +++ b/esapi/api.xpack.ml.update_datafeed.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.update_filter.go b/esapi/api.xpack.ml.update_filter.go index be9bc62b65..7fe70ec37e 100755 --- a/esapi/api.xpack.ml.update_filter.go +++ b/esapi/api.xpack.ml.update_filter.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.update_job.go b/esapi/api.xpack.ml.update_job.go index 1f1763c288..2cefa0156f 100755 --- a/esapi/api.xpack.ml.update_job.go +++ b/esapi/api.xpack.ml.update_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.update_model_snapshot.go b/esapi/api.xpack.ml.update_model_snapshot.go index cb4f669a00..4751863dc9 100755 --- a/esapi/api.xpack.ml.update_model_snapshot.go +++ b/esapi/api.xpack.ml.update_model_snapshot.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.validate.go b/esapi/api.xpack.ml.validate.go index 9b27251018..9ffa946cee 100755 --- a/esapi/api.xpack.ml.validate.go +++ b/esapi/api.xpack.ml.validate.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.validate_detector.go b/esapi/api.xpack.ml.validate_detector.go index 09b76282b3..48507d4b2d 100755 --- a/esapi/api.xpack.ml.validate_detector.go +++ b/esapi/api.xpack.ml.validate_detector.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.monitoring.bulk.go b/esapi/api.xpack.monitoring.bulk.go index e2b8c40e7c..cf8e525d35 100755 --- a/esapi/api.xpack.monitoring.bulk.go +++ b/esapi/api.xpack.monitoring.bulk.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.delete_job.go b/esapi/api.xpack.rollup.delete_job.go index b47121c9bd..3eb967be4a 100755 --- a/esapi/api.xpack.rollup.delete_job.go +++ b/esapi/api.xpack.rollup.delete_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.get_jobs.go b/esapi/api.xpack.rollup.get_jobs.go index ebced53e2f..4b1ed59f28 100755 --- a/esapi/api.xpack.rollup.get_jobs.go +++ b/esapi/api.xpack.rollup.get_jobs.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.get_rollup_caps.go b/esapi/api.xpack.rollup.get_rollup_caps.go index 73f19c5190..1c519c404e 100755 --- a/esapi/api.xpack.rollup.get_rollup_caps.go +++ b/esapi/api.xpack.rollup.get_rollup_caps.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.get_rollup_index_caps.go b/esapi/api.xpack.rollup.get_rollup_index_caps.go index c97b7dfc23..5b374e9adb 100755 --- a/esapi/api.xpack.rollup.get_rollup_index_caps.go +++ b/esapi/api.xpack.rollup.get_rollup_index_caps.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.put_job.go b/esapi/api.xpack.rollup.put_job.go index a68f5a7cef..6ee76224db 100755 --- a/esapi/api.xpack.rollup.put_job.go +++ b/esapi/api.xpack.rollup.put_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.rollup_search.go b/esapi/api.xpack.rollup.rollup_search.go index c24d746569..ceed19755c 100755 --- a/esapi/api.xpack.rollup.rollup_search.go +++ b/esapi/api.xpack.rollup.rollup_search.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.start_job.go b/esapi/api.xpack.rollup.start_job.go index 23ebde47f7..6511cfe2dc 100755 --- a/esapi/api.xpack.rollup.start_job.go +++ b/esapi/api.xpack.rollup.start_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.stop_job.go b/esapi/api.xpack.rollup.stop_job.go index 73256c4ab3..09c49f43a2 100755 --- a/esapi/api.xpack.rollup.stop_job.go +++ b/esapi/api.xpack.rollup.stop_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.authenticate.go b/esapi/api.xpack.security.authenticate.go index 4a0f1e593b..8fa2b33cf2 100755 --- a/esapi/api.xpack.security.authenticate.go +++ b/esapi/api.xpack.security.authenticate.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.change_password.go b/esapi/api.xpack.security.change_password.go index 91ebedb79e..9ffa8cf362 100755 --- a/esapi/api.xpack.security.change_password.go +++ b/esapi/api.xpack.security.change_password.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.clear_cached_realms.go b/esapi/api.xpack.security.clear_cached_realms.go index 04e945f58c..6055f2fa51 100755 --- a/esapi/api.xpack.security.clear_cached_realms.go +++ b/esapi/api.xpack.security.clear_cached_realms.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.clear_cached_roles.go b/esapi/api.xpack.security.clear_cached_roles.go index c818f2ec63..57bd0ba5bd 100755 --- a/esapi/api.xpack.security.clear_cached_roles.go +++ b/esapi/api.xpack.security.clear_cached_roles.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.create_api_key.go b/esapi/api.xpack.security.create_api_key.go index b4b7a48663..b1013216d7 100755 --- a/esapi/api.xpack.security.create_api_key.go +++ b/esapi/api.xpack.security.create_api_key.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.delete_privileges.go b/esapi/api.xpack.security.delete_privileges.go index 5e62a653ac..92f0d0dc0c 100755 --- a/esapi/api.xpack.security.delete_privileges.go +++ b/esapi/api.xpack.security.delete_privileges.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.delete_role.go b/esapi/api.xpack.security.delete_role.go index 8112c5ddd4..1e7bdba996 100755 --- a/esapi/api.xpack.security.delete_role.go +++ b/esapi/api.xpack.security.delete_role.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.delete_role_mapping.go b/esapi/api.xpack.security.delete_role_mapping.go index c9daf20cab..e48fc545bd 100755 --- a/esapi/api.xpack.security.delete_role_mapping.go +++ b/esapi/api.xpack.security.delete_role_mapping.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.delete_user.go b/esapi/api.xpack.security.delete_user.go index 9bfd9be084..e55a7ac030 100755 --- a/esapi/api.xpack.security.delete_user.go +++ b/esapi/api.xpack.security.delete_user.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.disable_user.go b/esapi/api.xpack.security.disable_user.go index 9403e7baa3..db2fb32c4f 100755 --- a/esapi/api.xpack.security.disable_user.go +++ b/esapi/api.xpack.security.disable_user.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.enable_user.go b/esapi/api.xpack.security.enable_user.go index bd03d9b187..c1a8736e69 100755 --- a/esapi/api.xpack.security.enable_user.go +++ b/esapi/api.xpack.security.enable_user.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_api_key.go b/esapi/api.xpack.security.get_api_key.go index 70e6f375b3..a51918ab28 100755 --- a/esapi/api.xpack.security.get_api_key.go +++ b/esapi/api.xpack.security.get_api_key.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_builtin_privileges.go b/esapi/api.xpack.security.get_builtin_privileges.go index 0ec002052c..e256bfba65 100755 --- a/esapi/api.xpack.security.get_builtin_privileges.go +++ b/esapi/api.xpack.security.get_builtin_privileges.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_privileges.go b/esapi/api.xpack.security.get_privileges.go index d41e9ba084..388a589c1e 100755 --- a/esapi/api.xpack.security.get_privileges.go +++ b/esapi/api.xpack.security.get_privileges.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_role.go b/esapi/api.xpack.security.get_role.go index 5a32dd2f0a..5c515e0274 100755 --- a/esapi/api.xpack.security.get_role.go +++ b/esapi/api.xpack.security.get_role.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_role_mapping.go b/esapi/api.xpack.security.get_role_mapping.go index d346621dcf..940dd64289 100755 --- a/esapi/api.xpack.security.get_role_mapping.go +++ b/esapi/api.xpack.security.get_role_mapping.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_token.go b/esapi/api.xpack.security.get_token.go index 98a1bd443b..7f57fc3ff2 100755 --- a/esapi/api.xpack.security.get_token.go +++ b/esapi/api.xpack.security.get_token.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_user.go b/esapi/api.xpack.security.get_user.go index 6af93a3035..016cffa310 100755 --- a/esapi/api.xpack.security.get_user.go +++ b/esapi/api.xpack.security.get_user.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_user_privileges.go b/esapi/api.xpack.security.get_user_privileges.go index fe6eccf695..1916fcdbe7 100755 --- a/esapi/api.xpack.security.get_user_privileges.go +++ b/esapi/api.xpack.security.get_user_privileges.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.has_privileges.go b/esapi/api.xpack.security.has_privileges.go index 158314fd0d..ab0478fcd4 100755 --- a/esapi/api.xpack.security.has_privileges.go +++ b/esapi/api.xpack.security.has_privileges.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.invalidate_api_key.go b/esapi/api.xpack.security.invalidate_api_key.go index a2a7c668b9..04ecdf01dc 100755 --- a/esapi/api.xpack.security.invalidate_api_key.go +++ b/esapi/api.xpack.security.invalidate_api_key.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.invalidate_token.go b/esapi/api.xpack.security.invalidate_token.go index 9b40c5e29d..2146660215 100755 --- a/esapi/api.xpack.security.invalidate_token.go +++ b/esapi/api.xpack.security.invalidate_token.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.put_privileges.go b/esapi/api.xpack.security.put_privileges.go index 80a08771ef..b828246992 100755 --- a/esapi/api.xpack.security.put_privileges.go +++ b/esapi/api.xpack.security.put_privileges.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.put_role.go b/esapi/api.xpack.security.put_role.go index 4987c71641..151197f761 100755 --- a/esapi/api.xpack.security.put_role.go +++ b/esapi/api.xpack.security.put_role.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.put_role_mapping.go b/esapi/api.xpack.security.put_role_mapping.go index 456dcc6377..bccf7a21d9 100755 --- a/esapi/api.xpack.security.put_role_mapping.go +++ b/esapi/api.xpack.security.put_role_mapping.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.put_user.go b/esapi/api.xpack.security.put_user.go index c073ada1ec..39f1335450 100755 --- a/esapi/api.xpack.security.put_user.go +++ b/esapi/api.xpack.security.put_user.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.sql.clear_cursor.go b/esapi/api.xpack.sql.clear_cursor.go index fdfc44ba1c..498f1c2cc2 100755 --- a/esapi/api.xpack.sql.clear_cursor.go +++ b/esapi/api.xpack.sql.clear_cursor.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.sql.query.go b/esapi/api.xpack.sql.query.go index 1e1c953331..a492763b16 100755 --- a/esapi/api.xpack.sql.query.go +++ b/esapi/api.xpack.sql.query.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.sql.translate.go b/esapi/api.xpack.sql.translate.go index f6d7af994c..ae8eb2cb7c 100755 --- a/esapi/api.xpack.sql.translate.go +++ b/esapi/api.xpack.sql.translate.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ssl.certificates.go b/esapi/api.xpack.ssl.certificates.go index 136fba3a3d..5feaf6125a 100755 --- a/esapi/api.xpack.ssl.certificates.go +++ b/esapi/api.xpack.ssl.certificates.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.ack_watch.go b/esapi/api.xpack.watcher.ack_watch.go index bd01b9c466..ce09ef0601 100755 --- a/esapi/api.xpack.watcher.ack_watch.go +++ b/esapi/api.xpack.watcher.ack_watch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.activate_watch.go b/esapi/api.xpack.watcher.activate_watch.go index d0035c6c75..2dec0051a2 100755 --- a/esapi/api.xpack.watcher.activate_watch.go +++ b/esapi/api.xpack.watcher.activate_watch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.deactivate_watch.go b/esapi/api.xpack.watcher.deactivate_watch.go index 76081d7398..c49171fa65 100755 --- a/esapi/api.xpack.watcher.deactivate_watch.go +++ b/esapi/api.xpack.watcher.deactivate_watch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.delete_watch.go b/esapi/api.xpack.watcher.delete_watch.go index c500f97285..74efbbadb7 100755 --- a/esapi/api.xpack.watcher.delete_watch.go +++ b/esapi/api.xpack.watcher.delete_watch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.execute_watch.go b/esapi/api.xpack.watcher.execute_watch.go index 7fecec92be..7a550b2e51 100755 --- a/esapi/api.xpack.watcher.execute_watch.go +++ b/esapi/api.xpack.watcher.execute_watch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.get_watch.go b/esapi/api.xpack.watcher.get_watch.go index 1f4370c565..f7341cdfab 100755 --- a/esapi/api.xpack.watcher.get_watch.go +++ b/esapi/api.xpack.watcher.get_watch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.put_watch.go b/esapi/api.xpack.watcher.put_watch.go index e7daed3e4f..38e94c57a4 100755 --- a/esapi/api.xpack.watcher.put_watch.go +++ b/esapi/api.xpack.watcher.put_watch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.start.go b/esapi/api.xpack.watcher.start.go index efd60eb5be..6b4c30230b 100755 --- a/esapi/api.xpack.watcher.start.go +++ b/esapi/api.xpack.watcher.start.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.stats.go b/esapi/api.xpack.watcher.stats.go index baa2dd46d0..290fd4eef7 100755 --- a/esapi/api.xpack.watcher.stats.go +++ b/esapi/api.xpack.watcher.stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.stop.go b/esapi/api.xpack.watcher.stop.go index 15ee3abc6d..d147541003 100755 --- a/esapi/api.xpack.watcher.stop.go +++ b/esapi/api.xpack.watcher.stop.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.xpack.info.go b/esapi/api.xpack.xpack.info.go index 0084fcd81c..42688d127a 100755 --- a/esapi/api.xpack.xpack.info.go +++ b/esapi/api.xpack.xpack.info.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.xpack.usage.go b/esapi/api.xpack.xpack.usage.go index 035e91f67e..a8af6a7414 100755 --- a/esapi/api.xpack.xpack.usage.go +++ b/esapi/api.xpack.xpack.usage.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.0: DO NOT EDIT +// Code generated from specification version 7.3.1: DO NOT EDIT package esapi From 92cf325b6bfb107aa82d896320ae96c79ff1e46d Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 1 Aug 2019 08:56:59 +0200 Subject: [PATCH 102/355] Update version to 7.3.1-SNAPSHOT --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index 7a21f9ecfd..92c4012178 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -2,4 +2,4 @@ package version // Client returns the client version as a string. // -const Client = "7.3.0" +const Client = "7.3.1-SNAPSHOT" From f7e505171871b7941e5b4182bcbb95c697feddc8 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 10 Sep 2019 09:50:00 +0200 Subject: [PATCH 103/355] Generator: Tests: Update the list of skipped tests (cherry picked from commit 5963931cb201fa3c2c7ff7b26b38850f93987060) --- internal/cmd/generate/commands/gentests/skips.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/cmd/generate/commands/gentests/skips.go b/internal/cmd/generate/commands/gentests/skips.go index 8073f00bd5..f3072cbfd5 100755 --- a/internal/cmd/generate/commands/gentests/skips.go +++ b/internal/cmd/generate/commands/gentests/skips.go @@ -95,6 +95,8 @@ bulk/81_cas_with_types.yml: # Stash in body api_key/10_basic.yml: - Test invalidate api key +rollup/put_job.yml: + - Test put job with templates # Changing password locks out tests change_password/10_basic.yml: From da9d675eb1a235346b80cc7c79e5eb28322ba2da Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 2 Oct 2019 09:13:02 +0200 Subject: [PATCH 104/355] Makefile: Update the Elasticsearch Docker image to 7.4-SNAPSHOT --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index cb5aedf9fa..f74ec9fb56 100755 --- a/Makefile +++ b/Makefile @@ -233,7 +233,7 @@ godoc: ## Display documentation for the package GOROOT=/tmp/tmpgoroot/ GOPATH=/tmp/tmpgopath/ godoc -http=localhost:6060 -play cluster: ## Launch an Elasticsearch cluster with Docker - $(eval version ?= "elasticsearch-oss:7.3-SNAPSHOT") + $(eval version ?= "elasticsearch-oss:7.4-SNAPSHOT") ifeq ($(origin nodes), undefined) $(eval nodes = 1) endif @@ -309,7 +309,7 @@ ifdef detached endif cluster-update: ## Update the Docker image - $(eval version ?= "elasticsearch-oss:7.3-SNAPSHOT") + $(eval version ?= "elasticsearch-oss:7.4-SNAPSHOT") @echo "\033[2m→ Updating the Docker image...\033[0m" @docker pull docker.elastic.co/elasticsearch/$(version); From 78e269c75b35d5064406b26b56622e4f472d8cd4 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 24 May 2019 12:13:03 +0200 Subject: [PATCH 105/355] Generator: Updates for the new REST API specification schema Related: https://github.com/elastic/elasticsearch/pull/42346 (cherry picked from commit cbca3aa54b0a05f23404f68e8e1c6eba3102b4a6) --- .../cmd/generate/commands/gensource/debug.go | 40 ++++-- .../generate/commands/gensource/generator.go | 62 ++++----- .../cmd/generate/commands/gensource/model.go | 118 +++++++++++++----- .../generate/commands/gensource/overrides.go | 6 +- .../cmd/generate/commands/gentests/skips.go | 11 ++ 5 files changed, 159 insertions(+), 78 deletions(-) diff --git a/internal/cmd/generate/commands/gensource/debug.go b/internal/cmd/generate/commands/gensource/debug.go index ef4a22ecc6..429d5eaa56 100755 --- a/internal/cmd/generate/commands/gensource/debug.go +++ b/internal/cmd/generate/commands/gensource/debug.go @@ -2,6 +2,7 @@ package gensource import ( "fmt" + "math" "strings" "text/tabwriter" @@ -16,24 +17,37 @@ func (e *Endpoint) DebugInfo() string { fmt.Fprintln(&out, strings.Repeat("─", utils.TerminalWidth())) fmt.Fprintf(&out, "API: %s (%s:%s)\n", e.MethodWithNamespace(), e.Type, e.Name) - // fmt.Fprintf(&out, "<%s>\n", e.Documentation) + fmt.Fprintf(&out, "%s\n", e.Documentation.Description[0:int(math.Min(float64(80), float64(len(e.Documentation.Description))))]) fmt.Fprintln(&out, strings.Repeat("─", utils.TerminalWidth())) - fmt.Fprintf(&out, "Methods:\n %s\n", e.Methods) - fmt.Fprintln(&out, "Paths:") for _, path := range e.URL.Paths { - fmt.Fprintf(&out, " • %s\n", path) + fmt.Fprintf(w, "%6s\t%s", path.Methods[0], path.Path) + if path.Deprecated.Version != "" { + fmt.Fprintf(w, "\t*deprecated*") + } + fmt.Fprintf(w, "\n") + } + w.Flush() + + longestPath := e.URL.Paths[0] + for _, v := range e.URL.Paths { + if len(v.Path) > len(longestPath.Path) { + longestPath = v + } } - if len(e.URL.Parts) > 0 { + if len(longestPath.Parts) > 0 { fmt.Fprintln(&out, "Parts:") - for _, part := range e.URL.Parts { + for _, part := range longestPath.Parts { fmt.Fprintf(w, " • %s\t", part.Name) fmt.Fprintf(w, " %s", part.Type) if part.Required { fmt.Fprint(w, ", required") } + if part.Default != nil { + fmt.Fprintf(w, ", default: %s", part.Default) + } fmt.Fprint(w, "\n") } w.Flush() @@ -49,20 +63,26 @@ func (e *Endpoint) DebugInfo() string { if param.Type == "enum" { fmt.Fprintf(w, ": %s", strings.Join(param.Options, ", ")) } + if param.Default != nil { + fmt.Fprintf(w, ", default: %s", param.Default) + } fmt.Fprint(w, "\n") } w.Flush() } if e.Body != nil { - fmt.Fprint(&out, "Body: ") + fmt.Fprintln(&out, "Body:") + if e.Body.Description != "" { + fmt.Fprintf(&out, " %s.", e.Body.Description) + } if e.Body.Required { - fmt.Fprintf(&out, "required") + fmt.Fprintf(&out, " *Required*") } else { - fmt.Fprintf(&out, "optional") + fmt.Fprintf(&out, " Optional") } if e.Body.ContentType != "" { - fmt.Fprintf(&out, " (format: %s)", e.Body.ContentType) + fmt.Fprintf(&out, ", format: %s", e.Body.ContentType) } fmt.Fprintf(&out, "\n") } diff --git a/internal/cmd/generate/commands/gensource/generator.go b/internal/cmd/generate/commands/gensource/generator.go index 98993aee47..cf99a192cb 100755 --- a/internal/cmd/generate/commands/gensource/generator.go +++ b/internal/cmd/generate/commands/gensource/generator.go @@ -115,10 +115,10 @@ func (g *Generator) genMethodDefinition() { g.w("\n// ----- API Definition -------------------------------------------------------\n\n") if g.Endpoint.Type == "xpack" { - g.w(`// ` + g.Endpoint.MethodWithNamespace() + " - " + g.Endpoint.Documentation) + g.w(`// ` + g.Endpoint.MethodWithNamespace() + " - " + g.Endpoint.Documentation.Description) } else { - if g.Endpoint.Description != "" { - words := strings.Split(g.Endpoint.Description, " ") + if g.Endpoint.Documentation.Description != "" { + words := strings.Split(g.Endpoint.Documentation.Description, " ") initial := strings.ToLower(words[0:1][0]) description := initial + " " + strings.Join(words[1:], " ") lines := strings.Split(description, "\n") @@ -127,12 +127,11 @@ func (g *Generator) genMethodDefinition() { for _, line := range lines[1:] { g.w("\n// " + line) } - g.w("\n") } + } - if g.Endpoint.Documentation != "" { - g.w("//\n" + `// See full documentation at ` + g.Endpoint.Documentation + ".") - } + if g.Endpoint.Documentation.URL != "" { + g.w("\n//\n" + `// See full documentation at ` + g.Endpoint.Documentation.URL + ".") } g.w(` @@ -174,13 +173,13 @@ func (g *Generator) genRequestStruct() { type ` + g.Endpoint.MethodWithNamespace() + `Request struct {`) specialFields := []string{"index", "type", "id"} for _, n := range specialFields { - if param, ok := g.Endpoint.URL.Parts[n]; ok { + if param, ok := g.Endpoint.URL.AllParts[n]; ok { g.w("\n\t" + param.GoName()) g.w("\t" + param.GoType(true)) } } - if len(g.Endpoint.URL.Parts) > 0 { + if len(g.Endpoint.URL.AllParts) > 0 { g.w("\n") } @@ -188,12 +187,12 @@ type ` + g.Endpoint.MethodWithNamespace() + `Request struct {`) g.w("\n\tBody io.Reader") } - if len(g.Endpoint.URL.Parts) > 0 || g.Endpoint.Body != nil { + if len(g.Endpoint.URL.AllParts) > 0 || g.Endpoint.Body != nil { g.w("\n") } for _, name := range g.Endpoint.URL.PartNamesSorted { - p, ok := g.Endpoint.URL.Parts[name] + p, ok := g.Endpoint.URL.AllParts[name] if !ok { panic(fmt.Sprintf("Part %q not found", name)) } @@ -212,7 +211,7 @@ type ` + g.Endpoint.MethodWithNamespace() + `Request struct {`) } - if len(g.Endpoint.URL.Parts) > 0 { + if len(g.Endpoint.URL.AllParts) > 0 { g.w("\n") } @@ -222,7 +221,7 @@ type ` + g.Endpoint.MethodWithNamespace() + `Request struct {`) panic(fmt.Sprintf("Parameter %q not found", name)) } - if _, ok := g.Endpoint.URL.Parts[name]; ok { + if _, ok := g.Endpoint.URL.AllParts[name]; ok { continue // skip params which are also parts } @@ -348,7 +347,7 @@ func (f ` + g.Endpoint.MethodWithNamespace() + `) WithBody(v io.Reader) func(*` // Generate With... methods for parts for _, pName := range g.Endpoint.URL.PartNamesSorted { - if p, ok := g.Endpoint.URL.Parts[pName]; ok { + if p, ok := g.Endpoint.URL.AllParts[pName]; ok { if skipRequiredArgs[p.Name] && p.Name != "type" { continue } @@ -361,7 +360,7 @@ func (f ` + g.Endpoint.MethodWithNamespace() + `) WithBody(v io.Reader) func(*` // Generate With... methods for params for _, pName := range g.Endpoint.URL.ParamNamesSorted { - if _, ok := g.Endpoint.URL.Parts[pName]; ok { + if _, ok := g.Endpoint.URL.AllParts[pName]; ok { continue // skip params which are also parts } if p, ok := g.Endpoint.URL.Params[pName]; ok { @@ -452,7 +451,7 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(ctx context.Context, }`) g.w("\n\n") default: - g.w("\t" + `method = "` + g.Endpoint.Methods[0] + `"` + "\n\n") + g.w("\t" + `method = "` + g.Endpoint.URL.Paths[0].Methods[0] + `"` + "\n\n") } // Get default part values for specific APIs @@ -460,7 +459,7 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(ctx context.Context, var defparts bool switch g.Endpoint.Name { case "index", "create", "delete", "explain", "exists", "get", "get_source", "update", "termvectors": - for _, p := range g.Endpoint.URL.Parts { + for _, p := range g.Endpoint.URL.AllParts { if p.Default != nil { var fieldName string var fieldValue string @@ -504,25 +503,25 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(ctx context.Context, pathGrow.WriteString(` path.Grow(`) - if len(g.Endpoint.URL.Parts) < 1 { - if g.Endpoint.URL.Path == "" { - panic(fmt.Sprintf("FAIL: %q: empty endpoint\n", g.Endpoint.Name)) + // FIXME: Select longest path based on number of template entries, not string length + longestPath := g.Endpoint.URL.Paths[0] + for _, v := range g.Endpoint.URL.Paths { + if len(v.Path) > len(longestPath.Path) { + longestPath = v } - pathGrow.WriteString(`len("` + g.Endpoint.URL.Path + `")`) - pathContent.WriteString(` path.WriteString("` + g.Endpoint.URL.Path + `")` + "\n") + } - } else { - // FIXME: Select longest path based on number of template entries, not string length - longestPath := g.Endpoint.URL.Paths[0] - for _, v := range g.Endpoint.URL.Paths { - if len(v) > len(longestPath) { - longestPath = v - } + if len(longestPath.Parts) < 1 { + if len(g.Endpoint.URL.Paths) < 1 { + panic(fmt.Sprintf("FAIL: %q: empty endpoint\n", g.Endpoint.Name)) } + pathGrow.WriteString(`len("` + longestPath.Path + `")`) + pathContent.WriteString(` path.WriteString("` + longestPath.Path + `")` + "\n") + } else { pathParts := make([]string, 0) apiArgs := g.Endpoint.RequiredArguments() - for _, v := range strings.Split(longestPath, "/") { + for _, v := range strings.Split(longestPath.Path, "/") { if v != "" { pathParts = append(pathParts, v) } @@ -555,7 +554,8 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(ctx context.Context, // Optional arguments if p == "" { - for _, a := range g.Endpoint.URL.Parts { + for _, a := range longestPath.Parts { + // fmt.Printf("a: %+v\n", a) if strings.HasPrefix(v, "{") && a.Name == r.Replace(v) { p = a.GoName() diff --git a/internal/cmd/generate/commands/gensource/model.go b/internal/cmd/generate/commands/gensource/model.go index 83f007511a..197e2a55ed 100755 --- a/internal/cmd/generate/commands/gensource/model.go +++ b/internal/cmd/generate/commands/gensource/model.go @@ -38,6 +38,7 @@ func NewEndpoint(f io.Reader) (*Endpoint, error) { for name, e := range spec { endpoint = e endpoint.Name = name + endpoint.URL.Params = endpoint.Params } if fpath, ok := f.(*os.File); ok { @@ -49,33 +50,71 @@ func NewEndpoint(f io.Reader) (*Endpoint, error) { endpoint.Type = "core" } - // Add Path when it's empty - if endpoint.URL.Path == "" { - endpoint.URL.Path = endpoint.URL.Paths[0] + endpoint.URL.AllParts = make(map[string]*Part) + + for _, path := range endpoint.URL.Paths { + for partName, part := range path.Parts { + part.Endpoint = &endpoint + part.Name = partName + part.Type = part.Type + part.Description = part.Description + } } - // Join "deprecated_paths" with paths - for _, p := range endpoint.URL.DeprecatedPaths { - endpoint.URL.Paths = append(endpoint.URL.Paths, p.Path) + var params [][]string + for _, path := range endpoint.URL.Paths { + var parts []string + for partName := range path.Parts { + parts = append(parts, partName) + } + params = append(params, parts) } - // Add Path when it's empty - if endpoint.URL.Path == "" { - endpoint.URL.Path = endpoint.URL.Paths[0] + var paramsCounter = make(map[string]int) + for _, pp := range params { + for _, p := range pp { + paramsCounter[p] += 1 + } } - for partName, p := range endpoint.URL.Parts { - p.Endpoint = &endpoint - p.Name = partName + // Update the required field of path parts + for _, path := range endpoint.URL.Paths { + for partName, part := range path.Parts { + if p, ok := paramsCounter[partName]; ok { + if p == len(params) { + part.Required = true + } + } + } } + for paramName, p := range endpoint.URL.Params { p.Endpoint = &endpoint p.Name = paramName } + // Update the AllParts field + var partSeen = make(map[string]bool) + for _, path := range endpoint.URL.Paths { + for partName, part := range path.Parts { + if !partSeen[partName] { + endpoint.URL.AllParts[partName] = part + } + partSeen[partName] = true + } + } + + // Fix up the documentation property (X-Pack spec related); TODO: PR + if !strings.HasPrefix(endpoint.Documentation.URL, "http") { + if endpoint.Type == "xpack" && endpoint.Documentation.Description == "" && endpoint.Documentation.URL != "" { + endpoint.Documentation.Description = endpoint.Documentation.URL + } + endpoint.Documentation.URL = "" + } + var partNames []string - for _, param := range endpoint.URL.Parts { - partNames = append(partNames, param.Name) + for param := range paramsCounter { + partNames = append(partNames, param) } sort.Slice(partNames, func(i, j int) bool { return strings.Replace(partNames[i], "_", "", 1) < strings.Replace(partNames[j], "_", "", 1) @@ -91,17 +130,19 @@ func NewEndpoint(f io.Reader) (*Endpoint, error) { }) endpoint.URL.ParamNamesSorted = paramNames - for _, param := range endpoint.URL.Parts { - if param.Name == "type" { - param.Default = "_doc" + for _, path := range endpoint.URL.Paths { + for _, part := range path.Parts { + if part.Name == "type" { + part.Default = "_doc" + } } } - if info, ok := apiDescriptions[endpoint.Name]; ok { - if desc, ok := info.(map[interface{}]interface{})["description"].(string); ok { - endpoint.Description = desc - } - } + // if info, ok := apiDescriptions[endpoint.Name]; ok { + // if desc, ok := info.(map[interface{}]interface{})["description"].(string); ok { + // endpoint.Documentation.Description = desc + // } + // } return &endpoint, nil } @@ -112,11 +153,14 @@ type Endpoint struct { Name string `json:"-"` Type string `json:"-"` - Description string `json:"-"` - Documentation string `json:"documentation"` - Methods []string `json:"methods"` - URL *URL `json:"url"` - Body *Body `json:"body"` + Documentation struct { + URL string `json:"url"` + Description string `json:"description"` + } `json:"documentation"` + + URL *URL `json:"url"` + Params map[string]*Param `json:"params"` + Body *Body `json:"body"` } // URL represents API endpoint URL. @@ -124,20 +168,30 @@ type Endpoint struct { type URL struct { Endpoint *Endpoint `json:"-"` - Path string `json:"path"` - Paths []string `json:"paths"` + Paths []Path `json:"paths"` DeprecatedPaths []struct { Path string `json:"path"` Version string `json:"version"` Description string `json:"description"` } `json:"deprecated_paths"` - Parts map[string]*Part `json:"parts"` Params map[string]*Param `json:"params"` + AllParts map[string]*Part PartNamesSorted []string ParamNamesSorted []string } +// Path represents URL path +type Path struct { + Path string `json:"path"` + Methods []string `json:"methods"` + Parts map[string]*Part `json:"parts"` + Deprecated struct { + Version string `json:"version"` + Description string `json:"description"` + } +} + // Part represents part of the API endpoint URL. // type Part struct { @@ -267,7 +321,7 @@ func (e *Endpoint) RequiredArguments() []MethodArgument { // Return the prominent arguments first for _, d := range prominentArgs { - for _, p := range e.URL.Parts { + for _, p := range e.URL.Paths[0].Parts { if p.Name != d { continue } @@ -303,7 +357,7 @@ func (e *Endpoint) RequiredArguments() []MethodArgument { } // Return rest of the URL parts - for _, p := range e.URL.Parts { + for _, p := range e.URL.Paths[0].Parts { if contains(p.Name) { continue } diff --git a/internal/cmd/generate/commands/gensource/overrides.go b/internal/cmd/generate/commands/gensource/overrides.go index d3bce29930..b9759f281d 100755 --- a/internal/cmd/generate/commands/gensource/overrides.go +++ b/internal/cmd/generate/commands/gensource/overrides.go @@ -81,17 +81,13 @@ func init() { Matching: []string{"indices.put_mapping"}, Func: func(*Endpoint, ...interface{}) string { return ` - path.Grow(len(strings.Join(r.Index, ",")) + len("/_mapping") + len(r.DocumentType) + 2) + path.Grow(len(strings.Join(r.Index, ",")) + len("/_mapping") + 1) if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) } path.WriteString("/") path.WriteString("_mapping") - if r.DocumentType != "" { - path.WriteString("/") - path.WriteString(r.DocumentType) - } ` }, }, diff --git a/internal/cmd/generate/commands/gentests/skips.go b/internal/cmd/generate/commands/gentests/skips.go index f3072cbfd5..bec0021fe9 100755 --- a/internal/cmd/generate/commands/gentests/skips.go +++ b/internal/cmd/generate/commands/gentests/skips.go @@ -82,6 +82,17 @@ search.aggregation/40_range.yml: tasks.list/10_basic.yml: - tasks_list headers +# Node Selector feature not implemented +cat.aliases/10_basic.yml: + - "Help (pre 7.4.0)" + - "Simple alias (pre 7.4.0)" + - "Complex alias (pre 7.4.0)" + - "Column headers (pre 7.4.0)" + - "Alias against closed index (pre 7.4.0)" + +indices.put_mapping/10_basic.yml: + - "Put mappings with explicit _doc type bwc" + # Not relevant search/issue4895.yml: search/issue9606.yml: From 4e09853ef5aedd99892beedccfc231467bbd5082 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 1 Oct 2019 18:33:10 +0200 Subject: [PATCH 106/355] Generator: Tests: Fix incorrect setup for X-Pack (cherry picked from commit 1e2c096a8e926af9fa4fbee66dba8a6bbe6ed948) --- internal/cmd/generate/commands/gentests/generator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cmd/generate/commands/gentests/generator.go b/internal/cmd/generate/commands/gentests/generator.go index 691001d22e..e145de4540 100755 --- a/internal/cmd/generate/commands/gentests/generator.go +++ b/internal/cmd/generate/commands/gentests/generator.go @@ -542,7 +542,7 @@ func (g *Generator) genXPackSetup() { } { - res, _ = es.ILM.RemovePolicy(es.ILM.RemovePolicy.WithIndex("_all")) + res, _ = es.ILM.RemovePolicy("_all") if res != nil && res.Body != nil { defer res.Body.Close() } From 7afc0714139ff5e440b84c7bd1d1b15bec15f810 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 1 Oct 2019 18:33:45 +0200 Subject: [PATCH 107/355] Generator: Tests: Prevent generating test body for skipped tests (cherry picked from commit 9fa8a3b712f3f7901dd094d86d8a5ad13f654e6e) --- .../generate/commands/gentests/generator.go | 54 ++++++++++--------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/internal/cmd/generate/commands/gentests/generator.go b/internal/cmd/generate/commands/gentests/generator.go index e145de4540..26e9c9425b 100755 --- a/internal/cmd/generate/commands/gentests/generator.go +++ b/internal/cmd/generate/commands/gentests/generator.go @@ -68,30 +68,31 @@ func (g *Generator) Output() (io.Reader, error) { g.w("\n") g.genLocationYAML(t) g.w("\t" + `t.Run("` + strings.Title(t.Name) + `", ` + "func(t *testing.T) {\n") - g.genSkip(t) - g.w("\tdefer recoverPanic(t)\n") - g.w("\tcommonSetup()\n") - if g.TestSuite.Type == "xpack" { - g.w("\txpackSetup()\n") - } - if len(g.TestSuite.Setup) > 0 { - g.w("\ttestSuiteSetup()\n") - } - g.w("\n") - if len(t.Setup) > 0 { - g.w("\t// Test setup\n") - g.genSetupTeardown(t.Setup) - } - if len(t.Teardown) > 0 { - g.w("\t// Test teardown\n") - g.w("\tdefer func(t) {\n") - g.genSetupTeardown(t.Teardown) - g.w("\t}(t *testing.T)\n") - } - if len(t.Setup) > 0 || len(t.Teardown) > 0 { + if !g.genSkip(t) { + g.w("\tdefer recoverPanic(t)\n") + g.w("\tcommonSetup()\n") + if g.TestSuite.Type == "xpack" { + g.w("\txpackSetup()\n") + } + if len(g.TestSuite.Setup) > 0 { + g.w("\ttestSuiteSetup()\n") + } g.w("\n") + if len(t.Setup) > 0 { + g.w("\t// Test setup\n") + g.genSetupTeardown(t.Setup) + } + if len(t.Teardown) > 0 { + g.w("\t// Test teardown\n") + g.w("\tdefer func(t) {\n") + g.genSetupTeardown(t.Teardown) + g.w("\t}(t *testing.T)\n") + } + if len(t.Setup) > 0 || len(t.Teardown) > 0 { + g.w("\n") + } + g.genSteps(t) } - g.genSteps(t) g.w("\t})\n") if i < len(g.TestSuite.Tests)-1 { g.w("\n") @@ -626,18 +627,19 @@ func (g *Generator) genLocationYAML(t Test) { } } -func (g *Generator) genSkip(t Test) { +func (g *Generator) genSkip(t Test) (skipped bool) { // Check the custom skip list if skips, ok := skipTests[t.BaseFilename()]; ok { if len(skips) < 1 { g.w("\t// Skipping all tests in '" + t.BaseFilename() + "'\n") g.w("\tt.SkipNow()\n\n") - return + return true } for _, skip := range skips { if skip == t.OrigName { g.w("\tt.SkipNow()\n\n") + return true } } } @@ -646,10 +648,14 @@ func (g *Generator) genSkip(t Test) { if t.Skip { if t.SkipInfo != "" { g.w("\tt.Skip(" + strconv.Quote(t.SkipInfo) + ")\n\n") + return true } else { g.w("\tt.SkipNow()\n\n") + return true } } + + return false } func (g *Generator) genSetupTeardown(actions []Action) { From b4a0be556b8315fd306ee35d5cea92fd44606f87 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 1 Oct 2019 18:52:12 +0200 Subject: [PATCH 108/355] Generator: Tests: Fix errors due to unused functions (cherry picked from commit 064adf8b9891a02882bbac309d859954e8c7e4fe) --- internal/cmd/generate/commands/gentests/generator.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/cmd/generate/commands/gentests/generator.go b/internal/cmd/generate/commands/gentests/generator.go index 26e9c9425b..2ab6ac4657 100755 --- a/internal/cmd/generate/commands/gentests/generator.go +++ b/internal/cmd/generate/commands/gentests/generator.go @@ -55,6 +55,7 @@ func (g *Generator) Output() (io.Reader, error) { g.w("testSuiteSetup := func() {\n") g.genSetupTeardown(g.TestSuite.Setup) g.w("}\n") + g.w("_ = testSuiteSetup\n") g.w("// --------------------------------------------------------------------------------\n") g.w("\n") } @@ -258,6 +259,7 @@ func (g *Generator) genHelpers() { t.Fatalf("Panic: %s in %s", rec, reLocation.ReplaceAllString(loc, "$1")) } } +_ = recoverPanic ` + "\n") g.w(` @@ -359,6 +361,7 @@ func (g *Generator) genCommonSetup() { } } } + _ = commonSetup `) } @@ -597,6 +600,7 @@ func (g *Generator) genXPackSetup() { } } } + _ = xpackSetup `) } From fb80d7d25fcd6d49005d67298c29e3b8aea30fef Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 2 Oct 2019 06:59:18 +0200 Subject: [PATCH 109/355] Generator: Tests: Update the list of skipped tests (cherry picked from commit 00c31cbe3a27b30d385af3d3308fa3c6a1dfea57) --- internal/cmd/generate/commands/gentests/skips.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/cmd/generate/commands/gentests/skips.go b/internal/cmd/generate/commands/gentests/skips.go index bec0021fe9..42a3bc4f32 100755 --- a/internal/cmd/generate/commands/gentests/skips.go +++ b/internal/cmd/generate/commands/gentests/skips.go @@ -152,6 +152,10 @@ monitoring/bulk/20_privileges.yml: # Test tries to match on whole body, but map keys are unstable in Go rollup/security_tests.yml: +# Test tries to match on map key, but map keys are unstable in Go +ml/data_frame_analytics_crud.yml: + - "Test put with description" + # TEMPORARY: Missing 'body: { indices: "test_index" }' payload, TODO: PR snapshot/10_basic.yml: - Create a source only snapshot and then restore it From ad181cc61d8b29e39bb555414304fa997f5d4f1c Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 2 Oct 2019 07:54:36 +0200 Subject: [PATCH 110/355] Generator: API: Fix unit tests (cherry picked from commit 57da5b86843e94d143406b97e42c878624c7e86e) --- .../commands/gensource/testdata/info.json | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/internal/cmd/generate/commands/gensource/testdata/info.json b/internal/cmd/generate/commands/gensource/testdata/info.json index 63754eb7f7..13fe1f2802 100755 --- a/internal/cmd/generate/commands/gensource/testdata/info.json +++ b/internal/cmd/generate/commands/gensource/testdata/info.json @@ -1,15 +1,18 @@ { "info": { - "documentation": "http://www.elastic.co/guide/", - "methods": ["GET"], + "stability": "stable", + "documentation": { + "url": "http://www.elastic.co/guide/", + "description": "Returns basic information about the cluster." + }, "url": { - "path": "/", - "paths": ["/"], - "parts": { - }, - "params": { - } + "paths": [ + { + "path": "/", + "methods": ["GET"] + } + ] }, - "body": null + "params": {} } -} +} \ No newline at end of file From 728956b98e048c5888a01b62edc503a49e6aa96d Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 2 Oct 2019 08:19:37 +0200 Subject: [PATCH 111/355] Generator: API: Remove extra code to make lint happy (cherry picked from commit fd0137cc35a75fb6ffe2d34969cb55431134abce) --- internal/cmd/generate/commands/gensource/model.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/cmd/generate/commands/gensource/model.go b/internal/cmd/generate/commands/gensource/model.go index 197e2a55ed..b9eaf559bc 100755 --- a/internal/cmd/generate/commands/gensource/model.go +++ b/internal/cmd/generate/commands/gensource/model.go @@ -56,8 +56,6 @@ func NewEndpoint(f io.Reader) (*Endpoint, error) { for partName, part := range path.Parts { part.Endpoint = &endpoint part.Name = partName - part.Type = part.Type - part.Description = part.Description } } From cee072c91acb6e80dca88ce8db1cec5ebcc5c0b3 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 2 Oct 2019 08:35:38 +0200 Subject: [PATCH 112/355] CI: Remove Windows from allowed failures on Travis (cherry picked from commit b491ce54d752a941350fa4b77fba5f20f59960e8) --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 20f6694fdc..b0fc3bbe68 100755 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,6 @@ install: true matrix: fast_finish: true - allow_failures: - - os: windows include: - name: Unit Tests | Linux, go:stable, gomod=on os: linux From 7dd970d40c11efc158cde02defdadd71fca226fb Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 2 Oct 2019 09:48:33 +0200 Subject: [PATCH 113/355] API: Update the APIs for Elasticsearch 7.4 (e2c4e8cacb9) --- esapi/api._.go | 54 ++-- esapi/api.bulk.go | 4 +- esapi/api.cat.aliases.go | 4 +- esapi/api.cat.allocation.go | 4 +- esapi/api.cat.count.go | 4 +- esapi/api.cat.fielddata.go | 4 +- esapi/api.cat.health.go | 4 +- esapi/api.cat.help.go | 4 +- esapi/api.cat.indices.go | 4 +- esapi/api.cat.master.go | 4 +- esapi/api.cat.nodeattrs.go | 4 +- esapi/api.cat.nodes.go | 4 +- esapi/api.cat.pending_tasks.go | 4 +- esapi/api.cat.plugins.go | 4 +- esapi/api.cat.recovery.go | 36 ++- esapi/api.cat.repositories.go | 4 +- esapi/api.cat.segments.go | 4 +- esapi/api.cat.shards.go | 4 +- esapi/api.cat.snapshots.go | 4 +- esapi/api.cat.tasks.go | 4 +- esapi/api.cat.templates.go | 4 +- esapi/api.cat.thread_pool.go | 4 +- esapi/api.clear_scroll.go | 4 +- esapi/api.cluster.allocation_explain.go | 4 +- esapi/api.cluster.get_settings.go | 4 +- esapi/api.cluster.health.go | 4 +- esapi/api.cluster.pending_tasks.go | 4 +- esapi/api.cluster.put_settings.go | 4 +- esapi/api.cluster.remote_info.go | 4 +- esapi/api.cluster.reroute.go | 4 +- esapi/api.cluster.state.go | 4 +- esapi/api.cluster.stats.go | 4 +- esapi/api.count.go | 4 +- esapi/api.create.go | 10 +- esapi/api.delete.go | 4 +- esapi/api.delete_by_query.go | 15 +- esapi/api.delete_by_query_rethrottle.go | 2 +- esapi/api.delete_script.go | 4 +- esapi/api.exists.go | 4 +- esapi/api.exists_source.go | 4 +- esapi/api.explain.go | 4 +- esapi/api.field_caps.go | 4 +- esapi/api.get.go | 4 +- esapi/api.get_script.go | 4 +- esapi/api.get_source.go | 4 +- esapi/api.index.go | 10 +- esapi/api.indices.analyze.go | 4 +- esapi/api.indices.clear_cache.go | 4 +- esapi/api.indices.clone.go | 230 ++++++++++++++++++ esapi/api.indices.close.go | 4 +- esapi/api.indices.create.go | 4 +- esapi/api.indices.delete.go | 4 +- esapi/api.indices.delete_alias.go | 4 +- esapi/api.indices.delete_template.go | 4 +- esapi/api.indices.exists.go | 4 +- esapi/api.indices.exists_alias.go | 4 +- esapi/api.indices.exists_template.go | 4 +- esapi/api.indices.exists_type.go | 4 +- esapi/api.indices.flush.go | 4 +- esapi/api.indices.flush_synced.go | 4 +- esapi/api.indices.forcemerge.go | 4 +- esapi/api.indices.get.go | 4 +- esapi/api.indices.get_alias.go | 4 +- esapi/api.indices.get_field_mapping.go | 4 +- esapi/api.indices.get_mapping.go | 4 +- esapi/api.indices.get_settings.go | 4 +- esapi/api.indices.get_template.go | 4 +- esapi/api.indices.get_upgrade.go | 4 +- esapi/api.indices.open.go | 4 +- esapi/api.indices.put_alias.go | 4 +- esapi/api.indices.put_mapping.go | 10 +- esapi/api.indices.put_settings.go | 4 +- esapi/api.indices.put_template.go | 4 +- esapi/api.indices.recovery.go | 4 +- esapi/api.indices.refresh.go | 4 +- esapi/api.indices.rollover.go | 4 +- esapi/api.indices.segments.go | 4 +- esapi/api.indices.shard_stores.go | 4 +- esapi/api.indices.shrink.go | 4 +- esapi/api.indices.split.go | 4 +- esapi/api.indices.stats.go | 4 +- esapi/api.indices.update_aliases.go | 4 +- esapi/api.indices.upgrade.go | 4 +- esapi/api.indices.validate_query.go | 4 +- esapi/api.info.go | 4 +- esapi/api.ingest.delete_pipeline.go | 2 +- esapi/api.ingest.get_pipeline.go | 2 +- esapi/api.ingest.processor_grok.go | 2 +- esapi/api.ingest.put_pipeline.go | 2 +- esapi/api.ingest.simulate.go | 2 +- esapi/api.mget.go | 4 +- esapi/api.msearch.go | 4 +- esapi/api.msearch_template.go | 17 +- esapi/api.mtermvectors.go | 4 +- esapi/api.nodes.hot_threads.go | 4 +- esapi/api.nodes.info.go | 4 +- esapi/api.nodes.reload_secure_settings.go | 2 +- esapi/api.nodes.stats.go | 4 +- esapi/api.nodes.usage.go | 4 +- esapi/api.ping.go | 4 +- esapi/api.put_script.go | 4 +- esapi/api.rank_eval.go | 2 +- esapi/api.reindex.go | 2 +- esapi/api.reindex_rethrottle.go | 2 +- esapi/api.render_search_template.go | 4 +- esapi/api.scripts_painless_execute.go | 2 +- esapi/api.scroll.go | 4 +- esapi/api.search.go | 4 +- esapi/api.search_shards.go | 4 +- esapi/api.search_template.go | 41 ++-- esapi/api.snapshot.cleanup_repository.go | 215 ++++++++++++++++ esapi/api.snapshot.create.go | 4 +- esapi/api.snapshot.create_repository.go | 4 +- esapi/api.snapshot.delete.go | 4 +- esapi/api.snapshot.delete_repository.go | 4 +- esapi/api.snapshot.get.go | 4 +- esapi/api.snapshot.get_repository.go | 4 +- esapi/api.snapshot.restore.go | 4 +- esapi/api.snapshot.status.go | 4 +- esapi/api.snapshot.verify_repository.go | 4 +- esapi/api.tasks.cancel.go | 4 +- esapi/api.tasks.get.go | 4 +- esapi/api.tasks.list.go | 4 +- esapi/api.termvectors.go | 4 +- esapi/api.update.go | 4 +- esapi/api.update_by_query.go | 2 +- esapi/api.update_by_query_rethrottle.go | 2 +- ...pi.xpack.ccr.delete_auto_follow_pattern.go | 6 +- esapi/api.xpack.ccr.follow.go | 6 +- esapi/api.xpack.ccr.follow_info.go | 26 +- esapi/api.xpack.ccr.follow_stats.go | 6 +- esapi/api.xpack.ccr.forget_follower.go | 6 +- .../api.xpack.ccr.get_auto_follow_pattern.go | 6 +- esapi/api.xpack.ccr.pause_follow.go | 6 +- .../api.xpack.ccr.put_auto_follow_pattern.go | 6 +- esapi/api.xpack.ccr.resume_follow.go | 6 +- esapi/api.xpack.ccr.stats.go | 6 +- esapi/api.xpack.ccr.unfollow.go | 6 +- ....data_frame.delete_data_frame_transform.go | 21 +- ...ack.data_frame.get_data_frame_transform.go | 6 +- ...ta_frame.get_data_frame_transform_stats.go | 26 +- ...data_frame.preview_data_frame_transform.go | 6 +- ...ack.data_frame.put_data_frame_transform.go | 21 +- ...k.data_frame.start_data_frame_transform.go | 6 +- ...ck.data_frame.stop_data_frame_transform.go | 6 +- ....data_frame.update_data_frame_transform.go | 196 +++++++++++++++ esapi/api.xpack.graph.explore.go | 26 +- esapi/api.xpack.ilm.delete_lifecycle.go | 26 +- esapi/api.xpack.ilm.explain_lifecycle.go | 44 +++- esapi/api.xpack.ilm.get_lifecycle.go | 6 +- esapi/api.xpack.ilm.get_status.go | 6 +- esapi/api.xpack.ilm.move_to_step.go | 26 +- esapi/api.xpack.ilm.put_lifecycle.go | 26 +- esapi/api.xpack.ilm.remove_policy.go | 26 +- esapi/api.xpack.ilm.retry.go | 26 +- esapi/api.xpack.ilm.start.go | 6 +- esapi/api.xpack.ilm.stop.go | 6 +- esapi/api.xpack.indices.freeze.go | 6 +- ...i.xpack.indices.reload_search_analyzers.go | 26 +- esapi/api.xpack.indices.unfreeze.go | 6 +- esapi/api.xpack.license.delete.go | 6 +- esapi/api.xpack.license.get.go | 6 +- esapi/api.xpack.license.get_basic_status.go | 6 +- esapi/api.xpack.license.get_trial_status.go | 6 +- esapi/api.xpack.license.post.go | 6 +- esapi/api.xpack.license.post_start_basic.go | 6 +- esapi/api.xpack.license.post_start_trial.go | 6 +- esapi/api.xpack.migration.deprecations.go | 6 +- esapi/api.xpack.ml.close_job.go | 6 +- esapi/api.xpack.ml.delete_calendar.go | 2 +- esapi/api.xpack.ml.delete_calendar_event.go | 2 +- esapi/api.xpack.ml.delete_calendar_job.go | 2 +- ...pi.xpack.ml.delete_data_frame_analytics.go | 6 +- esapi/api.xpack.ml.delete_datafeed.go | 6 +- esapi/api.xpack.ml.delete_expired_data.go | 2 +- esapi/api.xpack.ml.delete_filter.go | 2 +- esapi/api.xpack.ml.delete_forecast.go | 6 +- esapi/api.xpack.ml.delete_job.go | 6 +- esapi/api.xpack.ml.delete_model_snapshot.go | 6 +- esapi/api.xpack.ml.estimate_memory_usage.go | 172 +++++++++++++ esapi/api.xpack.ml.evaluate_data_frame.go | 6 +- esapi/api.xpack.ml.find_file_structure.go | 6 +- esapi/api.xpack.ml.flush_job.go | 6 +- esapi/api.xpack.ml.forecast.go | 2 +- esapi/api.xpack.ml.get_buckets.go | 6 +- esapi/api.xpack.ml.get_calendar_events.go | 2 +- esapi/api.xpack.ml.get_calendars.go | 2 +- esapi/api.xpack.ml.get_categories.go | 6 +- .../api.xpack.ml.get_data_frame_analytics.go | 6 +- ...xpack.ml.get_data_frame_analytics_stats.go | 6 +- esapi/api.xpack.ml.get_datafeed_stats.go | 6 +- esapi/api.xpack.ml.get_datafeeds.go | 6 +- esapi/api.xpack.ml.get_filters.go | 2 +- esapi/api.xpack.ml.get_influencers.go | 6 +- esapi/api.xpack.ml.get_job_stats.go | 6 +- esapi/api.xpack.ml.get_jobs.go | 6 +- esapi/api.xpack.ml.get_model_snapshots.go | 6 +- esapi/api.xpack.ml.get_overall_buckets.go | 6 +- esapi/api.xpack.ml.get_records.go | 6 +- esapi/api.xpack.ml.info.go | 2 +- esapi/api.xpack.ml.open_job.go | 27 +- esapi/api.xpack.ml.post_calendar_events.go | 2 +- esapi/api.xpack.ml.post_data.go | 6 +- esapi/api.xpack.ml.preview_datafeed.go | 6 +- esapi/api.xpack.ml.put_calendar.go | 2 +- esapi/api.xpack.ml.put_calendar_job.go | 2 +- .../api.xpack.ml.put_data_frame_analytics.go | 6 +- esapi/api.xpack.ml.put_datafeed.go | 6 +- esapi/api.xpack.ml.put_filter.go | 2 +- esapi/api.xpack.ml.put_job.go | 6 +- esapi/api.xpack.ml.revert_model_snapshot.go | 6 +- esapi/api.xpack.ml.set_upgrade_mode.go | 6 +- ...api.xpack.ml.start_data_frame_analytics.go | 6 +- esapi/api.xpack.ml.start_datafeed.go | 6 +- .../api.xpack.ml.stop_data_frame_analytics.go | 6 +- esapi/api.xpack.ml.stop_datafeed.go | 6 +- esapi/api.xpack.ml.update_datafeed.go | 6 +- esapi/api.xpack.ml.update_filter.go | 2 +- esapi/api.xpack.ml.update_job.go | 6 +- esapi/api.xpack.ml.update_model_snapshot.go | 6 +- esapi/api.xpack.ml.validate.go | 2 +- esapi/api.xpack.ml.validate_detector.go | 2 +- esapi/api.xpack.monitoring.bulk.go | 6 +- esapi/api.xpack.rollup.delete_job.go | 2 +- esapi/api.xpack.rollup.get_jobs.go | 2 +- esapi/api.xpack.rollup.get_rollup_caps.go | 2 +- .../api.xpack.rollup.get_rollup_index_caps.go | 2 +- esapi/api.xpack.rollup.put_job.go | 2 +- esapi/api.xpack.rollup.rollup_search.go | 2 +- esapi/api.xpack.rollup.start_job.go | 2 +- esapi/api.xpack.rollup.stop_job.go | 2 +- esapi/api.xpack.security.authenticate.go | 6 +- esapi/api.xpack.security.change_password.go | 6 +- .../api.xpack.security.clear_cached_realms.go | 6 +- .../api.xpack.security.clear_cached_roles.go | 6 +- esapi/api.xpack.security.create_api_key.go | 6 +- esapi/api.xpack.security.delete_privileges.go | 2 +- esapi/api.xpack.security.delete_role.go | 6 +- .../api.xpack.security.delete_role_mapping.go | 6 +- esapi/api.xpack.security.delete_user.go | 6 +- esapi/api.xpack.security.disable_user.go | 6 +- esapi/api.xpack.security.enable_user.go | 6 +- esapi/api.xpack.security.get_api_key.go | 6 +- ...i.xpack.security.get_builtin_privileges.go | 6 +- esapi/api.xpack.security.get_privileges.go | 6 +- esapi/api.xpack.security.get_role.go | 6 +- esapi/api.xpack.security.get_role_mapping.go | 6 +- esapi/api.xpack.security.get_token.go | 6 +- esapi/api.xpack.security.get_user.go | 6 +- .../api.xpack.security.get_user_privileges.go | 6 +- esapi/api.xpack.security.has_privileges.go | 6 +- .../api.xpack.security.invalidate_api_key.go | 6 +- esapi/api.xpack.security.invalidate_token.go | 6 +- esapi/api.xpack.security.put_privileges.go | 2 +- esapi/api.xpack.security.put_role.go | 6 +- esapi/api.xpack.security.put_role_mapping.go | 6 +- esapi/api.xpack.security.put_user.go | 6 +- esapi/api.xpack.slm.delete_lifecycle.go | 172 +++++++++++++ esapi/api.xpack.slm.execute_lifecycle.go | 174 +++++++++++++ esapi/api.xpack.slm.get_lifecycle.go | 182 ++++++++++++++ esapi/api.xpack.slm.put_lifecycle.go | 187 ++++++++++++++ esapi/api.xpack.sql.clear_cursor.go | 2 +- esapi/api.xpack.sql.query.go | 2 +- esapi/api.xpack.sql.translate.go | 2 +- esapi/api.xpack.ssl.certificates.go | 6 +- esapi/api.xpack.watcher.ack_watch.go | 6 +- esapi/api.xpack.watcher.activate_watch.go | 6 +- esapi/api.xpack.watcher.deactivate_watch.go | 6 +- esapi/api.xpack.watcher.delete_watch.go | 6 +- esapi/api.xpack.watcher.execute_watch.go | 6 +- esapi/api.xpack.watcher.get_watch.go | 6 +- esapi/api.xpack.watcher.put_watch.go | 6 +- esapi/api.xpack.watcher.start.go | 6 +- esapi/api.xpack.watcher.stats.go | 6 +- esapi/api.xpack.watcher.stop.go | 6 +- esapi/api.xpack.xpack.info.go | 6 +- esapi/api.xpack.xpack.usage.go | 2 +- 277 files changed, 2436 insertions(+), 736 deletions(-) create mode 100755 esapi/api.indices.clone.go create mode 100755 esapi/api.snapshot.cleanup_repository.go create mode 100755 esapi/api.xpack.data_frame.update_data_frame_transform.go create mode 100755 esapi/api.xpack.ml.estimate_memory_usage.go create mode 100755 esapi/api.xpack.slm.delete_lifecycle.go create mode 100755 esapi/api.xpack.slm.execute_lifecycle.go create mode 100755 esapi/api.xpack.slm.get_lifecycle.go create mode 100755 esapi/api.xpack.slm.put_lifecycle.go diff --git a/esapi/api._.go b/esapi/api._.go index d5178e9c15..329200c503 100644 --- a/esapi/api._.go +++ b/esapi/api._.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1 (a92f36162e5): DO NOT EDIT +// Code generated from specification version 7.4.0 (e2c4e8cacb9): DO NOT EDIT package esapi @@ -37,6 +37,7 @@ type API struct { DataFramePutDataFrameTransform DataFramePutDataFrameTransform DataFrameStartDataFrameTransform DataFrameStartDataFrameTransform DataFrameStopDataFrameTransform DataFrameStopDataFrameTransform + DataFrameUpdateDataFrameTransform DataFrameUpdateDataFrameTransform DeleteByQuery DeleteByQuery DeleteByQueryRethrottle DeleteByQueryRethrottle Delete Delete @@ -66,6 +67,10 @@ type API struct { Search Search SearchShards SearchShards SearchTemplate SearchTemplate + SlmDeleteLifecycle SlmDeleteLifecycle + SlmExecuteLifecycle SlmExecuteLifecycle + SlmGetLifecycle SlmGetLifecycle + SlmPutLifecycle SlmPutLifecycle Termvectors Termvectors UpdateByQuery UpdateByQuery UpdateByQueryRethrottle UpdateByQueryRethrottle @@ -113,6 +118,7 @@ type Cluster struct { type Indices struct { Analyze IndicesAnalyze ClearCache IndicesClearCache + Clone IndicesClone Close IndicesClose Create IndicesCreate DeleteAlias IndicesDeleteAlias @@ -177,15 +183,16 @@ type Remote struct { // Snapshot contains the Snapshot APIs type Snapshot struct { - CreateRepository SnapshotCreateRepository - Create SnapshotCreate - DeleteRepository SnapshotDeleteRepository - Delete SnapshotDelete - GetRepository SnapshotGetRepository - Get SnapshotGet - Restore SnapshotRestore - Status SnapshotStatus - VerifyRepository SnapshotVerifyRepository + CleanupRepository SnapshotCleanupRepository + CreateRepository SnapshotCreateRepository + Create SnapshotCreate + DeleteRepository SnapshotDeleteRepository + Delete SnapshotDelete + GetRepository SnapshotGetRepository + Get SnapshotGet + Restore SnapshotRestore + Status SnapshotStatus + VerifyRepository SnapshotVerifyRepository } // Tasks contains the Tasks APIs @@ -253,6 +260,7 @@ type ML struct { DeleteForecast MLDeleteForecast DeleteJob MLDeleteJob DeleteModelSnapshot MLDeleteModelSnapshot + EstimateMemoryUsage MLEstimateMemoryUsage EvaluateDataFrame MLEvaluateDataFrame FindFileStructure MLFindFileStructure FlushJob MLFlushJob @@ -391,6 +399,7 @@ func New(t Transport) *API { DataFramePutDataFrameTransform: newDataFramePutDataFrameTransformFunc(t), DataFrameStartDataFrameTransform: newDataFrameStartDataFrameTransformFunc(t), DataFrameStopDataFrameTransform: newDataFrameStopDataFrameTransformFunc(t), + DataFrameUpdateDataFrameTransform: newDataFrameUpdateDataFrameTransformFunc(t), DeleteByQuery: newDeleteByQueryFunc(t), DeleteByQueryRethrottle: newDeleteByQueryRethrottleFunc(t), Delete: newDeleteFunc(t), @@ -420,6 +429,10 @@ func New(t Transport) *API { Search: newSearchFunc(t), SearchShards: newSearchShardsFunc(t), SearchTemplate: newSearchTemplateFunc(t), + SlmDeleteLifecycle: newSlmDeleteLifecycleFunc(t), + SlmExecuteLifecycle: newSlmExecuteLifecycleFunc(t), + SlmGetLifecycle: newSlmGetLifecycleFunc(t), + SlmPutLifecycle: newSlmPutLifecycleFunc(t), Termvectors: newTermvectorsFunc(t), UpdateByQuery: newUpdateByQueryFunc(t), UpdateByQueryRethrottle: newUpdateByQueryRethrottleFunc(t), @@ -460,6 +473,7 @@ func New(t Transport) *API { Indices: &Indices{ Analyze: newIndicesAnalyzeFunc(t), ClearCache: newIndicesClearCacheFunc(t), + Clone: newIndicesCloneFunc(t), Close: newIndicesCloseFunc(t), Create: newIndicesCreateFunc(t), DeleteAlias: newIndicesDeleteAliasFunc(t), @@ -515,15 +529,16 @@ func New(t Transport) *API { }, Remote: &Remote{}, Snapshot: &Snapshot{ - CreateRepository: newSnapshotCreateRepositoryFunc(t), - Create: newSnapshotCreateFunc(t), - DeleteRepository: newSnapshotDeleteRepositoryFunc(t), - Delete: newSnapshotDeleteFunc(t), - GetRepository: newSnapshotGetRepositoryFunc(t), - Get: newSnapshotGetFunc(t), - Restore: newSnapshotRestoreFunc(t), - Status: newSnapshotStatusFunc(t), - VerifyRepository: newSnapshotVerifyRepositoryFunc(t), + CleanupRepository: newSnapshotCleanupRepositoryFunc(t), + CreateRepository: newSnapshotCreateRepositoryFunc(t), + Create: newSnapshotCreateFunc(t), + DeleteRepository: newSnapshotDeleteRepositoryFunc(t), + Delete: newSnapshotDeleteFunc(t), + GetRepository: newSnapshotGetRepositoryFunc(t), + Get: newSnapshotGetFunc(t), + Restore: newSnapshotRestoreFunc(t), + Status: newSnapshotStatusFunc(t), + VerifyRepository: newSnapshotVerifyRepositoryFunc(t), }, Tasks: &Tasks{ Cancel: newTasksCancelFunc(t), @@ -579,6 +594,7 @@ func New(t Transport) *API { DeleteForecast: newMLDeleteForecastFunc(t), DeleteJob: newMLDeleteJobFunc(t), DeleteModelSnapshot: newMLDeleteModelSnapshotFunc(t), + EstimateMemoryUsage: newMLEstimateMemoryUsageFunc(t), EvaluateDataFrame: newMLEvaluateDataFrameFunc(t), FindFileStructure: newMLFindFileStructureFunc(t), FlushJob: newMLFlushJobFunc(t), diff --git a/esapi/api.bulk.go b/esapi/api.bulk.go index 1aedac7c3e..738001ccf7 100755 --- a/esapi/api.bulk.go +++ b/esapi/api.bulk.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newBulkFunc(t Transport) Bulk { // Bulk allows to perform multiple index/update/delete operations in a single request. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html. // type Bulk func(body io.Reader, o ...func(*BulkRequest)) (*Response, error) diff --git a/esapi/api.cat.aliases.go b/esapi/api.cat.aliases.go index adc01bb96a..8265fcfa55 100755 --- a/esapi/api.cat.aliases.go +++ b/esapi/api.cat.aliases.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatAliasesFunc(t Transport) CatAliases { // CatAliases shows information about currently configured aliases to indices including filter and routing infos. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html. // type CatAliases func(o ...func(*CatAliasesRequest)) (*Response, error) diff --git a/esapi/api.cat.allocation.go b/esapi/api.cat.allocation.go index 6782545a1a..37e75e41fd 100755 --- a/esapi/api.cat.allocation.go +++ b/esapi/api.cat.allocation.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatAllocationFunc(t Transport) CatAllocation { // CatAllocation provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html. // type CatAllocation func(o ...func(*CatAllocationRequest)) (*Response, error) diff --git a/esapi/api.cat.count.go b/esapi/api.cat.count.go index 288444f4bc..fe8eba2e2c 100755 --- a/esapi/api.cat.count.go +++ b/esapi/api.cat.count.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatCountFunc(t Transport) CatCount { // CatCount provides quick access to the document count of the entire cluster, or individual indices. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html. // type CatCount func(o ...func(*CatCountRequest)) (*Response, error) diff --git a/esapi/api.cat.fielddata.go b/esapi/api.cat.fielddata.go index 358d5a53e4..91dbaaf164 100755 --- a/esapi/api.cat.fielddata.go +++ b/esapi/api.cat.fielddata.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatFielddataFunc(t Transport) CatFielddata { // CatFielddata shows how much heap memory is currently being used by fielddata on every data node in the cluster. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html. // type CatFielddata func(o ...func(*CatFielddataRequest)) (*Response, error) diff --git a/esapi/api.cat.health.go b/esapi/api.cat.health.go index 6b92fbfc9d..de563f1293 100755 --- a/esapi/api.cat.health.go +++ b/esapi/api.cat.health.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatHealthFunc(t Transport) CatHealth { // CatHealth returns a concise representation of the cluster health. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html. // type CatHealth func(o ...func(*CatHealthRequest)) (*Response, error) diff --git a/esapi/api.cat.help.go b/esapi/api.cat.help.go index 96ca4df3f8..d6a582f840 100755 --- a/esapi/api.cat.help.go +++ b/esapi/api.cat.help.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newCatHelpFunc(t Transport) CatHelp { // CatHelp returns help for the Cat APIs. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html. // type CatHelp func(o ...func(*CatHelpRequest)) (*Response, error) diff --git a/esapi/api.cat.indices.go b/esapi/api.cat.indices.go index c021910f0e..4d7dba58bd 100755 --- a/esapi/api.cat.indices.go +++ b/esapi/api.cat.indices.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatIndicesFunc(t Transport) CatIndices { // CatIndices returns information about indices: number of primaries and replicas, document counts, disk size, ... // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html. // type CatIndices func(o ...func(*CatIndicesRequest)) (*Response, error) diff --git a/esapi/api.cat.master.go b/esapi/api.cat.master.go index 657c5279d1..43f64dcadd 100755 --- a/esapi/api.cat.master.go +++ b/esapi/api.cat.master.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatMasterFunc(t Transport) CatMaster { // CatMaster returns information about the master node. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html. // type CatMaster func(o ...func(*CatMasterRequest)) (*Response, error) diff --git a/esapi/api.cat.nodeattrs.go b/esapi/api.cat.nodeattrs.go index f99c5a158a..70b064f9ee 100755 --- a/esapi/api.cat.nodeattrs.go +++ b/esapi/api.cat.nodeattrs.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatNodeattrsFunc(t Transport) CatNodeattrs { // CatNodeattrs returns information about custom node attributes. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html. // type CatNodeattrs func(o ...func(*CatNodeattrsRequest)) (*Response, error) diff --git a/esapi/api.cat.nodes.go b/esapi/api.cat.nodes.go index 9ec4463c11..e83a40de6b 100755 --- a/esapi/api.cat.nodes.go +++ b/esapi/api.cat.nodes.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatNodesFunc(t Transport) CatNodes { // CatNodes returns basic statistics about performance of cluster nodes. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html. // type CatNodes func(o ...func(*CatNodesRequest)) (*Response, error) diff --git a/esapi/api.cat.pending_tasks.go b/esapi/api.cat.pending_tasks.go index 2fdeda8dd4..4dd10a845d 100755 --- a/esapi/api.cat.pending_tasks.go +++ b/esapi/api.cat.pending_tasks.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatPendingTasksFunc(t Transport) CatPendingTasks { // CatPendingTasks returns a concise representation of the cluster pending tasks. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html. // type CatPendingTasks func(o ...func(*CatPendingTasksRequest)) (*Response, error) diff --git a/esapi/api.cat.plugins.go b/esapi/api.cat.plugins.go index 360d14ca79..e01f2fcb34 100755 --- a/esapi/api.cat.plugins.go +++ b/esapi/api.cat.plugins.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatPluginsFunc(t Transport) CatPlugins { // CatPlugins returns information about installed plugins across nodes node. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html. // type CatPlugins func(o ...func(*CatPluginsRequest)) (*Response, error) diff --git a/esapi/api.cat.recovery.go b/esapi/api.cat.recovery.go index e036b1c13d..f7af5ac6f2 100755 --- a/esapi/api.cat.recovery.go +++ b/esapi/api.cat.recovery.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatRecoveryFunc(t Transport) CatRecovery { // CatRecovery returns information about index shard recoveries, both on-going completed. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html. // type CatRecovery func(o ...func(*CatRecoveryRequest)) (*Response, error) @@ -33,7 +33,9 @@ type CatRecovery func(o ...func(*CatRecoveryRequest)) (*Response, error) type CatRecoveryRequest struct { Index []string + ActiveOnly *bool Bytes string + Detailed *bool Format string H []string Help *bool @@ -74,10 +76,18 @@ func (r CatRecoveryRequest) Do(ctx context.Context, transport Transport) (*Respo params = make(map[string]string) + if r.ActiveOnly != nil { + params["active_only"] = strconv.FormatBool(*r.ActiveOnly) + } + if r.Bytes != "" { params["bytes"] = r.Bytes } + if r.Detailed != nil { + params["detailed"] = strconv.FormatBool(*r.Detailed) + } + if r.Format != "" { params["format"] = r.Format } @@ -90,6 +100,10 @@ func (r CatRecoveryRequest) Do(ctx context.Context, transport Transport) (*Respo params["help"] = strconv.FormatBool(*r.Help) } + if len(r.Index) > 0 { + params["index"] = strings.Join(r.Index, ",") + } + if r.MasterTimeout != 0 { params["master_timeout"] = formatDuration(r.MasterTimeout) } @@ -166,7 +180,7 @@ func (f CatRecovery) WithContext(v context.Context) func(*CatRecoveryRequest) { } } -// WithIndex - a list of index names to limit the returned information. +// WithIndex - comma-separated list or wildcard expression of index names to limit the returned information. // func (f CatRecovery) WithIndex(v ...string) func(*CatRecoveryRequest) { return func(r *CatRecoveryRequest) { @@ -174,6 +188,14 @@ func (f CatRecovery) WithIndex(v ...string) func(*CatRecoveryRequest) { } } +// WithActiveOnly - if `true`, the response only includes ongoing shard recoveries. +// +func (f CatRecovery) WithActiveOnly(v bool) func(*CatRecoveryRequest) { + return func(r *CatRecoveryRequest) { + r.ActiveOnly = &v + } +} + // WithBytes - the unit in which to display byte values. // func (f CatRecovery) WithBytes(v string) func(*CatRecoveryRequest) { @@ -182,6 +204,14 @@ func (f CatRecovery) WithBytes(v string) func(*CatRecoveryRequest) { } } +// WithDetailed - if `true`, the response includes detailed information about shard recoveries. +// +func (f CatRecovery) WithDetailed(v bool) func(*CatRecoveryRequest) { + return func(r *CatRecoveryRequest) { + r.Detailed = &v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. // func (f CatRecovery) WithFormat(v string) func(*CatRecoveryRequest) { diff --git a/esapi/api.cat.repositories.go b/esapi/api.cat.repositories.go index b365005850..ffa9a4142d 100755 --- a/esapi/api.cat.repositories.go +++ b/esapi/api.cat.repositories.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatRepositoriesFunc(t Transport) CatRepositories { // CatRepositories returns information about snapshot repositories registered in the cluster. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html. // type CatRepositories func(o ...func(*CatRepositoriesRequest)) (*Response, error) diff --git a/esapi/api.cat.segments.go b/esapi/api.cat.segments.go index df17671154..7069a3ff6b 100755 --- a/esapi/api.cat.segments.go +++ b/esapi/api.cat.segments.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newCatSegmentsFunc(t Transport) CatSegments { // CatSegments provides low-level information about the segments in the shards of an index. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html. // type CatSegments func(o ...func(*CatSegmentsRequest)) (*Response, error) diff --git a/esapi/api.cat.shards.go b/esapi/api.cat.shards.go index 1c7fae468a..215dc74787 100755 --- a/esapi/api.cat.shards.go +++ b/esapi/api.cat.shards.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatShardsFunc(t Transport) CatShards { // CatShards provides a detailed view of shard allocation on nodes. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html. // type CatShards func(o ...func(*CatShardsRequest)) (*Response, error) diff --git a/esapi/api.cat.snapshots.go b/esapi/api.cat.snapshots.go index 11c5ff6c18..f70f31f82e 100755 --- a/esapi/api.cat.snapshots.go +++ b/esapi/api.cat.snapshots.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatSnapshotsFunc(t Transport) CatSnapshots { // CatSnapshots returns all snapshots in a specific repository. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html. // type CatSnapshots func(o ...func(*CatSnapshotsRequest)) (*Response, error) diff --git a/esapi/api.cat.tasks.go b/esapi/api.cat.tasks.go index 74fd9fd553..84f6cbed4a 100755 --- a/esapi/api.cat.tasks.go +++ b/esapi/api.cat.tasks.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newCatTasksFunc(t Transport) CatTasks { // CatTasks returns information about the tasks currently executing on one or more nodes in the cluster. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. // type CatTasks func(o ...func(*CatTasksRequest)) (*Response, error) diff --git a/esapi/api.cat.templates.go b/esapi/api.cat.templates.go index 7ff39fdb85..13153aa1d8 100755 --- a/esapi/api.cat.templates.go +++ b/esapi/api.cat.templates.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCatTemplatesFunc(t Transport) CatTemplates { // CatTemplates returns information about existing templates. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html. // type CatTemplates func(o ...func(*CatTemplatesRequest)) (*Response, error) diff --git a/esapi/api.cat.thread_pool.go b/esapi/api.cat.thread_pool.go index 7ff60c2101..e267ccd02f 100755 --- a/esapi/api.cat.thread_pool.go +++ b/esapi/api.cat.thread_pool.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newCatThreadPoolFunc(t Transport) CatThreadPool { // CatThreadPool returns cluster-wide thread pool statistics per node. // By default the active, queue and rejected statistics are returned for all thread pools. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html. // type CatThreadPool func(o ...func(*CatThreadPoolRequest)) (*Response, error) diff --git a/esapi/api.clear_scroll.go b/esapi/api.clear_scroll.go index cbd332c1bc..c908dda309 100755 --- a/esapi/api.clear_scroll.go +++ b/esapi/api.clear_scroll.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newClearScrollFunc(t Transport) ClearScroll { // ClearScroll explicitly clears the search context for a scroll. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#_clear_scroll_api. // type ClearScroll func(o ...func(*ClearScrollRequest)) (*Response, error) diff --git a/esapi/api.cluster.allocation_explain.go b/esapi/api.cluster.allocation_explain.go index 6af1a54946..307ddde830 100755 --- a/esapi/api.cluster.allocation_explain.go +++ b/esapi/api.cluster.allocation_explain.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newClusterAllocationExplainFunc(t Transport) ClusterAllocationExplain { // ClusterAllocationExplain provides explanations for shard allocations in the cluster. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html. // type ClusterAllocationExplain func(o ...func(*ClusterAllocationExplainRequest)) (*Response, error) diff --git a/esapi/api.cluster.get_settings.go b/esapi/api.cluster.get_settings.go index e6b056299b..6b1037e6f5 100755 --- a/esapi/api.cluster.get_settings.go +++ b/esapi/api.cluster.get_settings.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newClusterGetSettingsFunc(t Transport) ClusterGetSettings { // ClusterGetSettings returns cluster settings. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html. // type ClusterGetSettings func(o ...func(*ClusterGetSettingsRequest)) (*Response, error) diff --git a/esapi/api.cluster.health.go b/esapi/api.cluster.health.go index 04854bae6f..aff30c755b 100755 --- a/esapi/api.cluster.health.go +++ b/esapi/api.cluster.health.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newClusterHealthFunc(t Transport) ClusterHealth { // ClusterHealth returns basic information about the health of the cluster. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html. // type ClusterHealth func(o ...func(*ClusterHealthRequest)) (*Response, error) diff --git a/esapi/api.cluster.pending_tasks.go b/esapi/api.cluster.pending_tasks.go index ca8e546584..431c8720f7 100755 --- a/esapi/api.cluster.pending_tasks.go +++ b/esapi/api.cluster.pending_tasks.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newClusterPendingTasksFunc(t Transport) ClusterPendingTasks { // ClusterPendingTasks returns a list of any cluster-level changes (e.g. create index, update mapping, // allocate or fail shard) which have not yet been executed. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html. // type ClusterPendingTasks func(o ...func(*ClusterPendingTasksRequest)) (*Response, error) diff --git a/esapi/api.cluster.put_settings.go b/esapi/api.cluster.put_settings.go index c35bbb3682..5d3279a21a 100755 --- a/esapi/api.cluster.put_settings.go +++ b/esapi/api.cluster.put_settings.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newClusterPutSettingsFunc(t Transport) ClusterPutSettings { // ClusterPutSettings updates the cluster settings. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html. // type ClusterPutSettings func(body io.Reader, o ...func(*ClusterPutSettingsRequest)) (*Response, error) diff --git a/esapi/api.cluster.remote_info.go b/esapi/api.cluster.remote_info.go index 481b31f4ee..68b9409b8e 100755 --- a/esapi/api.cluster.remote_info.go +++ b/esapi/api.cluster.remote_info.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,7 @@ func newClusterRemoteInfoFunc(t Transport) ClusterRemoteInfo { // ClusterRemoteInfo returns the information about configured remote clusters. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html. // type ClusterRemoteInfo func(o ...func(*ClusterRemoteInfoRequest)) (*Response, error) diff --git a/esapi/api.cluster.reroute.go b/esapi/api.cluster.reroute.go index f2daf593ba..bb7b8a29da 100755 --- a/esapi/api.cluster.reroute.go +++ b/esapi/api.cluster.reroute.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newClusterRerouteFunc(t Transport) ClusterReroute { // ClusterReroute allows to manually change the allocation of individual shards in the cluster. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html. // type ClusterReroute func(o ...func(*ClusterRerouteRequest)) (*Response, error) diff --git a/esapi/api.cluster.state.go b/esapi/api.cluster.state.go index a18e21385d..553d1a5f35 100755 --- a/esapi/api.cluster.state.go +++ b/esapi/api.cluster.state.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newClusterStateFunc(t Transport) ClusterState { // ClusterState returns a comprehensive information about the state of the cluster. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html. // type ClusterState func(o ...func(*ClusterStateRequest)) (*Response, error) diff --git a/esapi/api.cluster.stats.go b/esapi/api.cluster.stats.go index f1a05f0554..f60d86af08 100755 --- a/esapi/api.cluster.stats.go +++ b/esapi/api.cluster.stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newClusterStatsFunc(t Transport) ClusterStats { // ClusterStats returns high-level overview of cluster statistics. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html. // type ClusterStats func(o ...func(*ClusterStatsRequest)) (*Response, error) diff --git a/esapi/api.count.go b/esapi/api.count.go index bf355fd6e0..c2d3637a0b 100755 --- a/esapi/api.count.go +++ b/esapi/api.count.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newCountFunc(t Transport) Count { // Count returns number of documents matching a query. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html. // type Count func(o ...func(*CountRequest)) (*Response, error) diff --git a/esapi/api.create.go b/esapi/api.create.go index c4a8afcdad..bf9e6c13de 100755 --- a/esapi/api.create.go +++ b/esapi/api.create.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -27,7 +27,7 @@ func newCreateFunc(t Transport) Create { // // Returns a 409 response when a document with a same ID already exists in the index. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html. // type Create func(index string, id string, body io.Reader, o ...func(*CreateRequest)) (*Response, error) @@ -76,8 +76,10 @@ func (r CreateRequest) Do(ctx context.Context, transport Transport) (*Response, path.Grow(1 + len(r.Index) + 1 + len(r.DocumentType) + 1 + len(r.DocumentID) + 1 + len("_create")) path.WriteString("/") path.WriteString(r.Index) - path.WriteString("/") - path.WriteString(r.DocumentType) + if r.DocumentType != "" { + path.WriteString("/") + path.WriteString(r.DocumentType) + } path.WriteString("/") path.WriteString(r.DocumentID) path.WriteString("/") diff --git a/esapi/api.delete.go b/esapi/api.delete.go index 3d81785db4..73016466d6 100755 --- a/esapi/api.delete.go +++ b/esapi/api.delete.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newDeleteFunc(t Transport) Delete { // Delete removes a document from the index. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html. // type Delete func(index string, id string, o ...func(*DeleteRequest)) (*Response, error) diff --git a/esapi/api.delete_by_query.go b/esapi/api.delete_by_query.go index 078498e948..36bc6023fd 100755 --- a/esapi/api.delete_by_query.go +++ b/esapi/api.delete_by_query.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -38,7 +38,6 @@ type DeleteByQueryRequest struct { Body io.Reader AllowNoIndices *bool - Analyzer string AnalyzeWildcard *bool Conflicts string DefaultOperator string @@ -108,10 +107,6 @@ func (r DeleteByQueryRequest) Do(ctx context.Context, transport Transport) (*Res params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.Analyzer != "" { - params["analyzer"] = r.Analyzer - } - if r.AnalyzeWildcard != nil { params["analyze_wildcard"] = strconv.FormatBool(*r.AnalyzeWildcard) } @@ -320,14 +315,6 @@ func (f DeleteByQuery) WithAllowNoIndices(v bool) func(*DeleteByQueryRequest) { } } -// WithAnalyzer - the analyzer to use for the query string. -// -func (f DeleteByQuery) WithAnalyzer(v string) func(*DeleteByQueryRequest) { - return func(r *DeleteByQueryRequest) { - r.Analyzer = v - } -} - // WithAnalyzeWildcard - specify whether wildcard and prefix queries should be analyzed (default: false). // func (f DeleteByQuery) WithAnalyzeWildcard(v bool) func(*DeleteByQueryRequest) { diff --git a/esapi/api.delete_by_query_rethrottle.go b/esapi/api.delete_by_query_rethrottle.go index eb98133cb6..57859a54ef 100755 --- a/esapi/api.delete_by_query_rethrottle.go +++ b/esapi/api.delete_by_query_rethrottle.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.delete_script.go b/esapi/api.delete_script.go index 9ae607451e..20bc0c9eaf 100755 --- a/esapi/api.delete_script.go +++ b/esapi/api.delete_script.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newDeleteScriptFunc(t Transport) DeleteScript { // DeleteScript deletes a script. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html. // type DeleteScript func(id string, o ...func(*DeleteScriptRequest)) (*Response, error) diff --git a/esapi/api.exists.go b/esapi/api.exists.go index c876981243..a5ad5140b2 100755 --- a/esapi/api.exists.go +++ b/esapi/api.exists.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newExistsFunc(t Transport) Exists { // Exists returns information about whether a document exists in an index. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. // type Exists func(index string, id string, o ...func(*ExistsRequest)) (*Response, error) diff --git a/esapi/api.exists_source.go b/esapi/api.exists_source.go index 38388f2a31..688448051b 100755 --- a/esapi/api.exists_source.go +++ b/esapi/api.exists_source.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newExistsSourceFunc(t Transport) ExistsSource { // ExistsSource returns information about whether a document source exists in an index. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. // type ExistsSource func(index string, id string, o ...func(*ExistsSourceRequest)) (*Response, error) diff --git a/esapi/api.explain.go b/esapi/api.explain.go index 70d9351387..f65be94b8e 100755 --- a/esapi/api.explain.go +++ b/esapi/api.explain.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newExplainFunc(t Transport) Explain { // Explain returns information about why a specific matches (or doesn't match) a query. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html. // type Explain func(index string, id string, o ...func(*ExplainRequest)) (*Response, error) diff --git a/esapi/api.field_caps.go b/esapi/api.field_caps.go index 5e042ae339..66e448ca15 100755 --- a/esapi/api.field_caps.go +++ b/esapi/api.field_caps.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newFieldCapsFunc(t Transport) FieldCaps { // FieldCaps returns the information about the capabilities of fields among multiple indices. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html. // type FieldCaps func(o ...func(*FieldCapsRequest)) (*Response, error) diff --git a/esapi/api.get.go b/esapi/api.get.go index 61f391e8ce..91f67e6c71 100755 --- a/esapi/api.get.go +++ b/esapi/api.get.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newGetFunc(t Transport) Get { // Get returns a document. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. // type Get func(index string, id string, o ...func(*GetRequest)) (*Response, error) diff --git a/esapi/api.get_script.go b/esapi/api.get_script.go index 2fec520736..33b7bc3299 100755 --- a/esapi/api.get_script.go +++ b/esapi/api.get_script.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newGetScriptFunc(t Transport) GetScript { // GetScript returns a script. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html. // type GetScript func(id string, o ...func(*GetScriptRequest)) (*Response, error) diff --git a/esapi/api.get_source.go b/esapi/api.get_source.go index ec02899bc0..a6217b3b7d 100755 --- a/esapi/api.get_source.go +++ b/esapi/api.get_source.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newGetSourceFunc(t Transport) GetSource { // GetSource returns the source of a document. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. // type GetSource func(index string, id string, o ...func(*GetSourceRequest)) (*Response, error) diff --git a/esapi/api.index.go b/esapi/api.index.go index f0c71d0769..6603b8c6ec 100755 --- a/esapi/api.index.go +++ b/esapi/api.index.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newIndexFunc(t Transport) Index { // Index creates or updates a document in an index. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html. // type Index func(index string, body io.Reader, o ...func(*IndexRequest)) (*Response, error) @@ -81,8 +81,10 @@ func (r IndexRequest) Do(ctx context.Context, transport Transport) (*Response, e path.Grow(1 + len(r.Index) + 1 + len(r.DocumentType) + 1 + len(r.DocumentID)) path.WriteString("/") path.WriteString(r.Index) - path.WriteString("/") - path.WriteString(r.DocumentType) + if r.DocumentType != "" { + path.WriteString("/") + path.WriteString(r.DocumentType) + } if r.DocumentID != "" { path.WriteString("/") path.WriteString(r.DocumentID) diff --git a/esapi/api.indices.analyze.go b/esapi/api.indices.analyze.go index e7a156af9f..9b9165ede6 100755 --- a/esapi/api.indices.analyze.go +++ b/esapi/api.indices.analyze.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesAnalyzeFunc(t Transport) IndicesAnalyze { // IndicesAnalyze performs the analysis process on a text and return the tokens breakdown of the text. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html. // type IndicesAnalyze func(o ...func(*IndicesAnalyzeRequest)) (*Response, error) diff --git a/esapi/api.indices.clear_cache.go b/esapi/api.indices.clear_cache.go index 6e3ac8d849..599d892c8d 100755 --- a/esapi/api.indices.clear_cache.go +++ b/esapi/api.indices.clear_cache.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesClearCacheFunc(t Transport) IndicesClearCache { // IndicesClearCache clears all or specific caches for one or more indices. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html. // type IndicesClearCache func(o ...func(*IndicesClearCacheRequest)) (*Response, error) diff --git a/esapi/api.indices.clone.go b/esapi/api.indices.clone.go new file mode 100755 index 0000000000..b7799fe372 --- /dev/null +++ b/esapi/api.indices.clone.go @@ -0,0 +1,230 @@ +// Code generated from specification version 7.4.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" + "time" +) + +func newIndicesCloneFunc(t Transport) IndicesClone { + return func(index string, target string, o ...func(*IndicesCloneRequest)) (*Response, error) { + var r = IndicesCloneRequest{Index: index, Target: target} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// IndicesClone clones an index +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html. +// +type IndicesClone func(index string, target string, o ...func(*IndicesCloneRequest)) (*Response, error) + +// IndicesCloneRequest configures the Indices Clone API request. +// +type IndicesCloneRequest struct { + Index string + + Body io.Reader + + Target string + + MasterTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r IndicesCloneRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len(r.Index) + 1 + len("_clone") + 1 + len(r.Target)) + path.WriteString("/") + path.WriteString(r.Index) + path.WriteString("/") + path.WriteString("_clone") + path.WriteString("/") + path.WriteString(r.Target) + + params = make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f IndicesClone) WithContext(v context.Context) func(*IndicesCloneRequest) { + return func(r *IndicesCloneRequest) { + r.ctx = v + } +} + +// WithBody - The configuration for the target index (`settings` and `aliases`). +// +func (f IndicesClone) WithBody(v io.Reader) func(*IndicesCloneRequest) { + return func(r *IndicesCloneRequest) { + r.Body = v + } +} + +// WithMasterTimeout - specify timeout for connection to master. +// +func (f IndicesClone) WithMasterTimeout(v time.Duration) func(*IndicesCloneRequest) { + return func(r *IndicesCloneRequest) { + r.MasterTimeout = v + } +} + +// WithTimeout - explicit operation timeout. +// +func (f IndicesClone) WithTimeout(v time.Duration) func(*IndicesCloneRequest) { + return func(r *IndicesCloneRequest) { + r.Timeout = v + } +} + +// WithWaitForActiveShards - set the number of active shards to wait for on the cloned index before the operation returns.. +// +func (f IndicesClone) WithWaitForActiveShards(v string) func(*IndicesCloneRequest) { + return func(r *IndicesCloneRequest) { + r.WaitForActiveShards = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f IndicesClone) WithPretty() func(*IndicesCloneRequest) { + return func(r *IndicesCloneRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f IndicesClone) WithHuman() func(*IndicesCloneRequest) { + return func(r *IndicesCloneRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f IndicesClone) WithErrorTrace() func(*IndicesCloneRequest) { + return func(r *IndicesCloneRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f IndicesClone) WithFilterPath(v ...string) func(*IndicesCloneRequest) { + return func(r *IndicesCloneRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f IndicesClone) WithHeader(h map[string]string) func(*IndicesCloneRequest) { + return func(r *IndicesCloneRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.indices.close.go b/esapi/api.indices.close.go index c972350083..6962c4beae 100755 --- a/esapi/api.indices.close.go +++ b/esapi/api.indices.close.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newIndicesCloseFunc(t Transport) IndicesClose { // IndicesClose closes an index. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html. // type IndicesClose func(index []string, o ...func(*IndicesCloseRequest)) (*Response, error) diff --git a/esapi/api.indices.create.go b/esapi/api.indices.create.go index 4555972b05..ce4f5ddc11 100755 --- a/esapi/api.indices.create.go +++ b/esapi/api.indices.create.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newIndicesCreateFunc(t Transport) IndicesCreate { // IndicesCreate creates an index with optional settings and mappings. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html. // type IndicesCreate func(index string, o ...func(*IndicesCreateRequest)) (*Response, error) diff --git a/esapi/api.indices.delete.go b/esapi/api.indices.delete.go index 9a693c42d3..7f36db6460 100755 --- a/esapi/api.indices.delete.go +++ b/esapi/api.indices.delete.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newIndicesDeleteFunc(t Transport) IndicesDelete { // IndicesDelete deletes an index. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html. // type IndicesDelete func(index []string, o ...func(*IndicesDeleteRequest)) (*Response, error) diff --git a/esapi/api.indices.delete_alias.go b/esapi/api.indices.delete_alias.go index 545a169415..8b7eb59191 100755 --- a/esapi/api.indices.delete_alias.go +++ b/esapi/api.indices.delete_alias.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesDeleteAliasFunc(t Transport) IndicesDeleteAlias { // IndicesDeleteAlias deletes an alias. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. // type IndicesDeleteAlias func(index []string, name []string, o ...func(*IndicesDeleteAliasRequest)) (*Response, error) diff --git a/esapi/api.indices.delete_template.go b/esapi/api.indices.delete_template.go index 2cc6995ef4..d3b30e05cb 100755 --- a/esapi/api.indices.delete_template.go +++ b/esapi/api.indices.delete_template.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesDeleteTemplateFunc(t Transport) IndicesDeleteTemplate { // IndicesDeleteTemplate deletes an index template. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. // type IndicesDeleteTemplate func(name string, o ...func(*IndicesDeleteTemplateRequest)) (*Response, error) diff --git a/esapi/api.indices.exists.go b/esapi/api.indices.exists.go index 2cb4e585eb..01189f0298 100755 --- a/esapi/api.indices.exists.go +++ b/esapi/api.indices.exists.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesExistsFunc(t Transport) IndicesExists { // IndicesExists returns information about whether a particular index exists. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html. // type IndicesExists func(index []string, o ...func(*IndicesExistsRequest)) (*Response, error) diff --git a/esapi/api.indices.exists_alias.go b/esapi/api.indices.exists_alias.go index e00f703d4b..8a9121eb1a 100755 --- a/esapi/api.indices.exists_alias.go +++ b/esapi/api.indices.exists_alias.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesExistsAliasFunc(t Transport) IndicesExistsAlias { // IndicesExistsAlias returns information about whether a particular alias exists. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. // type IndicesExistsAlias func(name []string, o ...func(*IndicesExistsAliasRequest)) (*Response, error) diff --git a/esapi/api.indices.exists_template.go b/esapi/api.indices.exists_template.go index 0b80ffeb1d..f0e18b52fd 100755 --- a/esapi/api.indices.exists_template.go +++ b/esapi/api.indices.exists_template.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newIndicesExistsTemplateFunc(t Transport) IndicesExistsTemplate { // IndicesExistsTemplate returns information about whether a particular index template exists. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. // type IndicesExistsTemplate func(name []string, o ...func(*IndicesExistsTemplateRequest)) (*Response, error) diff --git a/esapi/api.indices.exists_type.go b/esapi/api.indices.exists_type.go index b1533c33f8..2e13a8ff50 100755 --- a/esapi/api.indices.exists_type.go +++ b/esapi/api.indices.exists_type.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesExistsDocumentTypeFunc(t Transport) IndicesExistsDocumentType { // IndicesExistsDocumentType returns information about whether a particular document type exists. (DEPRECATED) // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html. // type IndicesExistsDocumentType func(index []string, o ...func(*IndicesExistsDocumentTypeRequest)) (*Response, error) diff --git a/esapi/api.indices.flush.go b/esapi/api.indices.flush.go index f103878054..4520a04ea0 100755 --- a/esapi/api.indices.flush.go +++ b/esapi/api.indices.flush.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesFlushFunc(t Transport) IndicesFlush { // IndicesFlush performs the flush operation on one or more indices. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html. // type IndicesFlush func(o ...func(*IndicesFlushRequest)) (*Response, error) diff --git a/esapi/api.indices.flush_synced.go b/esapi/api.indices.flush_synced.go index 3c181dad68..8ab7ce3ab2 100755 --- a/esapi/api.indices.flush_synced.go +++ b/esapi/api.indices.flush_synced.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesFlushSyncedFunc(t Transport) IndicesFlushSynced { // IndicesFlushSynced performs a synced flush operation on one or more indices. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html#synced-flush-api. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush-api.html. // type IndicesFlushSynced func(o ...func(*IndicesFlushSyncedRequest)) (*Response, error) diff --git a/esapi/api.indices.forcemerge.go b/esapi/api.indices.forcemerge.go index 87ff59fdd8..315dcded10 100755 --- a/esapi/api.indices.forcemerge.go +++ b/esapi/api.indices.forcemerge.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesForcemergeFunc(t Transport) IndicesForcemerge { // IndicesForcemerge performs the force merge operation on one or more indices. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html. // type IndicesForcemerge func(o ...func(*IndicesForcemergeRequest)) (*Response, error) diff --git a/esapi/api.indices.get.go b/esapi/api.indices.get.go index 4919f0217b..44242573bf 100755 --- a/esapi/api.indices.get.go +++ b/esapi/api.indices.get.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newIndicesGetFunc(t Transport) IndicesGet { // IndicesGet returns information about one or more indices. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html. // type IndicesGet func(index []string, o ...func(*IndicesGetRequest)) (*Response, error) diff --git a/esapi/api.indices.get_alias.go b/esapi/api.indices.get_alias.go index 098da99909..1bbb79a0be 100755 --- a/esapi/api.indices.get_alias.go +++ b/esapi/api.indices.get_alias.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesGetAliasFunc(t Transport) IndicesGetAlias { // IndicesGetAlias returns an alias. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. // type IndicesGetAlias func(o ...func(*IndicesGetAliasRequest)) (*Response, error) diff --git a/esapi/api.indices.get_field_mapping.go b/esapi/api.indices.get_field_mapping.go index 10b84b7143..5185816412 100755 --- a/esapi/api.indices.get_field_mapping.go +++ b/esapi/api.indices.get_field_mapping.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesGetFieldMappingFunc(t Transport) IndicesGetFieldMapping { // IndicesGetFieldMapping returns mapping for one or more fields. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html. // type IndicesGetFieldMapping func(fields []string, o ...func(*IndicesGetFieldMappingRequest)) (*Response, error) diff --git a/esapi/api.indices.get_mapping.go b/esapi/api.indices.get_mapping.go index ea662a9f25..6651d6bb79 100755 --- a/esapi/api.indices.get_mapping.go +++ b/esapi/api.indices.get_mapping.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newIndicesGetMappingFunc(t Transport) IndicesGetMapping { // IndicesGetMapping returns mappings for one or more indices. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html. // type IndicesGetMapping func(o ...func(*IndicesGetMappingRequest)) (*Response, error) diff --git a/esapi/api.indices.get_settings.go b/esapi/api.indices.get_settings.go index 22d9726455..785675cacf 100755 --- a/esapi/api.indices.get_settings.go +++ b/esapi/api.indices.get_settings.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newIndicesGetSettingsFunc(t Transport) IndicesGetSettings { // IndicesGetSettings returns settings for one or more indices. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html. // type IndicesGetSettings func(o ...func(*IndicesGetSettingsRequest)) (*Response, error) diff --git a/esapi/api.indices.get_template.go b/esapi/api.indices.get_template.go index a9e7001be9..52689d2604 100755 --- a/esapi/api.indices.get_template.go +++ b/esapi/api.indices.get_template.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newIndicesGetTemplateFunc(t Transport) IndicesGetTemplate { // IndicesGetTemplate returns an index template. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. // type IndicesGetTemplate func(o ...func(*IndicesGetTemplateRequest)) (*Response, error) diff --git a/esapi/api.indices.get_upgrade.go b/esapi/api.indices.get_upgrade.go index db5771e50c..aea3fec669 100755 --- a/esapi/api.indices.get_upgrade.go +++ b/esapi/api.indices.get_upgrade.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesGetUpgradeFunc(t Transport) IndicesGetUpgrade { // IndicesGetUpgrade the _upgrade API is no longer useful and will be removed. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html. // type IndicesGetUpgrade func(o ...func(*IndicesGetUpgradeRequest)) (*Response, error) diff --git a/esapi/api.indices.open.go b/esapi/api.indices.open.go index 2d8e5be187..a1466843ed 100755 --- a/esapi/api.indices.open.go +++ b/esapi/api.indices.open.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newIndicesOpenFunc(t Transport) IndicesOpen { // IndicesOpen opens an index. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html. // type IndicesOpen func(index []string, o ...func(*IndicesOpenRequest)) (*Response, error) diff --git a/esapi/api.indices.put_alias.go b/esapi/api.indices.put_alias.go index a1582047f7..4ee4605e91 100755 --- a/esapi/api.indices.put_alias.go +++ b/esapi/api.indices.put_alias.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newIndicesPutAliasFunc(t Transport) IndicesPutAlias { // IndicesPutAlias creates or updates an alias. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. // type IndicesPutAlias func(index []string, name string, o ...func(*IndicesPutAliasRequest)) (*Response, error) diff --git a/esapi/api.indices.put_mapping.go b/esapi/api.indices.put_mapping.go index 0f6e8e2454..0714880780 100755 --- a/esapi/api.indices.put_mapping.go +++ b/esapi/api.indices.put_mapping.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newIndicesPutMappingFunc(t Transport) IndicesPutMapping { // IndicesPutMapping updates the index mappings. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html. // type IndicesPutMapping func(body io.Reader, o ...func(*IndicesPutMappingRequest)) (*Response, error) @@ -65,17 +65,13 @@ func (r IndicesPutMappingRequest) Do(ctx context.Context, transport Transport) ( method = "PUT" - path.Grow(len(strings.Join(r.Index, ",")) + len("/_mapping") + len(r.DocumentType) + 2) + path.Grow(len(strings.Join(r.Index, ",")) + len("/_mapping") + 1) if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) } path.WriteString("/") path.WriteString("_mapping") - if r.DocumentType != "" { - path.WriteString("/") - path.WriteString(r.DocumentType) - } params = make(map[string]string) diff --git a/esapi/api.indices.put_settings.go b/esapi/api.indices.put_settings.go index 33122be92b..bfd9bd9678 100755 --- a/esapi/api.indices.put_settings.go +++ b/esapi/api.indices.put_settings.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newIndicesPutSettingsFunc(t Transport) IndicesPutSettings { // IndicesPutSettings updates the index settings. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html. // type IndicesPutSettings func(body io.Reader, o ...func(*IndicesPutSettingsRequest)) (*Response, error) diff --git a/esapi/api.indices.put_template.go b/esapi/api.indices.put_template.go index 7ff01fb369..f6a057f88d 100755 --- a/esapi/api.indices.put_template.go +++ b/esapi/api.indices.put_template.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newIndicesPutTemplateFunc(t Transport) IndicesPutTemplate { // IndicesPutTemplate creates or updates an index template. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html. // type IndicesPutTemplate func(name string, body io.Reader, o ...func(*IndicesPutTemplateRequest)) (*Response, error) diff --git a/esapi/api.indices.recovery.go b/esapi/api.indices.recovery.go index 6f2b99cd68..dc42214259 100755 --- a/esapi/api.indices.recovery.go +++ b/esapi/api.indices.recovery.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesRecoveryFunc(t Transport) IndicesRecovery { // IndicesRecovery returns information about ongoing index shard recoveries. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html. // type IndicesRecovery func(o ...func(*IndicesRecoveryRequest)) (*Response, error) diff --git a/esapi/api.indices.refresh.go b/esapi/api.indices.refresh.go index d973d6eec1..2fb7a104fe 100755 --- a/esapi/api.indices.refresh.go +++ b/esapi/api.indices.refresh.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesRefreshFunc(t Transport) IndicesRefresh { // IndicesRefresh performs the refresh operation in one or more indices. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html. // type IndicesRefresh func(o ...func(*IndicesRefreshRequest)) (*Response, error) diff --git a/esapi/api.indices.rollover.go b/esapi/api.indices.rollover.go index f4fd7f55f4..5b2001e619 100755 --- a/esapi/api.indices.rollover.go +++ b/esapi/api.indices.rollover.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -26,7 +26,7 @@ func newIndicesRolloverFunc(t Transport) IndicesRollover { // IndicesRollover updates an alias to point to a new index when the existing index // is considered to be too large or too old. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html. // type IndicesRollover func(alias string, o ...func(*IndicesRolloverRequest)) (*Response, error) diff --git a/esapi/api.indices.segments.go b/esapi/api.indices.segments.go index 9ec885cb53..3531085597 100755 --- a/esapi/api.indices.segments.go +++ b/esapi/api.indices.segments.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesSegmentsFunc(t Transport) IndicesSegments { // IndicesSegments provides low-level information about segments in a Lucene index. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html. // type IndicesSegments func(o ...func(*IndicesSegmentsRequest)) (*Response, error) diff --git a/esapi/api.indices.shard_stores.go b/esapi/api.indices.shard_stores.go index d3dafce548..e177b3e126 100755 --- a/esapi/api.indices.shard_stores.go +++ b/esapi/api.indices.shard_stores.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesShardStoresFunc(t Transport) IndicesShardStores { // IndicesShardStores provides store information for shard copies of indices. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html. // type IndicesShardStores func(o ...func(*IndicesShardStoresRequest)) (*Response, error) diff --git a/esapi/api.indices.shrink.go b/esapi/api.indices.shrink.go index a8ac4ef688..7f91de2cb5 100755 --- a/esapi/api.indices.shrink.go +++ b/esapi/api.indices.shrink.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newIndicesShrinkFunc(t Transport) IndicesShrink { // IndicesShrink allow to shrink an existing index into a new index with fewer primary shards. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html. // type IndicesShrink func(index string, target string, o ...func(*IndicesShrinkRequest)) (*Response, error) diff --git a/esapi/api.indices.split.go b/esapi/api.indices.split.go index 514e045bad..2167e190ff 100755 --- a/esapi/api.indices.split.go +++ b/esapi/api.indices.split.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newIndicesSplitFunc(t Transport) IndicesSplit { // IndicesSplit allows you to split an existing index into a new index with more primary shards. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html. // type IndicesSplit func(index string, target string, o ...func(*IndicesSplitRequest)) (*Response, error) diff --git a/esapi/api.indices.stats.go b/esapi/api.indices.stats.go index 84f7a4db00..8a0330cb90 100755 --- a/esapi/api.indices.stats.go +++ b/esapi/api.indices.stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesStatsFunc(t Transport) IndicesStats { // IndicesStats provides statistics on operations happening in an index. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html. // type IndicesStats func(o ...func(*IndicesStatsRequest)) (*Response, error) diff --git a/esapi/api.indices.update_aliases.go b/esapi/api.indices.update_aliases.go index fc1e2c0b70..a4e9bf708a 100755 --- a/esapi/api.indices.update_aliases.go +++ b/esapi/api.indices.update_aliases.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newIndicesUpdateAliasesFunc(t Transport) IndicesUpdateAliases { // IndicesUpdateAliases updates index aliases. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. // type IndicesUpdateAliases func(body io.Reader, o ...func(*IndicesUpdateAliasesRequest)) (*Response, error) diff --git a/esapi/api.indices.upgrade.go b/esapi/api.indices.upgrade.go index 26136d4d9d..283d7b121a 100755 --- a/esapi/api.indices.upgrade.go +++ b/esapi/api.indices.upgrade.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newIndicesUpgradeFunc(t Transport) IndicesUpgrade { // IndicesUpgrade the _upgrade API is no longer useful and will be removed. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html. // type IndicesUpgrade func(o ...func(*IndicesUpgradeRequest)) (*Response, error) diff --git a/esapi/api.indices.validate_query.go b/esapi/api.indices.validate_query.go index 125833c996..564742ba6b 100755 --- a/esapi/api.indices.validate_query.go +++ b/esapi/api.indices.validate_query.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newIndicesValidateQueryFunc(t Transport) IndicesValidateQuery { // IndicesValidateQuery allows a user to validate a potentially expensive query without executing it. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html. // type IndicesValidateQuery func(o ...func(*IndicesValidateQueryRequest)) (*Response, error) diff --git a/esapi/api.info.go b/esapi/api.info.go index 56a18a6e9c..7d304c3a49 100755 --- a/esapi/api.info.go +++ b/esapi/api.info.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,7 @@ func newInfoFunc(t Transport) Info { // Info returns basic information about the cluster. // -// See full documentation at http://www.elastic.co/guide/. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html. // type Info func(o ...func(*InfoRequest)) (*Response, error) diff --git a/esapi/api.ingest.delete_pipeline.go b/esapi/api.ingest.delete_pipeline.go index 479d3e310f..646cd25825 100755 --- a/esapi/api.ingest.delete_pipeline.go +++ b/esapi/api.ingest.delete_pipeline.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.get_pipeline.go b/esapi/api.ingest.get_pipeline.go index baaf94bfb0..7a554ecbef 100755 --- a/esapi/api.ingest.get_pipeline.go +++ b/esapi/api.ingest.get_pipeline.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.processor_grok.go b/esapi/api.ingest.processor_grok.go index 9166d37df1..f8daf64765 100755 --- a/esapi/api.ingest.processor_grok.go +++ b/esapi/api.ingest.processor_grok.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.put_pipeline.go b/esapi/api.ingest.put_pipeline.go index 71f0f15197..6d6ab7d8e3 100755 --- a/esapi/api.ingest.put_pipeline.go +++ b/esapi/api.ingest.put_pipeline.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.simulate.go b/esapi/api.ingest.simulate.go index 5bb782e0be..7b08528715 100755 --- a/esapi/api.ingest.simulate.go +++ b/esapi/api.ingest.simulate.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.mget.go b/esapi/api.mget.go index 436bc40218..09021a0a56 100755 --- a/esapi/api.mget.go +++ b/esapi/api.mget.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newMgetFunc(t Transport) Mget { // Mget allows to get multiple documents in one request. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html. // type Mget func(body io.Reader, o ...func(*MgetRequest)) (*Response, error) diff --git a/esapi/api.msearch.go b/esapi/api.msearch.go index b23b4f0a46..e6ef4bc041 100755 --- a/esapi/api.msearch.go +++ b/esapi/api.msearch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newMsearchFunc(t Transport) Msearch { // Msearch allows to execute several search operations in one request. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html. // type Msearch func(body io.Reader, o ...func(*MsearchRequest)) (*Response, error) diff --git a/esapi/api.msearch_template.go b/esapi/api.msearch_template.go index 5a6c3d8832..329943bc7b 100755 --- a/esapi/api.msearch_template.go +++ b/esapi/api.msearch_template.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newMsearchTemplateFunc(t Transport) MsearchTemplate { // MsearchTemplate allows to execute several search template operations in one request. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html. // type MsearchTemplate func(body io.Reader, o ...func(*MsearchTemplateRequest)) (*Response, error) @@ -36,7 +36,6 @@ type MsearchTemplateRequest struct { Body io.Reader - CcsMinimizeRoundtrips *bool MaxConcurrentSearches *int RestTotalHitsAsInt *bool SearchType string @@ -79,10 +78,6 @@ func (r MsearchTemplateRequest) Do(ctx context.Context, transport Transport) (*R params = make(map[string]string) - if r.CcsMinimizeRoundtrips != nil { - params["ccs_minimize_roundtrips"] = strconv.FormatBool(*r.CcsMinimizeRoundtrips) - } - if r.MaxConcurrentSearches != nil { params["max_concurrent_searches"] = strconv.FormatInt(int64(*r.MaxConcurrentSearches), 10) } @@ -183,14 +178,6 @@ func (f MsearchTemplate) WithDocumentType(v ...string) func(*MsearchTemplateRequ } } -// WithCcsMinimizeRoundtrips - indicates whether network round-trips should be minimized as part of cross-cluster search requests execution. -// -func (f MsearchTemplate) WithCcsMinimizeRoundtrips(v bool) func(*MsearchTemplateRequest) { - return func(r *MsearchTemplateRequest) { - r.CcsMinimizeRoundtrips = &v - } -} - // WithMaxConcurrentSearches - controls the maximum number of concurrent searches the multi search api will execute. // func (f MsearchTemplate) WithMaxConcurrentSearches(v int) func(*MsearchTemplateRequest) { diff --git a/esapi/api.mtermvectors.go b/esapi/api.mtermvectors.go index 6bd950ddc1..a538f1fae6 100755 --- a/esapi/api.mtermvectors.go +++ b/esapi/api.mtermvectors.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newMtermvectorsFunc(t Transport) Mtermvectors { // Mtermvectors returns multiple termvectors in one request. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html. // type Mtermvectors func(o ...func(*MtermvectorsRequest)) (*Response, error) diff --git a/esapi/api.nodes.hot_threads.go b/esapi/api.nodes.hot_threads.go index 5b69f6f5e2..87e1bcac84 100755 --- a/esapi/api.nodes.hot_threads.go +++ b/esapi/api.nodes.hot_threads.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newNodesHotThreadsFunc(t Transport) NodesHotThreads { // NodesHotThreads returns information about hot threads on each node in the cluster. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html. // type NodesHotThreads func(o ...func(*NodesHotThreadsRequest)) (*Response, error) diff --git a/esapi/api.nodes.info.go b/esapi/api.nodes.info.go index d9335711eb..e68e2d67f0 100755 --- a/esapi/api.nodes.info.go +++ b/esapi/api.nodes.info.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newNodesInfoFunc(t Transport) NodesInfo { // NodesInfo returns information about nodes in the cluster. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html. // type NodesInfo func(o ...func(*NodesInfoRequest)) (*Response, error) diff --git a/esapi/api.nodes.reload_secure_settings.go b/esapi/api.nodes.reload_secure_settings.go index 9af0794b5d..ba9c9a5cdc 100755 --- a/esapi/api.nodes.reload_secure_settings.go +++ b/esapi/api.nodes.reload_secure_settings.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.stats.go b/esapi/api.nodes.stats.go index c6fad59a6e..4d73e9b612 100755 --- a/esapi/api.nodes.stats.go +++ b/esapi/api.nodes.stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newNodesStatsFunc(t Transport) NodesStats { // NodesStats returns statistical information about nodes in the cluster. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html. // type NodesStats func(o ...func(*NodesStatsRequest)) (*Response, error) diff --git a/esapi/api.nodes.usage.go b/esapi/api.nodes.usage.go index ffe6a9eac8..95a76068a7 100755 --- a/esapi/api.nodes.usage.go +++ b/esapi/api.nodes.usage.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newNodesUsageFunc(t Transport) NodesUsage { // NodesUsage returns low-level information about REST actions usage on nodes. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html. // type NodesUsage func(o ...func(*NodesUsageRequest)) (*Response, error) diff --git a/esapi/api.ping.go b/esapi/api.ping.go index c207e80bf6..221931ba65 100755 --- a/esapi/api.ping.go +++ b/esapi/api.ping.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,7 @@ func newPingFunc(t Transport) Ping { // Ping returns whether the cluster is running. // -// See full documentation at http://www.elastic.co/guide/. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html. // type Ping func(o ...func(*PingRequest)) (*Response, error) diff --git a/esapi/api.put_script.go b/esapi/api.put_script.go index cd95734c05..0893d56f70 100755 --- a/esapi/api.put_script.go +++ b/esapi/api.put_script.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newPutScriptFunc(t Transport) PutScript { // PutScript creates or updates a script. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html. // type PutScript func(id string, body io.Reader, o ...func(*PutScriptRequest)) (*Response, error) diff --git a/esapi/api.rank_eval.go b/esapi/api.rank_eval.go index 1771f26753..d8518940b2 100755 --- a/esapi/api.rank_eval.go +++ b/esapi/api.rank_eval.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.reindex.go b/esapi/api.reindex.go index b174cf5b9e..e0d9e301e0 100755 --- a/esapi/api.reindex.go +++ b/esapi/api.reindex.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.reindex_rethrottle.go b/esapi/api.reindex_rethrottle.go index 7cf01d1f1c..3fc3ff08aa 100755 --- a/esapi/api.reindex_rethrottle.go +++ b/esapi/api.reindex_rethrottle.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.render_search_template.go b/esapi/api.render_search_template.go index 6c7bb50d01..75effc9ca9 100755 --- a/esapi/api.render_search_template.go +++ b/esapi/api.render_search_template.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newRenderSearchTemplateFunc(t Transport) RenderSearchTemplate { // RenderSearchTemplate allows to use the Mustache language to pre-render a search definition. // -// See full documentation at http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html#_validating_templates. // type RenderSearchTemplate func(o ...func(*RenderSearchTemplateRequest)) (*Response, error) diff --git a/esapi/api.scripts_painless_execute.go b/esapi/api.scripts_painless_execute.go index 70f0fd76f1..cd1c5638bc 100755 --- a/esapi/api.scripts_painless_execute.go +++ b/esapi/api.scripts_painless_execute.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.scroll.go b/esapi/api.scroll.go index 16388160f9..eec5b1255c 100755 --- a/esapi/api.scroll.go +++ b/esapi/api.scroll.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newScrollFunc(t Transport) Scroll { // Scroll allows to retrieve a large numbers of results from a single search request. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll. // type Scroll func(o ...func(*ScrollRequest)) (*Response, error) diff --git a/esapi/api.search.go b/esapi/api.search.go index 254ded79ce..87b59a94c5 100755 --- a/esapi/api.search.go +++ b/esapi/api.search.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -26,7 +26,7 @@ func newSearchFunc(t Transport) Search { // Search returns results matching a query. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html. // type Search func(o ...func(*SearchRequest)) (*Response, error) diff --git a/esapi/api.search_shards.go b/esapi/api.search_shards.go index c5e7fe0742..9b4a04095b 100755 --- a/esapi/api.search_shards.go +++ b/esapi/api.search_shards.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newSearchShardsFunc(t Transport) SearchShards { // SearchShards returns information about the indices and shards that a search request would be executed against. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html. // type SearchShards func(o ...func(*SearchShardsRequest)) (*Response, error) diff --git a/esapi/api.search_template.go b/esapi/api.search_template.go index 33caf6fd4c..64aacff3db 100755 --- a/esapi/api.search_template.go +++ b/esapi/api.search_template.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newSearchTemplateFunc(t Transport) SearchTemplate { // SearchTemplate allows to use the Mustache language to pre-render a search definition. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html. // type SearchTemplate func(body io.Reader, o ...func(*SearchTemplateRequest)) (*Response, error) @@ -37,19 +37,18 @@ type SearchTemplateRequest struct { Body io.Reader - AllowNoIndices *bool - CcsMinimizeRoundtrips *bool - ExpandWildcards string - Explain *bool - IgnoreThrottled *bool - IgnoreUnavailable *bool - Preference string - Profile *bool - RestTotalHitsAsInt *bool - Routing []string - Scroll time.Duration - SearchType string - TypedKeys *bool + AllowNoIndices *bool + ExpandWildcards string + Explain *bool + IgnoreThrottled *bool + IgnoreUnavailable *bool + Preference string + Profile *bool + RestTotalHitsAsInt *bool + Routing []string + Scroll time.Duration + SearchType string + TypedKeys *bool Pretty bool Human bool @@ -92,10 +91,6 @@ func (r SearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Re params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.CcsMinimizeRoundtrips != nil { - params["ccs_minimize_roundtrips"] = strconv.FormatBool(*r.CcsMinimizeRoundtrips) - } - if r.ExpandWildcards != "" { params["expand_wildcards"] = r.ExpandWildcards } @@ -232,14 +227,6 @@ func (f SearchTemplate) WithAllowNoIndices(v bool) func(*SearchTemplateRequest) } } -// WithCcsMinimizeRoundtrips - indicates whether network round-trips should be minimized as part of cross-cluster search requests execution. -// -func (f SearchTemplate) WithCcsMinimizeRoundtrips(v bool) func(*SearchTemplateRequest) { - return func(r *SearchTemplateRequest) { - r.CcsMinimizeRoundtrips = &v - } -} - // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. // func (f SearchTemplate) WithExpandWildcards(v string) func(*SearchTemplateRequest) { diff --git a/esapi/api.snapshot.cleanup_repository.go b/esapi/api.snapshot.cleanup_repository.go new file mode 100755 index 0000000000..13942e8cbf --- /dev/null +++ b/esapi/api.snapshot.cleanup_repository.go @@ -0,0 +1,215 @@ +// Code generated from specification version 7.4.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" + "time" +) + +func newSnapshotCleanupRepositoryFunc(t Transport) SnapshotCleanupRepository { + return func(repository string, o ...func(*SnapshotCleanupRepositoryRequest)) (*Response, error) { + var r = SnapshotCleanupRepositoryRequest{Repository: repository} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SnapshotCleanupRepository removes stale data from repository. +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// +type SnapshotCleanupRepository func(repository string, o ...func(*SnapshotCleanupRepositoryRequest)) (*Response, error) + +// SnapshotCleanupRepositoryRequest configures the Snapshot Cleanup Repository API request. +// +type SnapshotCleanupRepositoryRequest struct { + Body io.Reader + + Repository string + + MasterTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SnapshotCleanupRepositoryRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_snapshot") + 1 + len(r.Repository) + 1 + len("_cleanup")) + path.WriteString("/") + path.WriteString("_snapshot") + path.WriteString("/") + path.WriteString(r.Repository) + path.WriteString("/") + path.WriteString("_cleanup") + + params = make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SnapshotCleanupRepository) WithContext(v context.Context) func(*SnapshotCleanupRepositoryRequest) { + return func(r *SnapshotCleanupRepositoryRequest) { + r.ctx = v + } +} + +// WithBody - . +// +func (f SnapshotCleanupRepository) WithBody(v io.Reader) func(*SnapshotCleanupRepositoryRequest) { + return func(r *SnapshotCleanupRepositoryRequest) { + r.Body = v + } +} + +// WithMasterTimeout - explicit operation timeout for connection to master node. +// +func (f SnapshotCleanupRepository) WithMasterTimeout(v time.Duration) func(*SnapshotCleanupRepositoryRequest) { + return func(r *SnapshotCleanupRepositoryRequest) { + r.MasterTimeout = v + } +} + +// WithTimeout - explicit operation timeout. +// +func (f SnapshotCleanupRepository) WithTimeout(v time.Duration) func(*SnapshotCleanupRepositoryRequest) { + return func(r *SnapshotCleanupRepositoryRequest) { + r.Timeout = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SnapshotCleanupRepository) WithPretty() func(*SnapshotCleanupRepositoryRequest) { + return func(r *SnapshotCleanupRepositoryRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SnapshotCleanupRepository) WithHuman() func(*SnapshotCleanupRepositoryRequest) { + return func(r *SnapshotCleanupRepositoryRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SnapshotCleanupRepository) WithErrorTrace() func(*SnapshotCleanupRepositoryRequest) { + return func(r *SnapshotCleanupRepositoryRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SnapshotCleanupRepository) WithFilterPath(v ...string) func(*SnapshotCleanupRepositoryRequest) { + return func(r *SnapshotCleanupRepositoryRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SnapshotCleanupRepository) WithHeader(h map[string]string) func(*SnapshotCleanupRepositoryRequest) { + return func(r *SnapshotCleanupRepositoryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.snapshot.create.go b/esapi/api.snapshot.create.go index f0e7a1a330..4135fc9cd6 100755 --- a/esapi/api.snapshot.create.go +++ b/esapi/api.snapshot.create.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newSnapshotCreateFunc(t Transport) SnapshotCreate { // SnapshotCreate creates a snapshot in a repository. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. // type SnapshotCreate func(repository string, snapshot string, o ...func(*SnapshotCreateRequest)) (*Response, error) diff --git a/esapi/api.snapshot.create_repository.go b/esapi/api.snapshot.create_repository.go index 4da5f4c82d..e0b65a8c2a 100755 --- a/esapi/api.snapshot.create_repository.go +++ b/esapi/api.snapshot.create_repository.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newSnapshotCreateRepositoryFunc(t Transport) SnapshotCreateRepository { // SnapshotCreateRepository creates a repository. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. // type SnapshotCreateRepository func(repository string, body io.Reader, o ...func(*SnapshotCreateRepositoryRequest)) (*Response, error) diff --git a/esapi/api.snapshot.delete.go b/esapi/api.snapshot.delete.go index dde7a9c042..8afeaebd35 100755 --- a/esapi/api.snapshot.delete.go +++ b/esapi/api.snapshot.delete.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newSnapshotDeleteFunc(t Transport) SnapshotDelete { // SnapshotDelete deletes a snapshot. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. // type SnapshotDelete func(repository string, snapshot string, o ...func(*SnapshotDeleteRequest)) (*Response, error) diff --git a/esapi/api.snapshot.delete_repository.go b/esapi/api.snapshot.delete_repository.go index 710aef1e41..b2f65726ea 100755 --- a/esapi/api.snapshot.delete_repository.go +++ b/esapi/api.snapshot.delete_repository.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newSnapshotDeleteRepositoryFunc(t Transport) SnapshotDeleteRepository { // SnapshotDeleteRepository deletes a repository. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. // type SnapshotDeleteRepository func(repository []string, o ...func(*SnapshotDeleteRepositoryRequest)) (*Response, error) diff --git a/esapi/api.snapshot.get.go b/esapi/api.snapshot.get.go index 120bd3aa62..2d1fe5de10 100755 --- a/esapi/api.snapshot.get.go +++ b/esapi/api.snapshot.get.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newSnapshotGetFunc(t Transport) SnapshotGet { // SnapshotGet returns information about a snapshot. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. // type SnapshotGet func(repository string, snapshot []string, o ...func(*SnapshotGetRequest)) (*Response, error) diff --git a/esapi/api.snapshot.get_repository.go b/esapi/api.snapshot.get_repository.go index d03ad3df3c..1a9fa44976 100755 --- a/esapi/api.snapshot.get_repository.go +++ b/esapi/api.snapshot.get_repository.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newSnapshotGetRepositoryFunc(t Transport) SnapshotGetRepository { // SnapshotGetRepository returns information about a repository. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. // type SnapshotGetRepository func(o ...func(*SnapshotGetRepositoryRequest)) (*Response, error) diff --git a/esapi/api.snapshot.restore.go b/esapi/api.snapshot.restore.go index 5f6f2d3878..70727519cb 100755 --- a/esapi/api.snapshot.restore.go +++ b/esapi/api.snapshot.restore.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newSnapshotRestoreFunc(t Transport) SnapshotRestore { // SnapshotRestore restores a snapshot. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. // type SnapshotRestore func(repository string, snapshot string, o ...func(*SnapshotRestoreRequest)) (*Response, error) diff --git a/esapi/api.snapshot.status.go b/esapi/api.snapshot.status.go index 725e820e26..a86d5209d5 100755 --- a/esapi/api.snapshot.status.go +++ b/esapi/api.snapshot.status.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newSnapshotStatusFunc(t Transport) SnapshotStatus { // SnapshotStatus returns information about the status of a snapshot. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. // type SnapshotStatus func(o ...func(*SnapshotStatusRequest)) (*Response, error) diff --git a/esapi/api.snapshot.verify_repository.go b/esapi/api.snapshot.verify_repository.go index ab55dcff67..3cdc227417 100755 --- a/esapi/api.snapshot.verify_repository.go +++ b/esapi/api.snapshot.verify_repository.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,7 @@ func newSnapshotVerifyRepositoryFunc(t Transport) SnapshotVerifyRepository { // SnapshotVerifyRepository verifies a repository. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. // type SnapshotVerifyRepository func(repository string, o ...func(*SnapshotVerifyRepositoryRequest)) (*Response, error) diff --git a/esapi/api.tasks.cancel.go b/esapi/api.tasks.cancel.go index c9dfffd04e..fb52cffdc3 100755 --- a/esapi/api.tasks.cancel.go +++ b/esapi/api.tasks.cancel.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,7 @@ func newTasksCancelFunc(t Transport) TasksCancel { // TasksCancel cancels a task, if it can be cancelled through an API. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. // type TasksCancel func(o ...func(*TasksCancelRequest)) (*Response, error) diff --git a/esapi/api.tasks.get.go b/esapi/api.tasks.get.go index 490d0be71f..3827643658 100755 --- a/esapi/api.tasks.get.go +++ b/esapi/api.tasks.get.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newTasksGetFunc(t Transport) TasksGet { // TasksGet returns information about a task. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. // type TasksGet func(task_id string, o ...func(*TasksGetRequest)) (*Response, error) diff --git a/esapi/api.tasks.list.go b/esapi/api.tasks.list.go index 15b945d1a8..d226d54b0a 100755 --- a/esapi/api.tasks.list.go +++ b/esapi/api.tasks.list.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newTasksListFunc(t Transport) TasksList { // TasksList returns a list of tasks. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. // type TasksList func(o ...func(*TasksListRequest)) (*Response, error) diff --git a/esapi/api.termvectors.go b/esapi/api.termvectors.go index 6d248f241e..7f5a8b8660 100755 --- a/esapi/api.termvectors.go +++ b/esapi/api.termvectors.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -24,7 +24,7 @@ func newTermvectorsFunc(t Transport) Termvectors { // Termvectors returns information and statistics about terms in the fields of a particular document. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html. // type Termvectors func(index string, o ...func(*TermvectorsRequest)) (*Response, error) diff --git a/esapi/api.update.go b/esapi/api.update.go index b677616479..a90c43cbfa 100755 --- a/esapi/api.update.go +++ b/esapi/api.update.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -25,7 +25,7 @@ func newUpdateFunc(t Transport) Update { // Update updates a document with a script or partial document. // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html. // type Update func(index string, id string, body io.Reader, o ...func(*UpdateRequest)) (*Response, error) diff --git a/esapi/api.update_by_query.go b/esapi/api.update_by_query.go index 404cc0be25..eb76f56f3d 100755 --- a/esapi/api.update_by_query.go +++ b/esapi/api.update_by_query.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.update_by_query_rethrottle.go b/esapi/api.update_by_query_rethrottle.go index 1aa8b47fce..60b28bad1d 100755 --- a/esapi/api.update_by_query_rethrottle.go +++ b/esapi/api.update_by_query_rethrottle.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go index cbaa10d99d..ab1b07e86e 100755 --- a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newCCRDeleteAutoFollowPatternFunc(t Transport) CCRDeleteAutoFollowPattern { // ----- API Definition ------------------------------------------------------- -// CCRDeleteAutoFollowPattern - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html +// CCRDeleteAutoFollowPattern - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html. // type CCRDeleteAutoFollowPattern func(name string, o ...func(*CCRDeleteAutoFollowPatternRequest)) (*Response, error) diff --git a/esapi/api.xpack.ccr.follow.go b/esapi/api.xpack.ccr.follow.go index dd1f25dd20..aabf5ecc40 100755 --- a/esapi/api.xpack.ccr.follow.go +++ b/esapi/api.xpack.ccr.follow.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newCCRFollowFunc(t Transport) CCRFollow { // ----- API Definition ------------------------------------------------------- -// CCRFollow - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html +// CCRFollow - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html. // type CCRFollow func(index string, body io.Reader, o ...func(*CCRFollowRequest)) (*Response, error) diff --git a/esapi/api.xpack.ccr.follow_info.go b/esapi/api.xpack.ccr.follow_info.go index a4fd5411f2..1c22cd0d47 100755 --- a/esapi/api.xpack.ccr.follow_info.go +++ b/esapi/api.xpack.ccr.follow_info.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -9,8 +9,8 @@ import ( ) func newCCRFollowInfoFunc(t Transport) CCRFollowInfo { - return func(o ...func(*CCRFollowInfoRequest)) (*Response, error) { - var r = CCRFollowInfoRequest{} + return func(index []string, o ...func(*CCRFollowInfoRequest)) (*Response, error) { + var r = CCRFollowInfoRequest{Index: index} for _, f := range o { f(&r) } @@ -20,9 +20,11 @@ func newCCRFollowInfoFunc(t Transport) CCRFollowInfo { // ----- API Definition ------------------------------------------------------- -// CCRFollowInfo - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html +// CCRFollowInfo - // -type CCRFollowInfo func(o ...func(*CCRFollowInfoRequest)) (*Response, error) +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html. +// +type CCRFollowInfo func(index []string, o ...func(*CCRFollowInfoRequest)) (*Response, error) // CCRFollowInfoRequest configures the CCR Follow Info API request. // @@ -51,10 +53,8 @@ func (r CCRFollowInfoRequest) Do(ctx context.Context, transport Transport) (*Res method = "GET" path.Grow(1 + len(strings.Join(r.Index, ",")) + 1 + len("_ccr") + 1 + len("info")) - if len(r.Index) > 0 { - path.WriteString("/") - path.WriteString(strings.Join(r.Index, ",")) - } + path.WriteString("/") + path.WriteString(strings.Join(r.Index, ",")) path.WriteString("/") path.WriteString("_ccr") path.WriteString("/") @@ -126,14 +126,6 @@ func (f CCRFollowInfo) WithContext(v context.Context) func(*CCRFollowInfoRequest } } -// WithIndex - a list of index patterns; use `_all` to perform the operation on all indices. -// -func (f CCRFollowInfo) WithIndex(v ...string) func(*CCRFollowInfoRequest) { - return func(r *CCRFollowInfoRequest) { - r.Index = v - } -} - // WithPretty makes the response body pretty-printed. // func (f CCRFollowInfo) WithPretty() func(*CCRFollowInfoRequest) { diff --git a/esapi/api.xpack.ccr.follow_stats.go b/esapi/api.xpack.ccr.follow_stats.go index e6ae84e7f5..fd02f5e740 100755 --- a/esapi/api.xpack.ccr.follow_stats.go +++ b/esapi/api.xpack.ccr.follow_stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newCCRFollowStatsFunc(t Transport) CCRFollowStats { // ----- API Definition ------------------------------------------------------- -// CCRFollowStats - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html +// CCRFollowStats - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html. // type CCRFollowStats func(index []string, o ...func(*CCRFollowStatsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ccr.forget_follower.go b/esapi/api.xpack.ccr.forget_follower.go index bca9ce1ed1..753f5d1869 100755 --- a/esapi/api.xpack.ccr.forget_follower.go +++ b/esapi/api.xpack.ccr.forget_follower.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newCCRForgetFollowerFunc(t Transport) CCRForgetFollower { // ----- API Definition ------------------------------------------------------- -// CCRForgetFollower - http://www.elastic.co/guide/en/elasticsearch/reference/current +// CCRForgetFollower - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current. // type CCRForgetFollower func(index string, body io.Reader, o ...func(*CCRForgetFollowerRequest)) (*Response, error) diff --git a/esapi/api.xpack.ccr.get_auto_follow_pattern.go b/esapi/api.xpack.ccr.get_auto_follow_pattern.go index 39f20cd59d..c4aba9e17c 100755 --- a/esapi/api.xpack.ccr.get_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.get_auto_follow_pattern.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newCCRGetAutoFollowPatternFunc(t Transport) CCRGetAutoFollowPattern { // ----- API Definition ------------------------------------------------------- -// CCRGetAutoFollowPattern - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html +// CCRGetAutoFollowPattern - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html. // type CCRGetAutoFollowPattern func(o ...func(*CCRGetAutoFollowPatternRequest)) (*Response, error) diff --git a/esapi/api.xpack.ccr.pause_follow.go b/esapi/api.xpack.ccr.pause_follow.go index a81d94b820..1b3da90c05 100755 --- a/esapi/api.xpack.ccr.pause_follow.go +++ b/esapi/api.xpack.ccr.pause_follow.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newCCRPauseFollowFunc(t Transport) CCRPauseFollow { // ----- API Definition ------------------------------------------------------- -// CCRPauseFollow - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html +// CCRPauseFollow - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html. // type CCRPauseFollow func(index string, o ...func(*CCRPauseFollowRequest)) (*Response, error) diff --git a/esapi/api.xpack.ccr.put_auto_follow_pattern.go b/esapi/api.xpack.ccr.put_auto_follow_pattern.go index 62a5d70365..4642cea358 100755 --- a/esapi/api.xpack.ccr.put_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.put_auto_follow_pattern.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newCCRPutAutoFollowPatternFunc(t Transport) CCRPutAutoFollowPattern { // ----- API Definition ------------------------------------------------------- -// CCRPutAutoFollowPattern - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html +// CCRPutAutoFollowPattern - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html. // type CCRPutAutoFollowPattern func(name string, body io.Reader, o ...func(*CCRPutAutoFollowPatternRequest)) (*Response, error) diff --git a/esapi/api.xpack.ccr.resume_follow.go b/esapi/api.xpack.ccr.resume_follow.go index 8c4e17147c..d29b5f08cd 100755 --- a/esapi/api.xpack.ccr.resume_follow.go +++ b/esapi/api.xpack.ccr.resume_follow.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newCCRResumeFollowFunc(t Transport) CCRResumeFollow { // ----- API Definition ------------------------------------------------------- -// CCRResumeFollow - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html +// CCRResumeFollow - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html. // type CCRResumeFollow func(index string, o ...func(*CCRResumeFollowRequest)) (*Response, error) diff --git a/esapi/api.xpack.ccr.stats.go b/esapi/api.xpack.ccr.stats.go index e9312d18f0..365bc3d924 100755 --- a/esapi/api.xpack.ccr.stats.go +++ b/esapi/api.xpack.ccr.stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newCCRStatsFunc(t Transport) CCRStats { // ----- API Definition ------------------------------------------------------- -// CCRStats - https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html +// CCRStats - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html. // type CCRStats func(o ...func(*CCRStatsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ccr.unfollow.go b/esapi/api.xpack.ccr.unfollow.go index ed661327c0..9b0401e3f7 100755 --- a/esapi/api.xpack.ccr.unfollow.go +++ b/esapi/api.xpack.ccr.unfollow.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newCCRUnfollowFunc(t Transport) CCRUnfollow { // ----- API Definition ------------------------------------------------------- -// CCRUnfollow - http://www.elastic.co/guide/en/elasticsearch/reference/current +// CCRUnfollow - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current. // type CCRUnfollow func(index string, o ...func(*CCRUnfollowRequest)) (*Response, error) diff --git a/esapi/api.xpack.data_frame.delete_data_frame_transform.go b/esapi/api.xpack.data_frame.delete_data_frame_transform.go index b817981a91..03b5071577 100755 --- a/esapi/api.xpack.data_frame.delete_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.delete_data_frame_transform.go @@ -1,10 +1,11 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi import ( "context" "net/http" + "strconv" "strings" ) @@ -20,7 +21,9 @@ func newDataFrameDeleteDataFrameTransformFunc(t Transport) DataFrameDeleteDataFr // ----- API Definition ------------------------------------------------------- -// DataFrameDeleteDataFrameTransform - https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-data-frame-transform.html +// DataFrameDeleteDataFrameTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html. // type DataFrameDeleteDataFrameTransform func(transform_id string, o ...func(*DataFrameDeleteDataFrameTransformRequest)) (*Response, error) @@ -29,6 +32,8 @@ type DataFrameDeleteDataFrameTransform func(transform_id string, o ...func(*Data type DataFrameDeleteDataFrameTransformRequest struct { TransformID string + Force *bool + Pretty bool Human bool ErrorTrace bool @@ -60,6 +65,10 @@ func (r DataFrameDeleteDataFrameTransformRequest) Do(ctx context.Context, transp params = make(map[string]string) + if r.Force != nil { + params["force"] = strconv.FormatBool(*r.Force) + } + if r.Pretty { params["pretty"] = "true" } @@ -124,6 +133,14 @@ func (f DataFrameDeleteDataFrameTransform) WithContext(v context.Context) func(* } } +// WithForce - when `true`, the transform is deleted regardless of its current state. the default value is `false`, meaning that the transform must be `stopped` before it can be deleted.. +// +func (f DataFrameDeleteDataFrameTransform) WithForce(v bool) func(*DataFrameDeleteDataFrameTransformRequest) { + return func(r *DataFrameDeleteDataFrameTransformRequest) { + r.Force = &v + } +} + // WithPretty makes the response body pretty-printed. // func (f DataFrameDeleteDataFrameTransform) WithPretty() func(*DataFrameDeleteDataFrameTransformRequest) { diff --git a/esapi/api.xpack.data_frame.get_data_frame_transform.go b/esapi/api.xpack.data_frame.get_data_frame_transform.go index 4e07989d17..521c9bf73e 100755 --- a/esapi/api.xpack.data_frame.get_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.get_data_frame_transform.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newDataFrameGetDataFrameTransformFunc(t Transport) DataFrameGetDataFrameTra // ----- API Definition ------------------------------------------------------- -// DataFrameGetDataFrameTransform - https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html +// DataFrameGetDataFrameTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html. // type DataFrameGetDataFrameTransform func(o ...func(*DataFrameGetDataFrameTransformRequest)) (*Response, error) diff --git a/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go b/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go index e18d2d9810..4b0377e043 100755 --- a/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go +++ b/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -10,8 +10,8 @@ import ( ) func newDataFrameGetDataFrameTransformStatsFunc(t Transport) DataFrameGetDataFrameTransformStats { - return func(o ...func(*DataFrameGetDataFrameTransformStatsRequest)) (*Response, error) { - var r = DataFrameGetDataFrameTransformStatsRequest{} + return func(transform_id string, o ...func(*DataFrameGetDataFrameTransformStatsRequest)) (*Response, error) { + var r = DataFrameGetDataFrameTransformStatsRequest{TransformID: transform_id} for _, f := range o { f(&r) } @@ -21,9 +21,11 @@ func newDataFrameGetDataFrameTransformStatsFunc(t Transport) DataFrameGetDataFra // ----- API Definition ------------------------------------------------------- -// DataFrameGetDataFrameTransformStats - https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html +// DataFrameGetDataFrameTransformStats - // -type DataFrameGetDataFrameTransformStats func(o ...func(*DataFrameGetDataFrameTransformStatsRequest)) (*Response, error) +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html. +// +type DataFrameGetDataFrameTransformStats func(transform_id string, o ...func(*DataFrameGetDataFrameTransformStatsRequest)) (*Response, error) // DataFrameGetDataFrameTransformStatsRequest configures the Data Frame Get Data Frame Transform Stats API request. // @@ -60,10 +62,8 @@ func (r DataFrameGetDataFrameTransformStatsRequest) Do(ctx context.Context, tran path.WriteString("_data_frame") path.WriteString("/") path.WriteString("transforms") - if r.TransformID != "" { - path.WriteString("/") - path.WriteString(r.TransformID) - } + path.WriteString("/") + path.WriteString(r.TransformID) path.WriteString("/") path.WriteString("_stats") @@ -145,14 +145,6 @@ func (f DataFrameGetDataFrameTransformStats) WithContext(v context.Context) func } } -// WithTransformID - the ID of the transform for which to get stats. '_all' or '*' implies all transforms. -// -func (f DataFrameGetDataFrameTransformStats) WithTransformID(v string) func(*DataFrameGetDataFrameTransformStatsRequest) { - return func(r *DataFrameGetDataFrameTransformStatsRequest) { - r.TransformID = v - } -} - // WithAllowNoMatch - whether to ignore if a wildcard expression matches no data frame transforms. (this includes `_all` string or when no data frame transforms have been specified). // func (f DataFrameGetDataFrameTransformStats) WithAllowNoMatch(v bool) func(*DataFrameGetDataFrameTransformStatsRequest) { diff --git a/esapi/api.xpack.data_frame.preview_data_frame_transform.go b/esapi/api.xpack.data_frame.preview_data_frame_transform.go index c8be8bef82..27323a0994 100755 --- a/esapi/api.xpack.data_frame.preview_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.preview_data_frame_transform.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newDataFramePreviewDataFrameTransformFunc(t Transport) DataFramePreviewData // ----- API Definition ------------------------------------------------------- -// DataFramePreviewDataFrameTransform - https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html +// DataFramePreviewDataFrameTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html. // type DataFramePreviewDataFrameTransform func(body io.Reader, o ...func(*DataFramePreviewDataFrameTransformRequest)) (*Response, error) diff --git a/esapi/api.xpack.data_frame.put_data_frame_transform.go b/esapi/api.xpack.data_frame.put_data_frame_transform.go index 18c409db4b..146f0868da 100755 --- a/esapi/api.xpack.data_frame.put_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.put_data_frame_transform.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -6,6 +6,7 @@ import ( "context" "io" "net/http" + "strconv" "strings" ) @@ -21,7 +22,9 @@ func newDataFramePutDataFrameTransformFunc(t Transport) DataFramePutDataFrameTra // ----- API Definition ------------------------------------------------------- -// DataFramePutDataFrameTransform - https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html +// DataFramePutDataFrameTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html. // type DataFramePutDataFrameTransform func(body io.Reader, transform_id string, o ...func(*DataFramePutDataFrameTransformRequest)) (*Response, error) @@ -32,6 +35,8 @@ type DataFramePutDataFrameTransformRequest struct { TransformID string + DeferValidation *bool + Pretty bool Human bool ErrorTrace bool @@ -63,6 +68,10 @@ func (r DataFramePutDataFrameTransformRequest) Do(ctx context.Context, transport params = make(map[string]string) + if r.DeferValidation != nil { + params["defer_validation"] = strconv.FormatBool(*r.DeferValidation) + } + if r.Pretty { params["pretty"] = "true" } @@ -131,6 +140,14 @@ func (f DataFramePutDataFrameTransform) WithContext(v context.Context) func(*Dat } } +// WithDeferValidation - if validations should be deferred until data frame transform starts, defaults to false.. +// +func (f DataFramePutDataFrameTransform) WithDeferValidation(v bool) func(*DataFramePutDataFrameTransformRequest) { + return func(r *DataFramePutDataFrameTransformRequest) { + r.DeferValidation = &v + } +} + // WithPretty makes the response body pretty-printed. // func (f DataFramePutDataFrameTransform) WithPretty() func(*DataFramePutDataFrameTransformRequest) { diff --git a/esapi/api.xpack.data_frame.start_data_frame_transform.go b/esapi/api.xpack.data_frame.start_data_frame_transform.go index 1dcd1e648f..692a075c89 100755 --- a/esapi/api.xpack.data_frame.start_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.start_data_frame_transform.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newDataFrameStartDataFrameTransformFunc(t Transport) DataFrameStartDataFram // ----- API Definition ------------------------------------------------------- -// DataFrameStartDataFrameTransform - https://www.elastic.co/guide/en/elasticsearch/reference/current/start-data-frame-transform.html +// DataFrameStartDataFrameTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html. // type DataFrameStartDataFrameTransform func(transform_id string, o ...func(*DataFrameStartDataFrameTransformRequest)) (*Response, error) diff --git a/esapi/api.xpack.data_frame.stop_data_frame_transform.go b/esapi/api.xpack.data_frame.stop_data_frame_transform.go index 0f9c6b2e87..6ba02bad94 100755 --- a/esapi/api.xpack.data_frame.stop_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.stop_data_frame_transform.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,9 @@ func newDataFrameStopDataFrameTransformFunc(t Transport) DataFrameStopDataFrameT // ----- API Definition ------------------------------------------------------- -// DataFrameStopDataFrameTransform - https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html +// DataFrameStopDataFrameTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html. // type DataFrameStopDataFrameTransform func(transform_id string, o ...func(*DataFrameStopDataFrameTransformRequest)) (*Response, error) diff --git a/esapi/api.xpack.data_frame.update_data_frame_transform.go b/esapi/api.xpack.data_frame.update_data_frame_transform.go new file mode 100755 index 0000000000..9d2055b231 --- /dev/null +++ b/esapi/api.xpack.data_frame.update_data_frame_transform.go @@ -0,0 +1,196 @@ +// Code generated from specification version 7.4.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" +) + +func newDataFrameUpdateDataFrameTransformFunc(t Transport) DataFrameUpdateDataFrameTransform { + return func(body io.Reader, transform_id string, o ...func(*DataFrameUpdateDataFrameTransformRequest)) (*Response, error) { + var r = DataFrameUpdateDataFrameTransformRequest{Body: body, TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFrameUpdateDataFrameTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html. +// +type DataFrameUpdateDataFrameTransform func(body io.Reader, transform_id string, o ...func(*DataFrameUpdateDataFrameTransformRequest)) (*Response, error) + +// DataFrameUpdateDataFrameTransformRequest configures the Data Frame Update Data Frame Transform API request. +// +type DataFrameUpdateDataFrameTransformRequest struct { + Body io.Reader + + TransformID string + + DeferValidation *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFrameUpdateDataFrameTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_data_frame") + 1 + len("transforms") + 1 + len(r.TransformID) + 1 + len("_update")) + path.WriteString("/") + path.WriteString("_data_frame") + path.WriteString("/") + path.WriteString("transforms") + path.WriteString("/") + path.WriteString(r.TransformID) + path.WriteString("/") + path.WriteString("_update") + + params = make(map[string]string) + + if r.DeferValidation != nil { + params["defer_validation"] = strconv.FormatBool(*r.DeferValidation) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFrameUpdateDataFrameTransform) WithContext(v context.Context) func(*DataFrameUpdateDataFrameTransformRequest) { + return func(r *DataFrameUpdateDataFrameTransformRequest) { + r.ctx = v + } +} + +// WithDeferValidation - if validations should be deferred until data frame transform starts, defaults to false.. +// +func (f DataFrameUpdateDataFrameTransform) WithDeferValidation(v bool) func(*DataFrameUpdateDataFrameTransformRequest) { + return func(r *DataFrameUpdateDataFrameTransformRequest) { + r.DeferValidation = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFrameUpdateDataFrameTransform) WithPretty() func(*DataFrameUpdateDataFrameTransformRequest) { + return func(r *DataFrameUpdateDataFrameTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFrameUpdateDataFrameTransform) WithHuman() func(*DataFrameUpdateDataFrameTransformRequest) { + return func(r *DataFrameUpdateDataFrameTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFrameUpdateDataFrameTransform) WithErrorTrace() func(*DataFrameUpdateDataFrameTransformRequest) { + return func(r *DataFrameUpdateDataFrameTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFrameUpdateDataFrameTransform) WithFilterPath(v ...string) func(*DataFrameUpdateDataFrameTransformRequest) { + return func(r *DataFrameUpdateDataFrameTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFrameUpdateDataFrameTransform) WithHeader(h map[string]string) func(*DataFrameUpdateDataFrameTransformRequest) { + return func(r *DataFrameUpdateDataFrameTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.graph.explore.go b/esapi/api.xpack.graph.explore.go index 03a84fa123..a890123605 100755 --- a/esapi/api.xpack.graph.explore.go +++ b/esapi/api.xpack.graph.explore.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -11,8 +11,8 @@ import ( ) func newGraphExploreFunc(t Transport) GraphExplore { - return func(o ...func(*GraphExploreRequest)) (*Response, error) { - var r = GraphExploreRequest{} + return func(index []string, o ...func(*GraphExploreRequest)) (*Response, error) { + var r = GraphExploreRequest{Index: index} for _, f := range o { f(&r) } @@ -22,9 +22,11 @@ func newGraphExploreFunc(t Transport) GraphExplore { // ----- API Definition ------------------------------------------------------- -// GraphExplore - https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html +// GraphExplore - // -type GraphExplore func(o ...func(*GraphExploreRequest)) (*Response, error) +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html. +// +type GraphExplore func(index []string, o ...func(*GraphExploreRequest)) (*Response, error) // GraphExploreRequest configures the Graph Explore API request. // @@ -59,10 +61,8 @@ func (r GraphExploreRequest) Do(ctx context.Context, transport Transport) (*Resp method = "GET" path.Grow(1 + len(strings.Join(r.Index, ",")) + 1 + len(strings.Join(r.DocumentType, ",")) + 1 + len("_graph") + 1 + len("explore")) - if len(r.Index) > 0 { - path.WriteString("/") - path.WriteString(strings.Join(r.Index, ",")) - } + path.WriteString("/") + path.WriteString(strings.Join(r.Index, ",")) if len(r.DocumentType) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.DocumentType, ",")) @@ -158,14 +158,6 @@ func (f GraphExplore) WithBody(v io.Reader) func(*GraphExploreRequest) { } } -// WithIndex - a list of index names to search; use _all to perform the operation on all indices. -// -func (f GraphExplore) WithIndex(v ...string) func(*GraphExploreRequest) { - return func(r *GraphExploreRequest) { - r.Index = v - } -} - // WithDocumentType - a list of document types to search; leave empty to perform the operation on all types. // func (f GraphExplore) WithDocumentType(v ...string) func(*GraphExploreRequest) { diff --git a/esapi/api.xpack.ilm.delete_lifecycle.go b/esapi/api.xpack.ilm.delete_lifecycle.go index ed0ea5c3be..7c1037bcb7 100755 --- a/esapi/api.xpack.ilm.delete_lifecycle.go +++ b/esapi/api.xpack.ilm.delete_lifecycle.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -9,8 +9,8 @@ import ( ) func newILMDeleteLifecycleFunc(t Transport) ILMDeleteLifecycle { - return func(o ...func(*ILMDeleteLifecycleRequest)) (*Response, error) { - var r = ILMDeleteLifecycleRequest{} + return func(policy string, o ...func(*ILMDeleteLifecycleRequest)) (*Response, error) { + var r = ILMDeleteLifecycleRequest{Policy: policy} for _, f := range o { f(&r) } @@ -20,9 +20,11 @@ func newILMDeleteLifecycleFunc(t Transport) ILMDeleteLifecycle { // ----- API Definition ------------------------------------------------------- -// ILMDeleteLifecycle - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html +// ILMDeleteLifecycle - // -type ILMDeleteLifecycle func(o ...func(*ILMDeleteLifecycleRequest)) (*Response, error) +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html. +// +type ILMDeleteLifecycle func(policy string, o ...func(*ILMDeleteLifecycleRequest)) (*Response, error) // ILMDeleteLifecycleRequest configures the ILM Delete Lifecycle API request. // @@ -55,10 +57,8 @@ func (r ILMDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) path.WriteString("_ilm") path.WriteString("/") path.WriteString("policy") - if r.Policy != "" { - path.WriteString("/") - path.WriteString(r.Policy) - } + path.WriteString("/") + path.WriteString(r.Policy) params = make(map[string]string) @@ -126,14 +126,6 @@ func (f ILMDeleteLifecycle) WithContext(v context.Context) func(*ILMDeleteLifecy } } -// WithPolicy - the name of the index lifecycle policy. -// -func (f ILMDeleteLifecycle) WithPolicy(v string) func(*ILMDeleteLifecycleRequest) { - return func(r *ILMDeleteLifecycleRequest) { - r.Policy = v - } -} - // WithPretty makes the response body pretty-printed. // func (f ILMDeleteLifecycle) WithPretty() func(*ILMDeleteLifecycleRequest) { diff --git a/esapi/api.xpack.ilm.explain_lifecycle.go b/esapi/api.xpack.ilm.explain_lifecycle.go index fdcecbdf85..7c1244d464 100755 --- a/esapi/api.xpack.ilm.explain_lifecycle.go +++ b/esapi/api.xpack.ilm.explain_lifecycle.go @@ -1,16 +1,17 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi import ( "context" "net/http" + "strconv" "strings" ) func newILMExplainLifecycleFunc(t Transport) ILMExplainLifecycle { - return func(o ...func(*ILMExplainLifecycleRequest)) (*Response, error) { - var r = ILMExplainLifecycleRequest{} + return func(index string, o ...func(*ILMExplainLifecycleRequest)) (*Response, error) { + var r = ILMExplainLifecycleRequest{Index: index} for _, f := range o { f(&r) } @@ -20,15 +21,20 @@ func newILMExplainLifecycleFunc(t Transport) ILMExplainLifecycle { // ----- API Definition ------------------------------------------------------- -// ILMExplainLifecycle - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html +// ILMExplainLifecycle - // -type ILMExplainLifecycle func(o ...func(*ILMExplainLifecycleRequest)) (*Response, error) +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html. +// +type ILMExplainLifecycle func(index string, o ...func(*ILMExplainLifecycleRequest)) (*Response, error) // ILMExplainLifecycleRequest configures the ILM Explain Lifecycle API request. // type ILMExplainLifecycleRequest struct { Index string + OnlyErrors *bool + OnlyManaged *bool + Pretty bool Human bool ErrorTrace bool @@ -51,10 +57,8 @@ func (r ILMExplainLifecycleRequest) Do(ctx context.Context, transport Transport) method = "GET" path.Grow(1 + len(r.Index) + 1 + len("_ilm") + 1 + len("explain")) - if r.Index != "" { - path.WriteString("/") - path.WriteString(r.Index) - } + path.WriteString("/") + path.WriteString(r.Index) path.WriteString("/") path.WriteString("_ilm") path.WriteString("/") @@ -62,6 +66,14 @@ func (r ILMExplainLifecycleRequest) Do(ctx context.Context, transport Transport) params = make(map[string]string) + if r.OnlyErrors != nil { + params["only_errors"] = strconv.FormatBool(*r.OnlyErrors) + } + + if r.OnlyManaged != nil { + params["only_managed"] = strconv.FormatBool(*r.OnlyManaged) + } + if r.Pretty { params["pretty"] = "true" } @@ -126,11 +138,19 @@ func (f ILMExplainLifecycle) WithContext(v context.Context) func(*ILMExplainLife } } -// WithIndex - the name of the index to explain. +// WithOnlyErrors - filters the indices included in the response to ones in an ilm error state, implies only_managed. +// +func (f ILMExplainLifecycle) WithOnlyErrors(v bool) func(*ILMExplainLifecycleRequest) { + return func(r *ILMExplainLifecycleRequest) { + r.OnlyErrors = &v + } +} + +// WithOnlyManaged - filters the indices included in the response to ones managed by ilm. // -func (f ILMExplainLifecycle) WithIndex(v string) func(*ILMExplainLifecycleRequest) { +func (f ILMExplainLifecycle) WithOnlyManaged(v bool) func(*ILMExplainLifecycleRequest) { return func(r *ILMExplainLifecycleRequest) { - r.Index = v + r.OnlyManaged = &v } } diff --git a/esapi/api.xpack.ilm.get_lifecycle.go b/esapi/api.xpack.ilm.get_lifecycle.go index c8991ee1db..03460c0dfc 100755 --- a/esapi/api.xpack.ilm.get_lifecycle.go +++ b/esapi/api.xpack.ilm.get_lifecycle.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newILMGetLifecycleFunc(t Transport) ILMGetLifecycle { // ----- API Definition ------------------------------------------------------- -// ILMGetLifecycle - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html +// ILMGetLifecycle - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html. // type ILMGetLifecycle func(o ...func(*ILMGetLifecycleRequest)) (*Response, error) diff --git a/esapi/api.xpack.ilm.get_status.go b/esapi/api.xpack.ilm.get_status.go index 2069f8565e..0c616de805 100755 --- a/esapi/api.xpack.ilm.get_status.go +++ b/esapi/api.xpack.ilm.get_status.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newILMGetStatusFunc(t Transport) ILMGetStatus { // ----- API Definition ------------------------------------------------------- -// ILMGetStatus - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html +// ILMGetStatus - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html. // type ILMGetStatus func(o ...func(*ILMGetStatusRequest)) (*Response, error) diff --git a/esapi/api.xpack.ilm.move_to_step.go b/esapi/api.xpack.ilm.move_to_step.go index e0c01f20cb..d20d5b9c7f 100755 --- a/esapi/api.xpack.ilm.move_to_step.go +++ b/esapi/api.xpack.ilm.move_to_step.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -10,8 +10,8 @@ import ( ) func newILMMoveToStepFunc(t Transport) ILMMoveToStep { - return func(o ...func(*ILMMoveToStepRequest)) (*Response, error) { - var r = ILMMoveToStepRequest{} + return func(index string, o ...func(*ILMMoveToStepRequest)) (*Response, error) { + var r = ILMMoveToStepRequest{Index: index} for _, f := range o { f(&r) } @@ -21,9 +21,11 @@ func newILMMoveToStepFunc(t Transport) ILMMoveToStep { // ----- API Definition ------------------------------------------------------- -// ILMMoveToStep - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html +// ILMMoveToStep - // -type ILMMoveToStep func(o ...func(*ILMMoveToStepRequest)) (*Response, error) +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html. +// +type ILMMoveToStep func(index string, o ...func(*ILMMoveToStepRequest)) (*Response, error) // ILMMoveToStepRequest configures the ILM Move To Step API request. // @@ -58,10 +60,8 @@ func (r ILMMoveToStepRequest) Do(ctx context.Context, transport Transport) (*Res path.WriteString("_ilm") path.WriteString("/") path.WriteString("move") - if r.Index != "" { - path.WriteString("/") - path.WriteString(r.Index) - } + path.WriteString("/") + path.WriteString(r.Index) params = make(map[string]string) @@ -141,14 +141,6 @@ func (f ILMMoveToStep) WithBody(v io.Reader) func(*ILMMoveToStepRequest) { } } -// WithIndex - the name of the index whose lifecycle step is to change. -// -func (f ILMMoveToStep) WithIndex(v string) func(*ILMMoveToStepRequest) { - return func(r *ILMMoveToStepRequest) { - r.Index = v - } -} - // WithPretty makes the response body pretty-printed. // func (f ILMMoveToStep) WithPretty() func(*ILMMoveToStepRequest) { diff --git a/esapi/api.xpack.ilm.put_lifecycle.go b/esapi/api.xpack.ilm.put_lifecycle.go index 9bf6784568..0786ea659d 100755 --- a/esapi/api.xpack.ilm.put_lifecycle.go +++ b/esapi/api.xpack.ilm.put_lifecycle.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -10,8 +10,8 @@ import ( ) func newILMPutLifecycleFunc(t Transport) ILMPutLifecycle { - return func(o ...func(*ILMPutLifecycleRequest)) (*Response, error) { - var r = ILMPutLifecycleRequest{} + return func(policy string, o ...func(*ILMPutLifecycleRequest)) (*Response, error) { + var r = ILMPutLifecycleRequest{Policy: policy} for _, f := range o { f(&r) } @@ -21,9 +21,11 @@ func newILMPutLifecycleFunc(t Transport) ILMPutLifecycle { // ----- API Definition ------------------------------------------------------- -// ILMPutLifecycle - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html +// ILMPutLifecycle - // -type ILMPutLifecycle func(o ...func(*ILMPutLifecycleRequest)) (*Response, error) +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html. +// +type ILMPutLifecycle func(policy string, o ...func(*ILMPutLifecycleRequest)) (*Response, error) // ILMPutLifecycleRequest configures the ILM Put Lifecycle API request. // @@ -58,10 +60,8 @@ func (r ILMPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R path.WriteString("_ilm") path.WriteString("/") path.WriteString("policy") - if r.Policy != "" { - path.WriteString("/") - path.WriteString(r.Policy) - } + path.WriteString("/") + path.WriteString(r.Policy) params = make(map[string]string) @@ -141,14 +141,6 @@ func (f ILMPutLifecycle) WithBody(v io.Reader) func(*ILMPutLifecycleRequest) { } } -// WithPolicy - the name of the index lifecycle policy. -// -func (f ILMPutLifecycle) WithPolicy(v string) func(*ILMPutLifecycleRequest) { - return func(r *ILMPutLifecycleRequest) { - r.Policy = v - } -} - // WithPretty makes the response body pretty-printed. // func (f ILMPutLifecycle) WithPretty() func(*ILMPutLifecycleRequest) { diff --git a/esapi/api.xpack.ilm.remove_policy.go b/esapi/api.xpack.ilm.remove_policy.go index e025994fc0..6402ec73a3 100755 --- a/esapi/api.xpack.ilm.remove_policy.go +++ b/esapi/api.xpack.ilm.remove_policy.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -9,8 +9,8 @@ import ( ) func newILMRemovePolicyFunc(t Transport) ILMRemovePolicy { - return func(o ...func(*ILMRemovePolicyRequest)) (*Response, error) { - var r = ILMRemovePolicyRequest{} + return func(index string, o ...func(*ILMRemovePolicyRequest)) (*Response, error) { + var r = ILMRemovePolicyRequest{Index: index} for _, f := range o { f(&r) } @@ -20,9 +20,11 @@ func newILMRemovePolicyFunc(t Transport) ILMRemovePolicy { // ----- API Definition ------------------------------------------------------- -// ILMRemovePolicy - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html +// ILMRemovePolicy - // -type ILMRemovePolicy func(o ...func(*ILMRemovePolicyRequest)) (*Response, error) +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html. +// +type ILMRemovePolicy func(index string, o ...func(*ILMRemovePolicyRequest)) (*Response, error) // ILMRemovePolicyRequest configures the ILM Remove Policy API request. // @@ -51,10 +53,8 @@ func (r ILMRemovePolicyRequest) Do(ctx context.Context, transport Transport) (*R method = "POST" path.Grow(1 + len(r.Index) + 1 + len("_ilm") + 1 + len("remove")) - if r.Index != "" { - path.WriteString("/") - path.WriteString(r.Index) - } + path.WriteString("/") + path.WriteString(r.Index) path.WriteString("/") path.WriteString("_ilm") path.WriteString("/") @@ -126,14 +126,6 @@ func (f ILMRemovePolicy) WithContext(v context.Context) func(*ILMRemovePolicyReq } } -// WithIndex - the name of the index to remove policy on. -// -func (f ILMRemovePolicy) WithIndex(v string) func(*ILMRemovePolicyRequest) { - return func(r *ILMRemovePolicyRequest) { - r.Index = v - } -} - // WithPretty makes the response body pretty-printed. // func (f ILMRemovePolicy) WithPretty() func(*ILMRemovePolicyRequest) { diff --git a/esapi/api.xpack.ilm.retry.go b/esapi/api.xpack.ilm.retry.go index 469c8e9732..61a3328450 100755 --- a/esapi/api.xpack.ilm.retry.go +++ b/esapi/api.xpack.ilm.retry.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -9,8 +9,8 @@ import ( ) func newILMRetryFunc(t Transport) ILMRetry { - return func(o ...func(*ILMRetryRequest)) (*Response, error) { - var r = ILMRetryRequest{} + return func(index string, o ...func(*ILMRetryRequest)) (*Response, error) { + var r = ILMRetryRequest{Index: index} for _, f := range o { f(&r) } @@ -20,9 +20,11 @@ func newILMRetryFunc(t Transport) ILMRetry { // ----- API Definition ------------------------------------------------------- -// ILMRetry - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html +// ILMRetry - // -type ILMRetry func(o ...func(*ILMRetryRequest)) (*Response, error) +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html. +// +type ILMRetry func(index string, o ...func(*ILMRetryRequest)) (*Response, error) // ILMRetryRequest configures the ILM Retry API request. // @@ -51,10 +53,8 @@ func (r ILMRetryRequest) Do(ctx context.Context, transport Transport) (*Response method = "POST" path.Grow(1 + len(r.Index) + 1 + len("_ilm") + 1 + len("retry")) - if r.Index != "" { - path.WriteString("/") - path.WriteString(r.Index) - } + path.WriteString("/") + path.WriteString(r.Index) path.WriteString("/") path.WriteString("_ilm") path.WriteString("/") @@ -126,14 +126,6 @@ func (f ILMRetry) WithContext(v context.Context) func(*ILMRetryRequest) { } } -// WithIndex - the name of the indices (comma-separated) whose failed lifecycle step is to be retry. -// -func (f ILMRetry) WithIndex(v string) func(*ILMRetryRequest) { - return func(r *ILMRetryRequest) { - r.Index = v - } -} - // WithPretty makes the response body pretty-printed. // func (f ILMRetry) WithPretty() func(*ILMRetryRequest) { diff --git a/esapi/api.xpack.ilm.start.go b/esapi/api.xpack.ilm.start.go index b3dbf9370f..297c0031c7 100755 --- a/esapi/api.xpack.ilm.start.go +++ b/esapi/api.xpack.ilm.start.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newILMStartFunc(t Transport) ILMStart { // ----- API Definition ------------------------------------------------------- -// ILMStart - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html +// ILMStart - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html. // type ILMStart func(o ...func(*ILMStartRequest)) (*Response, error) diff --git a/esapi/api.xpack.ilm.stop.go b/esapi/api.xpack.ilm.stop.go index 9acfc4be40..5af3b991c8 100755 --- a/esapi/api.xpack.ilm.stop.go +++ b/esapi/api.xpack.ilm.stop.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newILMStopFunc(t Transport) ILMStop { // ----- API Definition ------------------------------------------------------- -// ILMStop - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html +// ILMStop - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html. // type ILMStop func(o ...func(*ILMStopRequest)) (*Response, error) diff --git a/esapi/api.xpack.indices.freeze.go b/esapi/api.xpack.indices.freeze.go index 23c8c733df..c45c182e1f 100755 --- a/esapi/api.xpack.indices.freeze.go +++ b/esapi/api.xpack.indices.freeze.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,9 @@ func newIndicesFreezeFunc(t Transport) IndicesFreeze { // ----- API Definition ------------------------------------------------------- -// IndicesFreeze - https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html +// IndicesFreeze - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html. // type IndicesFreeze func(index string, o ...func(*IndicesFreezeRequest)) (*Response, error) diff --git a/esapi/api.xpack.indices.reload_search_analyzers.go b/esapi/api.xpack.indices.reload_search_analyzers.go index aa76738251..a4f8b8dbab 100755 --- a/esapi/api.xpack.indices.reload_search_analyzers.go +++ b/esapi/api.xpack.indices.reload_search_analyzers.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -10,8 +10,8 @@ import ( ) func newIndicesReloadSearchAnalyzersFunc(t Transport) IndicesReloadSearchAnalyzers { - return func(o ...func(*IndicesReloadSearchAnalyzersRequest)) (*Response, error) { - var r = IndicesReloadSearchAnalyzersRequest{} + return func(index []string, o ...func(*IndicesReloadSearchAnalyzersRequest)) (*Response, error) { + var r = IndicesReloadSearchAnalyzersRequest{Index: index} for _, f := range o { f(&r) } @@ -21,9 +21,11 @@ func newIndicesReloadSearchAnalyzersFunc(t Transport) IndicesReloadSearchAnalyze // ----- API Definition ------------------------------------------------------- -// IndicesReloadSearchAnalyzers - https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html +// IndicesReloadSearchAnalyzers - // -type IndicesReloadSearchAnalyzers func(o ...func(*IndicesReloadSearchAnalyzersRequest)) (*Response, error) +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html. +// +type IndicesReloadSearchAnalyzers func(index []string, o ...func(*IndicesReloadSearchAnalyzersRequest)) (*Response, error) // IndicesReloadSearchAnalyzersRequest configures the Indices Reload Search Analyzers API request. // @@ -56,10 +58,8 @@ func (r IndicesReloadSearchAnalyzersRequest) Do(ctx context.Context, transport T method = "GET" path.Grow(1 + len(strings.Join(r.Index, ",")) + 1 + len("_reload_search_analyzers")) - if len(r.Index) > 0 { - path.WriteString("/") - path.WriteString(strings.Join(r.Index, ",")) - } + path.WriteString("/") + path.WriteString(strings.Join(r.Index, ",")) path.WriteString("/") path.WriteString("_reload_search_analyzers") @@ -141,14 +141,6 @@ func (f IndicesReloadSearchAnalyzers) WithContext(v context.Context) func(*Indic } } -// WithIndex - a list of index names to reload analyzers for. -// -func (f IndicesReloadSearchAnalyzers) WithIndex(v ...string) func(*IndicesReloadSearchAnalyzersRequest) { - return func(r *IndicesReloadSearchAnalyzersRequest) { - r.Index = v - } -} - // WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified). // func (f IndicesReloadSearchAnalyzers) WithAllowNoIndices(v bool) func(*IndicesReloadSearchAnalyzersRequest) { diff --git a/esapi/api.xpack.indices.unfreeze.go b/esapi/api.xpack.indices.unfreeze.go index b0892fcda3..3caae3f969 100755 --- a/esapi/api.xpack.indices.unfreeze.go +++ b/esapi/api.xpack.indices.unfreeze.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,9 @@ func newIndicesUnfreezeFunc(t Transport) IndicesUnfreeze { // ----- API Definition ------------------------------------------------------- -// IndicesUnfreeze - https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html +// IndicesUnfreeze - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html. // type IndicesUnfreeze func(index string, o ...func(*IndicesUnfreezeRequest)) (*Response, error) diff --git a/esapi/api.xpack.license.delete.go b/esapi/api.xpack.license.delete.go index 71b569a861..d10a905b35 100755 --- a/esapi/api.xpack.license.delete.go +++ b/esapi/api.xpack.license.delete.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newLicenseDeleteFunc(t Transport) LicenseDelete { // ----- API Definition ------------------------------------------------------- -// LicenseDelete - https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html +// LicenseDelete - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html. // type LicenseDelete func(o ...func(*LicenseDeleteRequest)) (*Response, error) diff --git a/esapi/api.xpack.license.get.go b/esapi/api.xpack.license.get.go index 2f92f855d0..244dcf5a53 100755 --- a/esapi/api.xpack.license.get.go +++ b/esapi/api.xpack.license.get.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newLicenseGetFunc(t Transport) LicenseGet { // ----- API Definition ------------------------------------------------------- -// LicenseGet - https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html +// LicenseGet - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html. // type LicenseGet func(o ...func(*LicenseGetRequest)) (*Response, error) diff --git a/esapi/api.xpack.license.get_basic_status.go b/esapi/api.xpack.license.get_basic_status.go index f121699f60..6f4865e18c 100755 --- a/esapi/api.xpack.license.get_basic_status.go +++ b/esapi/api.xpack.license.get_basic_status.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newLicenseGetBasicStatusFunc(t Transport) LicenseGetBasicStatus { // ----- API Definition ------------------------------------------------------- -// LicenseGetBasicStatus - https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html +// LicenseGetBasicStatus - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html. // type LicenseGetBasicStatus func(o ...func(*LicenseGetBasicStatusRequest)) (*Response, error) diff --git a/esapi/api.xpack.license.get_trial_status.go b/esapi/api.xpack.license.get_trial_status.go index ee93125567..6e2410ba38 100755 --- a/esapi/api.xpack.license.get_trial_status.go +++ b/esapi/api.xpack.license.get_trial_status.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newLicenseGetTrialStatusFunc(t Transport) LicenseGetTrialStatus { // ----- API Definition ------------------------------------------------------- -// LicenseGetTrialStatus - https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html +// LicenseGetTrialStatus - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html. // type LicenseGetTrialStatus func(o ...func(*LicenseGetTrialStatusRequest)) (*Response, error) diff --git a/esapi/api.xpack.license.post.go b/esapi/api.xpack.license.post.go index 1e2ba44f83..31c7093bb7 100755 --- a/esapi/api.xpack.license.post.go +++ b/esapi/api.xpack.license.post.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,9 @@ func newLicensePostFunc(t Transport) LicensePost { // ----- API Definition ------------------------------------------------------- -// LicensePost - https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html +// LicensePost - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html. // type LicensePost func(o ...func(*LicensePostRequest)) (*Response, error) diff --git a/esapi/api.xpack.license.post_start_basic.go b/esapi/api.xpack.license.post_start_basic.go index 70b3483dde..a9d447ccdd 100755 --- a/esapi/api.xpack.license.post_start_basic.go +++ b/esapi/api.xpack.license.post_start_basic.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newLicensePostStartBasicFunc(t Transport) LicensePostStartBasic { // ----- API Definition ------------------------------------------------------- -// LicensePostStartBasic - https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html +// LicensePostStartBasic - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html. // type LicensePostStartBasic func(o ...func(*LicensePostStartBasicRequest)) (*Response, error) diff --git a/esapi/api.xpack.license.post_start_trial.go b/esapi/api.xpack.license.post_start_trial.go index c85b30a29e..f82b2c90f9 100755 --- a/esapi/api.xpack.license.post_start_trial.go +++ b/esapi/api.xpack.license.post_start_trial.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newLicensePostStartTrialFunc(t Transport) LicensePostStartTrial { // ----- API Definition ------------------------------------------------------- -// LicensePostStartTrial - https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html +// LicensePostStartTrial - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html. // type LicensePostStartTrial func(o ...func(*LicensePostStartTrialRequest)) (*Response, error) diff --git a/esapi/api.xpack.migration.deprecations.go b/esapi/api.xpack.migration.deprecations.go index 511e13287f..f6c43e318d 100755 --- a/esapi/api.xpack.migration.deprecations.go +++ b/esapi/api.xpack.migration.deprecations.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newMigrationDeprecationsFunc(t Transport) MigrationDeprecations { // ----- API Definition ------------------------------------------------------- -// MigrationDeprecations - http://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html +// MigrationDeprecations - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html. // type MigrationDeprecations func(o ...func(*MigrationDeprecationsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.close_job.go b/esapi/api.xpack.ml.close_job.go index 6eadd6e7aa..232dfa6752 100755 --- a/esapi/api.xpack.ml.close_job.go +++ b/esapi/api.xpack.ml.close_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,9 @@ func newMLCloseJobFunc(t Transport) MLCloseJob { // ----- API Definition ------------------------------------------------------- -// MLCloseJob - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html +// MLCloseJob - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html. // type MLCloseJob func(job_id string, o ...func(*MLCloseJobRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.delete_calendar.go b/esapi/api.xpack.ml.delete_calendar.go index 9d1a4d8739..9e132873eb 100755 --- a/esapi/api.xpack.ml.delete_calendar.go +++ b/esapi/api.xpack.ml.delete_calendar.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_calendar_event.go b/esapi/api.xpack.ml.delete_calendar_event.go index 8172cc32ec..b786f25953 100755 --- a/esapi/api.xpack.ml.delete_calendar_event.go +++ b/esapi/api.xpack.ml.delete_calendar_event.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_calendar_job.go b/esapi/api.xpack.ml.delete_calendar_job.go index cf7e152cd5..e8eb743c1e 100755 --- a/esapi/api.xpack.ml.delete_calendar_job.go +++ b/esapi/api.xpack.ml.delete_calendar_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_data_frame_analytics.go b/esapi/api.xpack.ml.delete_data_frame_analytics.go index a929bf4798..982ee4555e 100755 --- a/esapi/api.xpack.ml.delete_data_frame_analytics.go +++ b/esapi/api.xpack.ml.delete_data_frame_analytics.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newMLDeleteDataFrameAnalyticsFunc(t Transport) MLDeleteDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLDeleteDataFrameAnalytics - http://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html +// MLDeleteDataFrameAnalytics - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html. // type MLDeleteDataFrameAnalytics func(id string, o ...func(*MLDeleteDataFrameAnalyticsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.delete_datafeed.go b/esapi/api.xpack.ml.delete_datafeed.go index e208bf8819..01aa51ada9 100755 --- a/esapi/api.xpack.ml.delete_datafeed.go +++ b/esapi/api.xpack.ml.delete_datafeed.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLDeleteDatafeedFunc(t Transport) MLDeleteDatafeed { // ----- API Definition ------------------------------------------------------- -// MLDeleteDatafeed - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html +// MLDeleteDatafeed - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html. // type MLDeleteDatafeed func(datafeed_id string, o ...func(*MLDeleteDatafeedRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.delete_expired_data.go b/esapi/api.xpack.ml.delete_expired_data.go index 06783deee3..b8648a5e4c 100755 --- a/esapi/api.xpack.ml.delete_expired_data.go +++ b/esapi/api.xpack.ml.delete_expired_data.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_filter.go b/esapi/api.xpack.ml.delete_filter.go index a18fae0aeb..b15d2d0866 100755 --- a/esapi/api.xpack.ml.delete_filter.go +++ b/esapi/api.xpack.ml.delete_filter.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_forecast.go b/esapi/api.xpack.ml.delete_forecast.go index 8b7a8f91f3..f237b4c9c8 100755 --- a/esapi/api.xpack.ml.delete_forecast.go +++ b/esapi/api.xpack.ml.delete_forecast.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,9 @@ func newMLDeleteForecastFunc(t Transport) MLDeleteForecast { // ----- API Definition ------------------------------------------------------- -// MLDeleteForecast - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html +// MLDeleteForecast - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html. // type MLDeleteForecast func(job_id string, o ...func(*MLDeleteForecastRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.delete_job.go b/esapi/api.xpack.ml.delete_job.go index 432d248b2a..32a06c2ada 100755 --- a/esapi/api.xpack.ml.delete_job.go +++ b/esapi/api.xpack.ml.delete_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLDeleteJobFunc(t Transport) MLDeleteJob { // ----- API Definition ------------------------------------------------------- -// MLDeleteJob - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html +// MLDeleteJob - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html. // type MLDeleteJob func(job_id string, o ...func(*MLDeleteJobRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.delete_model_snapshot.go b/esapi/api.xpack.ml.delete_model_snapshot.go index 83855201aa..9f88cf6eaf 100755 --- a/esapi/api.xpack.ml.delete_model_snapshot.go +++ b/esapi/api.xpack.ml.delete_model_snapshot.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newMLDeleteModelSnapshotFunc(t Transport) MLDeleteModelSnapshot { // ----- API Definition ------------------------------------------------------- -// MLDeleteModelSnapshot - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html +// MLDeleteModelSnapshot - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html. // type MLDeleteModelSnapshot func(snapshot_id string, job_id string, o ...func(*MLDeleteModelSnapshotRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.estimate_memory_usage.go b/esapi/api.xpack.ml.estimate_memory_usage.go new file mode 100755 index 0000000000..64f3b15cfb --- /dev/null +++ b/esapi/api.xpack.ml.estimate_memory_usage.go @@ -0,0 +1,172 @@ +// Code generated from specification version 7.4.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newMLEstimateMemoryUsageFunc(t Transport) MLEstimateMemoryUsage { + return func(body io.Reader, o ...func(*MLEstimateMemoryUsageRequest)) (*Response, error) { + var r = MLEstimateMemoryUsageRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// MLEstimateMemoryUsage - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/estimate-memory-usage-dfanalytics.html. +// +type MLEstimateMemoryUsage func(body io.Reader, o ...func(*MLEstimateMemoryUsageRequest)) (*Response, error) + +// MLEstimateMemoryUsageRequest configures the ML Estimate Memory Usage API request. +// +type MLEstimateMemoryUsageRequest struct { + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r MLEstimateMemoryUsageRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_ml/data_frame/analytics/_estimate_memory_usage")) + path.WriteString("/_ml/data_frame/analytics/_estimate_memory_usage") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f MLEstimateMemoryUsage) WithContext(v context.Context) func(*MLEstimateMemoryUsageRequest) { + return func(r *MLEstimateMemoryUsageRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f MLEstimateMemoryUsage) WithPretty() func(*MLEstimateMemoryUsageRequest) { + return func(r *MLEstimateMemoryUsageRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f MLEstimateMemoryUsage) WithHuman() func(*MLEstimateMemoryUsageRequest) { + return func(r *MLEstimateMemoryUsageRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f MLEstimateMemoryUsage) WithErrorTrace() func(*MLEstimateMemoryUsageRequest) { + return func(r *MLEstimateMemoryUsageRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f MLEstimateMemoryUsage) WithFilterPath(v ...string) func(*MLEstimateMemoryUsageRequest) { + return func(r *MLEstimateMemoryUsageRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f MLEstimateMemoryUsage) WithHeader(h map[string]string) func(*MLEstimateMemoryUsageRequest) { + return func(r *MLEstimateMemoryUsageRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.ml.evaluate_data_frame.go b/esapi/api.xpack.ml.evaluate_data_frame.go index 74400e8475..3ec29f50a7 100755 --- a/esapi/api.xpack.ml.evaluate_data_frame.go +++ b/esapi/api.xpack.ml.evaluate_data_frame.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLEvaluateDataFrameFunc(t Transport) MLEvaluateDataFrame { // ----- API Definition ------------------------------------------------------- -// MLEvaluateDataFrame - http://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html +// MLEvaluateDataFrame - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html. // type MLEvaluateDataFrame func(body io.Reader, o ...func(*MLEvaluateDataFrameRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.find_file_structure.go b/esapi/api.xpack.ml.find_file_structure.go index 8acf3b87dc..985a2b3b84 100755 --- a/esapi/api.xpack.ml.find_file_structure.go +++ b/esapi/api.xpack.ml.find_file_structure.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,9 @@ func newMLFindFileStructureFunc(t Transport) MLFindFileStructure { // ----- API Definition ------------------------------------------------------- -// MLFindFileStructure - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html +// MLFindFileStructure - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html. // type MLFindFileStructure func(body io.Reader, o ...func(*MLFindFileStructureRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.flush_job.go b/esapi/api.xpack.ml.flush_job.go index 8bf46f47c0..d584b78b97 100755 --- a/esapi/api.xpack.ml.flush_job.go +++ b/esapi/api.xpack.ml.flush_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,9 @@ func newMLFlushJobFunc(t Transport) MLFlushJob { // ----- API Definition ------------------------------------------------------- -// MLFlushJob - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html +// MLFlushJob - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html. // type MLFlushJob func(job_id string, o ...func(*MLFlushJobRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.forecast.go b/esapi/api.xpack.ml.forecast.go index 80ccfdafce..5f2c028c58 100755 --- a/esapi/api.xpack.ml.forecast.go +++ b/esapi/api.xpack.ml.forecast.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_buckets.go b/esapi/api.xpack.ml.get_buckets.go index 97ceeea81f..4525416e74 100755 --- a/esapi/api.xpack.ml.get_buckets.go +++ b/esapi/api.xpack.ml.get_buckets.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,9 @@ func newMLGetBucketsFunc(t Transport) MLGetBuckets { // ----- API Definition ------------------------------------------------------- -// MLGetBuckets - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html +// MLGetBuckets - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html. // type MLGetBuckets func(job_id string, o ...func(*MLGetBucketsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.get_calendar_events.go b/esapi/api.xpack.ml.get_calendar_events.go index 3ceca76330..e7dd55dcdc 100755 --- a/esapi/api.xpack.ml.get_calendar_events.go +++ b/esapi/api.xpack.ml.get_calendar_events.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_calendars.go b/esapi/api.xpack.ml.get_calendars.go index d1b0c9a00f..4bc843624b 100755 --- a/esapi/api.xpack.ml.get_calendars.go +++ b/esapi/api.xpack.ml.get_calendars.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_categories.go b/esapi/api.xpack.ml.get_categories.go index 26db463729..e34b41319c 100755 --- a/esapi/api.xpack.ml.get_categories.go +++ b/esapi/api.xpack.ml.get_categories.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,9 @@ func newMLGetCategoriesFunc(t Transport) MLGetCategories { // ----- API Definition ------------------------------------------------------- -// MLGetCategories - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html +// MLGetCategories - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html. // type MLGetCategories func(job_id string, o ...func(*MLGetCategoriesRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.get_data_frame_analytics.go b/esapi/api.xpack.ml.get_data_frame_analytics.go index 5f50e612c1..4a2dc53bf7 100755 --- a/esapi/api.xpack.ml.get_data_frame_analytics.go +++ b/esapi/api.xpack.ml.get_data_frame_analytics.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLGetDataFrameAnalyticsFunc(t Transport) MLGetDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLGetDataFrameAnalytics - http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html +// MLGetDataFrameAnalytics - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html. // type MLGetDataFrameAnalytics func(o ...func(*MLGetDataFrameAnalyticsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go index 336b0a5fa5..8a897154e0 100755 --- a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go +++ b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLGetDataFrameAnalyticsStatsFunc(t Transport) MLGetDataFrameAnalyticsSta // ----- API Definition ------------------------------------------------------- -// MLGetDataFrameAnalyticsStats - http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html +// MLGetDataFrameAnalyticsStats - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html. // type MLGetDataFrameAnalyticsStats func(o ...func(*MLGetDataFrameAnalyticsStatsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.get_datafeed_stats.go b/esapi/api.xpack.ml.get_datafeed_stats.go index bb7dab00fd..44cb2f82e2 100755 --- a/esapi/api.xpack.ml.get_datafeed_stats.go +++ b/esapi/api.xpack.ml.get_datafeed_stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLGetDatafeedStatsFunc(t Transport) MLGetDatafeedStats { // ----- API Definition ------------------------------------------------------- -// MLGetDatafeedStats - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html +// MLGetDatafeedStats - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html. // type MLGetDatafeedStats func(o ...func(*MLGetDatafeedStatsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.get_datafeeds.go b/esapi/api.xpack.ml.get_datafeeds.go index 0e32643be8..ae8cd0b346 100755 --- a/esapi/api.xpack.ml.get_datafeeds.go +++ b/esapi/api.xpack.ml.get_datafeeds.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLGetDatafeedsFunc(t Transport) MLGetDatafeeds { // ----- API Definition ------------------------------------------------------- -// MLGetDatafeeds - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html +// MLGetDatafeeds - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html. // type MLGetDatafeeds func(o ...func(*MLGetDatafeedsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.get_filters.go b/esapi/api.xpack.ml.get_filters.go index 84b8430c8c..8b2241587c 100755 --- a/esapi/api.xpack.ml.get_filters.go +++ b/esapi/api.xpack.ml.get_filters.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_influencers.go b/esapi/api.xpack.ml.get_influencers.go index fe21f0e691..71fc74b6f8 100755 --- a/esapi/api.xpack.ml.get_influencers.go +++ b/esapi/api.xpack.ml.get_influencers.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,9 @@ func newMLGetInfluencersFunc(t Transport) MLGetInfluencers { // ----- API Definition ------------------------------------------------------- -// MLGetInfluencers - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html +// MLGetInfluencers - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html. // type MLGetInfluencers func(job_id string, o ...func(*MLGetInfluencersRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.get_job_stats.go b/esapi/api.xpack.ml.get_job_stats.go index 2143870a71..4c63c5292a 100755 --- a/esapi/api.xpack.ml.get_job_stats.go +++ b/esapi/api.xpack.ml.get_job_stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLGetJobStatsFunc(t Transport) MLGetJobStats { // ----- API Definition ------------------------------------------------------- -// MLGetJobStats - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html +// MLGetJobStats - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html. // type MLGetJobStats func(o ...func(*MLGetJobStatsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.get_jobs.go b/esapi/api.xpack.ml.get_jobs.go index aad7c9056d..5a70975713 100755 --- a/esapi/api.xpack.ml.get_jobs.go +++ b/esapi/api.xpack.ml.get_jobs.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLGetJobsFunc(t Transport) MLGetJobs { // ----- API Definition ------------------------------------------------------- -// MLGetJobs - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html +// MLGetJobs - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html. // type MLGetJobs func(o ...func(*MLGetJobsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.get_model_snapshots.go b/esapi/api.xpack.ml.get_model_snapshots.go index 4d4300ff73..8d27d0d238 100755 --- a/esapi/api.xpack.ml.get_model_snapshots.go +++ b/esapi/api.xpack.ml.get_model_snapshots.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,9 @@ func newMLGetModelSnapshotsFunc(t Transport) MLGetModelSnapshots { // ----- API Definition ------------------------------------------------------- -// MLGetModelSnapshots - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html +// MLGetModelSnapshots - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html. // type MLGetModelSnapshots func(job_id string, o ...func(*MLGetModelSnapshotsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.get_overall_buckets.go b/esapi/api.xpack.ml.get_overall_buckets.go index c8ddfa2269..cb2880f3c2 100755 --- a/esapi/api.xpack.ml.get_overall_buckets.go +++ b/esapi/api.xpack.ml.get_overall_buckets.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,9 @@ func newMLGetOverallBucketsFunc(t Transport) MLGetOverallBuckets { // ----- API Definition ------------------------------------------------------- -// MLGetOverallBuckets - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html +// MLGetOverallBuckets - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html. // type MLGetOverallBuckets func(job_id string, o ...func(*MLGetOverallBucketsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.get_records.go b/esapi/api.xpack.ml.get_records.go index 6d47e9b054..6ed8c07c6c 100755 --- a/esapi/api.xpack.ml.get_records.go +++ b/esapi/api.xpack.ml.get_records.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,9 @@ func newMLGetRecordsFunc(t Transport) MLGetRecords { // ----- API Definition ------------------------------------------------------- -// MLGetRecords - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html +// MLGetRecords - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html. // type MLGetRecords func(job_id string, o ...func(*MLGetRecordsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.info.go b/esapi/api.xpack.ml.info.go index fc4362b8b0..42e0e253ba 100755 --- a/esapi/api.xpack.ml.info.go +++ b/esapi/api.xpack.ml.info.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.open_job.go b/esapi/api.xpack.ml.open_job.go index e994dea553..ea553a9198 100755 --- a/esapi/api.xpack.ml.open_job.go +++ b/esapi/api.xpack.ml.open_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -6,7 +6,6 @@ import ( "context" "net/http" "strings" - "time" ) func newMLOpenJobFunc(t Transport) MLOpenJob { @@ -21,16 +20,16 @@ func newMLOpenJobFunc(t Transport) MLOpenJob { // ----- API Definition ------------------------------------------------------- -// MLOpenJob - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html +// MLOpenJob - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html. // type MLOpenJob func(job_id string, o ...func(*MLOpenJobRequest)) (*Response, error) // MLOpenJobRequest configures the ML Open Job API request. // type MLOpenJobRequest struct { - IgnoreDowntime *bool - JobID string - Timeout time.Duration + JobID string Pretty bool Human bool @@ -129,22 +128,6 @@ func (f MLOpenJob) WithContext(v context.Context) func(*MLOpenJobRequest) { } } -// WithIgnoreDowntime - controls if gaps in data are treated as anomalous or as a maintenance window after a job re-start. -// -func (f MLOpenJob) WithIgnoreDowntime(v bool) func(*MLOpenJobRequest) { - return func(r *MLOpenJobRequest) { - r.IgnoreDowntime = &v - } -} - -// WithTimeout - controls the time to wait until a job has opened. default to 30 minutes. -// -func (f MLOpenJob) WithTimeout(v time.Duration) func(*MLOpenJobRequest) { - return func(r *MLOpenJobRequest) { - r.Timeout = v - } -} - // WithPretty makes the response body pretty-printed. // func (f MLOpenJob) WithPretty() func(*MLOpenJobRequest) { diff --git a/esapi/api.xpack.ml.post_calendar_events.go b/esapi/api.xpack.ml.post_calendar_events.go index 17b8e1a7c8..e143b68d02 100755 --- a/esapi/api.xpack.ml.post_calendar_events.go +++ b/esapi/api.xpack.ml.post_calendar_events.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.post_data.go b/esapi/api.xpack.ml.post_data.go index 99e07068d5..0619ed6ffa 100755 --- a/esapi/api.xpack.ml.post_data.go +++ b/esapi/api.xpack.ml.post_data.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLPostDataFunc(t Transport) MLPostData { // ----- API Definition ------------------------------------------------------- -// MLPostData - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html +// MLPostData - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html. // type MLPostData func(job_id string, body io.Reader, o ...func(*MLPostDataRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.preview_datafeed.go b/esapi/api.xpack.ml.preview_datafeed.go index 2df8836a02..4388ffe0b2 100755 --- a/esapi/api.xpack.ml.preview_datafeed.go +++ b/esapi/api.xpack.ml.preview_datafeed.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newMLPreviewDatafeedFunc(t Transport) MLPreviewDatafeed { // ----- API Definition ------------------------------------------------------- -// MLPreviewDatafeed - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html +// MLPreviewDatafeed - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html. // type MLPreviewDatafeed func(datafeed_id string, o ...func(*MLPreviewDatafeedRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.put_calendar.go b/esapi/api.xpack.ml.put_calendar.go index a501c821a9..ab424550f4 100755 --- a/esapi/api.xpack.ml.put_calendar.go +++ b/esapi/api.xpack.ml.put_calendar.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_calendar_job.go b/esapi/api.xpack.ml.put_calendar_job.go index 9bb61433e7..13787cfb2e 100755 --- a/esapi/api.xpack.ml.put_calendar_job.go +++ b/esapi/api.xpack.ml.put_calendar_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_data_frame_analytics.go b/esapi/api.xpack.ml.put_data_frame_analytics.go index a472021421..f7f051774c 100755 --- a/esapi/api.xpack.ml.put_data_frame_analytics.go +++ b/esapi/api.xpack.ml.put_data_frame_analytics.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLPutDataFrameAnalyticsFunc(t Transport) MLPutDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLPutDataFrameAnalytics - http://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html +// MLPutDataFrameAnalytics - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html. // type MLPutDataFrameAnalytics func(id string, body io.Reader, o ...func(*MLPutDataFrameAnalyticsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.put_datafeed.go b/esapi/api.xpack.ml.put_datafeed.go index 6d77bb1446..3c5252bf09 100755 --- a/esapi/api.xpack.ml.put_datafeed.go +++ b/esapi/api.xpack.ml.put_datafeed.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLPutDatafeedFunc(t Transport) MLPutDatafeed { // ----- API Definition ------------------------------------------------------- -// MLPutDatafeed - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html +// MLPutDatafeed - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html. // type MLPutDatafeed func(body io.Reader, datafeed_id string, o ...func(*MLPutDatafeedRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.put_filter.go b/esapi/api.xpack.ml.put_filter.go index 52cd702edf..ccc4a0de90 100755 --- a/esapi/api.xpack.ml.put_filter.go +++ b/esapi/api.xpack.ml.put_filter.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_job.go b/esapi/api.xpack.ml.put_job.go index e62a828e7e..302fb9c539 100755 --- a/esapi/api.xpack.ml.put_job.go +++ b/esapi/api.xpack.ml.put_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLPutJobFunc(t Transport) MLPutJob { // ----- API Definition ------------------------------------------------------- -// MLPutJob - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html +// MLPutJob - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html. // type MLPutJob func(job_id string, body io.Reader, o ...func(*MLPutJobRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.revert_model_snapshot.go b/esapi/api.xpack.ml.revert_model_snapshot.go index 4ff73b528f..32a166a381 100755 --- a/esapi/api.xpack.ml.revert_model_snapshot.go +++ b/esapi/api.xpack.ml.revert_model_snapshot.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,9 @@ func newMLRevertModelSnapshotFunc(t Transport) MLRevertModelSnapshot { // ----- API Definition ------------------------------------------------------- -// MLRevertModelSnapshot - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html +// MLRevertModelSnapshot - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html. // type MLRevertModelSnapshot func(snapshot_id string, job_id string, o ...func(*MLRevertModelSnapshotRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.set_upgrade_mode.go b/esapi/api.xpack.ml.set_upgrade_mode.go index f68b2fd505..a2b00182b3 100755 --- a/esapi/api.xpack.ml.set_upgrade_mode.go +++ b/esapi/api.xpack.ml.set_upgrade_mode.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,9 @@ func newMLSetUpgradeModeFunc(t Transport) MLSetUpgradeMode { // ----- API Definition ------------------------------------------------------- -// MLSetUpgradeMode - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html +// MLSetUpgradeMode - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html. // type MLSetUpgradeMode func(o ...func(*MLSetUpgradeModeRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.start_data_frame_analytics.go b/esapi/api.xpack.ml.start_data_frame_analytics.go index 1b469e6dd2..507a9aabd2 100755 --- a/esapi/api.xpack.ml.start_data_frame_analytics.go +++ b/esapi/api.xpack.ml.start_data_frame_analytics.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,9 @@ func newMLStartDataFrameAnalyticsFunc(t Transport) MLStartDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLStartDataFrameAnalytics - http://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html +// MLStartDataFrameAnalytics - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html. // type MLStartDataFrameAnalytics func(id string, o ...func(*MLStartDataFrameAnalyticsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.start_datafeed.go b/esapi/api.xpack.ml.start_datafeed.go index c22fdd9447..08611ea8ba 100755 --- a/esapi/api.xpack.ml.start_datafeed.go +++ b/esapi/api.xpack.ml.start_datafeed.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,9 @@ func newMLStartDatafeedFunc(t Transport) MLStartDatafeed { // ----- API Definition ------------------------------------------------------- -// MLStartDatafeed - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html +// MLStartDatafeed - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html. // type MLStartDatafeed func(datafeed_id string, o ...func(*MLStartDatafeedRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.stop_data_frame_analytics.go b/esapi/api.xpack.ml.stop_data_frame_analytics.go index fa1f3d56a1..a8d318e0f5 100755 --- a/esapi/api.xpack.ml.stop_data_frame_analytics.go +++ b/esapi/api.xpack.ml.stop_data_frame_analytics.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -23,7 +23,9 @@ func newMLStopDataFrameAnalyticsFunc(t Transport) MLStopDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLStopDataFrameAnalytics - http://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html +// MLStopDataFrameAnalytics - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html. // type MLStopDataFrameAnalytics func(id string, o ...func(*MLStopDataFrameAnalyticsRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.stop_datafeed.go b/esapi/api.xpack.ml.stop_datafeed.go index 8f54478495..c9754723a0 100755 --- a/esapi/api.xpack.ml.stop_datafeed.go +++ b/esapi/api.xpack.ml.stop_datafeed.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,9 @@ func newMLStopDatafeedFunc(t Transport) MLStopDatafeed { // ----- API Definition ------------------------------------------------------- -// MLStopDatafeed - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html +// MLStopDatafeed - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html. // type MLStopDatafeed func(datafeed_id string, o ...func(*MLStopDatafeedRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.update_datafeed.go b/esapi/api.xpack.ml.update_datafeed.go index 343e013157..c7248ff6a4 100755 --- a/esapi/api.xpack.ml.update_datafeed.go +++ b/esapi/api.xpack.ml.update_datafeed.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLUpdateDatafeedFunc(t Transport) MLUpdateDatafeed { // ----- API Definition ------------------------------------------------------- -// MLUpdateDatafeed - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html +// MLUpdateDatafeed - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html. // type MLUpdateDatafeed func(body io.Reader, datafeed_id string, o ...func(*MLUpdateDatafeedRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.update_filter.go b/esapi/api.xpack.ml.update_filter.go index 7fe70ec37e..ceac90776b 100755 --- a/esapi/api.xpack.ml.update_filter.go +++ b/esapi/api.xpack.ml.update_filter.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.update_job.go b/esapi/api.xpack.ml.update_job.go index 2cefa0156f..61ec09860b 100755 --- a/esapi/api.xpack.ml.update_job.go +++ b/esapi/api.xpack.ml.update_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLUpdateJobFunc(t Transport) MLUpdateJob { // ----- API Definition ------------------------------------------------------- -// MLUpdateJob - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html +// MLUpdateJob - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html. // type MLUpdateJob func(job_id string, body io.Reader, o ...func(*MLUpdateJobRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.update_model_snapshot.go b/esapi/api.xpack.ml.update_model_snapshot.go index 4751863dc9..dfbc3312d9 100755 --- a/esapi/api.xpack.ml.update_model_snapshot.go +++ b/esapi/api.xpack.ml.update_model_snapshot.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMLUpdateModelSnapshotFunc(t Transport) MLUpdateModelSnapshot { // ----- API Definition ------------------------------------------------------- -// MLUpdateModelSnapshot - http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html +// MLUpdateModelSnapshot - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html. // type MLUpdateModelSnapshot func(snapshot_id string, job_id string, body io.Reader, o ...func(*MLUpdateModelSnapshotRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.validate.go b/esapi/api.xpack.ml.validate.go index 9ffa946cee..40bb81fe87 100755 --- a/esapi/api.xpack.ml.validate.go +++ b/esapi/api.xpack.ml.validate.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.validate_detector.go b/esapi/api.xpack.ml.validate_detector.go index 48507d4b2d..96568ab8c0 100755 --- a/esapi/api.xpack.ml.validate_detector.go +++ b/esapi/api.xpack.ml.validate_detector.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.monitoring.bulk.go b/esapi/api.xpack.monitoring.bulk.go index cf8e525d35..6427b6d434 100755 --- a/esapi/api.xpack.monitoring.bulk.go +++ b/esapi/api.xpack.monitoring.bulk.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newMonitoringBulkFunc(t Transport) MonitoringBulk { // ----- API Definition ------------------------------------------------------- -// MonitoringBulk - https://www.elastic.co/guide/en/elasticsearch/reference/master/es-monitoring.html +// MonitoringBulk - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/es-monitoring.html. // type MonitoringBulk func(body io.Reader, o ...func(*MonitoringBulkRequest)) (*Response, error) diff --git a/esapi/api.xpack.rollup.delete_job.go b/esapi/api.xpack.rollup.delete_job.go index 3eb967be4a..dcdc2ddc5d 100755 --- a/esapi/api.xpack.rollup.delete_job.go +++ b/esapi/api.xpack.rollup.delete_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.get_jobs.go b/esapi/api.xpack.rollup.get_jobs.go index 4b1ed59f28..73dc9e5ed2 100755 --- a/esapi/api.xpack.rollup.get_jobs.go +++ b/esapi/api.xpack.rollup.get_jobs.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.get_rollup_caps.go b/esapi/api.xpack.rollup.get_rollup_caps.go index 1c519c404e..1cba935ffe 100755 --- a/esapi/api.xpack.rollup.get_rollup_caps.go +++ b/esapi/api.xpack.rollup.get_rollup_caps.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.get_rollup_index_caps.go b/esapi/api.xpack.rollup.get_rollup_index_caps.go index 5b374e9adb..6591b32c13 100755 --- a/esapi/api.xpack.rollup.get_rollup_index_caps.go +++ b/esapi/api.xpack.rollup.get_rollup_index_caps.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.put_job.go b/esapi/api.xpack.rollup.put_job.go index 6ee76224db..a83aeff1cb 100755 --- a/esapi/api.xpack.rollup.put_job.go +++ b/esapi/api.xpack.rollup.put_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.rollup_search.go b/esapi/api.xpack.rollup.rollup_search.go index ceed19755c..97c0d028bb 100755 --- a/esapi/api.xpack.rollup.rollup_search.go +++ b/esapi/api.xpack.rollup.rollup_search.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.start_job.go b/esapi/api.xpack.rollup.start_job.go index 6511cfe2dc..2a2b23f3ec 100755 --- a/esapi/api.xpack.rollup.start_job.go +++ b/esapi/api.xpack.rollup.start_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.stop_job.go b/esapi/api.xpack.rollup.stop_job.go index 09c49f43a2..69a43d0b0f 100755 --- a/esapi/api.xpack.rollup.stop_job.go +++ b/esapi/api.xpack.rollup.stop_job.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.authenticate.go b/esapi/api.xpack.security.authenticate.go index 8fa2b33cf2..678ca79fa0 100755 --- a/esapi/api.xpack.security.authenticate.go +++ b/esapi/api.xpack.security.authenticate.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityAuthenticateFunc(t Transport) SecurityAuthenticate { // ----- API Definition ------------------------------------------------------- -// SecurityAuthenticate - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html +// SecurityAuthenticate - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html. // type SecurityAuthenticate func(o ...func(*SecurityAuthenticateRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.change_password.go b/esapi/api.xpack.security.change_password.go index 9ffa8cf362..bdbbfc8a53 100755 --- a/esapi/api.xpack.security.change_password.go +++ b/esapi/api.xpack.security.change_password.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newSecurityChangePasswordFunc(t Transport) SecurityChangePassword { // ----- API Definition ------------------------------------------------------- -// SecurityChangePassword - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html +// SecurityChangePassword - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html. // type SecurityChangePassword func(body io.Reader, o ...func(*SecurityChangePasswordRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.clear_cached_realms.go b/esapi/api.xpack.security.clear_cached_realms.go index 6055f2fa51..bf4e8052b0 100755 --- a/esapi/api.xpack.security.clear_cached_realms.go +++ b/esapi/api.xpack.security.clear_cached_realms.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityClearCachedRealmsFunc(t Transport) SecurityClearCachedRealms { // ----- API Definition ------------------------------------------------------- -// SecurityClearCachedRealms - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html +// SecurityClearCachedRealms - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html. // type SecurityClearCachedRealms func(realms []string, o ...func(*SecurityClearCachedRealmsRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.clear_cached_roles.go b/esapi/api.xpack.security.clear_cached_roles.go index 57bd0ba5bd..30863b524a 100755 --- a/esapi/api.xpack.security.clear_cached_roles.go +++ b/esapi/api.xpack.security.clear_cached_roles.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityClearCachedRolesFunc(t Transport) SecurityClearCachedRoles { // ----- API Definition ------------------------------------------------------- -// SecurityClearCachedRoles - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html +// SecurityClearCachedRoles - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html. // type SecurityClearCachedRoles func(name []string, o ...func(*SecurityClearCachedRolesRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.create_api_key.go b/esapi/api.xpack.security.create_api_key.go index b1013216d7..d3cb21ab75 100755 --- a/esapi/api.xpack.security.create_api_key.go +++ b/esapi/api.xpack.security.create_api_key.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newSecurityCreateAPIKeyFunc(t Transport) SecurityCreateAPIKey { // ----- API Definition ------------------------------------------------------- -// SecurityCreateAPIKey - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html +// SecurityCreateAPIKey - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html. // type SecurityCreateAPIKey func(body io.Reader, o ...func(*SecurityCreateAPIKeyRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.delete_privileges.go b/esapi/api.xpack.security.delete_privileges.go index 92f0d0dc0c..65a54d7e79 100755 --- a/esapi/api.xpack.security.delete_privileges.go +++ b/esapi/api.xpack.security.delete_privileges.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.delete_role.go b/esapi/api.xpack.security.delete_role.go index 1e7bdba996..d66390d862 100755 --- a/esapi/api.xpack.security.delete_role.go +++ b/esapi/api.xpack.security.delete_role.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityDeleteRoleFunc(t Transport) SecurityDeleteRole { // ----- API Definition ------------------------------------------------------- -// SecurityDeleteRole - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html +// SecurityDeleteRole - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html. // type SecurityDeleteRole func(name string, o ...func(*SecurityDeleteRoleRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.delete_role_mapping.go b/esapi/api.xpack.security.delete_role_mapping.go index e48fc545bd..e873ebdc9d 100755 --- a/esapi/api.xpack.security.delete_role_mapping.go +++ b/esapi/api.xpack.security.delete_role_mapping.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityDeleteRoleMappingFunc(t Transport) SecurityDeleteRoleMapping { // ----- API Definition ------------------------------------------------------- -// SecurityDeleteRoleMapping - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html +// SecurityDeleteRoleMapping - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html. // type SecurityDeleteRoleMapping func(name string, o ...func(*SecurityDeleteRoleMappingRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.delete_user.go b/esapi/api.xpack.security.delete_user.go index e55a7ac030..b1a3f7bbf2 100755 --- a/esapi/api.xpack.security.delete_user.go +++ b/esapi/api.xpack.security.delete_user.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityDeleteUserFunc(t Transport) SecurityDeleteUser { // ----- API Definition ------------------------------------------------------- -// SecurityDeleteUser - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html +// SecurityDeleteUser - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html. // type SecurityDeleteUser func(username string, o ...func(*SecurityDeleteUserRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.disable_user.go b/esapi/api.xpack.security.disable_user.go index db2fb32c4f..a609b3259e 100755 --- a/esapi/api.xpack.security.disable_user.go +++ b/esapi/api.xpack.security.disable_user.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityDisableUserFunc(t Transport) SecurityDisableUser { // ----- API Definition ------------------------------------------------------- -// SecurityDisableUser - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html +// SecurityDisableUser - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html. // type SecurityDisableUser func(username string, o ...func(*SecurityDisableUserRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.enable_user.go b/esapi/api.xpack.security.enable_user.go index c1a8736e69..6c2368c05d 100755 --- a/esapi/api.xpack.security.enable_user.go +++ b/esapi/api.xpack.security.enable_user.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityEnableUserFunc(t Transport) SecurityEnableUser { // ----- API Definition ------------------------------------------------------- -// SecurityEnableUser - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html +// SecurityEnableUser - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html. // type SecurityEnableUser func(username string, o ...func(*SecurityEnableUserRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.get_api_key.go b/esapi/api.xpack.security.get_api_key.go index a51918ab28..caf8c7ecf7 100755 --- a/esapi/api.xpack.security.get_api_key.go +++ b/esapi/api.xpack.security.get_api_key.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityGetAPIKeyFunc(t Transport) SecurityGetAPIKey { // ----- API Definition ------------------------------------------------------- -// SecurityGetAPIKey - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html +// SecurityGetAPIKey - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html. // type SecurityGetAPIKey func(o ...func(*SecurityGetAPIKeyRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.get_builtin_privileges.go b/esapi/api.xpack.security.get_builtin_privileges.go index e256bfba65..e2d8531665 100755 --- a/esapi/api.xpack.security.get_builtin_privileges.go +++ b/esapi/api.xpack.security.get_builtin_privileges.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityGetBuiltinPrivilegesFunc(t Transport) SecurityGetBuiltinPrivileg // ----- API Definition ------------------------------------------------------- -// SecurityGetBuiltinPrivileges - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html +// SecurityGetBuiltinPrivileges - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html. // type SecurityGetBuiltinPrivileges func(o ...func(*SecurityGetBuiltinPrivilegesRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.get_privileges.go b/esapi/api.xpack.security.get_privileges.go index 388a589c1e..30f72b4952 100755 --- a/esapi/api.xpack.security.get_privileges.go +++ b/esapi/api.xpack.security.get_privileges.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityGetPrivilegesFunc(t Transport) SecurityGetPrivileges { // ----- API Definition ------------------------------------------------------- -// SecurityGetPrivileges - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html +// SecurityGetPrivileges - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html. // type SecurityGetPrivileges func(o ...func(*SecurityGetPrivilegesRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.get_role.go b/esapi/api.xpack.security.get_role.go index 5c515e0274..f0d7bc7bf2 100755 --- a/esapi/api.xpack.security.get_role.go +++ b/esapi/api.xpack.security.get_role.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityGetRoleFunc(t Transport) SecurityGetRole { // ----- API Definition ------------------------------------------------------- -// SecurityGetRole - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html +// SecurityGetRole - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html. // type SecurityGetRole func(o ...func(*SecurityGetRoleRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.get_role_mapping.go b/esapi/api.xpack.security.get_role_mapping.go index 940dd64289..0477144310 100755 --- a/esapi/api.xpack.security.get_role_mapping.go +++ b/esapi/api.xpack.security.get_role_mapping.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityGetRoleMappingFunc(t Transport) SecurityGetRoleMapping { // ----- API Definition ------------------------------------------------------- -// SecurityGetRoleMapping - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html +// SecurityGetRoleMapping - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html. // type SecurityGetRoleMapping func(o ...func(*SecurityGetRoleMappingRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.get_token.go b/esapi/api.xpack.security.get_token.go index 7f57fc3ff2..26382bbec7 100755 --- a/esapi/api.xpack.security.get_token.go +++ b/esapi/api.xpack.security.get_token.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newSecurityGetTokenFunc(t Transport) SecurityGetToken { // ----- API Definition ------------------------------------------------------- -// SecurityGetToken - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html +// SecurityGetToken - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html. // type SecurityGetToken func(body io.Reader, o ...func(*SecurityGetTokenRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.get_user.go b/esapi/api.xpack.security.get_user.go index 016cffa310..03802f5943 100755 --- a/esapi/api.xpack.security.get_user.go +++ b/esapi/api.xpack.security.get_user.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityGetUserFunc(t Transport) SecurityGetUser { // ----- API Definition ------------------------------------------------------- -// SecurityGetUser - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html +// SecurityGetUser - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html. // type SecurityGetUser func(o ...func(*SecurityGetUserRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.get_user_privileges.go b/esapi/api.xpack.security.get_user_privileges.go index 1916fcdbe7..7ac5f7e550 100755 --- a/esapi/api.xpack.security.get_user_privileges.go +++ b/esapi/api.xpack.security.get_user_privileges.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSecurityGetUserPrivilegesFunc(t Transport) SecurityGetUserPrivileges { // ----- API Definition ------------------------------------------------------- -// SecurityGetUserPrivileges - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html +// SecurityGetUserPrivileges - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html. // type SecurityGetUserPrivileges func(o ...func(*SecurityGetUserPrivilegesRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.has_privileges.go b/esapi/api.xpack.security.has_privileges.go index ab0478fcd4..aeec8a1c07 100755 --- a/esapi/api.xpack.security.has_privileges.go +++ b/esapi/api.xpack.security.has_privileges.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newSecurityHasPrivilegesFunc(t Transport) SecurityHasPrivileges { // ----- API Definition ------------------------------------------------------- -// SecurityHasPrivileges - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html +// SecurityHasPrivileges - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html. // type SecurityHasPrivileges func(body io.Reader, o ...func(*SecurityHasPrivilegesRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.invalidate_api_key.go b/esapi/api.xpack.security.invalidate_api_key.go index 04ecdf01dc..b2a96c2479 100755 --- a/esapi/api.xpack.security.invalidate_api_key.go +++ b/esapi/api.xpack.security.invalidate_api_key.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newSecurityInvalidateAPIKeyFunc(t Transport) SecurityInvalidateAPIKey { // ----- API Definition ------------------------------------------------------- -// SecurityInvalidateAPIKey - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html +// SecurityInvalidateAPIKey - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html. // type SecurityInvalidateAPIKey func(body io.Reader, o ...func(*SecurityInvalidateAPIKeyRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.invalidate_token.go b/esapi/api.xpack.security.invalidate_token.go index 2146660215..16fb6345e0 100755 --- a/esapi/api.xpack.security.invalidate_token.go +++ b/esapi/api.xpack.security.invalidate_token.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newSecurityInvalidateTokenFunc(t Transport) SecurityInvalidateToken { // ----- API Definition ------------------------------------------------------- -// SecurityInvalidateToken - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html +// SecurityInvalidateToken - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html. // type SecurityInvalidateToken func(body io.Reader, o ...func(*SecurityInvalidateTokenRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.put_privileges.go b/esapi/api.xpack.security.put_privileges.go index b828246992..cd3ade8c60 100755 --- a/esapi/api.xpack.security.put_privileges.go +++ b/esapi/api.xpack.security.put_privileges.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.put_role.go b/esapi/api.xpack.security.put_role.go index 151197f761..390a411b12 100755 --- a/esapi/api.xpack.security.put_role.go +++ b/esapi/api.xpack.security.put_role.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newSecurityPutRoleFunc(t Transport) SecurityPutRole { // ----- API Definition ------------------------------------------------------- -// SecurityPutRole - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html +// SecurityPutRole - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html. // type SecurityPutRole func(name string, body io.Reader, o ...func(*SecurityPutRoleRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.put_role_mapping.go b/esapi/api.xpack.security.put_role_mapping.go index bccf7a21d9..60fc66f898 100755 --- a/esapi/api.xpack.security.put_role_mapping.go +++ b/esapi/api.xpack.security.put_role_mapping.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newSecurityPutRoleMappingFunc(t Transport) SecurityPutRoleMapping { // ----- API Definition ------------------------------------------------------- -// SecurityPutRoleMapping - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html +// SecurityPutRoleMapping - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html. // type SecurityPutRoleMapping func(name string, body io.Reader, o ...func(*SecurityPutRoleMappingRequest)) (*Response, error) diff --git a/esapi/api.xpack.security.put_user.go b/esapi/api.xpack.security.put_user.go index 39f1335450..ade293fcb5 100755 --- a/esapi/api.xpack.security.put_user.go +++ b/esapi/api.xpack.security.put_user.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newSecurityPutUserFunc(t Transport) SecurityPutUser { // ----- API Definition ------------------------------------------------------- -// SecurityPutUser - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html +// SecurityPutUser - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html. // type SecurityPutUser func(username string, body io.Reader, o ...func(*SecurityPutUserRequest)) (*Response, error) diff --git a/esapi/api.xpack.slm.delete_lifecycle.go b/esapi/api.xpack.slm.delete_lifecycle.go new file mode 100755 index 0000000000..f539014de0 --- /dev/null +++ b/esapi/api.xpack.slm.delete_lifecycle.go @@ -0,0 +1,172 @@ +// Code generated from specification version 7.4.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSlmDeleteLifecycleFunc(t Transport) SlmDeleteLifecycle { + return func(policy_id string, o ...func(*SlmDeleteLifecycleRequest)) (*Response, error) { + var r = SlmDeleteLifecycleRequest{PolicyID: policy_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SlmDeleteLifecycle - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete.html. +// +type SlmDeleteLifecycle func(policy_id string, o ...func(*SlmDeleteLifecycleRequest)) (*Response, error) + +// SlmDeleteLifecycleRequest configures the Slm Delete Lifecycle API request. +// +type SlmDeleteLifecycleRequest struct { + PolicyID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SlmDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_slm") + 1 + len("policy") + 1 + len(r.PolicyID)) + path.WriteString("/") + path.WriteString("_slm") + path.WriteString("/") + path.WriteString("policy") + path.WriteString("/") + path.WriteString(r.PolicyID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SlmDeleteLifecycle) WithContext(v context.Context) func(*SlmDeleteLifecycleRequest) { + return func(r *SlmDeleteLifecycleRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SlmDeleteLifecycle) WithPretty() func(*SlmDeleteLifecycleRequest) { + return func(r *SlmDeleteLifecycleRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SlmDeleteLifecycle) WithHuman() func(*SlmDeleteLifecycleRequest) { + return func(r *SlmDeleteLifecycleRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SlmDeleteLifecycle) WithErrorTrace() func(*SlmDeleteLifecycleRequest) { + return func(r *SlmDeleteLifecycleRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SlmDeleteLifecycle) WithFilterPath(v ...string) func(*SlmDeleteLifecycleRequest) { + return func(r *SlmDeleteLifecycleRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SlmDeleteLifecycle) WithHeader(h map[string]string) func(*SlmDeleteLifecycleRequest) { + return func(r *SlmDeleteLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.slm.execute_lifecycle.go b/esapi/api.xpack.slm.execute_lifecycle.go new file mode 100755 index 0000000000..c74644ecc7 --- /dev/null +++ b/esapi/api.xpack.slm.execute_lifecycle.go @@ -0,0 +1,174 @@ +// Code generated from specification version 7.4.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSlmExecuteLifecycleFunc(t Transport) SlmExecuteLifecycle { + return func(policy_id string, o ...func(*SlmExecuteLifecycleRequest)) (*Response, error) { + var r = SlmExecuteLifecycleRequest{PolicyID: policy_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SlmExecuteLifecycle - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute.html. +// +type SlmExecuteLifecycle func(policy_id string, o ...func(*SlmExecuteLifecycleRequest)) (*Response, error) + +// SlmExecuteLifecycleRequest configures the Slm Execute Lifecycle API request. +// +type SlmExecuteLifecycleRequest struct { + PolicyID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SlmExecuteLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_slm") + 1 + len("policy") + 1 + len(r.PolicyID) + 1 + len("_execute")) + path.WriteString("/") + path.WriteString("_slm") + path.WriteString("/") + path.WriteString("policy") + path.WriteString("/") + path.WriteString(r.PolicyID) + path.WriteString("/") + path.WriteString("_execute") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SlmExecuteLifecycle) WithContext(v context.Context) func(*SlmExecuteLifecycleRequest) { + return func(r *SlmExecuteLifecycleRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SlmExecuteLifecycle) WithPretty() func(*SlmExecuteLifecycleRequest) { + return func(r *SlmExecuteLifecycleRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SlmExecuteLifecycle) WithHuman() func(*SlmExecuteLifecycleRequest) { + return func(r *SlmExecuteLifecycleRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SlmExecuteLifecycle) WithErrorTrace() func(*SlmExecuteLifecycleRequest) { + return func(r *SlmExecuteLifecycleRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SlmExecuteLifecycle) WithFilterPath(v ...string) func(*SlmExecuteLifecycleRequest) { + return func(r *SlmExecuteLifecycleRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SlmExecuteLifecycle) WithHeader(h map[string]string) func(*SlmExecuteLifecycleRequest) { + return func(r *SlmExecuteLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.slm.get_lifecycle.go b/esapi/api.xpack.slm.get_lifecycle.go new file mode 100755 index 0000000000..4a53b7bf21 --- /dev/null +++ b/esapi/api.xpack.slm.get_lifecycle.go @@ -0,0 +1,182 @@ +// Code generated from specification version 7.4.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSlmGetLifecycleFunc(t Transport) SlmGetLifecycle { + return func(o ...func(*SlmGetLifecycleRequest)) (*Response, error) { + var r = SlmGetLifecycleRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SlmGetLifecycle - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get.html. +// +type SlmGetLifecycle func(o ...func(*SlmGetLifecycleRequest)) (*Response, error) + +// SlmGetLifecycleRequest configures the Slm Get Lifecycle API request. +// +type SlmGetLifecycleRequest struct { + PolicyID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SlmGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_slm") + 1 + len("policy") + 1 + len(r.PolicyID)) + path.WriteString("/") + path.WriteString("_slm") + path.WriteString("/") + path.WriteString("policy") + if r.PolicyID != "" { + path.WriteString("/") + path.WriteString(r.PolicyID) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), nil) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SlmGetLifecycle) WithContext(v context.Context) func(*SlmGetLifecycleRequest) { + return func(r *SlmGetLifecycleRequest) { + r.ctx = v + } +} + +// WithPolicyID - comma-separated list of snapshot lifecycle policies to retrieve. +// +func (f SlmGetLifecycle) WithPolicyID(v string) func(*SlmGetLifecycleRequest) { + return func(r *SlmGetLifecycleRequest) { + r.PolicyID = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SlmGetLifecycle) WithPretty() func(*SlmGetLifecycleRequest) { + return func(r *SlmGetLifecycleRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SlmGetLifecycle) WithHuman() func(*SlmGetLifecycleRequest) { + return func(r *SlmGetLifecycleRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SlmGetLifecycle) WithErrorTrace() func(*SlmGetLifecycleRequest) { + return func(r *SlmGetLifecycleRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SlmGetLifecycle) WithFilterPath(v ...string) func(*SlmGetLifecycleRequest) { + return func(r *SlmGetLifecycleRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SlmGetLifecycle) WithHeader(h map[string]string) func(*SlmGetLifecycleRequest) { + return func(r *SlmGetLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.slm.put_lifecycle.go b/esapi/api.xpack.slm.put_lifecycle.go new file mode 100755 index 0000000000..dcbab9bc22 --- /dev/null +++ b/esapi/api.xpack.slm.put_lifecycle.go @@ -0,0 +1,187 @@ +// Code generated from specification version 7.4.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newSlmPutLifecycleFunc(t Transport) SlmPutLifecycle { + return func(policy_id string, o ...func(*SlmPutLifecycleRequest)) (*Response, error) { + var r = SlmPutLifecycleRequest{PolicyID: policy_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SlmPutLifecycle - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put.html. +// +type SlmPutLifecycle func(policy_id string, o ...func(*SlmPutLifecycleRequest)) (*Response, error) + +// SlmPutLifecycleRequest configures the Slm Put Lifecycle API request. +// +type SlmPutLifecycleRequest struct { + Body io.Reader + + PolicyID string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SlmPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_slm") + 1 + len("policy") + 1 + len(r.PolicyID)) + path.WriteString("/") + path.WriteString("_slm") + path.WriteString("/") + path.WriteString("policy") + path.WriteString("/") + path.WriteString(r.PolicyID) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, _ := newRequest(method, path.String(), r.Body) + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SlmPutLifecycle) WithContext(v context.Context) func(*SlmPutLifecycleRequest) { + return func(r *SlmPutLifecycleRequest) { + r.ctx = v + } +} + +// WithBody - The snapshot lifecycle policy definition to register. +// +func (f SlmPutLifecycle) WithBody(v io.Reader) func(*SlmPutLifecycleRequest) { + return func(r *SlmPutLifecycleRequest) { + r.Body = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SlmPutLifecycle) WithPretty() func(*SlmPutLifecycleRequest) { + return func(r *SlmPutLifecycleRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SlmPutLifecycle) WithHuman() func(*SlmPutLifecycleRequest) { + return func(r *SlmPutLifecycleRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SlmPutLifecycle) WithErrorTrace() func(*SlmPutLifecycleRequest) { + return func(r *SlmPutLifecycleRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SlmPutLifecycle) WithFilterPath(v ...string) func(*SlmPutLifecycleRequest) { + return func(r *SlmPutLifecycleRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SlmPutLifecycle) WithHeader(h map[string]string) func(*SlmPutLifecycleRequest) { + return func(r *SlmPutLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} diff --git a/esapi/api.xpack.sql.clear_cursor.go b/esapi/api.xpack.sql.clear_cursor.go index 498f1c2cc2..866537e434 100755 --- a/esapi/api.xpack.sql.clear_cursor.go +++ b/esapi/api.xpack.sql.clear_cursor.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.sql.query.go b/esapi/api.xpack.sql.query.go index a492763b16..22144e138c 100755 --- a/esapi/api.xpack.sql.query.go +++ b/esapi/api.xpack.sql.query.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.sql.translate.go b/esapi/api.xpack.sql.translate.go index ae8eb2cb7c..0272be981d 100755 --- a/esapi/api.xpack.sql.translate.go +++ b/esapi/api.xpack.sql.translate.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ssl.certificates.go b/esapi/api.xpack.ssl.certificates.go index 5feaf6125a..12d25b5363 100755 --- a/esapi/api.xpack.ssl.certificates.go +++ b/esapi/api.xpack.ssl.certificates.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newSSLCertificatesFunc(t Transport) SSLCertificates { // ----- API Definition ------------------------------------------------------- -// SSLCertificates - https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html +// SSLCertificates - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html. // type SSLCertificates func(o ...func(*SSLCertificatesRequest)) (*Response, error) diff --git a/esapi/api.xpack.watcher.ack_watch.go b/esapi/api.xpack.watcher.ack_watch.go index ce09ef0601..23fd68dc4d 100755 --- a/esapi/api.xpack.watcher.ack_watch.go +++ b/esapi/api.xpack.watcher.ack_watch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newWatcherAckWatchFunc(t Transport) WatcherAckWatch { // ----- API Definition ------------------------------------------------------- -// WatcherAckWatch - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html +// WatcherAckWatch - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html. // type WatcherAckWatch func(watch_id string, o ...func(*WatcherAckWatchRequest)) (*Response, error) diff --git a/esapi/api.xpack.watcher.activate_watch.go b/esapi/api.xpack.watcher.activate_watch.go index 2dec0051a2..85554d5b19 100755 --- a/esapi/api.xpack.watcher.activate_watch.go +++ b/esapi/api.xpack.watcher.activate_watch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newWatcherActivateWatchFunc(t Transport) WatcherActivateWatch { // ----- API Definition ------------------------------------------------------- -// WatcherActivateWatch - https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html +// WatcherActivateWatch - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html. // type WatcherActivateWatch func(watch_id string, o ...func(*WatcherActivateWatchRequest)) (*Response, error) diff --git a/esapi/api.xpack.watcher.deactivate_watch.go b/esapi/api.xpack.watcher.deactivate_watch.go index c49171fa65..f39f5d945d 100755 --- a/esapi/api.xpack.watcher.deactivate_watch.go +++ b/esapi/api.xpack.watcher.deactivate_watch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newWatcherDeactivateWatchFunc(t Transport) WatcherDeactivateWatch { // ----- API Definition ------------------------------------------------------- -// WatcherDeactivateWatch - https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html +// WatcherDeactivateWatch - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html. // type WatcherDeactivateWatch func(watch_id string, o ...func(*WatcherDeactivateWatchRequest)) (*Response, error) diff --git a/esapi/api.xpack.watcher.delete_watch.go b/esapi/api.xpack.watcher.delete_watch.go index 74efbbadb7..3b153aa25a 100755 --- a/esapi/api.xpack.watcher.delete_watch.go +++ b/esapi/api.xpack.watcher.delete_watch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newWatcherDeleteWatchFunc(t Transport) WatcherDeleteWatch { // ----- API Definition ------------------------------------------------------- -// WatcherDeleteWatch - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html +// WatcherDeleteWatch - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html. // type WatcherDeleteWatch func(id string, o ...func(*WatcherDeleteWatchRequest)) (*Response, error) diff --git a/esapi/api.xpack.watcher.execute_watch.go b/esapi/api.xpack.watcher.execute_watch.go index 7a550b2e51..3ec836d98f 100755 --- a/esapi/api.xpack.watcher.execute_watch.go +++ b/esapi/api.xpack.watcher.execute_watch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,9 @@ func newWatcherExecuteWatchFunc(t Transport) WatcherExecuteWatch { // ----- API Definition ------------------------------------------------------- -// WatcherExecuteWatch - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html +// WatcherExecuteWatch - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html. // type WatcherExecuteWatch func(o ...func(*WatcherExecuteWatchRequest)) (*Response, error) diff --git a/esapi/api.xpack.watcher.get_watch.go b/esapi/api.xpack.watcher.get_watch.go index f7341cdfab..83f826955b 100755 --- a/esapi/api.xpack.watcher.get_watch.go +++ b/esapi/api.xpack.watcher.get_watch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newWatcherGetWatchFunc(t Transport) WatcherGetWatch { // ----- API Definition ------------------------------------------------------- -// WatcherGetWatch - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html +// WatcherGetWatch - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html. // type WatcherGetWatch func(id string, o ...func(*WatcherGetWatchRequest)) (*Response, error) diff --git a/esapi/api.xpack.watcher.put_watch.go b/esapi/api.xpack.watcher.put_watch.go index 38e94c57a4..5f2e912d92 100755 --- a/esapi/api.xpack.watcher.put_watch.go +++ b/esapi/api.xpack.watcher.put_watch.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -22,7 +22,9 @@ func newWatcherPutWatchFunc(t Transport) WatcherPutWatch { // ----- API Definition ------------------------------------------------------- -// WatcherPutWatch - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html +// WatcherPutWatch - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html. // type WatcherPutWatch func(id string, o ...func(*WatcherPutWatchRequest)) (*Response, error) diff --git a/esapi/api.xpack.watcher.start.go b/esapi/api.xpack.watcher.start.go index 6b4c30230b..3e1efbee6a 100755 --- a/esapi/api.xpack.watcher.start.go +++ b/esapi/api.xpack.watcher.start.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newWatcherStartFunc(t Transport) WatcherStart { // ----- API Definition ------------------------------------------------------- -// WatcherStart - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html +// WatcherStart - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html. // type WatcherStart func(o ...func(*WatcherStartRequest)) (*Response, error) diff --git a/esapi/api.xpack.watcher.stats.go b/esapi/api.xpack.watcher.stats.go index 290fd4eef7..b84a595eea 100755 --- a/esapi/api.xpack.watcher.stats.go +++ b/esapi/api.xpack.watcher.stats.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -21,7 +21,9 @@ func newWatcherStatsFunc(t Transport) WatcherStats { // ----- API Definition ------------------------------------------------------- -// WatcherStats - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html +// WatcherStats - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html. // type WatcherStats func(o ...func(*WatcherStatsRequest)) (*Response, error) diff --git a/esapi/api.xpack.watcher.stop.go b/esapi/api.xpack.watcher.stop.go index d147541003..b6dd38e896 100755 --- a/esapi/api.xpack.watcher.stop.go +++ b/esapi/api.xpack.watcher.stop.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newWatcherStopFunc(t Transport) WatcherStop { // ----- API Definition ------------------------------------------------------- -// WatcherStop - http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html +// WatcherStop - +// +// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html. // type WatcherStop func(o ...func(*WatcherStopRequest)) (*Response, error) diff --git a/esapi/api.xpack.xpack.info.go b/esapi/api.xpack.xpack.info.go index 42688d127a..3921238cf6 100755 --- a/esapi/api.xpack.xpack.info.go +++ b/esapi/api.xpack.xpack.info.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi @@ -20,7 +20,9 @@ func newXPackInfoFunc(t Transport) XPackInfo { // ----- API Definition ------------------------------------------------------- -// XPackInfo - https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html +// XPackInfo - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html. // type XPackInfo func(o ...func(*XPackInfoRequest)) (*Response, error) diff --git a/esapi/api.xpack.xpack.usage.go b/esapi/api.xpack.xpack.usage.go index a8af6a7414..9a254de899 100755 --- a/esapi/api.xpack.xpack.usage.go +++ b/esapi/api.xpack.xpack.usage.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.3.1: DO NOT EDIT +// Code generated from specification version 7.4.0: DO NOT EDIT package esapi From c971b968c63448c0f1ee69a6e27dc7b1a38e0972 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 2 Oct 2019 10:30:40 +0200 Subject: [PATCH 114/355] Generator: API: Add override for handling types in "Indices Put Mapping" --- internal/cmd/generate/commands/gensource/overrides.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/cmd/generate/commands/gensource/overrides.go b/internal/cmd/generate/commands/gensource/overrides.go index b9759f281d..557e79d28f 100755 --- a/internal/cmd/generate/commands/gensource/overrides.go +++ b/internal/cmd/generate/commands/gensource/overrides.go @@ -81,13 +81,17 @@ func init() { Matching: []string{"indices.put_mapping"}, Func: func(*Endpoint, ...interface{}) string { return ` - path.Grow(len(strings.Join(r.Index, ",")) + len("/_mapping") + 1) + path.Grow(len(strings.Join(r.Index, ",")) + len("/_mapping") + len(r.DocumentType) + 2) if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) } path.WriteString("/") path.WriteString("_mapping") + if r.DocumentType != "" { + path.WriteString("/") + path.WriteString(r.DocumentType) +} ` }, }, From 8b191d3317c7ebd38aab4f3765ab287bb7cbd05a Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 2 Oct 2019 10:31:17 +0200 Subject: [PATCH 115/355] API: Fix handling types in "Indices Put Mapping" for Elasticsearch 7.4 (e2c4e8cacb9) --- esapi/api.indices.put_mapping.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esapi/api.indices.put_mapping.go b/esapi/api.indices.put_mapping.go index 0714880780..072d77f8e9 100755 --- a/esapi/api.indices.put_mapping.go +++ b/esapi/api.indices.put_mapping.go @@ -65,13 +65,17 @@ func (r IndicesPutMappingRequest) Do(ctx context.Context, transport Transport) ( method = "PUT" - path.Grow(len(strings.Join(r.Index, ",")) + len("/_mapping") + 1) + path.Grow(len(strings.Join(r.Index, ",")) + len("/_mapping") + len(r.DocumentType) + 2) if len(r.Index) > 0 { path.WriteString("/") path.WriteString(strings.Join(r.Index, ",")) } path.WriteString("/") path.WriteString("_mapping") + if r.DocumentType != "" { + path.WriteString("/") + path.WriteString(r.DocumentType) + } params = make(map[string]string) From 621f2bad60a7fb2a1d424b8b93671232e79b781c Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 2 Oct 2019 11:03:38 +0200 Subject: [PATCH 116/355] Release 7.4.0 --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index 92c4012178..8aa9d4ebda 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -2,4 +2,4 @@ package version // Client returns the client version as a string. // -const Client = "7.3.1-SNAPSHOT" +const Client = "7.4.0" From e26e3a7b7f9c74091602e36875b9b33b926c67c1 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 2 Oct 2019 11:04:28 +0200 Subject: [PATCH 117/355] Update version to 7.4-SNAPSHOT --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index 8aa9d4ebda..be67e25026 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -2,4 +2,4 @@ package version // Client returns the client version as a string. // -const Client = "7.4.0" +const Client = "7.4-SNAPSHOT" From 6488acd4e10ba367c8ff6a2da6b4f2827df2bd6c Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 14 Oct 2019 09:21:09 +0200 Subject: [PATCH 118/355] Generator: API: Use correct permission value for generated files (cherry picked from commit 2678db5819fdec42405d78d570a07ac16bbb3395) --- internal/cmd/generate/commands/gensource/command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 internal/cmd/generate/commands/gensource/command.go diff --git a/internal/cmd/generate/commands/gensource/command.go b/internal/cmd/generate/commands/gensource/command.go old mode 100755 new mode 100644 index a6f3f4f6c8..9786d5c470 --- a/internal/cmd/generate/commands/gensource/command.go +++ b/internal/cmd/generate/commands/gensource/command.go @@ -259,7 +259,7 @@ func (cmd *Command) processFile(f *os.File) (err error) { fName = filepath.Join(cmd.Output, "api."+gen.Endpoint.Type+"."+gen.Endpoint.Name+".go") } - f, err := os.OpenFile(fName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0755) + f, err := os.OpenFile(fName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) if err != nil { return fmt.Errorf("error creating file: %s", err) } From dac2e222bee4a10235b7b2c0010e84ccf84f6dae Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 14 Oct 2019 09:26:20 +0200 Subject: [PATCH 119/355] Generator: API: Add the license header to generated code (cherry picked from commit 50538731a187ecdea27e3bb39bea6f1a7788979c) --- internal/cmd/generate/commands/gensource/generator.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/cmd/generate/commands/gensource/generator.go b/internal/cmd/generate/commands/gensource/generator.go index cf99a192cb..6b0c32cf39 100755 --- a/internal/cmd/generate/commands/gensource/generator.go +++ b/internal/cmd/generate/commands/gensource/generator.go @@ -72,7 +72,10 @@ func (g *Generator) w(s string) { } func (g *Generator) genHeader() { - g.w("// Code generated") + g.w(`// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information.` + "\n") + g.w("//\n// Code generated") if EsVersion != "" { g.w(fmt.Sprintf(" from specification version %s", EsVersion)) } From 8f11465a991594c69b25e7a3c85a0995eda8507f Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 14 Oct 2019 10:12:36 +0200 Subject: [PATCH 120/355] Remove the executable bit from file permissions --- .circleci/config.yml | 0 .codecov.yml | 0 .dockerignore | 0 .gitignore | 0 .jenkins/certs/ca.crt | 0 .jenkins/certs/testnode.crt | 0 .jenkins/certs/testnode.key | 0 .jenkins/jobs/defaults.yml | 0 .jenkins/jobs/elastic+go-elasticsearch+5.x.yml | 0 .jenkins/jobs/elastic+go-elasticsearch+6.x.yml | 0 .jenkins/jobs/elastic+go-elasticsearch+7.x.yml | 0 .jenkins/jobs/elastic+go-elasticsearch+master.yml | 0 .jenkins/test-matrix.yml | 0 .jenkins/tests-core.sh | 0 .travis.yml | 0 Dockerfile | 0 LICENSE | 0 Makefile | 0 README.md | 0 _examples/README.md | 0 _examples/cloudfunction/.gcloudignore | 0 _examples/cloudfunction/.gitignore | 0 _examples/cloudfunction/Makefile | 0 _examples/cloudfunction/README.md | 0 _examples/cloudfunction/function.go | 0 _examples/cloudfunction/function_test.go | 0 _examples/cloudfunction/screenshot.png | Bin _examples/configuration.go | 0 _examples/customization.go | 0 _examples/fasthttp/.gitignore | 0 _examples/fasthttp/Makefile | 0 _examples/fasthttp/README.md | 0 _examples/fasthttp/cmd/main.go | 0 _examples/fasthttp/fasthttp.go | 0 _examples/fasthttp/fasthttp_benchmark_test.go | 0 _examples/main.go | 0 _examples/xkcdsearch/.dockerignore | 0 _examples/xkcdsearch/.gitignore | 0 _examples/xkcdsearch/Dockerfile | 0 _examples/xkcdsearch/Makefile | 0 _examples/xkcdsearch/README.md | 0 _examples/xkcdsearch/cmd/xkcd/commands/index.go | 0 _examples/xkcdsearch/cmd/xkcd/commands/root.go | 0 _examples/xkcdsearch/cmd/xkcd/commands/search.go | 0 _examples/xkcdsearch/cmd/xkcd/commands/server.go | 0 _examples/xkcdsearch/cmd/xkcd/main.go | 0 _examples/xkcdsearch/http.go | 0 _examples/xkcdsearch/store.go | 0 _examples/xkcdsearch/store_test.go | 0 _examples/xkcdsearch/testdata/match_all.json | 0 _examples/xkcdsearch/testdata/match_query.json | 0 _examples/xkcdsearch/web/application.js | 0 .../xkcdsearch/web/assets/fonts/xkcd-script.woff | Bin .../xkcdsearch/web/assets/images/github-ribbon.svg | 0 _examples/xkcdsearch/web/assets/images/left.png | Bin _examples/xkcdsearch/web/assets/images/middle.png | Bin _examples/xkcdsearch/web/assets/images/right.png | Bin _examples/xkcdsearch/web/index.html | 0 _examples/xkcdsearch/web/style.css | 0 _examples/xkcdsearch/xkcd.go | 0 doc.go | 0 elasticsearch.go | 0 elasticsearch_benchmark_test.go | 0 elasticsearch_example_test.go | 0 elasticsearch_integration_test.go | 0 elasticsearch_internal_test.go | 0 esapi/api.bulk.go | 0 esapi/api.cat.aliases.go | 0 esapi/api.cat.allocation.go | 0 esapi/api.cat.count.go | 0 esapi/api.cat.fielddata.go | 0 esapi/api.cat.health.go | 0 esapi/api.cat.help.go | 0 esapi/api.cat.indices.go | 0 esapi/api.cat.master.go | 0 esapi/api.cat.nodeattrs.go | 0 esapi/api.cat.nodes.go | 0 esapi/api.cat.pending_tasks.go | 0 esapi/api.cat.plugins.go | 0 esapi/api.cat.recovery.go | 0 esapi/api.cat.repositories.go | 0 esapi/api.cat.segments.go | 0 esapi/api.cat.shards.go | 0 esapi/api.cat.snapshots.go | 0 esapi/api.cat.tasks.go | 0 esapi/api.cat.templates.go | 0 esapi/api.cat.thread_pool.go | 0 esapi/api.clear_scroll.go | 0 esapi/api.cluster.allocation_explain.go | 0 esapi/api.cluster.get_settings.go | 0 esapi/api.cluster.health.go | 0 esapi/api.cluster.pending_tasks.go | 0 esapi/api.cluster.put_settings.go | 0 esapi/api.cluster.remote_info.go | 0 esapi/api.cluster.reroute.go | 0 esapi/api.cluster.state.go | 0 esapi/api.cluster.stats.go | 0 esapi/api.count.go | 0 esapi/api.create.go | 0 esapi/api.delete.go | 0 esapi/api.delete_by_query.go | 0 esapi/api.delete_by_query_rethrottle.go | 0 esapi/api.delete_script.go | 0 esapi/api.exists.go | 0 esapi/api.exists_source.go | 0 esapi/api.explain.go | 0 esapi/api.field_caps.go | 0 esapi/api.get.go | 0 esapi/api.get_script.go | 0 esapi/api.get_source.go | 0 esapi/api.index.go | 0 esapi/api.indices.analyze.go | 0 esapi/api.indices.clear_cache.go | 0 esapi/api.indices.clone.go | 0 esapi/api.indices.close.go | 0 esapi/api.indices.create.go | 0 esapi/api.indices.delete.go | 0 esapi/api.indices.delete_alias.go | 0 esapi/api.indices.delete_template.go | 0 esapi/api.indices.exists.go | 0 esapi/api.indices.exists_alias.go | 0 esapi/api.indices.exists_template.go | 0 esapi/api.indices.exists_type.go | 0 esapi/api.indices.flush.go | 0 esapi/api.indices.flush_synced.go | 0 esapi/api.indices.forcemerge.go | 0 esapi/api.indices.get.go | 0 esapi/api.indices.get_alias.go | 0 esapi/api.indices.get_field_mapping.go | 0 esapi/api.indices.get_mapping.go | 0 esapi/api.indices.get_settings.go | 0 esapi/api.indices.get_template.go | 0 esapi/api.indices.get_upgrade.go | 0 esapi/api.indices.open.go | 0 esapi/api.indices.put_alias.go | 0 esapi/api.indices.put_mapping.go | 0 esapi/api.indices.put_settings.go | 0 esapi/api.indices.put_template.go | 0 esapi/api.indices.recovery.go | 0 esapi/api.indices.refresh.go | 0 esapi/api.indices.rollover.go | 0 esapi/api.indices.segments.go | 0 esapi/api.indices.shard_stores.go | 0 esapi/api.indices.shrink.go | 0 esapi/api.indices.split.go | 0 esapi/api.indices.stats.go | 0 esapi/api.indices.update_aliases.go | 0 esapi/api.indices.upgrade.go | 0 esapi/api.indices.validate_query.go | 0 esapi/api.info.go | 0 esapi/api.ingest.delete_pipeline.go | 0 esapi/api.ingest.get_pipeline.go | 0 esapi/api.ingest.processor_grok.go | 0 esapi/api.ingest.put_pipeline.go | 0 esapi/api.ingest.simulate.go | 0 esapi/api.mget.go | 0 esapi/api.msearch.go | 0 esapi/api.msearch_template.go | 0 esapi/api.mtermvectors.go | 0 esapi/api.nodes.hot_threads.go | 0 esapi/api.nodes.info.go | 0 esapi/api.nodes.reload_secure_settings.go | 0 esapi/api.nodes.stats.go | 0 esapi/api.nodes.usage.go | 0 esapi/api.ping.go | 0 esapi/api.put_script.go | 0 esapi/api.rank_eval.go | 0 esapi/api.reindex.go | 0 esapi/api.reindex_rethrottle.go | 0 esapi/api.render_search_template.go | 0 esapi/api.scripts_painless_execute.go | 0 esapi/api.scroll.go | 0 esapi/api.search.go | 0 esapi/api.search_shards.go | 0 esapi/api.search_template.go | 0 esapi/api.snapshot.cleanup_repository.go | 0 esapi/api.snapshot.create.go | 0 esapi/api.snapshot.create_repository.go | 0 esapi/api.snapshot.delete.go | 0 esapi/api.snapshot.delete_repository.go | 0 esapi/api.snapshot.get.go | 0 esapi/api.snapshot.get_repository.go | 0 esapi/api.snapshot.restore.go | 0 esapi/api.snapshot.status.go | 0 esapi/api.snapshot.verify_repository.go | 0 esapi/api.tasks.cancel.go | 0 esapi/api.tasks.get.go | 0 esapi/api.tasks.list.go | 0 esapi/api.termvectors.go | 0 esapi/api.update.go | 0 esapi/api.update_by_query.go | 0 esapi/api.update_by_query_rethrottle.go | 0 esapi/api.xpack.ccr.delete_auto_follow_pattern.go | 0 esapi/api.xpack.ccr.follow.go | 0 esapi/api.xpack.ccr.follow_info.go | 0 esapi/api.xpack.ccr.follow_stats.go | 0 esapi/api.xpack.ccr.forget_follower.go | 0 esapi/api.xpack.ccr.get_auto_follow_pattern.go | 0 esapi/api.xpack.ccr.pause_follow.go | 0 esapi/api.xpack.ccr.put_auto_follow_pattern.go | 0 esapi/api.xpack.ccr.resume_follow.go | 0 esapi/api.xpack.ccr.stats.go | 0 esapi/api.xpack.ccr.unfollow.go | 0 ....xpack.data_frame.delete_data_frame_transform.go | 0 ...api.xpack.data_frame.get_data_frame_transform.go | 0 ...ack.data_frame.get_data_frame_transform_stats.go | 0 ...xpack.data_frame.preview_data_frame_transform.go | 0 ...api.xpack.data_frame.put_data_frame_transform.go | 0 ...i.xpack.data_frame.start_data_frame_transform.go | 0 ...pi.xpack.data_frame.stop_data_frame_transform.go | 0 ....xpack.data_frame.update_data_frame_transform.go | 0 esapi/api.xpack.graph.explore.go | 0 esapi/api.xpack.ilm.delete_lifecycle.go | 0 esapi/api.xpack.ilm.explain_lifecycle.go | 0 esapi/api.xpack.ilm.get_lifecycle.go | 0 esapi/api.xpack.ilm.get_status.go | 0 esapi/api.xpack.ilm.move_to_step.go | 0 esapi/api.xpack.ilm.put_lifecycle.go | 0 esapi/api.xpack.ilm.remove_policy.go | 0 esapi/api.xpack.ilm.retry.go | 0 esapi/api.xpack.ilm.start.go | 0 esapi/api.xpack.ilm.stop.go | 0 esapi/api.xpack.indices.freeze.go | 0 esapi/api.xpack.indices.reload_search_analyzers.go | 0 esapi/api.xpack.indices.unfreeze.go | 0 esapi/api.xpack.license.delete.go | 0 esapi/api.xpack.license.get.go | 0 esapi/api.xpack.license.get_basic_status.go | 0 esapi/api.xpack.license.get_trial_status.go | 0 esapi/api.xpack.license.post.go | 0 esapi/api.xpack.license.post_start_basic.go | 0 esapi/api.xpack.license.post_start_trial.go | 0 esapi/api.xpack.migration.deprecations.go | 0 esapi/api.xpack.ml.close_job.go | 0 esapi/api.xpack.ml.delete_calendar.go | 0 esapi/api.xpack.ml.delete_calendar_event.go | 0 esapi/api.xpack.ml.delete_calendar_job.go | 0 esapi/api.xpack.ml.delete_data_frame_analytics.go | 0 esapi/api.xpack.ml.delete_datafeed.go | 0 esapi/api.xpack.ml.delete_expired_data.go | 0 esapi/api.xpack.ml.delete_filter.go | 0 esapi/api.xpack.ml.delete_forecast.go | 0 esapi/api.xpack.ml.delete_job.go | 0 esapi/api.xpack.ml.delete_model_snapshot.go | 0 esapi/api.xpack.ml.estimate_memory_usage.go | 0 esapi/api.xpack.ml.evaluate_data_frame.go | 0 esapi/api.xpack.ml.find_file_structure.go | 0 esapi/api.xpack.ml.flush_job.go | 0 esapi/api.xpack.ml.forecast.go | 0 esapi/api.xpack.ml.get_buckets.go | 0 esapi/api.xpack.ml.get_calendar_events.go | 0 esapi/api.xpack.ml.get_calendars.go | 0 esapi/api.xpack.ml.get_categories.go | 0 esapi/api.xpack.ml.get_data_frame_analytics.go | 0 .../api.xpack.ml.get_data_frame_analytics_stats.go | 0 esapi/api.xpack.ml.get_datafeed_stats.go | 0 esapi/api.xpack.ml.get_datafeeds.go | 0 esapi/api.xpack.ml.get_filters.go | 0 esapi/api.xpack.ml.get_influencers.go | 0 esapi/api.xpack.ml.get_job_stats.go | 0 esapi/api.xpack.ml.get_jobs.go | 0 esapi/api.xpack.ml.get_model_snapshots.go | 0 esapi/api.xpack.ml.get_overall_buckets.go | 0 esapi/api.xpack.ml.get_records.go | 0 esapi/api.xpack.ml.info.go | 0 esapi/api.xpack.ml.open_job.go | 0 esapi/api.xpack.ml.post_calendar_events.go | 0 esapi/api.xpack.ml.post_data.go | 0 esapi/api.xpack.ml.preview_datafeed.go | 0 esapi/api.xpack.ml.put_calendar.go | 0 esapi/api.xpack.ml.put_calendar_job.go | 0 esapi/api.xpack.ml.put_data_frame_analytics.go | 0 esapi/api.xpack.ml.put_datafeed.go | 0 esapi/api.xpack.ml.put_filter.go | 0 esapi/api.xpack.ml.put_job.go | 0 esapi/api.xpack.ml.revert_model_snapshot.go | 0 esapi/api.xpack.ml.set_upgrade_mode.go | 0 esapi/api.xpack.ml.start_data_frame_analytics.go | 0 esapi/api.xpack.ml.start_datafeed.go | 0 esapi/api.xpack.ml.stop_data_frame_analytics.go | 0 esapi/api.xpack.ml.stop_datafeed.go | 0 esapi/api.xpack.ml.update_datafeed.go | 0 esapi/api.xpack.ml.update_filter.go | 0 esapi/api.xpack.ml.update_job.go | 0 esapi/api.xpack.ml.update_model_snapshot.go | 0 esapi/api.xpack.ml.validate.go | 0 esapi/api.xpack.ml.validate_detector.go | 0 esapi/api.xpack.monitoring.bulk.go | 0 esapi/api.xpack.rollup.delete_job.go | 0 esapi/api.xpack.rollup.get_jobs.go | 0 esapi/api.xpack.rollup.get_rollup_caps.go | 0 esapi/api.xpack.rollup.get_rollup_index_caps.go | 0 esapi/api.xpack.rollup.put_job.go | 0 esapi/api.xpack.rollup.rollup_search.go | 0 esapi/api.xpack.rollup.start_job.go | 0 esapi/api.xpack.rollup.stop_job.go | 0 esapi/api.xpack.security.authenticate.go | 0 esapi/api.xpack.security.change_password.go | 0 esapi/api.xpack.security.clear_cached_realms.go | 0 esapi/api.xpack.security.clear_cached_roles.go | 0 esapi/api.xpack.security.create_api_key.go | 0 esapi/api.xpack.security.delete_privileges.go | 0 esapi/api.xpack.security.delete_role.go | 0 esapi/api.xpack.security.delete_role_mapping.go | 0 esapi/api.xpack.security.delete_user.go | 0 esapi/api.xpack.security.disable_user.go | 0 esapi/api.xpack.security.enable_user.go | 0 esapi/api.xpack.security.get_api_key.go | 0 esapi/api.xpack.security.get_builtin_privileges.go | 0 esapi/api.xpack.security.get_privileges.go | 0 esapi/api.xpack.security.get_role.go | 0 esapi/api.xpack.security.get_role_mapping.go | 0 esapi/api.xpack.security.get_token.go | 0 esapi/api.xpack.security.get_user.go | 0 esapi/api.xpack.security.get_user_privileges.go | 0 esapi/api.xpack.security.has_privileges.go | 0 esapi/api.xpack.security.invalidate_api_key.go | 0 esapi/api.xpack.security.invalidate_token.go | 0 esapi/api.xpack.security.put_privileges.go | 0 esapi/api.xpack.security.put_role.go | 0 esapi/api.xpack.security.put_role_mapping.go | 0 esapi/api.xpack.security.put_user.go | 0 esapi/api.xpack.slm.delete_lifecycle.go | 0 esapi/api.xpack.slm.execute_lifecycle.go | 0 esapi/api.xpack.slm.get_lifecycle.go | 0 esapi/api.xpack.slm.put_lifecycle.go | 0 esapi/api.xpack.sql.clear_cursor.go | 0 esapi/api.xpack.sql.query.go | 0 esapi/api.xpack.sql.translate.go | 0 esapi/api.xpack.ssl.certificates.go | 0 esapi/api.xpack.watcher.ack_watch.go | 0 esapi/api.xpack.watcher.activate_watch.go | 0 esapi/api.xpack.watcher.deactivate_watch.go | 0 esapi/api.xpack.watcher.delete_watch.go | 0 esapi/api.xpack.watcher.execute_watch.go | 0 esapi/api.xpack.watcher.get_watch.go | 0 esapi/api.xpack.watcher.put_watch.go | 0 esapi/api.xpack.watcher.start.go | 0 esapi/api.xpack.watcher.stats.go | 0 esapi/api.xpack.watcher.stop.go | 0 esapi/api.xpack.xpack.info.go | 0 esapi/api.xpack.xpack.usage.go | 0 esapi/doc.go | 0 esapi/esapi.go | 0 esapi/esapi.request.go | 0 esapi/esapi.response.go | 0 esapi/esapi.response_example_test.go | 0 esapi/esapi_benchmark_test.go | 0 esapi/esapi_internal_test.go | 0 esapi/esapi_request_internal_test.go | 0 esapi/esapi_response_internal_test.go | 0 esapi/test/.gitignore | 0 estransport/doc.go | 0 estransport/estransport.go | 0 estransport/estransport_integration_test.go | 0 estransport/estransport_internal_test.go | 0 estransport/selector.go | 0 go.sum | 0 internal/cmd/generate/commands/commands.go | 0 internal/cmd/generate/commands/gensource/debug.go | 0 .../cmd/generate/commands/gensource/descriptions.go | 0 .../cmd/generate/commands/gensource/generator.go | 0 .../generate/commands/gensource/generator_test.go | 0 internal/cmd/generate/commands/gensource/model.go | 0 .../cmd/generate/commands/gensource/overrides.go | 0 .../generate/commands/gensource/testdata/info.json | 0 internal/cmd/generate/commands/gentests/.gitignore | 0 internal/cmd/generate/commands/gentests/command.go | 0 internal/cmd/generate/commands/gentests/debug.go | 0 .../generate/commands/gentests/gen_api_registry.go | 0 .../cmd/generate/commands/gentests/generator.go | 0 internal/cmd/generate/commands/gentests/model.go | 0 internal/cmd/generate/commands/gentests/patches.go | 0 internal/cmd/generate/commands/gentests/skips.go | 0 .../gentests/testdata/cluster.health/10_basic.yml | 0 .../commands/gentests/testdata/info/10_basic.yml | 0 .../gentests/testdata/info/20_lucene_version.yml | 0 internal/cmd/generate/main.go | 0 internal/cmd/generate/utils/chromatize.go | 0 internal/cmd/generate/utils/debug.go | 0 internal/cmd/generate/utils/map.go | 0 internal/cmd/generate/utils/metadata.go | 0 internal/cmd/generate/utils/naming.go | 0 internal/cmd/generate/utils/strings.go | 0 internal/cmd/generate/utils/terminal.go | 0 385 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 .circleci/config.yml mode change 100755 => 100644 .codecov.yml mode change 100755 => 100644 .dockerignore mode change 100755 => 100644 .gitignore mode change 100755 => 100644 .jenkins/certs/ca.crt mode change 100755 => 100644 .jenkins/certs/testnode.crt mode change 100755 => 100644 .jenkins/certs/testnode.key mode change 100755 => 100644 .jenkins/jobs/defaults.yml mode change 100755 => 100644 .jenkins/jobs/elastic+go-elasticsearch+5.x.yml mode change 100755 => 100644 .jenkins/jobs/elastic+go-elasticsearch+6.x.yml mode change 100755 => 100644 .jenkins/jobs/elastic+go-elasticsearch+7.x.yml mode change 100755 => 100644 .jenkins/jobs/elastic+go-elasticsearch+master.yml mode change 100755 => 100644 .jenkins/test-matrix.yml mode change 100755 => 100644 .jenkins/tests-core.sh mode change 100755 => 100644 .travis.yml mode change 100755 => 100644 Dockerfile mode change 100755 => 100644 LICENSE mode change 100755 => 100644 Makefile mode change 100755 => 100644 README.md mode change 100755 => 100644 _examples/README.md mode change 100755 => 100644 _examples/cloudfunction/.gcloudignore mode change 100755 => 100644 _examples/cloudfunction/.gitignore mode change 100755 => 100644 _examples/cloudfunction/Makefile mode change 100755 => 100644 _examples/cloudfunction/README.md mode change 100755 => 100644 _examples/cloudfunction/function.go mode change 100755 => 100644 _examples/cloudfunction/function_test.go mode change 100755 => 100644 _examples/cloudfunction/screenshot.png mode change 100755 => 100644 _examples/configuration.go mode change 100755 => 100644 _examples/customization.go mode change 100755 => 100644 _examples/fasthttp/.gitignore mode change 100755 => 100644 _examples/fasthttp/Makefile mode change 100755 => 100644 _examples/fasthttp/README.md mode change 100755 => 100644 _examples/fasthttp/cmd/main.go mode change 100755 => 100644 _examples/fasthttp/fasthttp.go mode change 100755 => 100644 _examples/fasthttp/fasthttp_benchmark_test.go mode change 100755 => 100644 _examples/main.go mode change 100755 => 100644 _examples/xkcdsearch/.dockerignore mode change 100755 => 100644 _examples/xkcdsearch/.gitignore mode change 100755 => 100644 _examples/xkcdsearch/Dockerfile mode change 100755 => 100644 _examples/xkcdsearch/Makefile mode change 100755 => 100644 _examples/xkcdsearch/README.md mode change 100755 => 100644 _examples/xkcdsearch/cmd/xkcd/commands/index.go mode change 100755 => 100644 _examples/xkcdsearch/cmd/xkcd/commands/root.go mode change 100755 => 100644 _examples/xkcdsearch/cmd/xkcd/commands/search.go mode change 100755 => 100644 _examples/xkcdsearch/cmd/xkcd/commands/server.go mode change 100755 => 100644 _examples/xkcdsearch/cmd/xkcd/main.go mode change 100755 => 100644 _examples/xkcdsearch/http.go mode change 100755 => 100644 _examples/xkcdsearch/store.go mode change 100755 => 100644 _examples/xkcdsearch/store_test.go mode change 100755 => 100644 _examples/xkcdsearch/testdata/match_all.json mode change 100755 => 100644 _examples/xkcdsearch/testdata/match_query.json mode change 100755 => 100644 _examples/xkcdsearch/web/application.js mode change 100755 => 100644 _examples/xkcdsearch/web/assets/fonts/xkcd-script.woff mode change 100755 => 100644 _examples/xkcdsearch/web/assets/images/github-ribbon.svg mode change 100755 => 100644 _examples/xkcdsearch/web/assets/images/left.png mode change 100755 => 100644 _examples/xkcdsearch/web/assets/images/middle.png mode change 100755 => 100644 _examples/xkcdsearch/web/assets/images/right.png mode change 100755 => 100644 _examples/xkcdsearch/web/index.html mode change 100755 => 100644 _examples/xkcdsearch/web/style.css mode change 100755 => 100644 _examples/xkcdsearch/xkcd.go mode change 100755 => 100644 doc.go mode change 100755 => 100644 elasticsearch.go mode change 100755 => 100644 elasticsearch_benchmark_test.go mode change 100755 => 100644 elasticsearch_example_test.go mode change 100755 => 100644 elasticsearch_integration_test.go mode change 100755 => 100644 elasticsearch_internal_test.go mode change 100755 => 100644 esapi/api.bulk.go mode change 100755 => 100644 esapi/api.cat.aliases.go mode change 100755 => 100644 esapi/api.cat.allocation.go mode change 100755 => 100644 esapi/api.cat.count.go mode change 100755 => 100644 esapi/api.cat.fielddata.go mode change 100755 => 100644 esapi/api.cat.health.go mode change 100755 => 100644 esapi/api.cat.help.go mode change 100755 => 100644 esapi/api.cat.indices.go mode change 100755 => 100644 esapi/api.cat.master.go mode change 100755 => 100644 esapi/api.cat.nodeattrs.go mode change 100755 => 100644 esapi/api.cat.nodes.go mode change 100755 => 100644 esapi/api.cat.pending_tasks.go mode change 100755 => 100644 esapi/api.cat.plugins.go mode change 100755 => 100644 esapi/api.cat.recovery.go mode change 100755 => 100644 esapi/api.cat.repositories.go mode change 100755 => 100644 esapi/api.cat.segments.go mode change 100755 => 100644 esapi/api.cat.shards.go mode change 100755 => 100644 esapi/api.cat.snapshots.go mode change 100755 => 100644 esapi/api.cat.tasks.go mode change 100755 => 100644 esapi/api.cat.templates.go mode change 100755 => 100644 esapi/api.cat.thread_pool.go mode change 100755 => 100644 esapi/api.clear_scroll.go mode change 100755 => 100644 esapi/api.cluster.allocation_explain.go mode change 100755 => 100644 esapi/api.cluster.get_settings.go mode change 100755 => 100644 esapi/api.cluster.health.go mode change 100755 => 100644 esapi/api.cluster.pending_tasks.go mode change 100755 => 100644 esapi/api.cluster.put_settings.go mode change 100755 => 100644 esapi/api.cluster.remote_info.go mode change 100755 => 100644 esapi/api.cluster.reroute.go mode change 100755 => 100644 esapi/api.cluster.state.go mode change 100755 => 100644 esapi/api.cluster.stats.go mode change 100755 => 100644 esapi/api.count.go mode change 100755 => 100644 esapi/api.create.go mode change 100755 => 100644 esapi/api.delete.go mode change 100755 => 100644 esapi/api.delete_by_query.go mode change 100755 => 100644 esapi/api.delete_by_query_rethrottle.go mode change 100755 => 100644 esapi/api.delete_script.go mode change 100755 => 100644 esapi/api.exists.go mode change 100755 => 100644 esapi/api.exists_source.go mode change 100755 => 100644 esapi/api.explain.go mode change 100755 => 100644 esapi/api.field_caps.go mode change 100755 => 100644 esapi/api.get.go mode change 100755 => 100644 esapi/api.get_script.go mode change 100755 => 100644 esapi/api.get_source.go mode change 100755 => 100644 esapi/api.index.go mode change 100755 => 100644 esapi/api.indices.analyze.go mode change 100755 => 100644 esapi/api.indices.clear_cache.go mode change 100755 => 100644 esapi/api.indices.clone.go mode change 100755 => 100644 esapi/api.indices.close.go mode change 100755 => 100644 esapi/api.indices.create.go mode change 100755 => 100644 esapi/api.indices.delete.go mode change 100755 => 100644 esapi/api.indices.delete_alias.go mode change 100755 => 100644 esapi/api.indices.delete_template.go mode change 100755 => 100644 esapi/api.indices.exists.go mode change 100755 => 100644 esapi/api.indices.exists_alias.go mode change 100755 => 100644 esapi/api.indices.exists_template.go mode change 100755 => 100644 esapi/api.indices.exists_type.go mode change 100755 => 100644 esapi/api.indices.flush.go mode change 100755 => 100644 esapi/api.indices.flush_synced.go mode change 100755 => 100644 esapi/api.indices.forcemerge.go mode change 100755 => 100644 esapi/api.indices.get.go mode change 100755 => 100644 esapi/api.indices.get_alias.go mode change 100755 => 100644 esapi/api.indices.get_field_mapping.go mode change 100755 => 100644 esapi/api.indices.get_mapping.go mode change 100755 => 100644 esapi/api.indices.get_settings.go mode change 100755 => 100644 esapi/api.indices.get_template.go mode change 100755 => 100644 esapi/api.indices.get_upgrade.go mode change 100755 => 100644 esapi/api.indices.open.go mode change 100755 => 100644 esapi/api.indices.put_alias.go mode change 100755 => 100644 esapi/api.indices.put_mapping.go mode change 100755 => 100644 esapi/api.indices.put_settings.go mode change 100755 => 100644 esapi/api.indices.put_template.go mode change 100755 => 100644 esapi/api.indices.recovery.go mode change 100755 => 100644 esapi/api.indices.refresh.go mode change 100755 => 100644 esapi/api.indices.rollover.go mode change 100755 => 100644 esapi/api.indices.segments.go mode change 100755 => 100644 esapi/api.indices.shard_stores.go mode change 100755 => 100644 esapi/api.indices.shrink.go mode change 100755 => 100644 esapi/api.indices.split.go mode change 100755 => 100644 esapi/api.indices.stats.go mode change 100755 => 100644 esapi/api.indices.update_aliases.go mode change 100755 => 100644 esapi/api.indices.upgrade.go mode change 100755 => 100644 esapi/api.indices.validate_query.go mode change 100755 => 100644 esapi/api.info.go mode change 100755 => 100644 esapi/api.ingest.delete_pipeline.go mode change 100755 => 100644 esapi/api.ingest.get_pipeline.go mode change 100755 => 100644 esapi/api.ingest.processor_grok.go mode change 100755 => 100644 esapi/api.ingest.put_pipeline.go mode change 100755 => 100644 esapi/api.ingest.simulate.go mode change 100755 => 100644 esapi/api.mget.go mode change 100755 => 100644 esapi/api.msearch.go mode change 100755 => 100644 esapi/api.msearch_template.go mode change 100755 => 100644 esapi/api.mtermvectors.go mode change 100755 => 100644 esapi/api.nodes.hot_threads.go mode change 100755 => 100644 esapi/api.nodes.info.go mode change 100755 => 100644 esapi/api.nodes.reload_secure_settings.go mode change 100755 => 100644 esapi/api.nodes.stats.go mode change 100755 => 100644 esapi/api.nodes.usage.go mode change 100755 => 100644 esapi/api.ping.go mode change 100755 => 100644 esapi/api.put_script.go mode change 100755 => 100644 esapi/api.rank_eval.go mode change 100755 => 100644 esapi/api.reindex.go mode change 100755 => 100644 esapi/api.reindex_rethrottle.go mode change 100755 => 100644 esapi/api.render_search_template.go mode change 100755 => 100644 esapi/api.scripts_painless_execute.go mode change 100755 => 100644 esapi/api.scroll.go mode change 100755 => 100644 esapi/api.search.go mode change 100755 => 100644 esapi/api.search_shards.go mode change 100755 => 100644 esapi/api.search_template.go mode change 100755 => 100644 esapi/api.snapshot.cleanup_repository.go mode change 100755 => 100644 esapi/api.snapshot.create.go mode change 100755 => 100644 esapi/api.snapshot.create_repository.go mode change 100755 => 100644 esapi/api.snapshot.delete.go mode change 100755 => 100644 esapi/api.snapshot.delete_repository.go mode change 100755 => 100644 esapi/api.snapshot.get.go mode change 100755 => 100644 esapi/api.snapshot.get_repository.go mode change 100755 => 100644 esapi/api.snapshot.restore.go mode change 100755 => 100644 esapi/api.snapshot.status.go mode change 100755 => 100644 esapi/api.snapshot.verify_repository.go mode change 100755 => 100644 esapi/api.tasks.cancel.go mode change 100755 => 100644 esapi/api.tasks.get.go mode change 100755 => 100644 esapi/api.tasks.list.go mode change 100755 => 100644 esapi/api.termvectors.go mode change 100755 => 100644 esapi/api.update.go mode change 100755 => 100644 esapi/api.update_by_query.go mode change 100755 => 100644 esapi/api.update_by_query_rethrottle.go mode change 100755 => 100644 esapi/api.xpack.ccr.delete_auto_follow_pattern.go mode change 100755 => 100644 esapi/api.xpack.ccr.follow.go mode change 100755 => 100644 esapi/api.xpack.ccr.follow_info.go mode change 100755 => 100644 esapi/api.xpack.ccr.follow_stats.go mode change 100755 => 100644 esapi/api.xpack.ccr.forget_follower.go mode change 100755 => 100644 esapi/api.xpack.ccr.get_auto_follow_pattern.go mode change 100755 => 100644 esapi/api.xpack.ccr.pause_follow.go mode change 100755 => 100644 esapi/api.xpack.ccr.put_auto_follow_pattern.go mode change 100755 => 100644 esapi/api.xpack.ccr.resume_follow.go mode change 100755 => 100644 esapi/api.xpack.ccr.stats.go mode change 100755 => 100644 esapi/api.xpack.ccr.unfollow.go mode change 100755 => 100644 esapi/api.xpack.data_frame.delete_data_frame_transform.go mode change 100755 => 100644 esapi/api.xpack.data_frame.get_data_frame_transform.go mode change 100755 => 100644 esapi/api.xpack.data_frame.get_data_frame_transform_stats.go mode change 100755 => 100644 esapi/api.xpack.data_frame.preview_data_frame_transform.go mode change 100755 => 100644 esapi/api.xpack.data_frame.put_data_frame_transform.go mode change 100755 => 100644 esapi/api.xpack.data_frame.start_data_frame_transform.go mode change 100755 => 100644 esapi/api.xpack.data_frame.stop_data_frame_transform.go mode change 100755 => 100644 esapi/api.xpack.data_frame.update_data_frame_transform.go mode change 100755 => 100644 esapi/api.xpack.graph.explore.go mode change 100755 => 100644 esapi/api.xpack.ilm.delete_lifecycle.go mode change 100755 => 100644 esapi/api.xpack.ilm.explain_lifecycle.go mode change 100755 => 100644 esapi/api.xpack.ilm.get_lifecycle.go mode change 100755 => 100644 esapi/api.xpack.ilm.get_status.go mode change 100755 => 100644 esapi/api.xpack.ilm.move_to_step.go mode change 100755 => 100644 esapi/api.xpack.ilm.put_lifecycle.go mode change 100755 => 100644 esapi/api.xpack.ilm.remove_policy.go mode change 100755 => 100644 esapi/api.xpack.ilm.retry.go mode change 100755 => 100644 esapi/api.xpack.ilm.start.go mode change 100755 => 100644 esapi/api.xpack.ilm.stop.go mode change 100755 => 100644 esapi/api.xpack.indices.freeze.go mode change 100755 => 100644 esapi/api.xpack.indices.reload_search_analyzers.go mode change 100755 => 100644 esapi/api.xpack.indices.unfreeze.go mode change 100755 => 100644 esapi/api.xpack.license.delete.go mode change 100755 => 100644 esapi/api.xpack.license.get.go mode change 100755 => 100644 esapi/api.xpack.license.get_basic_status.go mode change 100755 => 100644 esapi/api.xpack.license.get_trial_status.go mode change 100755 => 100644 esapi/api.xpack.license.post.go mode change 100755 => 100644 esapi/api.xpack.license.post_start_basic.go mode change 100755 => 100644 esapi/api.xpack.license.post_start_trial.go mode change 100755 => 100644 esapi/api.xpack.migration.deprecations.go mode change 100755 => 100644 esapi/api.xpack.ml.close_job.go mode change 100755 => 100644 esapi/api.xpack.ml.delete_calendar.go mode change 100755 => 100644 esapi/api.xpack.ml.delete_calendar_event.go mode change 100755 => 100644 esapi/api.xpack.ml.delete_calendar_job.go mode change 100755 => 100644 esapi/api.xpack.ml.delete_data_frame_analytics.go mode change 100755 => 100644 esapi/api.xpack.ml.delete_datafeed.go mode change 100755 => 100644 esapi/api.xpack.ml.delete_expired_data.go mode change 100755 => 100644 esapi/api.xpack.ml.delete_filter.go mode change 100755 => 100644 esapi/api.xpack.ml.delete_forecast.go mode change 100755 => 100644 esapi/api.xpack.ml.delete_job.go mode change 100755 => 100644 esapi/api.xpack.ml.delete_model_snapshot.go mode change 100755 => 100644 esapi/api.xpack.ml.estimate_memory_usage.go mode change 100755 => 100644 esapi/api.xpack.ml.evaluate_data_frame.go mode change 100755 => 100644 esapi/api.xpack.ml.find_file_structure.go mode change 100755 => 100644 esapi/api.xpack.ml.flush_job.go mode change 100755 => 100644 esapi/api.xpack.ml.forecast.go mode change 100755 => 100644 esapi/api.xpack.ml.get_buckets.go mode change 100755 => 100644 esapi/api.xpack.ml.get_calendar_events.go mode change 100755 => 100644 esapi/api.xpack.ml.get_calendars.go mode change 100755 => 100644 esapi/api.xpack.ml.get_categories.go mode change 100755 => 100644 esapi/api.xpack.ml.get_data_frame_analytics.go mode change 100755 => 100644 esapi/api.xpack.ml.get_data_frame_analytics_stats.go mode change 100755 => 100644 esapi/api.xpack.ml.get_datafeed_stats.go mode change 100755 => 100644 esapi/api.xpack.ml.get_datafeeds.go mode change 100755 => 100644 esapi/api.xpack.ml.get_filters.go mode change 100755 => 100644 esapi/api.xpack.ml.get_influencers.go mode change 100755 => 100644 esapi/api.xpack.ml.get_job_stats.go mode change 100755 => 100644 esapi/api.xpack.ml.get_jobs.go mode change 100755 => 100644 esapi/api.xpack.ml.get_model_snapshots.go mode change 100755 => 100644 esapi/api.xpack.ml.get_overall_buckets.go mode change 100755 => 100644 esapi/api.xpack.ml.get_records.go mode change 100755 => 100644 esapi/api.xpack.ml.info.go mode change 100755 => 100644 esapi/api.xpack.ml.open_job.go mode change 100755 => 100644 esapi/api.xpack.ml.post_calendar_events.go mode change 100755 => 100644 esapi/api.xpack.ml.post_data.go mode change 100755 => 100644 esapi/api.xpack.ml.preview_datafeed.go mode change 100755 => 100644 esapi/api.xpack.ml.put_calendar.go mode change 100755 => 100644 esapi/api.xpack.ml.put_calendar_job.go mode change 100755 => 100644 esapi/api.xpack.ml.put_data_frame_analytics.go mode change 100755 => 100644 esapi/api.xpack.ml.put_datafeed.go mode change 100755 => 100644 esapi/api.xpack.ml.put_filter.go mode change 100755 => 100644 esapi/api.xpack.ml.put_job.go mode change 100755 => 100644 esapi/api.xpack.ml.revert_model_snapshot.go mode change 100755 => 100644 esapi/api.xpack.ml.set_upgrade_mode.go mode change 100755 => 100644 esapi/api.xpack.ml.start_data_frame_analytics.go mode change 100755 => 100644 esapi/api.xpack.ml.start_datafeed.go mode change 100755 => 100644 esapi/api.xpack.ml.stop_data_frame_analytics.go mode change 100755 => 100644 esapi/api.xpack.ml.stop_datafeed.go mode change 100755 => 100644 esapi/api.xpack.ml.update_datafeed.go mode change 100755 => 100644 esapi/api.xpack.ml.update_filter.go mode change 100755 => 100644 esapi/api.xpack.ml.update_job.go mode change 100755 => 100644 esapi/api.xpack.ml.update_model_snapshot.go mode change 100755 => 100644 esapi/api.xpack.ml.validate.go mode change 100755 => 100644 esapi/api.xpack.ml.validate_detector.go mode change 100755 => 100644 esapi/api.xpack.monitoring.bulk.go mode change 100755 => 100644 esapi/api.xpack.rollup.delete_job.go mode change 100755 => 100644 esapi/api.xpack.rollup.get_jobs.go mode change 100755 => 100644 esapi/api.xpack.rollup.get_rollup_caps.go mode change 100755 => 100644 esapi/api.xpack.rollup.get_rollup_index_caps.go mode change 100755 => 100644 esapi/api.xpack.rollup.put_job.go mode change 100755 => 100644 esapi/api.xpack.rollup.rollup_search.go mode change 100755 => 100644 esapi/api.xpack.rollup.start_job.go mode change 100755 => 100644 esapi/api.xpack.rollup.stop_job.go mode change 100755 => 100644 esapi/api.xpack.security.authenticate.go mode change 100755 => 100644 esapi/api.xpack.security.change_password.go mode change 100755 => 100644 esapi/api.xpack.security.clear_cached_realms.go mode change 100755 => 100644 esapi/api.xpack.security.clear_cached_roles.go mode change 100755 => 100644 esapi/api.xpack.security.create_api_key.go mode change 100755 => 100644 esapi/api.xpack.security.delete_privileges.go mode change 100755 => 100644 esapi/api.xpack.security.delete_role.go mode change 100755 => 100644 esapi/api.xpack.security.delete_role_mapping.go mode change 100755 => 100644 esapi/api.xpack.security.delete_user.go mode change 100755 => 100644 esapi/api.xpack.security.disable_user.go mode change 100755 => 100644 esapi/api.xpack.security.enable_user.go mode change 100755 => 100644 esapi/api.xpack.security.get_api_key.go mode change 100755 => 100644 esapi/api.xpack.security.get_builtin_privileges.go mode change 100755 => 100644 esapi/api.xpack.security.get_privileges.go mode change 100755 => 100644 esapi/api.xpack.security.get_role.go mode change 100755 => 100644 esapi/api.xpack.security.get_role_mapping.go mode change 100755 => 100644 esapi/api.xpack.security.get_token.go mode change 100755 => 100644 esapi/api.xpack.security.get_user.go mode change 100755 => 100644 esapi/api.xpack.security.get_user_privileges.go mode change 100755 => 100644 esapi/api.xpack.security.has_privileges.go mode change 100755 => 100644 esapi/api.xpack.security.invalidate_api_key.go mode change 100755 => 100644 esapi/api.xpack.security.invalidate_token.go mode change 100755 => 100644 esapi/api.xpack.security.put_privileges.go mode change 100755 => 100644 esapi/api.xpack.security.put_role.go mode change 100755 => 100644 esapi/api.xpack.security.put_role_mapping.go mode change 100755 => 100644 esapi/api.xpack.security.put_user.go mode change 100755 => 100644 esapi/api.xpack.slm.delete_lifecycle.go mode change 100755 => 100644 esapi/api.xpack.slm.execute_lifecycle.go mode change 100755 => 100644 esapi/api.xpack.slm.get_lifecycle.go mode change 100755 => 100644 esapi/api.xpack.slm.put_lifecycle.go mode change 100755 => 100644 esapi/api.xpack.sql.clear_cursor.go mode change 100755 => 100644 esapi/api.xpack.sql.query.go mode change 100755 => 100644 esapi/api.xpack.sql.translate.go mode change 100755 => 100644 esapi/api.xpack.ssl.certificates.go mode change 100755 => 100644 esapi/api.xpack.watcher.ack_watch.go mode change 100755 => 100644 esapi/api.xpack.watcher.activate_watch.go mode change 100755 => 100644 esapi/api.xpack.watcher.deactivate_watch.go mode change 100755 => 100644 esapi/api.xpack.watcher.delete_watch.go mode change 100755 => 100644 esapi/api.xpack.watcher.execute_watch.go mode change 100755 => 100644 esapi/api.xpack.watcher.get_watch.go mode change 100755 => 100644 esapi/api.xpack.watcher.put_watch.go mode change 100755 => 100644 esapi/api.xpack.watcher.start.go mode change 100755 => 100644 esapi/api.xpack.watcher.stats.go mode change 100755 => 100644 esapi/api.xpack.watcher.stop.go mode change 100755 => 100644 esapi/api.xpack.xpack.info.go mode change 100755 => 100644 esapi/api.xpack.xpack.usage.go mode change 100755 => 100644 esapi/doc.go mode change 100755 => 100644 esapi/esapi.go mode change 100755 => 100644 esapi/esapi.request.go mode change 100755 => 100644 esapi/esapi.response.go mode change 100755 => 100644 esapi/esapi.response_example_test.go mode change 100755 => 100644 esapi/esapi_benchmark_test.go mode change 100755 => 100644 esapi/esapi_internal_test.go mode change 100755 => 100644 esapi/esapi_request_internal_test.go mode change 100755 => 100644 esapi/esapi_response_internal_test.go mode change 100755 => 100644 esapi/test/.gitignore mode change 100755 => 100644 estransport/doc.go mode change 100755 => 100644 estransport/estransport.go mode change 100755 => 100644 estransport/estransport_integration_test.go mode change 100755 => 100644 estransport/estransport_internal_test.go mode change 100755 => 100644 estransport/selector.go mode change 100755 => 100644 go.sum mode change 100755 => 100644 internal/cmd/generate/commands/commands.go mode change 100755 => 100644 internal/cmd/generate/commands/gensource/debug.go mode change 100755 => 100644 internal/cmd/generate/commands/gensource/descriptions.go mode change 100755 => 100644 internal/cmd/generate/commands/gensource/generator.go mode change 100755 => 100644 internal/cmd/generate/commands/gensource/generator_test.go mode change 100755 => 100644 internal/cmd/generate/commands/gensource/model.go mode change 100755 => 100644 internal/cmd/generate/commands/gensource/overrides.go mode change 100755 => 100644 internal/cmd/generate/commands/gensource/testdata/info.json mode change 100755 => 100644 internal/cmd/generate/commands/gentests/.gitignore mode change 100755 => 100644 internal/cmd/generate/commands/gentests/command.go mode change 100755 => 100644 internal/cmd/generate/commands/gentests/debug.go mode change 100755 => 100644 internal/cmd/generate/commands/gentests/gen_api_registry.go mode change 100755 => 100644 internal/cmd/generate/commands/gentests/generator.go mode change 100755 => 100644 internal/cmd/generate/commands/gentests/model.go mode change 100755 => 100644 internal/cmd/generate/commands/gentests/patches.go mode change 100755 => 100644 internal/cmd/generate/commands/gentests/skips.go mode change 100755 => 100644 internal/cmd/generate/commands/gentests/testdata/cluster.health/10_basic.yml mode change 100755 => 100644 internal/cmd/generate/commands/gentests/testdata/info/10_basic.yml mode change 100755 => 100644 internal/cmd/generate/commands/gentests/testdata/info/20_lucene_version.yml mode change 100755 => 100644 internal/cmd/generate/main.go mode change 100755 => 100644 internal/cmd/generate/utils/chromatize.go mode change 100755 => 100644 internal/cmd/generate/utils/debug.go mode change 100755 => 100644 internal/cmd/generate/utils/map.go mode change 100755 => 100644 internal/cmd/generate/utils/metadata.go mode change 100755 => 100644 internal/cmd/generate/utils/naming.go mode change 100755 => 100644 internal/cmd/generate/utils/strings.go mode change 100755 => 100644 internal/cmd/generate/utils/terminal.go diff --git a/.circleci/config.yml b/.circleci/config.yml old mode 100755 new mode 100644 diff --git a/.codecov.yml b/.codecov.yml old mode 100755 new mode 100644 diff --git a/.dockerignore b/.dockerignore old mode 100755 new mode 100644 diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/.jenkins/certs/ca.crt b/.jenkins/certs/ca.crt old mode 100755 new mode 100644 diff --git a/.jenkins/certs/testnode.crt b/.jenkins/certs/testnode.crt old mode 100755 new mode 100644 diff --git a/.jenkins/certs/testnode.key b/.jenkins/certs/testnode.key old mode 100755 new mode 100644 diff --git a/.jenkins/jobs/defaults.yml b/.jenkins/jobs/defaults.yml old mode 100755 new mode 100644 diff --git a/.jenkins/jobs/elastic+go-elasticsearch+5.x.yml b/.jenkins/jobs/elastic+go-elasticsearch+5.x.yml old mode 100755 new mode 100644 diff --git a/.jenkins/jobs/elastic+go-elasticsearch+6.x.yml b/.jenkins/jobs/elastic+go-elasticsearch+6.x.yml old mode 100755 new mode 100644 diff --git a/.jenkins/jobs/elastic+go-elasticsearch+7.x.yml b/.jenkins/jobs/elastic+go-elasticsearch+7.x.yml old mode 100755 new mode 100644 diff --git a/.jenkins/jobs/elastic+go-elasticsearch+master.yml b/.jenkins/jobs/elastic+go-elasticsearch+master.yml old mode 100755 new mode 100644 diff --git a/.jenkins/test-matrix.yml b/.jenkins/test-matrix.yml old mode 100755 new mode 100644 diff --git a/.jenkins/tests-core.sh b/.jenkins/tests-core.sh old mode 100755 new mode 100644 diff --git a/.travis.yml b/.travis.yml old mode 100755 new mode 100644 diff --git a/Dockerfile b/Dockerfile old mode 100755 new mode 100644 diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/Makefile b/Makefile old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/_examples/README.md b/_examples/README.md old mode 100755 new mode 100644 diff --git a/_examples/cloudfunction/.gcloudignore b/_examples/cloudfunction/.gcloudignore old mode 100755 new mode 100644 diff --git a/_examples/cloudfunction/.gitignore b/_examples/cloudfunction/.gitignore old mode 100755 new mode 100644 diff --git a/_examples/cloudfunction/Makefile b/_examples/cloudfunction/Makefile old mode 100755 new mode 100644 diff --git a/_examples/cloudfunction/README.md b/_examples/cloudfunction/README.md old mode 100755 new mode 100644 diff --git a/_examples/cloudfunction/function.go b/_examples/cloudfunction/function.go old mode 100755 new mode 100644 diff --git a/_examples/cloudfunction/function_test.go b/_examples/cloudfunction/function_test.go old mode 100755 new mode 100644 diff --git a/_examples/cloudfunction/screenshot.png b/_examples/cloudfunction/screenshot.png old mode 100755 new mode 100644 diff --git a/_examples/configuration.go b/_examples/configuration.go old mode 100755 new mode 100644 diff --git a/_examples/customization.go b/_examples/customization.go old mode 100755 new mode 100644 diff --git a/_examples/fasthttp/.gitignore b/_examples/fasthttp/.gitignore old mode 100755 new mode 100644 diff --git a/_examples/fasthttp/Makefile b/_examples/fasthttp/Makefile old mode 100755 new mode 100644 diff --git a/_examples/fasthttp/README.md b/_examples/fasthttp/README.md old mode 100755 new mode 100644 diff --git a/_examples/fasthttp/cmd/main.go b/_examples/fasthttp/cmd/main.go old mode 100755 new mode 100644 diff --git a/_examples/fasthttp/fasthttp.go b/_examples/fasthttp/fasthttp.go old mode 100755 new mode 100644 diff --git a/_examples/fasthttp/fasthttp_benchmark_test.go b/_examples/fasthttp/fasthttp_benchmark_test.go old mode 100755 new mode 100644 diff --git a/_examples/main.go b/_examples/main.go old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/.dockerignore b/_examples/xkcdsearch/.dockerignore old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/.gitignore b/_examples/xkcdsearch/.gitignore old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/Dockerfile b/_examples/xkcdsearch/Dockerfile old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/Makefile b/_examples/xkcdsearch/Makefile old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/README.md b/_examples/xkcdsearch/README.md old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/cmd/xkcd/commands/index.go b/_examples/xkcdsearch/cmd/xkcd/commands/index.go old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/cmd/xkcd/commands/root.go b/_examples/xkcdsearch/cmd/xkcd/commands/root.go old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/cmd/xkcd/commands/search.go b/_examples/xkcdsearch/cmd/xkcd/commands/search.go old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/cmd/xkcd/commands/server.go b/_examples/xkcdsearch/cmd/xkcd/commands/server.go old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/cmd/xkcd/main.go b/_examples/xkcdsearch/cmd/xkcd/main.go old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/http.go b/_examples/xkcdsearch/http.go old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/store.go b/_examples/xkcdsearch/store.go old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/store_test.go b/_examples/xkcdsearch/store_test.go old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/testdata/match_all.json b/_examples/xkcdsearch/testdata/match_all.json old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/testdata/match_query.json b/_examples/xkcdsearch/testdata/match_query.json old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/web/application.js b/_examples/xkcdsearch/web/application.js old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/web/assets/fonts/xkcd-script.woff b/_examples/xkcdsearch/web/assets/fonts/xkcd-script.woff old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/web/assets/images/github-ribbon.svg b/_examples/xkcdsearch/web/assets/images/github-ribbon.svg old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/web/assets/images/left.png b/_examples/xkcdsearch/web/assets/images/left.png old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/web/assets/images/middle.png b/_examples/xkcdsearch/web/assets/images/middle.png old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/web/assets/images/right.png b/_examples/xkcdsearch/web/assets/images/right.png old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/web/index.html b/_examples/xkcdsearch/web/index.html old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/web/style.css b/_examples/xkcdsearch/web/style.css old mode 100755 new mode 100644 diff --git a/_examples/xkcdsearch/xkcd.go b/_examples/xkcdsearch/xkcd.go old mode 100755 new mode 100644 diff --git a/doc.go b/doc.go old mode 100755 new mode 100644 diff --git a/elasticsearch.go b/elasticsearch.go old mode 100755 new mode 100644 diff --git a/elasticsearch_benchmark_test.go b/elasticsearch_benchmark_test.go old mode 100755 new mode 100644 diff --git a/elasticsearch_example_test.go b/elasticsearch_example_test.go old mode 100755 new mode 100644 diff --git a/elasticsearch_integration_test.go b/elasticsearch_integration_test.go old mode 100755 new mode 100644 diff --git a/elasticsearch_internal_test.go b/elasticsearch_internal_test.go old mode 100755 new mode 100644 diff --git a/esapi/api.bulk.go b/esapi/api.bulk.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.aliases.go b/esapi/api.cat.aliases.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.allocation.go b/esapi/api.cat.allocation.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.count.go b/esapi/api.cat.count.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.fielddata.go b/esapi/api.cat.fielddata.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.health.go b/esapi/api.cat.health.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.help.go b/esapi/api.cat.help.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.indices.go b/esapi/api.cat.indices.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.master.go b/esapi/api.cat.master.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.nodeattrs.go b/esapi/api.cat.nodeattrs.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.nodes.go b/esapi/api.cat.nodes.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.pending_tasks.go b/esapi/api.cat.pending_tasks.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.plugins.go b/esapi/api.cat.plugins.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.recovery.go b/esapi/api.cat.recovery.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.repositories.go b/esapi/api.cat.repositories.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.segments.go b/esapi/api.cat.segments.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.shards.go b/esapi/api.cat.shards.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.snapshots.go b/esapi/api.cat.snapshots.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.tasks.go b/esapi/api.cat.tasks.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.templates.go b/esapi/api.cat.templates.go old mode 100755 new mode 100644 diff --git a/esapi/api.cat.thread_pool.go b/esapi/api.cat.thread_pool.go old mode 100755 new mode 100644 diff --git a/esapi/api.clear_scroll.go b/esapi/api.clear_scroll.go old mode 100755 new mode 100644 diff --git a/esapi/api.cluster.allocation_explain.go b/esapi/api.cluster.allocation_explain.go old mode 100755 new mode 100644 diff --git a/esapi/api.cluster.get_settings.go b/esapi/api.cluster.get_settings.go old mode 100755 new mode 100644 diff --git a/esapi/api.cluster.health.go b/esapi/api.cluster.health.go old mode 100755 new mode 100644 diff --git a/esapi/api.cluster.pending_tasks.go b/esapi/api.cluster.pending_tasks.go old mode 100755 new mode 100644 diff --git a/esapi/api.cluster.put_settings.go b/esapi/api.cluster.put_settings.go old mode 100755 new mode 100644 diff --git a/esapi/api.cluster.remote_info.go b/esapi/api.cluster.remote_info.go old mode 100755 new mode 100644 diff --git a/esapi/api.cluster.reroute.go b/esapi/api.cluster.reroute.go old mode 100755 new mode 100644 diff --git a/esapi/api.cluster.state.go b/esapi/api.cluster.state.go old mode 100755 new mode 100644 diff --git a/esapi/api.cluster.stats.go b/esapi/api.cluster.stats.go old mode 100755 new mode 100644 diff --git a/esapi/api.count.go b/esapi/api.count.go old mode 100755 new mode 100644 diff --git a/esapi/api.create.go b/esapi/api.create.go old mode 100755 new mode 100644 diff --git a/esapi/api.delete.go b/esapi/api.delete.go old mode 100755 new mode 100644 diff --git a/esapi/api.delete_by_query.go b/esapi/api.delete_by_query.go old mode 100755 new mode 100644 diff --git a/esapi/api.delete_by_query_rethrottle.go b/esapi/api.delete_by_query_rethrottle.go old mode 100755 new mode 100644 diff --git a/esapi/api.delete_script.go b/esapi/api.delete_script.go old mode 100755 new mode 100644 diff --git a/esapi/api.exists.go b/esapi/api.exists.go old mode 100755 new mode 100644 diff --git a/esapi/api.exists_source.go b/esapi/api.exists_source.go old mode 100755 new mode 100644 diff --git a/esapi/api.explain.go b/esapi/api.explain.go old mode 100755 new mode 100644 diff --git a/esapi/api.field_caps.go b/esapi/api.field_caps.go old mode 100755 new mode 100644 diff --git a/esapi/api.get.go b/esapi/api.get.go old mode 100755 new mode 100644 diff --git a/esapi/api.get_script.go b/esapi/api.get_script.go old mode 100755 new mode 100644 diff --git a/esapi/api.get_source.go b/esapi/api.get_source.go old mode 100755 new mode 100644 diff --git a/esapi/api.index.go b/esapi/api.index.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.analyze.go b/esapi/api.indices.analyze.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.clear_cache.go b/esapi/api.indices.clear_cache.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.clone.go b/esapi/api.indices.clone.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.close.go b/esapi/api.indices.close.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.create.go b/esapi/api.indices.create.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.delete.go b/esapi/api.indices.delete.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.delete_alias.go b/esapi/api.indices.delete_alias.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.delete_template.go b/esapi/api.indices.delete_template.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.exists.go b/esapi/api.indices.exists.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.exists_alias.go b/esapi/api.indices.exists_alias.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.exists_template.go b/esapi/api.indices.exists_template.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.exists_type.go b/esapi/api.indices.exists_type.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.flush.go b/esapi/api.indices.flush.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.flush_synced.go b/esapi/api.indices.flush_synced.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.forcemerge.go b/esapi/api.indices.forcemerge.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.get.go b/esapi/api.indices.get.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.get_alias.go b/esapi/api.indices.get_alias.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.get_field_mapping.go b/esapi/api.indices.get_field_mapping.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.get_mapping.go b/esapi/api.indices.get_mapping.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.get_settings.go b/esapi/api.indices.get_settings.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.get_template.go b/esapi/api.indices.get_template.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.get_upgrade.go b/esapi/api.indices.get_upgrade.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.open.go b/esapi/api.indices.open.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.put_alias.go b/esapi/api.indices.put_alias.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.put_mapping.go b/esapi/api.indices.put_mapping.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.put_settings.go b/esapi/api.indices.put_settings.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.put_template.go b/esapi/api.indices.put_template.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.recovery.go b/esapi/api.indices.recovery.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.refresh.go b/esapi/api.indices.refresh.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.rollover.go b/esapi/api.indices.rollover.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.segments.go b/esapi/api.indices.segments.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.shard_stores.go b/esapi/api.indices.shard_stores.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.shrink.go b/esapi/api.indices.shrink.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.split.go b/esapi/api.indices.split.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.stats.go b/esapi/api.indices.stats.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.update_aliases.go b/esapi/api.indices.update_aliases.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.upgrade.go b/esapi/api.indices.upgrade.go old mode 100755 new mode 100644 diff --git a/esapi/api.indices.validate_query.go b/esapi/api.indices.validate_query.go old mode 100755 new mode 100644 diff --git a/esapi/api.info.go b/esapi/api.info.go old mode 100755 new mode 100644 diff --git a/esapi/api.ingest.delete_pipeline.go b/esapi/api.ingest.delete_pipeline.go old mode 100755 new mode 100644 diff --git a/esapi/api.ingest.get_pipeline.go b/esapi/api.ingest.get_pipeline.go old mode 100755 new mode 100644 diff --git a/esapi/api.ingest.processor_grok.go b/esapi/api.ingest.processor_grok.go old mode 100755 new mode 100644 diff --git a/esapi/api.ingest.put_pipeline.go b/esapi/api.ingest.put_pipeline.go old mode 100755 new mode 100644 diff --git a/esapi/api.ingest.simulate.go b/esapi/api.ingest.simulate.go old mode 100755 new mode 100644 diff --git a/esapi/api.mget.go b/esapi/api.mget.go old mode 100755 new mode 100644 diff --git a/esapi/api.msearch.go b/esapi/api.msearch.go old mode 100755 new mode 100644 diff --git a/esapi/api.msearch_template.go b/esapi/api.msearch_template.go old mode 100755 new mode 100644 diff --git a/esapi/api.mtermvectors.go b/esapi/api.mtermvectors.go old mode 100755 new mode 100644 diff --git a/esapi/api.nodes.hot_threads.go b/esapi/api.nodes.hot_threads.go old mode 100755 new mode 100644 diff --git a/esapi/api.nodes.info.go b/esapi/api.nodes.info.go old mode 100755 new mode 100644 diff --git a/esapi/api.nodes.reload_secure_settings.go b/esapi/api.nodes.reload_secure_settings.go old mode 100755 new mode 100644 diff --git a/esapi/api.nodes.stats.go b/esapi/api.nodes.stats.go old mode 100755 new mode 100644 diff --git a/esapi/api.nodes.usage.go b/esapi/api.nodes.usage.go old mode 100755 new mode 100644 diff --git a/esapi/api.ping.go b/esapi/api.ping.go old mode 100755 new mode 100644 diff --git a/esapi/api.put_script.go b/esapi/api.put_script.go old mode 100755 new mode 100644 diff --git a/esapi/api.rank_eval.go b/esapi/api.rank_eval.go old mode 100755 new mode 100644 diff --git a/esapi/api.reindex.go b/esapi/api.reindex.go old mode 100755 new mode 100644 diff --git a/esapi/api.reindex_rethrottle.go b/esapi/api.reindex_rethrottle.go old mode 100755 new mode 100644 diff --git a/esapi/api.render_search_template.go b/esapi/api.render_search_template.go old mode 100755 new mode 100644 diff --git a/esapi/api.scripts_painless_execute.go b/esapi/api.scripts_painless_execute.go old mode 100755 new mode 100644 diff --git a/esapi/api.scroll.go b/esapi/api.scroll.go old mode 100755 new mode 100644 diff --git a/esapi/api.search.go b/esapi/api.search.go old mode 100755 new mode 100644 diff --git a/esapi/api.search_shards.go b/esapi/api.search_shards.go old mode 100755 new mode 100644 diff --git a/esapi/api.search_template.go b/esapi/api.search_template.go old mode 100755 new mode 100644 diff --git a/esapi/api.snapshot.cleanup_repository.go b/esapi/api.snapshot.cleanup_repository.go old mode 100755 new mode 100644 diff --git a/esapi/api.snapshot.create.go b/esapi/api.snapshot.create.go old mode 100755 new mode 100644 diff --git a/esapi/api.snapshot.create_repository.go b/esapi/api.snapshot.create_repository.go old mode 100755 new mode 100644 diff --git a/esapi/api.snapshot.delete.go b/esapi/api.snapshot.delete.go old mode 100755 new mode 100644 diff --git a/esapi/api.snapshot.delete_repository.go b/esapi/api.snapshot.delete_repository.go old mode 100755 new mode 100644 diff --git a/esapi/api.snapshot.get.go b/esapi/api.snapshot.get.go old mode 100755 new mode 100644 diff --git a/esapi/api.snapshot.get_repository.go b/esapi/api.snapshot.get_repository.go old mode 100755 new mode 100644 diff --git a/esapi/api.snapshot.restore.go b/esapi/api.snapshot.restore.go old mode 100755 new mode 100644 diff --git a/esapi/api.snapshot.status.go b/esapi/api.snapshot.status.go old mode 100755 new mode 100644 diff --git a/esapi/api.snapshot.verify_repository.go b/esapi/api.snapshot.verify_repository.go old mode 100755 new mode 100644 diff --git a/esapi/api.tasks.cancel.go b/esapi/api.tasks.cancel.go old mode 100755 new mode 100644 diff --git a/esapi/api.tasks.get.go b/esapi/api.tasks.get.go old mode 100755 new mode 100644 diff --git a/esapi/api.tasks.list.go b/esapi/api.tasks.list.go old mode 100755 new mode 100644 diff --git a/esapi/api.termvectors.go b/esapi/api.termvectors.go old mode 100755 new mode 100644 diff --git a/esapi/api.update.go b/esapi/api.update.go old mode 100755 new mode 100644 diff --git a/esapi/api.update_by_query.go b/esapi/api.update_by_query.go old mode 100755 new mode 100644 diff --git a/esapi/api.update_by_query_rethrottle.go b/esapi/api.update_by_query_rethrottle.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ccr.follow.go b/esapi/api.xpack.ccr.follow.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ccr.follow_info.go b/esapi/api.xpack.ccr.follow_info.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ccr.follow_stats.go b/esapi/api.xpack.ccr.follow_stats.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ccr.forget_follower.go b/esapi/api.xpack.ccr.forget_follower.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ccr.get_auto_follow_pattern.go b/esapi/api.xpack.ccr.get_auto_follow_pattern.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ccr.pause_follow.go b/esapi/api.xpack.ccr.pause_follow.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ccr.put_auto_follow_pattern.go b/esapi/api.xpack.ccr.put_auto_follow_pattern.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ccr.resume_follow.go b/esapi/api.xpack.ccr.resume_follow.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ccr.stats.go b/esapi/api.xpack.ccr.stats.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ccr.unfollow.go b/esapi/api.xpack.ccr.unfollow.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.data_frame.delete_data_frame_transform.go b/esapi/api.xpack.data_frame.delete_data_frame_transform.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.data_frame.get_data_frame_transform.go b/esapi/api.xpack.data_frame.get_data_frame_transform.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go b/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.data_frame.preview_data_frame_transform.go b/esapi/api.xpack.data_frame.preview_data_frame_transform.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.data_frame.put_data_frame_transform.go b/esapi/api.xpack.data_frame.put_data_frame_transform.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.data_frame.start_data_frame_transform.go b/esapi/api.xpack.data_frame.start_data_frame_transform.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.data_frame.stop_data_frame_transform.go b/esapi/api.xpack.data_frame.stop_data_frame_transform.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.data_frame.update_data_frame_transform.go b/esapi/api.xpack.data_frame.update_data_frame_transform.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.graph.explore.go b/esapi/api.xpack.graph.explore.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ilm.delete_lifecycle.go b/esapi/api.xpack.ilm.delete_lifecycle.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ilm.explain_lifecycle.go b/esapi/api.xpack.ilm.explain_lifecycle.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ilm.get_lifecycle.go b/esapi/api.xpack.ilm.get_lifecycle.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ilm.get_status.go b/esapi/api.xpack.ilm.get_status.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ilm.move_to_step.go b/esapi/api.xpack.ilm.move_to_step.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ilm.put_lifecycle.go b/esapi/api.xpack.ilm.put_lifecycle.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ilm.remove_policy.go b/esapi/api.xpack.ilm.remove_policy.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ilm.retry.go b/esapi/api.xpack.ilm.retry.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ilm.start.go b/esapi/api.xpack.ilm.start.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ilm.stop.go b/esapi/api.xpack.ilm.stop.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.indices.freeze.go b/esapi/api.xpack.indices.freeze.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.indices.reload_search_analyzers.go b/esapi/api.xpack.indices.reload_search_analyzers.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.indices.unfreeze.go b/esapi/api.xpack.indices.unfreeze.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.license.delete.go b/esapi/api.xpack.license.delete.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.license.get.go b/esapi/api.xpack.license.get.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.license.get_basic_status.go b/esapi/api.xpack.license.get_basic_status.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.license.get_trial_status.go b/esapi/api.xpack.license.get_trial_status.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.license.post.go b/esapi/api.xpack.license.post.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.license.post_start_basic.go b/esapi/api.xpack.license.post_start_basic.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.license.post_start_trial.go b/esapi/api.xpack.license.post_start_trial.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.migration.deprecations.go b/esapi/api.xpack.migration.deprecations.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.close_job.go b/esapi/api.xpack.ml.close_job.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.delete_calendar.go b/esapi/api.xpack.ml.delete_calendar.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.delete_calendar_event.go b/esapi/api.xpack.ml.delete_calendar_event.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.delete_calendar_job.go b/esapi/api.xpack.ml.delete_calendar_job.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.delete_data_frame_analytics.go b/esapi/api.xpack.ml.delete_data_frame_analytics.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.delete_datafeed.go b/esapi/api.xpack.ml.delete_datafeed.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.delete_expired_data.go b/esapi/api.xpack.ml.delete_expired_data.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.delete_filter.go b/esapi/api.xpack.ml.delete_filter.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.delete_forecast.go b/esapi/api.xpack.ml.delete_forecast.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.delete_job.go b/esapi/api.xpack.ml.delete_job.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.delete_model_snapshot.go b/esapi/api.xpack.ml.delete_model_snapshot.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.estimate_memory_usage.go b/esapi/api.xpack.ml.estimate_memory_usage.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.evaluate_data_frame.go b/esapi/api.xpack.ml.evaluate_data_frame.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.find_file_structure.go b/esapi/api.xpack.ml.find_file_structure.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.flush_job.go b/esapi/api.xpack.ml.flush_job.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.forecast.go b/esapi/api.xpack.ml.forecast.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_buckets.go b/esapi/api.xpack.ml.get_buckets.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_calendar_events.go b/esapi/api.xpack.ml.get_calendar_events.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_calendars.go b/esapi/api.xpack.ml.get_calendars.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_categories.go b/esapi/api.xpack.ml.get_categories.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_data_frame_analytics.go b/esapi/api.xpack.ml.get_data_frame_analytics.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_datafeed_stats.go b/esapi/api.xpack.ml.get_datafeed_stats.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_datafeeds.go b/esapi/api.xpack.ml.get_datafeeds.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_filters.go b/esapi/api.xpack.ml.get_filters.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_influencers.go b/esapi/api.xpack.ml.get_influencers.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_job_stats.go b/esapi/api.xpack.ml.get_job_stats.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_jobs.go b/esapi/api.xpack.ml.get_jobs.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_model_snapshots.go b/esapi/api.xpack.ml.get_model_snapshots.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_overall_buckets.go b/esapi/api.xpack.ml.get_overall_buckets.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.get_records.go b/esapi/api.xpack.ml.get_records.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.info.go b/esapi/api.xpack.ml.info.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.open_job.go b/esapi/api.xpack.ml.open_job.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.post_calendar_events.go b/esapi/api.xpack.ml.post_calendar_events.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.post_data.go b/esapi/api.xpack.ml.post_data.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.preview_datafeed.go b/esapi/api.xpack.ml.preview_datafeed.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.put_calendar.go b/esapi/api.xpack.ml.put_calendar.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.put_calendar_job.go b/esapi/api.xpack.ml.put_calendar_job.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.put_data_frame_analytics.go b/esapi/api.xpack.ml.put_data_frame_analytics.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.put_datafeed.go b/esapi/api.xpack.ml.put_datafeed.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.put_filter.go b/esapi/api.xpack.ml.put_filter.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.put_job.go b/esapi/api.xpack.ml.put_job.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.revert_model_snapshot.go b/esapi/api.xpack.ml.revert_model_snapshot.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.set_upgrade_mode.go b/esapi/api.xpack.ml.set_upgrade_mode.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.start_data_frame_analytics.go b/esapi/api.xpack.ml.start_data_frame_analytics.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.start_datafeed.go b/esapi/api.xpack.ml.start_datafeed.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.stop_data_frame_analytics.go b/esapi/api.xpack.ml.stop_data_frame_analytics.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.stop_datafeed.go b/esapi/api.xpack.ml.stop_datafeed.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.update_datafeed.go b/esapi/api.xpack.ml.update_datafeed.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.update_filter.go b/esapi/api.xpack.ml.update_filter.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.update_job.go b/esapi/api.xpack.ml.update_job.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.update_model_snapshot.go b/esapi/api.xpack.ml.update_model_snapshot.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.validate.go b/esapi/api.xpack.ml.validate.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ml.validate_detector.go b/esapi/api.xpack.ml.validate_detector.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.monitoring.bulk.go b/esapi/api.xpack.monitoring.bulk.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.rollup.delete_job.go b/esapi/api.xpack.rollup.delete_job.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.rollup.get_jobs.go b/esapi/api.xpack.rollup.get_jobs.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.rollup.get_rollup_caps.go b/esapi/api.xpack.rollup.get_rollup_caps.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.rollup.get_rollup_index_caps.go b/esapi/api.xpack.rollup.get_rollup_index_caps.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.rollup.put_job.go b/esapi/api.xpack.rollup.put_job.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.rollup.rollup_search.go b/esapi/api.xpack.rollup.rollup_search.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.rollup.start_job.go b/esapi/api.xpack.rollup.start_job.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.rollup.stop_job.go b/esapi/api.xpack.rollup.stop_job.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.authenticate.go b/esapi/api.xpack.security.authenticate.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.change_password.go b/esapi/api.xpack.security.change_password.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.clear_cached_realms.go b/esapi/api.xpack.security.clear_cached_realms.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.clear_cached_roles.go b/esapi/api.xpack.security.clear_cached_roles.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.create_api_key.go b/esapi/api.xpack.security.create_api_key.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.delete_privileges.go b/esapi/api.xpack.security.delete_privileges.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.delete_role.go b/esapi/api.xpack.security.delete_role.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.delete_role_mapping.go b/esapi/api.xpack.security.delete_role_mapping.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.delete_user.go b/esapi/api.xpack.security.delete_user.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.disable_user.go b/esapi/api.xpack.security.disable_user.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.enable_user.go b/esapi/api.xpack.security.enable_user.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.get_api_key.go b/esapi/api.xpack.security.get_api_key.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.get_builtin_privileges.go b/esapi/api.xpack.security.get_builtin_privileges.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.get_privileges.go b/esapi/api.xpack.security.get_privileges.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.get_role.go b/esapi/api.xpack.security.get_role.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.get_role_mapping.go b/esapi/api.xpack.security.get_role_mapping.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.get_token.go b/esapi/api.xpack.security.get_token.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.get_user.go b/esapi/api.xpack.security.get_user.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.get_user_privileges.go b/esapi/api.xpack.security.get_user_privileges.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.has_privileges.go b/esapi/api.xpack.security.has_privileges.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.invalidate_api_key.go b/esapi/api.xpack.security.invalidate_api_key.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.invalidate_token.go b/esapi/api.xpack.security.invalidate_token.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.put_privileges.go b/esapi/api.xpack.security.put_privileges.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.put_role.go b/esapi/api.xpack.security.put_role.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.put_role_mapping.go b/esapi/api.xpack.security.put_role_mapping.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.security.put_user.go b/esapi/api.xpack.security.put_user.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.slm.delete_lifecycle.go b/esapi/api.xpack.slm.delete_lifecycle.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.slm.execute_lifecycle.go b/esapi/api.xpack.slm.execute_lifecycle.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.slm.get_lifecycle.go b/esapi/api.xpack.slm.get_lifecycle.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.slm.put_lifecycle.go b/esapi/api.xpack.slm.put_lifecycle.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.sql.clear_cursor.go b/esapi/api.xpack.sql.clear_cursor.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.sql.query.go b/esapi/api.xpack.sql.query.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.sql.translate.go b/esapi/api.xpack.sql.translate.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.ssl.certificates.go b/esapi/api.xpack.ssl.certificates.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.watcher.ack_watch.go b/esapi/api.xpack.watcher.ack_watch.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.watcher.activate_watch.go b/esapi/api.xpack.watcher.activate_watch.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.watcher.deactivate_watch.go b/esapi/api.xpack.watcher.deactivate_watch.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.watcher.delete_watch.go b/esapi/api.xpack.watcher.delete_watch.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.watcher.execute_watch.go b/esapi/api.xpack.watcher.execute_watch.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.watcher.get_watch.go b/esapi/api.xpack.watcher.get_watch.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.watcher.put_watch.go b/esapi/api.xpack.watcher.put_watch.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.watcher.start.go b/esapi/api.xpack.watcher.start.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.watcher.stats.go b/esapi/api.xpack.watcher.stats.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.watcher.stop.go b/esapi/api.xpack.watcher.stop.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.xpack.info.go b/esapi/api.xpack.xpack.info.go old mode 100755 new mode 100644 diff --git a/esapi/api.xpack.xpack.usage.go b/esapi/api.xpack.xpack.usage.go old mode 100755 new mode 100644 diff --git a/esapi/doc.go b/esapi/doc.go old mode 100755 new mode 100644 diff --git a/esapi/esapi.go b/esapi/esapi.go old mode 100755 new mode 100644 diff --git a/esapi/esapi.request.go b/esapi/esapi.request.go old mode 100755 new mode 100644 diff --git a/esapi/esapi.response.go b/esapi/esapi.response.go old mode 100755 new mode 100644 diff --git a/esapi/esapi.response_example_test.go b/esapi/esapi.response_example_test.go old mode 100755 new mode 100644 diff --git a/esapi/esapi_benchmark_test.go b/esapi/esapi_benchmark_test.go old mode 100755 new mode 100644 diff --git a/esapi/esapi_internal_test.go b/esapi/esapi_internal_test.go old mode 100755 new mode 100644 diff --git a/esapi/esapi_request_internal_test.go b/esapi/esapi_request_internal_test.go old mode 100755 new mode 100644 diff --git a/esapi/esapi_response_internal_test.go b/esapi/esapi_response_internal_test.go old mode 100755 new mode 100644 diff --git a/esapi/test/.gitignore b/esapi/test/.gitignore old mode 100755 new mode 100644 diff --git a/estransport/doc.go b/estransport/doc.go old mode 100755 new mode 100644 diff --git a/estransport/estransport.go b/estransport/estransport.go old mode 100755 new mode 100644 diff --git a/estransport/estransport_integration_test.go b/estransport/estransport_integration_test.go old mode 100755 new mode 100644 diff --git a/estransport/estransport_internal_test.go b/estransport/estransport_internal_test.go old mode 100755 new mode 100644 diff --git a/estransport/selector.go b/estransport/selector.go old mode 100755 new mode 100644 diff --git a/go.sum b/go.sum old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/commands.go b/internal/cmd/generate/commands/commands.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gensource/debug.go b/internal/cmd/generate/commands/gensource/debug.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gensource/descriptions.go b/internal/cmd/generate/commands/gensource/descriptions.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gensource/generator.go b/internal/cmd/generate/commands/gensource/generator.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gensource/generator_test.go b/internal/cmd/generate/commands/gensource/generator_test.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gensource/model.go b/internal/cmd/generate/commands/gensource/model.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gensource/overrides.go b/internal/cmd/generate/commands/gensource/overrides.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gensource/testdata/info.json b/internal/cmd/generate/commands/gensource/testdata/info.json old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gentests/.gitignore b/internal/cmd/generate/commands/gentests/.gitignore old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gentests/command.go b/internal/cmd/generate/commands/gentests/command.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gentests/debug.go b/internal/cmd/generate/commands/gentests/debug.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gentests/gen_api_registry.go b/internal/cmd/generate/commands/gentests/gen_api_registry.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gentests/generator.go b/internal/cmd/generate/commands/gentests/generator.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gentests/model.go b/internal/cmd/generate/commands/gentests/model.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gentests/patches.go b/internal/cmd/generate/commands/gentests/patches.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gentests/skips.go b/internal/cmd/generate/commands/gentests/skips.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gentests/testdata/cluster.health/10_basic.yml b/internal/cmd/generate/commands/gentests/testdata/cluster.health/10_basic.yml old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gentests/testdata/info/10_basic.yml b/internal/cmd/generate/commands/gentests/testdata/info/10_basic.yml old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/commands/gentests/testdata/info/20_lucene_version.yml b/internal/cmd/generate/commands/gentests/testdata/info/20_lucene_version.yml old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/main.go b/internal/cmd/generate/main.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/utils/chromatize.go b/internal/cmd/generate/utils/chromatize.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/utils/debug.go b/internal/cmd/generate/utils/debug.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/utils/map.go b/internal/cmd/generate/utils/map.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/utils/metadata.go b/internal/cmd/generate/utils/metadata.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/utils/naming.go b/internal/cmd/generate/utils/naming.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/utils/strings.go b/internal/cmd/generate/utils/strings.go old mode 100755 new mode 100644 diff --git a/internal/cmd/generate/utils/terminal.go b/internal/cmd/generate/utils/terminal.go old mode 100755 new mode 100644 From 63531ae741bd50422cccc351cfc3e6eb388ff0dd Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 14 Oct 2019 10:23:01 +0200 Subject: [PATCH 121/355] Add the short Apache 2 license header to code files --- _examples/bulk/bulk.go | 4 +++ _examples/cloudfunction/function.go | 4 +++ _examples/cloudfunction/function_test.go | 4 +++ _examples/configuration.go | 4 +++ _examples/customization.go | 4 +++ _examples/encoding/benchmark_test.go | 4 +++ _examples/encoding/easyjson.go | 4 +++ _examples/encoding/gjson.go | 4 +++ _examples/encoding/jsonreader.go | 4 +++ _examples/encoding/model/model.go | 4 +++ _examples/encoding/model/response.go | 4 +++ _examples/extension/main.go | 4 +++ _examples/fasthttp/cmd/main.go | 4 +++ _examples/fasthttp/fasthttp.go | 4 +++ _examples/fasthttp/fasthttp_benchmark_test.go | 4 +++ _examples/instrumentation/apmelasticsearch.go | 4 +++ _examples/instrumentation/opencensus.go | 4 +++ _examples/logging/custom.go | 4 +++ _examples/logging/default.go | 4 +++ _examples/main.go | 4 +++ .../xkcdsearch/cmd/xkcd/commands/index.go | 4 +++ .../xkcdsearch/cmd/xkcd/commands/root.go | 4 +++ .../xkcdsearch/cmd/xkcd/commands/search.go | 4 +++ .../xkcdsearch/cmd/xkcd/commands/server.go | 4 +++ _examples/xkcdsearch/cmd/xkcd/main.go | 4 +++ _examples/xkcdsearch/http.go | 4 +++ _examples/xkcdsearch/store.go | 4 +++ _examples/xkcdsearch/store_test.go | 4 +++ _examples/xkcdsearch/xkcd.go | 4 +++ elasticsearch.go | 4 +++ elasticsearch_benchmark_test.go | 4 +++ elasticsearch_example_test.go | 4 +++ elasticsearch_integration_test.go | 4 +++ elasticsearch_internal_test.go | 4 +++ esapi/api._.go | 6 +++- esapi/api.bulk.go | 6 +++- esapi/api.cat.aliases.go | 6 +++- esapi/api.cat.allocation.go | 6 +++- esapi/api.cat.count.go | 6 +++- esapi/api.cat.fielddata.go | 6 +++- esapi/api.cat.health.go | 19 ++++++++++- esapi/api.cat.help.go | 6 +++- esapi/api.cat.indices.go | 19 ++++++++++- esapi/api.cat.master.go | 6 +++- esapi/api.cat.nodeattrs.go | 6 +++- esapi/api.cat.nodes.go | 32 ++++++++++++++++++- esapi/api.cat.pending_tasks.go | 19 ++++++++++- esapi/api.cat.plugins.go | 6 +++- esapi/api.cat.recovery.go | 19 ++++++++++- esapi/api.cat.repositories.go | 6 +++- esapi/api.cat.segments.go | 6 +++- esapi/api.cat.shards.go | 19 ++++++++++- esapi/api.cat.snapshots.go | 19 ++++++++++- esapi/api.cat.tasks.go | 19 ++++++++++- esapi/api.cat.templates.go | 6 +++- esapi/api.cat.thread_pool.go | 6 +++- esapi/api.clear_scroll.go | 6 +++- esapi/api.cluster.allocation_explain.go | 6 +++- esapi/api.cluster.get_settings.go | 6 +++- esapi/api.cluster.health.go | 6 +++- esapi/api.cluster.pending_tasks.go | 6 +++- esapi/api.cluster.put_settings.go | 6 +++- esapi/api.cluster.remote_info.go | 6 +++- esapi/api.cluster.reroute.go | 6 +++- esapi/api.cluster.state.go | 6 +++- esapi/api.cluster.stats.go | 6 +++- esapi/api.count.go | 6 +++- esapi/api.create.go | 6 +++- esapi/api.delete.go | 6 +++- esapi/api.delete_by_query.go | 6 +++- esapi/api.delete_by_query_rethrottle.go | 6 +++- esapi/api.delete_script.go | 6 +++- esapi/api.exists.go | 6 +++- esapi/api.exists_source.go | 6 +++- esapi/api.explain.go | 6 +++- esapi/api.field_caps.go | 6 +++- esapi/api.get.go | 6 +++- esapi/api.get_script.go | 6 +++- esapi/api.get_source.go | 6 +++- esapi/api.index.go | 6 +++- esapi/api.indices.analyze.go | 6 +++- esapi/api.indices.clear_cache.go | 6 +++- esapi/api.indices.clone.go | 6 +++- esapi/api.indices.close.go | 6 +++- esapi/api.indices.create.go | 6 +++- esapi/api.indices.delete.go | 6 +++- esapi/api.indices.delete_alias.go | 6 +++- esapi/api.indices.delete_template.go | 6 +++- esapi/api.indices.exists.go | 6 +++- esapi/api.indices.exists_alias.go | 6 +++- esapi/api.indices.exists_template.go | 6 +++- esapi/api.indices.exists_type.go | 6 +++- esapi/api.indices.flush.go | 6 +++- esapi/api.indices.flush_synced.go | 6 +++- esapi/api.indices.forcemerge.go | 6 +++- esapi/api.indices.get.go | 6 +++- esapi/api.indices.get_alias.go | 6 +++- esapi/api.indices.get_field_mapping.go | 6 +++- esapi/api.indices.get_mapping.go | 6 +++- esapi/api.indices.get_settings.go | 6 +++- esapi/api.indices.get_template.go | 6 +++- esapi/api.indices.get_upgrade.go | 6 +++- esapi/api.indices.open.go | 6 +++- esapi/api.indices.put_alias.go | 6 +++- esapi/api.indices.put_mapping.go | 6 +++- esapi/api.indices.put_settings.go | 6 +++- esapi/api.indices.put_template.go | 6 +++- esapi/api.indices.recovery.go | 6 +++- esapi/api.indices.refresh.go | 6 +++- esapi/api.indices.rollover.go | 6 +++- esapi/api.indices.segments.go | 6 +++- esapi/api.indices.shard_stores.go | 6 +++- esapi/api.indices.shrink.go | 6 +++- esapi/api.indices.split.go | 6 +++- esapi/api.indices.stats.go | 6 +++- esapi/api.indices.update_aliases.go | 6 +++- esapi/api.indices.upgrade.go | 6 +++- esapi/api.indices.validate_query.go | 6 +++- esapi/api.info.go | 6 +++- esapi/api.ingest.delete_pipeline.go | 6 +++- esapi/api.ingest.get_pipeline.go | 6 +++- esapi/api.ingest.processor_grok.go | 6 +++- esapi/api.ingest.put_pipeline.go | 6 +++- esapi/api.ingest.simulate.go | 6 +++- esapi/api.mget.go | 6 +++- esapi/api.msearch.go | 6 +++- esapi/api.msearch_template.go | 6 +++- esapi/api.mtermvectors.go | 6 +++- esapi/api.nodes.hot_threads.go | 6 +++- esapi/api.nodes.info.go | 6 +++- esapi/api.nodes.reload_secure_settings.go | 6 +++- esapi/api.nodes.stats.go | 6 +++- esapi/api.nodes.usage.go | 6 +++- esapi/api.ping.go | 6 +++- esapi/api.put_script.go | 6 +++- esapi/api.rank_eval.go | 6 +++- esapi/api.reindex.go | 6 +++- esapi/api.reindex_rethrottle.go | 6 +++- esapi/api.render_search_template.go | 6 +++- esapi/api.scripts_painless_execute.go | 6 +++- esapi/api.scroll.go | 6 +++- esapi/api.search.go | 6 +++- esapi/api.search_shards.go | 6 +++- esapi/api.search_template.go | 6 +++- esapi/api.snapshot.cleanup_repository.go | 6 +++- esapi/api.snapshot.create.go | 6 +++- esapi/api.snapshot.create_repository.go | 6 +++- esapi/api.snapshot.delete.go | 6 +++- esapi/api.snapshot.delete_repository.go | 6 +++- esapi/api.snapshot.get.go | 6 +++- esapi/api.snapshot.get_repository.go | 6 +++- esapi/api.snapshot.restore.go | 6 +++- esapi/api.snapshot.status.go | 6 +++- esapi/api.snapshot.verify_repository.go | 6 +++- esapi/api.tasks.cancel.go | 6 +++- esapi/api.tasks.get.go | 6 +++- esapi/api.tasks.list.go | 6 +++- esapi/api.termvectors.go | 6 +++- esapi/api.update.go | 6 +++- esapi/api.update_by_query.go | 6 +++- esapi/api.update_by_query_rethrottle.go | 6 +++- ...pi.xpack.ccr.delete_auto_follow_pattern.go | 6 +++- esapi/api.xpack.ccr.follow.go | 6 +++- esapi/api.xpack.ccr.follow_info.go | 6 +++- esapi/api.xpack.ccr.follow_stats.go | 6 +++- esapi/api.xpack.ccr.forget_follower.go | 6 +++- .../api.xpack.ccr.get_auto_follow_pattern.go | 6 +++- esapi/api.xpack.ccr.pause_follow.go | 6 +++- .../api.xpack.ccr.put_auto_follow_pattern.go | 6 +++- esapi/api.xpack.ccr.resume_follow.go | 6 +++- esapi/api.xpack.ccr.stats.go | 6 +++- esapi/api.xpack.ccr.unfollow.go | 6 +++- ....data_frame.delete_data_frame_transform.go | 6 +++- ...ack.data_frame.get_data_frame_transform.go | 6 +++- ...ta_frame.get_data_frame_transform_stats.go | 6 +++- ...data_frame.preview_data_frame_transform.go | 6 +++- ...ack.data_frame.put_data_frame_transform.go | 6 +++- ...k.data_frame.start_data_frame_transform.go | 6 +++- ...ck.data_frame.stop_data_frame_transform.go | 6 +++- ....data_frame.update_data_frame_transform.go | 6 +++- esapi/api.xpack.graph.explore.go | 6 +++- esapi/api.xpack.ilm.delete_lifecycle.go | 6 +++- esapi/api.xpack.ilm.explain_lifecycle.go | 6 +++- esapi/api.xpack.ilm.get_lifecycle.go | 6 +++- esapi/api.xpack.ilm.get_status.go | 6 +++- esapi/api.xpack.ilm.move_to_step.go | 6 +++- esapi/api.xpack.ilm.put_lifecycle.go | 6 +++- esapi/api.xpack.ilm.remove_policy.go | 6 +++- esapi/api.xpack.ilm.retry.go | 6 +++- esapi/api.xpack.ilm.start.go | 6 +++- esapi/api.xpack.ilm.stop.go | 6 +++- esapi/api.xpack.indices.freeze.go | 6 +++- ...i.xpack.indices.reload_search_analyzers.go | 6 +++- esapi/api.xpack.indices.unfreeze.go | 6 +++- esapi/api.xpack.license.delete.go | 6 +++- esapi/api.xpack.license.get.go | 6 +++- esapi/api.xpack.license.get_basic_status.go | 6 +++- esapi/api.xpack.license.get_trial_status.go | 6 +++- esapi/api.xpack.license.post.go | 6 +++- esapi/api.xpack.license.post_start_basic.go | 6 +++- esapi/api.xpack.license.post_start_trial.go | 6 +++- esapi/api.xpack.migration.deprecations.go | 6 +++- esapi/api.xpack.ml.close_job.go | 6 +++- esapi/api.xpack.ml.delete_calendar.go | 6 +++- esapi/api.xpack.ml.delete_calendar_event.go | 6 +++- esapi/api.xpack.ml.delete_calendar_job.go | 6 +++- ...pi.xpack.ml.delete_data_frame_analytics.go | 6 +++- esapi/api.xpack.ml.delete_datafeed.go | 6 +++- esapi/api.xpack.ml.delete_expired_data.go | 6 +++- esapi/api.xpack.ml.delete_filter.go | 6 +++- esapi/api.xpack.ml.delete_forecast.go | 6 +++- esapi/api.xpack.ml.delete_job.go | 6 +++- esapi/api.xpack.ml.delete_model_snapshot.go | 6 +++- esapi/api.xpack.ml.estimate_memory_usage.go | 6 +++- esapi/api.xpack.ml.evaluate_data_frame.go | 6 +++- esapi/api.xpack.ml.find_file_structure.go | 6 +++- esapi/api.xpack.ml.flush_job.go | 6 +++- esapi/api.xpack.ml.forecast.go | 6 +++- esapi/api.xpack.ml.get_buckets.go | 6 +++- esapi/api.xpack.ml.get_calendar_events.go | 6 +++- esapi/api.xpack.ml.get_calendars.go | 6 +++- esapi/api.xpack.ml.get_categories.go | 6 +++- .../api.xpack.ml.get_data_frame_analytics.go | 6 +++- ...xpack.ml.get_data_frame_analytics_stats.go | 6 +++- esapi/api.xpack.ml.get_datafeed_stats.go | 6 +++- esapi/api.xpack.ml.get_datafeeds.go | 6 +++- esapi/api.xpack.ml.get_filters.go | 6 +++- esapi/api.xpack.ml.get_influencers.go | 6 +++- esapi/api.xpack.ml.get_job_stats.go | 6 +++- esapi/api.xpack.ml.get_jobs.go | 6 +++- esapi/api.xpack.ml.get_model_snapshots.go | 6 +++- esapi/api.xpack.ml.get_overall_buckets.go | 6 +++- esapi/api.xpack.ml.get_records.go | 6 +++- esapi/api.xpack.ml.info.go | 6 +++- esapi/api.xpack.ml.open_job.go | 6 +++- esapi/api.xpack.ml.post_calendar_events.go | 6 +++- esapi/api.xpack.ml.post_data.go | 6 +++- esapi/api.xpack.ml.preview_datafeed.go | 6 +++- esapi/api.xpack.ml.put_calendar.go | 6 +++- esapi/api.xpack.ml.put_calendar_job.go | 6 +++- .../api.xpack.ml.put_data_frame_analytics.go | 6 +++- esapi/api.xpack.ml.put_datafeed.go | 6 +++- esapi/api.xpack.ml.put_filter.go | 6 +++- esapi/api.xpack.ml.put_job.go | 6 +++- esapi/api.xpack.ml.revert_model_snapshot.go | 6 +++- esapi/api.xpack.ml.set_upgrade_mode.go | 6 +++- ...api.xpack.ml.start_data_frame_analytics.go | 6 +++- esapi/api.xpack.ml.start_datafeed.go | 6 +++- .../api.xpack.ml.stop_data_frame_analytics.go | 6 +++- esapi/api.xpack.ml.stop_datafeed.go | 6 +++- esapi/api.xpack.ml.update_datafeed.go | 6 +++- esapi/api.xpack.ml.update_filter.go | 6 +++- esapi/api.xpack.ml.update_job.go | 6 +++- esapi/api.xpack.ml.update_model_snapshot.go | 6 +++- esapi/api.xpack.ml.validate.go | 6 +++- esapi/api.xpack.ml.validate_detector.go | 6 +++- esapi/api.xpack.monitoring.bulk.go | 6 +++- esapi/api.xpack.rollup.delete_job.go | 6 +++- esapi/api.xpack.rollup.get_jobs.go | 6 +++- esapi/api.xpack.rollup.get_rollup_caps.go | 6 +++- .../api.xpack.rollup.get_rollup_index_caps.go | 6 +++- esapi/api.xpack.rollup.put_job.go | 6 +++- esapi/api.xpack.rollup.rollup_search.go | 6 +++- esapi/api.xpack.rollup.start_job.go | 6 +++- esapi/api.xpack.rollup.stop_job.go | 6 +++- esapi/api.xpack.security.authenticate.go | 6 +++- esapi/api.xpack.security.change_password.go | 6 +++- .../api.xpack.security.clear_cached_realms.go | 6 +++- .../api.xpack.security.clear_cached_roles.go | 6 +++- esapi/api.xpack.security.create_api_key.go | 6 +++- esapi/api.xpack.security.delete_privileges.go | 6 +++- esapi/api.xpack.security.delete_role.go | 6 +++- .../api.xpack.security.delete_role_mapping.go | 6 +++- esapi/api.xpack.security.delete_user.go | 6 +++- esapi/api.xpack.security.disable_user.go | 6 +++- esapi/api.xpack.security.enable_user.go | 6 +++- esapi/api.xpack.security.get_api_key.go | 6 +++- ...i.xpack.security.get_builtin_privileges.go | 6 +++- esapi/api.xpack.security.get_privileges.go | 6 +++- esapi/api.xpack.security.get_role.go | 6 +++- esapi/api.xpack.security.get_role_mapping.go | 6 +++- esapi/api.xpack.security.get_token.go | 6 +++- esapi/api.xpack.security.get_user.go | 6 +++- .../api.xpack.security.get_user_privileges.go | 6 +++- esapi/api.xpack.security.has_privileges.go | 6 +++- .../api.xpack.security.invalidate_api_key.go | 6 +++- esapi/api.xpack.security.invalidate_token.go | 6 +++- esapi/api.xpack.security.put_privileges.go | 6 +++- esapi/api.xpack.security.put_role.go | 6 +++- esapi/api.xpack.security.put_role_mapping.go | 6 +++- esapi/api.xpack.security.put_user.go | 6 +++- esapi/api.xpack.slm.delete_lifecycle.go | 6 +++- esapi/api.xpack.slm.execute_lifecycle.go | 6 +++- esapi/api.xpack.slm.get_lifecycle.go | 6 +++- esapi/api.xpack.slm.put_lifecycle.go | 6 +++- esapi/api.xpack.sql.clear_cursor.go | 6 +++- esapi/api.xpack.sql.query.go | 6 +++- esapi/api.xpack.sql.translate.go | 6 +++- esapi/api.xpack.ssl.certificates.go | 6 +++- esapi/api.xpack.watcher.ack_watch.go | 6 +++- esapi/api.xpack.watcher.activate_watch.go | 6 +++- esapi/api.xpack.watcher.deactivate_watch.go | 6 +++- esapi/api.xpack.watcher.delete_watch.go | 6 +++- esapi/api.xpack.watcher.execute_watch.go | 6 +++- esapi/api.xpack.watcher.get_watch.go | 6 +++- esapi/api.xpack.watcher.put_watch.go | 6 +++- esapi/api.xpack.watcher.start.go | 6 +++- esapi/api.xpack.watcher.stats.go | 6 +++- esapi/api.xpack.watcher.stop.go | 6 +++- esapi/api.xpack.xpack.info.go | 6 +++- esapi/api.xpack.xpack.usage.go | 6 +++- esapi/esapi.go | 4 +++ esapi/esapi.request.go | 4 +++ esapi/esapi.response.go | 4 +++ esapi/esapi.response_example_test.go | 4 +++ esapi/esapi_benchmark_test.go | 4 +++ esapi/esapi_integration_test.go | 4 +++ esapi/esapi_internal_test.go | 4 +++ esapi/esapi_request_internal_test.go | 4 +++ esapi/esapi_response_internal_test.go | 4 +++ estransport/estransport.go | 4 +++ estransport/estransport_benchmark_test.go | 4 +++ estransport/estransport_integration_test.go | 4 +++ estransport/estransport_internal_test.go | 4 +++ estransport/logger.go | 4 +++ estransport/logger_benchmark_test.go | 4 +++ estransport/logger_internal_test.go | 4 +++ estransport/selector.go | 4 +++ esutil/json_reader.go | 4 +++ esutil/json_reader_benchmark_test.go | 4 +++ esutil/json_reader_integration_test.go | 4 +++ esutil/json_reader_internal_test.go | 4 +++ internal/cmd/generate/commands/commands.go | 4 +++ .../generate/commands/gensource/command.go | 4 +++ .../cmd/generate/commands/gensource/debug.go | 4 +++ .../commands/gensource/descriptions.go | 4 +++ .../generate/commands/gensource/generator.go | 4 +++ .../commands/gensource/generator_test.go | 4 +++ .../cmd/generate/commands/gensource/model.go | 4 +++ .../generate/commands/gensource/overrides.go | 4 +++ .../generate/commands/genstruct/command.go | 4 +++ .../cmd/generate/commands/gentests/command.go | 4 +++ .../cmd/generate/commands/gentests/debug.go | 4 +++ .../commands/gentests/gen_api_registry.go | 4 +++ .../generate/commands/gentests/generator.go | 4 +++ .../cmd/generate/commands/gentests/model.go | 4 +++ .../cmd/generate/commands/gentests/patches.go | 4 +++ .../cmd/generate/commands/gentests/skips.go | 4 +++ internal/cmd/generate/main.go | 4 +++ internal/cmd/generate/utils/chromatize.go | 4 +++ internal/cmd/generate/utils/debug.go | 4 +++ internal/cmd/generate/utils/map.go | 4 +++ internal/cmd/generate/utils/metadata.go | 4 +++ internal/cmd/generate/utils/naming.go | 4 +++ internal/cmd/generate/utils/strings.go | 4 +++ internal/cmd/generate/utils/terminal.go | 4 +++ internal/version/version.go | 4 +++ 357 files changed, 1822 insertions(+), 277 deletions(-) diff --git a/_examples/bulk/bulk.go b/_examples/bulk/bulk.go index 2368ba634c..88e299d1f6 100644 --- a/_examples/bulk/bulk.go +++ b/_examples/bulk/bulk.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build ignore // This example demonstrates indexing documents using the Elasticsearch "Bulk" API diff --git a/_examples/cloudfunction/function.go b/_examples/cloudfunction/function.go index 6503f3222f..7f3d0082e3 100644 --- a/_examples/cloudfunction/function.go +++ b/_examples/cloudfunction/function.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // Package clusterstatus demonstrates using the Elasticsearch client for Go with Google Cloud Functions. // // Deploy the function with the gcloud command: diff --git a/_examples/cloudfunction/function_test.go b/_examples/cloudfunction/function_test.go index 05d979117e..f96256a837 100644 --- a/_examples/cloudfunction/function_test.go +++ b/_examples/cloudfunction/function_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package clusterstatus_test import ( diff --git a/_examples/configuration.go b/_examples/configuration.go index 00602c2092..539d6bad68 100644 --- a/_examples/configuration.go +++ b/_examples/configuration.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build ignore package main diff --git a/_examples/customization.go b/_examples/customization.go index 33dfc0f078..af9d8ee15d 100644 --- a/_examples/customization.go +++ b/_examples/customization.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build ignore package main diff --git a/_examples/encoding/benchmark_test.go b/_examples/encoding/benchmark_test.go index 5a589287b6..617b0a86f4 100644 --- a/_examples/encoding/benchmark_test.go +++ b/_examples/encoding/benchmark_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package main_test import ( diff --git a/_examples/encoding/easyjson.go b/_examples/encoding/easyjson.go index 8cba078343..6e97504dbd 100644 --- a/_examples/encoding/easyjson.go +++ b/_examples/encoding/easyjson.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package main import ( diff --git a/_examples/encoding/gjson.go b/_examples/encoding/gjson.go index eed8cabde6..922d5be29d 100644 --- a/_examples/encoding/gjson.go +++ b/_examples/encoding/gjson.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package main import ( diff --git a/_examples/encoding/jsonreader.go b/_examples/encoding/jsonreader.go index b6b2b74526..e2d372a7ef 100644 --- a/_examples/encoding/jsonreader.go +++ b/_examples/encoding/jsonreader.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package main import ( diff --git a/_examples/encoding/model/model.go b/_examples/encoding/model/model.go index c3612807bb..fd1b969ad7 100644 --- a/_examples/encoding/model/model.go +++ b/_examples/encoding/model/model.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + //go:generate easyjson -all -snake_case $GOFILE package model diff --git a/_examples/encoding/model/response.go b/_examples/encoding/model/response.go index 316dbdca14..ca49f81d17 100644 --- a/_examples/encoding/model/response.go +++ b/_examples/encoding/model/response.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + //go:generate easyjson -all -snake_case $GOFILE package model diff --git a/_examples/extension/main.go b/_examples/extension/main.go index f2a9746f1d..274d6e0f54 100644 --- a/_examples/extension/main.go +++ b/_examples/extension/main.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build ignore // This examples demonstrates how extend the API of the client by embedding it inside a custom type. diff --git a/_examples/fasthttp/cmd/main.go b/_examples/fasthttp/cmd/main.go index 76b46d0547..f332d97b70 100644 --- a/_examples/fasthttp/cmd/main.go +++ b/_examples/fasthttp/cmd/main.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package main import ( diff --git a/_examples/fasthttp/fasthttp.go b/_examples/fasthttp/fasthttp.go index 5f8744efbe..2a9ef5026f 100644 --- a/_examples/fasthttp/fasthttp.go +++ b/_examples/fasthttp/fasthttp.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package fasthttp import ( diff --git a/_examples/fasthttp/fasthttp_benchmark_test.go b/_examples/fasthttp/fasthttp_benchmark_test.go index be108ae12b..6c2f8c9ab7 100644 --- a/_examples/fasthttp/fasthttp_benchmark_test.go +++ b/_examples/fasthttp/fasthttp_benchmark_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package fasthttp_test import ( diff --git a/_examples/instrumentation/apmelasticsearch.go b/_examples/instrumentation/apmelasticsearch.go index 60779d1219..234d1c7f30 100644 --- a/_examples/instrumentation/apmelasticsearch.go +++ b/_examples/instrumentation/apmelasticsearch.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package main import ( diff --git a/_examples/instrumentation/opencensus.go b/_examples/instrumentation/opencensus.go index 2e188232c3..1524a844ab 100644 --- a/_examples/instrumentation/opencensus.go +++ b/_examples/instrumentation/opencensus.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package main import ( diff --git a/_examples/logging/custom.go b/_examples/logging/custom.go index a53f81ca50..7fb7ac77f1 100644 --- a/_examples/logging/custom.go +++ b/_examples/logging/custom.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build ignore // This examples demonstrates how to implement the "estransport.Logger" interface with a custom type, diff --git a/_examples/logging/default.go b/_examples/logging/default.go index 84035bcbbb..91b1b63c72 100644 --- a/_examples/logging/default.go +++ b/_examples/logging/default.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build ignore // This collection of examples demonstrates how to configure the default logger of the client. diff --git a/_examples/main.go b/_examples/main.go index 1226740080..9b687f8191 100644 --- a/_examples/main.go +++ b/_examples/main.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build ignore // This example demonstrates a basic usage of the Elasticsearch Go client. diff --git a/_examples/xkcdsearch/cmd/xkcd/commands/index.go b/_examples/xkcdsearch/cmd/xkcd/commands/index.go index fda005cb19..6c8fa4292f 100644 --- a/_examples/xkcdsearch/cmd/xkcd/commands/index.go +++ b/_examples/xkcdsearch/cmd/xkcd/commands/index.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package commands import ( diff --git a/_examples/xkcdsearch/cmd/xkcd/commands/root.go b/_examples/xkcdsearch/cmd/xkcd/commands/root.go index 464ef8f01d..3aba6b55d5 100644 --- a/_examples/xkcdsearch/cmd/xkcd/commands/root.go +++ b/_examples/xkcdsearch/cmd/xkcd/commands/root.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package commands import ( diff --git a/_examples/xkcdsearch/cmd/xkcd/commands/search.go b/_examples/xkcdsearch/cmd/xkcd/commands/search.go index 252047d9dd..427a6b6781 100644 --- a/_examples/xkcdsearch/cmd/xkcd/commands/search.go +++ b/_examples/xkcdsearch/cmd/xkcd/commands/search.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package commands import ( diff --git a/_examples/xkcdsearch/cmd/xkcd/commands/server.go b/_examples/xkcdsearch/cmd/xkcd/commands/server.go index 0c104a1a32..e99cdb1e31 100644 --- a/_examples/xkcdsearch/cmd/xkcd/commands/server.go +++ b/_examples/xkcdsearch/cmd/xkcd/commands/server.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package commands import ( diff --git a/_examples/xkcdsearch/cmd/xkcd/main.go b/_examples/xkcdsearch/cmd/xkcd/main.go index 00880bd01b..99645dc048 100644 --- a/_examples/xkcdsearch/cmd/xkcd/main.go +++ b/_examples/xkcdsearch/cmd/xkcd/main.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package main import "github.com/elastic/go-elasticsearch/v7/_examples/xkcdsearch/cmd/xkcd/commands" diff --git a/_examples/xkcdsearch/http.go b/_examples/xkcdsearch/http.go index a2022d8901..99477e7c7e 100644 --- a/_examples/xkcdsearch/http.go +++ b/_examples/xkcdsearch/http.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package xkcdsearch import ( diff --git a/_examples/xkcdsearch/store.go b/_examples/xkcdsearch/store.go index 01f0d0bded..dc1b10b842 100644 --- a/_examples/xkcdsearch/store.go +++ b/_examples/xkcdsearch/store.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package xkcdsearch import ( diff --git a/_examples/xkcdsearch/store_test.go b/_examples/xkcdsearch/store_test.go index 3a427a7c00..829c6dae4a 100644 --- a/_examples/xkcdsearch/store_test.go +++ b/_examples/xkcdsearch/store_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package xkcdsearch_test import ( diff --git a/_examples/xkcdsearch/xkcd.go b/_examples/xkcdsearch/xkcd.go index 42415ef20e..59c4ff6436 100644 --- a/_examples/xkcdsearch/xkcd.go +++ b/_examples/xkcdsearch/xkcd.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package xkcdsearch import ( diff --git a/elasticsearch.go b/elasticsearch.go index e67bccd0de..334918e59c 100644 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package elasticsearch import ( diff --git a/elasticsearch_benchmark_test.go b/elasticsearch_benchmark_test.go index 4c4f5cf18c..6a652418e6 100644 --- a/elasticsearch_benchmark_test.go +++ b/elasticsearch_benchmark_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build !integration package elasticsearch_test diff --git a/elasticsearch_example_test.go b/elasticsearch_example_test.go index 8a1c9269eb..b0c82b8685 100644 --- a/elasticsearch_example_test.go +++ b/elasticsearch_example_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build !integration package elasticsearch_test diff --git a/elasticsearch_integration_test.go b/elasticsearch_integration_test.go index 99d79e2a05..5848244d7a 100644 --- a/elasticsearch_integration_test.go +++ b/elasticsearch_integration_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build integration,!multinode package elasticsearch_test diff --git a/elasticsearch_internal_test.go b/elasticsearch_internal_test.go index 1c90acbfb3..92081ad7d9 100644 --- a/elasticsearch_internal_test.go +++ b/elasticsearch_internal_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build !integration package elasticsearch diff --git a/esapi/api._.go b/esapi/api._.go index 329200c503..f0e0151a7c 100644 --- a/esapi/api._.go +++ b/esapi/api._.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0 (e2c4e8cacb9): DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1 (42824b3731a): DO NOT EDIT package esapi diff --git a/esapi/api.bulk.go b/esapi/api.bulk.go index 738001ccf7..c4a8f9c116 100644 --- a/esapi/api.bulk.go +++ b/esapi/api.bulk.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.aliases.go b/esapi/api.cat.aliases.go index 8265fcfa55..5a611ed027 100644 --- a/esapi/api.cat.aliases.go +++ b/esapi/api.cat.aliases.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.allocation.go b/esapi/api.cat.allocation.go index 37e75e41fd..7e3911d776 100644 --- a/esapi/api.cat.allocation.go +++ b/esapi/api.cat.allocation.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.count.go b/esapi/api.cat.count.go index fe8eba2e2c..0022713d02 100644 --- a/esapi/api.cat.count.go +++ b/esapi/api.cat.count.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.fielddata.go b/esapi/api.cat.fielddata.go index 91dbaaf164..6d2bc38ebc 100644 --- a/esapi/api.cat.fielddata.go +++ b/esapi/api.cat.fielddata.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.health.go b/esapi/api.cat.health.go index de563f1293..8f5eb53a0e 100644 --- a/esapi/api.cat.health.go +++ b/esapi/api.cat.health.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi @@ -37,6 +41,7 @@ type CatHealthRequest struct { Local *bool MasterTimeout time.Duration S []string + Time string Ts *bool V *bool @@ -90,6 +95,10 @@ func (r CatHealthRequest) Do(ctx context.Context, transport Transport) (*Respons params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.Ts != nil { params["ts"] = strconv.FormatBool(*r.Ts) } @@ -210,6 +219,14 @@ func (f CatHealth) WithS(v ...string) func(*CatHealthRequest) { } } +// WithTime - the unit in which to display time values. +// +func (f CatHealth) WithTime(v string) func(*CatHealthRequest) { + return func(r *CatHealthRequest) { + r.Time = v + } +} + // WithTs - set to false to disable timestamping. // func (f CatHealth) WithTs(v bool) func(*CatHealthRequest) { diff --git a/esapi/api.cat.help.go b/esapi/api.cat.help.go index d6a582f840..409f01082f 100644 --- a/esapi/api.cat.help.go +++ b/esapi/api.cat.help.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.indices.go b/esapi/api.cat.indices.go index 4d7dba58bd..c506a693fb 100644 --- a/esapi/api.cat.indices.go +++ b/esapi/api.cat.indices.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi @@ -43,6 +47,7 @@ type CatIndicesRequest struct { MasterTimeout time.Duration Pri *bool S []string + Time string V *bool Pretty bool @@ -118,6 +123,10 @@ func (r CatIndicesRequest) Do(ctx context.Context, transport Transport) (*Respon params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -274,6 +283,14 @@ func (f CatIndices) WithS(v ...string) func(*CatIndicesRequest) { } } +// WithTime - the unit in which to display time values. +// +func (f CatIndices) WithTime(v string) func(*CatIndicesRequest) { + return func(r *CatIndicesRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. // func (f CatIndices) WithV(v bool) func(*CatIndicesRequest) { diff --git a/esapi/api.cat.master.go b/esapi/api.cat.master.go index 43f64dcadd..f4078ace6e 100644 --- a/esapi/api.cat.master.go +++ b/esapi/api.cat.master.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.nodeattrs.go b/esapi/api.cat.nodeattrs.go index 70b064f9ee..5f09270a46 100644 --- a/esapi/api.cat.nodeattrs.go +++ b/esapi/api.cat.nodeattrs.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.nodes.go b/esapi/api.cat.nodes.go index e83a40de6b..6283d878f3 100644 --- a/esapi/api.cat.nodes.go +++ b/esapi/api.cat.nodes.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi @@ -31,6 +35,7 @@ type CatNodes func(o ...func(*CatNodesRequest)) (*Response, error) // CatNodesRequest configures the Cat Nodes API request. // type CatNodesRequest struct { + Bytes string Format string FullID *bool H []string @@ -38,6 +43,7 @@ type CatNodesRequest struct { Local *bool MasterTimeout time.Duration S []string + Time string V *bool Pretty bool @@ -66,6 +72,10 @@ func (r CatNodesRequest) Do(ctx context.Context, transport Transport) (*Response params = make(map[string]string) + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Format != "" { params["format"] = r.Format } @@ -94,6 +104,10 @@ func (r CatNodesRequest) Do(ctx context.Context, transport Transport) (*Response params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -162,6 +176,14 @@ func (f CatNodes) WithContext(v context.Context) func(*CatNodesRequest) { } } +// WithBytes - the unit in which to display byte values. +// +func (f CatNodes) WithBytes(v string) func(*CatNodesRequest) { + return func(r *CatNodesRequest) { + r.Bytes = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. // func (f CatNodes) WithFormat(v string) func(*CatNodesRequest) { @@ -218,6 +240,14 @@ func (f CatNodes) WithS(v ...string) func(*CatNodesRequest) { } } +// WithTime - the unit in which to display time values. +// +func (f CatNodes) WithTime(v string) func(*CatNodesRequest) { + return func(r *CatNodesRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. // func (f CatNodes) WithV(v bool) func(*CatNodesRequest) { diff --git a/esapi/api.cat.pending_tasks.go b/esapi/api.cat.pending_tasks.go index 4dd10a845d..0089be371c 100644 --- a/esapi/api.cat.pending_tasks.go +++ b/esapi/api.cat.pending_tasks.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi @@ -37,6 +41,7 @@ type CatPendingTasksRequest struct { Local *bool MasterTimeout time.Duration S []string + Time string V *bool Pretty bool @@ -89,6 +94,10 @@ func (r CatPendingTasksRequest) Do(ctx context.Context, transport Transport) (*R params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -205,6 +214,14 @@ func (f CatPendingTasks) WithS(v ...string) func(*CatPendingTasksRequest) { } } +// WithTime - the unit in which to display time values. +// +func (f CatPendingTasks) WithTime(v string) func(*CatPendingTasksRequest) { + return func(r *CatPendingTasksRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. // func (f CatPendingTasks) WithV(v bool) func(*CatPendingTasksRequest) { diff --git a/esapi/api.cat.plugins.go b/esapi/api.cat.plugins.go index e01f2fcb34..aae6f6fdb7 100644 --- a/esapi/api.cat.plugins.go +++ b/esapi/api.cat.plugins.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.recovery.go b/esapi/api.cat.recovery.go index f7af5ac6f2..7c77737c6e 100644 --- a/esapi/api.cat.recovery.go +++ b/esapi/api.cat.recovery.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi @@ -41,6 +45,7 @@ type CatRecoveryRequest struct { Help *bool MasterTimeout time.Duration S []string + Time string V *bool Pretty bool @@ -112,6 +117,10 @@ func (r CatRecoveryRequest) Do(ctx context.Context, transport Transport) (*Respo params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -252,6 +261,14 @@ func (f CatRecovery) WithS(v ...string) func(*CatRecoveryRequest) { } } +// WithTime - the unit in which to display time values. +// +func (f CatRecovery) WithTime(v string) func(*CatRecoveryRequest) { + return func(r *CatRecoveryRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. // func (f CatRecovery) WithV(v bool) func(*CatRecoveryRequest) { diff --git a/esapi/api.cat.repositories.go b/esapi/api.cat.repositories.go index ffa9a4142d..122e14e3a7 100644 --- a/esapi/api.cat.repositories.go +++ b/esapi/api.cat.repositories.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.segments.go b/esapi/api.cat.segments.go index 7069a3ff6b..17f59601cb 100644 --- a/esapi/api.cat.segments.go +++ b/esapi/api.cat.segments.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.shards.go b/esapi/api.cat.shards.go index 215dc74787..c4522c39ca 100644 --- a/esapi/api.cat.shards.go +++ b/esapi/api.cat.shards.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi @@ -40,6 +44,7 @@ type CatShardsRequest struct { Local *bool MasterTimeout time.Duration S []string + Time string V *bool Pretty bool @@ -103,6 +108,10 @@ func (r CatShardsRequest) Do(ctx context.Context, transport Transport) (*Respons params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -235,6 +244,14 @@ func (f CatShards) WithS(v ...string) func(*CatShardsRequest) { } } +// WithTime - the unit in which to display time values. +// +func (f CatShards) WithTime(v string) func(*CatShardsRequest) { + return func(r *CatShardsRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. // func (f CatShards) WithV(v bool) func(*CatShardsRequest) { diff --git a/esapi/api.cat.snapshots.go b/esapi/api.cat.snapshots.go index f70f31f82e..2a8c5ed3d6 100644 --- a/esapi/api.cat.snapshots.go +++ b/esapi/api.cat.snapshots.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi @@ -39,6 +43,7 @@ type CatSnapshotsRequest struct { IgnoreUnavailable *bool MasterTimeout time.Duration S []string + Time string V *bool Pretty bool @@ -98,6 +103,10 @@ func (r CatSnapshotsRequest) Do(ctx context.Context, transport Transport) (*Resp params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -222,6 +231,14 @@ func (f CatSnapshots) WithS(v ...string) func(*CatSnapshotsRequest) { } } +// WithTime - the unit in which to display time values. +// +func (f CatSnapshots) WithTime(v string) func(*CatSnapshotsRequest) { + return func(r *CatSnapshotsRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. // func (f CatSnapshots) WithV(v bool) func(*CatSnapshotsRequest) { diff --git a/esapi/api.cat.tasks.go b/esapi/api.cat.tasks.go index 84f6cbed4a..9dfe68c291 100644 --- a/esapi/api.cat.tasks.go +++ b/esapi/api.cat.tasks.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi @@ -38,6 +42,7 @@ type CatTasksRequest struct { NodeID []string ParentTask *int S []string + Time string V *bool Pretty bool @@ -98,6 +103,10 @@ func (r CatTasksRequest) Do(ctx context.Context, transport Transport) (*Response params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -230,6 +239,14 @@ func (f CatTasks) WithS(v ...string) func(*CatTasksRequest) { } } +// WithTime - the unit in which to display time values. +// +func (f CatTasks) WithTime(v string) func(*CatTasksRequest) { + return func(r *CatTasksRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. // func (f CatTasks) WithV(v bool) func(*CatTasksRequest) { diff --git a/esapi/api.cat.templates.go b/esapi/api.cat.templates.go index 13153aa1d8..48d4acfade 100644 --- a/esapi/api.cat.templates.go +++ b/esapi/api.cat.templates.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cat.thread_pool.go b/esapi/api.cat.thread_pool.go index e267ccd02f..1d3d8beefc 100644 --- a/esapi/api.cat.thread_pool.go +++ b/esapi/api.cat.thread_pool.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.clear_scroll.go b/esapi/api.clear_scroll.go index c908dda309..7777e39910 100644 --- a/esapi/api.clear_scroll.go +++ b/esapi/api.clear_scroll.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.allocation_explain.go b/esapi/api.cluster.allocation_explain.go index 307ddde830..a2e738b697 100644 --- a/esapi/api.cluster.allocation_explain.go +++ b/esapi/api.cluster.allocation_explain.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.get_settings.go b/esapi/api.cluster.get_settings.go index 6b1037e6f5..e6e02684d4 100644 --- a/esapi/api.cluster.get_settings.go +++ b/esapi/api.cluster.get_settings.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.health.go b/esapi/api.cluster.health.go index aff30c755b..aee3972bdb 100644 --- a/esapi/api.cluster.health.go +++ b/esapi/api.cluster.health.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.pending_tasks.go b/esapi/api.cluster.pending_tasks.go index 431c8720f7..2a36d102e0 100644 --- a/esapi/api.cluster.pending_tasks.go +++ b/esapi/api.cluster.pending_tasks.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.put_settings.go b/esapi/api.cluster.put_settings.go index 5d3279a21a..5982d52c55 100644 --- a/esapi/api.cluster.put_settings.go +++ b/esapi/api.cluster.put_settings.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.remote_info.go b/esapi/api.cluster.remote_info.go index 68b9409b8e..128193f4b0 100644 --- a/esapi/api.cluster.remote_info.go +++ b/esapi/api.cluster.remote_info.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.reroute.go b/esapi/api.cluster.reroute.go index bb7b8a29da..a21d9ac84b 100644 --- a/esapi/api.cluster.reroute.go +++ b/esapi/api.cluster.reroute.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.state.go b/esapi/api.cluster.state.go index 553d1a5f35..878c0a07a1 100644 --- a/esapi/api.cluster.state.go +++ b/esapi/api.cluster.state.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.stats.go b/esapi/api.cluster.stats.go index f60d86af08..a6732fe2d8 100644 --- a/esapi/api.cluster.stats.go +++ b/esapi/api.cluster.stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.count.go b/esapi/api.count.go index c2d3637a0b..6f2d2f23e5 100644 --- a/esapi/api.count.go +++ b/esapi/api.count.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.create.go b/esapi/api.create.go index bf9e6c13de..19ff97403f 100644 --- a/esapi/api.create.go +++ b/esapi/api.create.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.delete.go b/esapi/api.delete.go index 73016466d6..9760d70f29 100644 --- a/esapi/api.delete.go +++ b/esapi/api.delete.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.delete_by_query.go b/esapi/api.delete_by_query.go index 36bc6023fd..4ea8fc5e4e 100644 --- a/esapi/api.delete_by_query.go +++ b/esapi/api.delete_by_query.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.delete_by_query_rethrottle.go b/esapi/api.delete_by_query_rethrottle.go index 57859a54ef..6e99b0527a 100644 --- a/esapi/api.delete_by_query_rethrottle.go +++ b/esapi/api.delete_by_query_rethrottle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.delete_script.go b/esapi/api.delete_script.go index 20bc0c9eaf..b575744544 100644 --- a/esapi/api.delete_script.go +++ b/esapi/api.delete_script.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.exists.go b/esapi/api.exists.go index a5ad5140b2..2b6ae3aa11 100644 --- a/esapi/api.exists.go +++ b/esapi/api.exists.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.exists_source.go b/esapi/api.exists_source.go index 688448051b..62bd3df440 100644 --- a/esapi/api.exists_source.go +++ b/esapi/api.exists_source.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.explain.go b/esapi/api.explain.go index f65be94b8e..994601eab0 100644 --- a/esapi/api.explain.go +++ b/esapi/api.explain.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.field_caps.go b/esapi/api.field_caps.go index 66e448ca15..51910b6193 100644 --- a/esapi/api.field_caps.go +++ b/esapi/api.field_caps.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.get.go b/esapi/api.get.go index 91f67e6c71..4892edbd10 100644 --- a/esapi/api.get.go +++ b/esapi/api.get.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.get_script.go b/esapi/api.get_script.go index 33b7bc3299..3810f9c338 100644 --- a/esapi/api.get_script.go +++ b/esapi/api.get_script.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.get_source.go b/esapi/api.get_source.go index a6217b3b7d..4c1e156414 100644 --- a/esapi/api.get_source.go +++ b/esapi/api.get_source.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.index.go b/esapi/api.index.go index 6603b8c6ec..5fb7b63b17 100644 --- a/esapi/api.index.go +++ b/esapi/api.index.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.analyze.go b/esapi/api.indices.analyze.go index 9b9165ede6..cb83865e6c 100644 --- a/esapi/api.indices.analyze.go +++ b/esapi/api.indices.analyze.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.clear_cache.go b/esapi/api.indices.clear_cache.go index 599d892c8d..91fc41774c 100644 --- a/esapi/api.indices.clear_cache.go +++ b/esapi/api.indices.clear_cache.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.clone.go b/esapi/api.indices.clone.go index b7799fe372..a73b444811 100644 --- a/esapi/api.indices.clone.go +++ b/esapi/api.indices.clone.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.close.go b/esapi/api.indices.close.go index 6962c4beae..ddd5f70012 100644 --- a/esapi/api.indices.close.go +++ b/esapi/api.indices.close.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.create.go b/esapi/api.indices.create.go index ce4f5ddc11..0df011f60a 100644 --- a/esapi/api.indices.create.go +++ b/esapi/api.indices.create.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.delete.go b/esapi/api.indices.delete.go index 7f36db6460..886037a031 100644 --- a/esapi/api.indices.delete.go +++ b/esapi/api.indices.delete.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.delete_alias.go b/esapi/api.indices.delete_alias.go index 8b7eb59191..02eaee3823 100644 --- a/esapi/api.indices.delete_alias.go +++ b/esapi/api.indices.delete_alias.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.delete_template.go b/esapi/api.indices.delete_template.go index d3b30e05cb..99293e3e42 100644 --- a/esapi/api.indices.delete_template.go +++ b/esapi/api.indices.delete_template.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.exists.go b/esapi/api.indices.exists.go index 01189f0298..6c1033e6a5 100644 --- a/esapi/api.indices.exists.go +++ b/esapi/api.indices.exists.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.exists_alias.go b/esapi/api.indices.exists_alias.go index 8a9121eb1a..bcdcad5112 100644 --- a/esapi/api.indices.exists_alias.go +++ b/esapi/api.indices.exists_alias.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.exists_template.go b/esapi/api.indices.exists_template.go index f0e18b52fd..c50e06af3f 100644 --- a/esapi/api.indices.exists_template.go +++ b/esapi/api.indices.exists_template.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.exists_type.go b/esapi/api.indices.exists_type.go index 2e13a8ff50..b8f7673c54 100644 --- a/esapi/api.indices.exists_type.go +++ b/esapi/api.indices.exists_type.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.flush.go b/esapi/api.indices.flush.go index 4520a04ea0..9897649936 100644 --- a/esapi/api.indices.flush.go +++ b/esapi/api.indices.flush.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.flush_synced.go b/esapi/api.indices.flush_synced.go index 8ab7ce3ab2..dd39e632b3 100644 --- a/esapi/api.indices.flush_synced.go +++ b/esapi/api.indices.flush_synced.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.forcemerge.go b/esapi/api.indices.forcemerge.go index 315dcded10..825ecb280e 100644 --- a/esapi/api.indices.forcemerge.go +++ b/esapi/api.indices.forcemerge.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get.go b/esapi/api.indices.get.go index 44242573bf..4acc011dbf 100644 --- a/esapi/api.indices.get.go +++ b/esapi/api.indices.get.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_alias.go b/esapi/api.indices.get_alias.go index 1bbb79a0be..f9da62a3bb 100644 --- a/esapi/api.indices.get_alias.go +++ b/esapi/api.indices.get_alias.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_field_mapping.go b/esapi/api.indices.get_field_mapping.go index 5185816412..ce688e6885 100644 --- a/esapi/api.indices.get_field_mapping.go +++ b/esapi/api.indices.get_field_mapping.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_mapping.go b/esapi/api.indices.get_mapping.go index 6651d6bb79..3d65941446 100644 --- a/esapi/api.indices.get_mapping.go +++ b/esapi/api.indices.get_mapping.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_settings.go b/esapi/api.indices.get_settings.go index 785675cacf..ab2d2cb4cd 100644 --- a/esapi/api.indices.get_settings.go +++ b/esapi/api.indices.get_settings.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_template.go b/esapi/api.indices.get_template.go index 52689d2604..72f71baecd 100644 --- a/esapi/api.indices.get_template.go +++ b/esapi/api.indices.get_template.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_upgrade.go b/esapi/api.indices.get_upgrade.go index aea3fec669..1ec09844cf 100644 --- a/esapi/api.indices.get_upgrade.go +++ b/esapi/api.indices.get_upgrade.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.open.go b/esapi/api.indices.open.go index a1466843ed..b2b6c1e6de 100644 --- a/esapi/api.indices.open.go +++ b/esapi/api.indices.open.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.put_alias.go b/esapi/api.indices.put_alias.go index 4ee4605e91..91dccf0dc1 100644 --- a/esapi/api.indices.put_alias.go +++ b/esapi/api.indices.put_alias.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.put_mapping.go b/esapi/api.indices.put_mapping.go index 072d77f8e9..5adf2883c8 100644 --- a/esapi/api.indices.put_mapping.go +++ b/esapi/api.indices.put_mapping.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.put_settings.go b/esapi/api.indices.put_settings.go index bfd9bd9678..9ab4d2d1bb 100644 --- a/esapi/api.indices.put_settings.go +++ b/esapi/api.indices.put_settings.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.put_template.go b/esapi/api.indices.put_template.go index f6a057f88d..90c4a7c087 100644 --- a/esapi/api.indices.put_template.go +++ b/esapi/api.indices.put_template.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.recovery.go b/esapi/api.indices.recovery.go index dc42214259..03522431bc 100644 --- a/esapi/api.indices.recovery.go +++ b/esapi/api.indices.recovery.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.refresh.go b/esapi/api.indices.refresh.go index 2fb7a104fe..fcacf18850 100644 --- a/esapi/api.indices.refresh.go +++ b/esapi/api.indices.refresh.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.rollover.go b/esapi/api.indices.rollover.go index 5b2001e619..71939a8fd1 100644 --- a/esapi/api.indices.rollover.go +++ b/esapi/api.indices.rollover.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.segments.go b/esapi/api.indices.segments.go index 3531085597..5bed542d53 100644 --- a/esapi/api.indices.segments.go +++ b/esapi/api.indices.segments.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.shard_stores.go b/esapi/api.indices.shard_stores.go index e177b3e126..a29de23a10 100644 --- a/esapi/api.indices.shard_stores.go +++ b/esapi/api.indices.shard_stores.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.shrink.go b/esapi/api.indices.shrink.go index 7f91de2cb5..90ae42d2c2 100644 --- a/esapi/api.indices.shrink.go +++ b/esapi/api.indices.shrink.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.split.go b/esapi/api.indices.split.go index 2167e190ff..5b330d6ced 100644 --- a/esapi/api.indices.split.go +++ b/esapi/api.indices.split.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.stats.go b/esapi/api.indices.stats.go index 8a0330cb90..2d67f0ae04 100644 --- a/esapi/api.indices.stats.go +++ b/esapi/api.indices.stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.update_aliases.go b/esapi/api.indices.update_aliases.go index a4e9bf708a..027439e7b3 100644 --- a/esapi/api.indices.update_aliases.go +++ b/esapi/api.indices.update_aliases.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.upgrade.go b/esapi/api.indices.upgrade.go index 283d7b121a..a0a94429e0 100644 --- a/esapi/api.indices.upgrade.go +++ b/esapi/api.indices.upgrade.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.indices.validate_query.go b/esapi/api.indices.validate_query.go index 564742ba6b..ddef49ecb7 100644 --- a/esapi/api.indices.validate_query.go +++ b/esapi/api.indices.validate_query.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.info.go b/esapi/api.info.go index 7d304c3a49..35ba32df1a 100644 --- a/esapi/api.info.go +++ b/esapi/api.info.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.delete_pipeline.go b/esapi/api.ingest.delete_pipeline.go index 646cd25825..31713dcc7b 100644 --- a/esapi/api.ingest.delete_pipeline.go +++ b/esapi/api.ingest.delete_pipeline.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.get_pipeline.go b/esapi/api.ingest.get_pipeline.go index 7a554ecbef..6ce38e8527 100644 --- a/esapi/api.ingest.get_pipeline.go +++ b/esapi/api.ingest.get_pipeline.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.processor_grok.go b/esapi/api.ingest.processor_grok.go index f8daf64765..fb1ee1cb5b 100644 --- a/esapi/api.ingest.processor_grok.go +++ b/esapi/api.ingest.processor_grok.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.put_pipeline.go b/esapi/api.ingest.put_pipeline.go index 6d6ab7d8e3..d0238728ad 100644 --- a/esapi/api.ingest.put_pipeline.go +++ b/esapi/api.ingest.put_pipeline.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.simulate.go b/esapi/api.ingest.simulate.go index 7b08528715..c77e6c3402 100644 --- a/esapi/api.ingest.simulate.go +++ b/esapi/api.ingest.simulate.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.mget.go b/esapi/api.mget.go index 09021a0a56..84854c1d8d 100644 --- a/esapi/api.mget.go +++ b/esapi/api.mget.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.msearch.go b/esapi/api.msearch.go index e6ef4bc041..cec1319683 100644 --- a/esapi/api.msearch.go +++ b/esapi/api.msearch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.msearch_template.go b/esapi/api.msearch_template.go index 329943bc7b..3c14827c0c 100644 --- a/esapi/api.msearch_template.go +++ b/esapi/api.msearch_template.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.mtermvectors.go b/esapi/api.mtermvectors.go index a538f1fae6..c4b500a603 100644 --- a/esapi/api.mtermvectors.go +++ b/esapi/api.mtermvectors.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.hot_threads.go b/esapi/api.nodes.hot_threads.go index 87e1bcac84..863939a028 100644 --- a/esapi/api.nodes.hot_threads.go +++ b/esapi/api.nodes.hot_threads.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.info.go b/esapi/api.nodes.info.go index e68e2d67f0..290953055d 100644 --- a/esapi/api.nodes.info.go +++ b/esapi/api.nodes.info.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.reload_secure_settings.go b/esapi/api.nodes.reload_secure_settings.go index ba9c9a5cdc..29fe28c40b 100644 --- a/esapi/api.nodes.reload_secure_settings.go +++ b/esapi/api.nodes.reload_secure_settings.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.stats.go b/esapi/api.nodes.stats.go index 4d73e9b612..69d1653021 100644 --- a/esapi/api.nodes.stats.go +++ b/esapi/api.nodes.stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.usage.go b/esapi/api.nodes.usage.go index 95a76068a7..171a46842a 100644 --- a/esapi/api.nodes.usage.go +++ b/esapi/api.nodes.usage.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.ping.go b/esapi/api.ping.go index 221931ba65..28a64c31d8 100644 --- a/esapi/api.ping.go +++ b/esapi/api.ping.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.put_script.go b/esapi/api.put_script.go index 0893d56f70..f2631528f8 100644 --- a/esapi/api.put_script.go +++ b/esapi/api.put_script.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.rank_eval.go b/esapi/api.rank_eval.go index d8518940b2..f008c99fe8 100644 --- a/esapi/api.rank_eval.go +++ b/esapi/api.rank_eval.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.reindex.go b/esapi/api.reindex.go index e0d9e301e0..fa9a9a78ce 100644 --- a/esapi/api.reindex.go +++ b/esapi/api.reindex.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.reindex_rethrottle.go b/esapi/api.reindex_rethrottle.go index 3fc3ff08aa..ea07eeb678 100644 --- a/esapi/api.reindex_rethrottle.go +++ b/esapi/api.reindex_rethrottle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.render_search_template.go b/esapi/api.render_search_template.go index 75effc9ca9..774a879c0a 100644 --- a/esapi/api.render_search_template.go +++ b/esapi/api.render_search_template.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.scripts_painless_execute.go b/esapi/api.scripts_painless_execute.go index cd1c5638bc..7f0f32f818 100644 --- a/esapi/api.scripts_painless_execute.go +++ b/esapi/api.scripts_painless_execute.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.scroll.go b/esapi/api.scroll.go index eec5b1255c..8a63ff3115 100644 --- a/esapi/api.scroll.go +++ b/esapi/api.scroll.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.search.go b/esapi/api.search.go index 87b59a94c5..14f70f8545 100644 --- a/esapi/api.search.go +++ b/esapi/api.search.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.search_shards.go b/esapi/api.search_shards.go index 9b4a04095b..0dc6481e27 100644 --- a/esapi/api.search_shards.go +++ b/esapi/api.search_shards.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.search_template.go b/esapi/api.search_template.go index 64aacff3db..b683f232a8 100644 --- a/esapi/api.search_template.go +++ b/esapi/api.search_template.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.cleanup_repository.go b/esapi/api.snapshot.cleanup_repository.go index 13942e8cbf..57a0b43035 100644 --- a/esapi/api.snapshot.cleanup_repository.go +++ b/esapi/api.snapshot.cleanup_repository.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.create.go b/esapi/api.snapshot.create.go index 4135fc9cd6..ec485e0ab3 100644 --- a/esapi/api.snapshot.create.go +++ b/esapi/api.snapshot.create.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.create_repository.go b/esapi/api.snapshot.create_repository.go index e0b65a8c2a..abc06a49e7 100644 --- a/esapi/api.snapshot.create_repository.go +++ b/esapi/api.snapshot.create_repository.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.delete.go b/esapi/api.snapshot.delete.go index 8afeaebd35..67afb05ba1 100644 --- a/esapi/api.snapshot.delete.go +++ b/esapi/api.snapshot.delete.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.delete_repository.go b/esapi/api.snapshot.delete_repository.go index b2f65726ea..b0295a17df 100644 --- a/esapi/api.snapshot.delete_repository.go +++ b/esapi/api.snapshot.delete_repository.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.get.go b/esapi/api.snapshot.get.go index 2d1fe5de10..b83ad7a431 100644 --- a/esapi/api.snapshot.get.go +++ b/esapi/api.snapshot.get.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.get_repository.go b/esapi/api.snapshot.get_repository.go index 1a9fa44976..ee68289b0a 100644 --- a/esapi/api.snapshot.get_repository.go +++ b/esapi/api.snapshot.get_repository.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.restore.go b/esapi/api.snapshot.restore.go index 70727519cb..7d92634582 100644 --- a/esapi/api.snapshot.restore.go +++ b/esapi/api.snapshot.restore.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.status.go b/esapi/api.snapshot.status.go index a86d5209d5..b07ff266c7 100644 --- a/esapi/api.snapshot.status.go +++ b/esapi/api.snapshot.status.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.verify_repository.go b/esapi/api.snapshot.verify_repository.go index 3cdc227417..cb2a4a2ed2 100644 --- a/esapi/api.snapshot.verify_repository.go +++ b/esapi/api.snapshot.verify_repository.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.tasks.cancel.go b/esapi/api.tasks.cancel.go index fb52cffdc3..953b707901 100644 --- a/esapi/api.tasks.cancel.go +++ b/esapi/api.tasks.cancel.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.tasks.get.go b/esapi/api.tasks.get.go index 3827643658..10ebf58cff 100644 --- a/esapi/api.tasks.get.go +++ b/esapi/api.tasks.get.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.tasks.list.go b/esapi/api.tasks.list.go index d226d54b0a..14251a505a 100644 --- a/esapi/api.tasks.list.go +++ b/esapi/api.tasks.list.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.termvectors.go b/esapi/api.termvectors.go index 7f5a8b8660..21b073517c 100644 --- a/esapi/api.termvectors.go +++ b/esapi/api.termvectors.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.update.go b/esapi/api.update.go index a90c43cbfa..d88923428d 100644 --- a/esapi/api.update.go +++ b/esapi/api.update.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.update_by_query.go b/esapi/api.update_by_query.go index eb76f56f3d..af1c8f1076 100644 --- a/esapi/api.update_by_query.go +++ b/esapi/api.update_by_query.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.update_by_query_rethrottle.go b/esapi/api.update_by_query_rethrottle.go index 60b28bad1d..054297c6a1 100644 --- a/esapi/api.update_by_query_rethrottle.go +++ b/esapi/api.update_by_query_rethrottle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go index ab1b07e86e..8987581993 100644 --- a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.follow.go b/esapi/api.xpack.ccr.follow.go index aabf5ecc40..a2284d44c8 100644 --- a/esapi/api.xpack.ccr.follow.go +++ b/esapi/api.xpack.ccr.follow.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.follow_info.go b/esapi/api.xpack.ccr.follow_info.go index 1c22cd0d47..85d3dec9d4 100644 --- a/esapi/api.xpack.ccr.follow_info.go +++ b/esapi/api.xpack.ccr.follow_info.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.follow_stats.go b/esapi/api.xpack.ccr.follow_stats.go index fd02f5e740..8e901fe044 100644 --- a/esapi/api.xpack.ccr.follow_stats.go +++ b/esapi/api.xpack.ccr.follow_stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.forget_follower.go b/esapi/api.xpack.ccr.forget_follower.go index 753f5d1869..ca3ae1aaac 100644 --- a/esapi/api.xpack.ccr.forget_follower.go +++ b/esapi/api.xpack.ccr.forget_follower.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.get_auto_follow_pattern.go b/esapi/api.xpack.ccr.get_auto_follow_pattern.go index c4aba9e17c..00d31cf4c6 100644 --- a/esapi/api.xpack.ccr.get_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.get_auto_follow_pattern.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.pause_follow.go b/esapi/api.xpack.ccr.pause_follow.go index 1b3da90c05..f3d75a2a7e 100644 --- a/esapi/api.xpack.ccr.pause_follow.go +++ b/esapi/api.xpack.ccr.pause_follow.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.put_auto_follow_pattern.go b/esapi/api.xpack.ccr.put_auto_follow_pattern.go index 4642cea358..f5152244c4 100644 --- a/esapi/api.xpack.ccr.put_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.put_auto_follow_pattern.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.resume_follow.go b/esapi/api.xpack.ccr.resume_follow.go index d29b5f08cd..5b09958506 100644 --- a/esapi/api.xpack.ccr.resume_follow.go +++ b/esapi/api.xpack.ccr.resume_follow.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.stats.go b/esapi/api.xpack.ccr.stats.go index 365bc3d924..01c34c848a 100644 --- a/esapi/api.xpack.ccr.stats.go +++ b/esapi/api.xpack.ccr.stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.unfollow.go b/esapi/api.xpack.ccr.unfollow.go index 9b0401e3f7..0ca35509ca 100644 --- a/esapi/api.xpack.ccr.unfollow.go +++ b/esapi/api.xpack.ccr.unfollow.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.delete_data_frame_transform.go b/esapi/api.xpack.data_frame.delete_data_frame_transform.go index 03b5071577..5d53be1bfd 100644 --- a/esapi/api.xpack.data_frame.delete_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.delete_data_frame_transform.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.get_data_frame_transform.go b/esapi/api.xpack.data_frame.get_data_frame_transform.go index 521c9bf73e..27a650fd2c 100644 --- a/esapi/api.xpack.data_frame.get_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.get_data_frame_transform.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go b/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go index 4b0377e043..b16b62ca59 100644 --- a/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go +++ b/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.preview_data_frame_transform.go b/esapi/api.xpack.data_frame.preview_data_frame_transform.go index 27323a0994..6ca8717ccf 100644 --- a/esapi/api.xpack.data_frame.preview_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.preview_data_frame_transform.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.put_data_frame_transform.go b/esapi/api.xpack.data_frame.put_data_frame_transform.go index 146f0868da..148a0dc45b 100644 --- a/esapi/api.xpack.data_frame.put_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.put_data_frame_transform.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.start_data_frame_transform.go b/esapi/api.xpack.data_frame.start_data_frame_transform.go index 692a075c89..acf38ef9aa 100644 --- a/esapi/api.xpack.data_frame.start_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.start_data_frame_transform.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.stop_data_frame_transform.go b/esapi/api.xpack.data_frame.stop_data_frame_transform.go index 6ba02bad94..d42b4975d5 100644 --- a/esapi/api.xpack.data_frame.stop_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.stop_data_frame_transform.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame.update_data_frame_transform.go b/esapi/api.xpack.data_frame.update_data_frame_transform.go index 9d2055b231..5a2c334a25 100644 --- a/esapi/api.xpack.data_frame.update_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.update_data_frame_transform.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.graph.explore.go b/esapi/api.xpack.graph.explore.go index a890123605..43ef4dbc02 100644 --- a/esapi/api.xpack.graph.explore.go +++ b/esapi/api.xpack.graph.explore.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.delete_lifecycle.go b/esapi/api.xpack.ilm.delete_lifecycle.go index 7c1037bcb7..2cb13430c3 100644 --- a/esapi/api.xpack.ilm.delete_lifecycle.go +++ b/esapi/api.xpack.ilm.delete_lifecycle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.explain_lifecycle.go b/esapi/api.xpack.ilm.explain_lifecycle.go index 7c1244d464..98f32e68d4 100644 --- a/esapi/api.xpack.ilm.explain_lifecycle.go +++ b/esapi/api.xpack.ilm.explain_lifecycle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.get_lifecycle.go b/esapi/api.xpack.ilm.get_lifecycle.go index 03460c0dfc..0023cdeba1 100644 --- a/esapi/api.xpack.ilm.get_lifecycle.go +++ b/esapi/api.xpack.ilm.get_lifecycle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.get_status.go b/esapi/api.xpack.ilm.get_status.go index 0c616de805..68d2cd522f 100644 --- a/esapi/api.xpack.ilm.get_status.go +++ b/esapi/api.xpack.ilm.get_status.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.move_to_step.go b/esapi/api.xpack.ilm.move_to_step.go index d20d5b9c7f..23278d7a9f 100644 --- a/esapi/api.xpack.ilm.move_to_step.go +++ b/esapi/api.xpack.ilm.move_to_step.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.put_lifecycle.go b/esapi/api.xpack.ilm.put_lifecycle.go index 0786ea659d..1baab94fc1 100644 --- a/esapi/api.xpack.ilm.put_lifecycle.go +++ b/esapi/api.xpack.ilm.put_lifecycle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.remove_policy.go b/esapi/api.xpack.ilm.remove_policy.go index 6402ec73a3..8908d2559b 100644 --- a/esapi/api.xpack.ilm.remove_policy.go +++ b/esapi/api.xpack.ilm.remove_policy.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.retry.go b/esapi/api.xpack.ilm.retry.go index 61a3328450..061c8a7e23 100644 --- a/esapi/api.xpack.ilm.retry.go +++ b/esapi/api.xpack.ilm.retry.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.start.go b/esapi/api.xpack.ilm.start.go index 297c0031c7..70e229d3b2 100644 --- a/esapi/api.xpack.ilm.start.go +++ b/esapi/api.xpack.ilm.start.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.stop.go b/esapi/api.xpack.ilm.stop.go index 5af3b991c8..dd2ed11ed5 100644 --- a/esapi/api.xpack.ilm.stop.go +++ b/esapi/api.xpack.ilm.stop.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.indices.freeze.go b/esapi/api.xpack.indices.freeze.go index c45c182e1f..92ee8d79a9 100644 --- a/esapi/api.xpack.indices.freeze.go +++ b/esapi/api.xpack.indices.freeze.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.indices.reload_search_analyzers.go b/esapi/api.xpack.indices.reload_search_analyzers.go index a4f8b8dbab..4e06af8c10 100644 --- a/esapi/api.xpack.indices.reload_search_analyzers.go +++ b/esapi/api.xpack.indices.reload_search_analyzers.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.indices.unfreeze.go b/esapi/api.xpack.indices.unfreeze.go index 3caae3f969..8e2addff1e 100644 --- a/esapi/api.xpack.indices.unfreeze.go +++ b/esapi/api.xpack.indices.unfreeze.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.delete.go b/esapi/api.xpack.license.delete.go index d10a905b35..925fc4e49d 100644 --- a/esapi/api.xpack.license.delete.go +++ b/esapi/api.xpack.license.delete.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.get.go b/esapi/api.xpack.license.get.go index 244dcf5a53..544f34f284 100644 --- a/esapi/api.xpack.license.get.go +++ b/esapi/api.xpack.license.get.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.get_basic_status.go b/esapi/api.xpack.license.get_basic_status.go index 6f4865e18c..3c3d5e5f85 100644 --- a/esapi/api.xpack.license.get_basic_status.go +++ b/esapi/api.xpack.license.get_basic_status.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.get_trial_status.go b/esapi/api.xpack.license.get_trial_status.go index 6e2410ba38..b81611d4af 100644 --- a/esapi/api.xpack.license.get_trial_status.go +++ b/esapi/api.xpack.license.get_trial_status.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.post.go b/esapi/api.xpack.license.post.go index 31c7093bb7..64762db07d 100644 --- a/esapi/api.xpack.license.post.go +++ b/esapi/api.xpack.license.post.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.post_start_basic.go b/esapi/api.xpack.license.post_start_basic.go index a9d447ccdd..b5949cbcbf 100644 --- a/esapi/api.xpack.license.post_start_basic.go +++ b/esapi/api.xpack.license.post_start_basic.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.post_start_trial.go b/esapi/api.xpack.license.post_start_trial.go index f82b2c90f9..3eb9b17acd 100644 --- a/esapi/api.xpack.license.post_start_trial.go +++ b/esapi/api.xpack.license.post_start_trial.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.migration.deprecations.go b/esapi/api.xpack.migration.deprecations.go index f6c43e318d..23bd2252d2 100644 --- a/esapi/api.xpack.migration.deprecations.go +++ b/esapi/api.xpack.migration.deprecations.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.close_job.go b/esapi/api.xpack.ml.close_job.go index 232dfa6752..8ae616c004 100644 --- a/esapi/api.xpack.ml.close_job.go +++ b/esapi/api.xpack.ml.close_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_calendar.go b/esapi/api.xpack.ml.delete_calendar.go index 9e132873eb..76ca9cc441 100644 --- a/esapi/api.xpack.ml.delete_calendar.go +++ b/esapi/api.xpack.ml.delete_calendar.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_calendar_event.go b/esapi/api.xpack.ml.delete_calendar_event.go index b786f25953..83101891d1 100644 --- a/esapi/api.xpack.ml.delete_calendar_event.go +++ b/esapi/api.xpack.ml.delete_calendar_event.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_calendar_job.go b/esapi/api.xpack.ml.delete_calendar_job.go index e8eb743c1e..1c96d6697c 100644 --- a/esapi/api.xpack.ml.delete_calendar_job.go +++ b/esapi/api.xpack.ml.delete_calendar_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_data_frame_analytics.go b/esapi/api.xpack.ml.delete_data_frame_analytics.go index 982ee4555e..82393d68a1 100644 --- a/esapi/api.xpack.ml.delete_data_frame_analytics.go +++ b/esapi/api.xpack.ml.delete_data_frame_analytics.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_datafeed.go b/esapi/api.xpack.ml.delete_datafeed.go index 01aa51ada9..844c9097ec 100644 --- a/esapi/api.xpack.ml.delete_datafeed.go +++ b/esapi/api.xpack.ml.delete_datafeed.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_expired_data.go b/esapi/api.xpack.ml.delete_expired_data.go index b8648a5e4c..a44a44f31a 100644 --- a/esapi/api.xpack.ml.delete_expired_data.go +++ b/esapi/api.xpack.ml.delete_expired_data.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_filter.go b/esapi/api.xpack.ml.delete_filter.go index b15d2d0866..ad7c070256 100644 --- a/esapi/api.xpack.ml.delete_filter.go +++ b/esapi/api.xpack.ml.delete_filter.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_forecast.go b/esapi/api.xpack.ml.delete_forecast.go index f237b4c9c8..65db92911b 100644 --- a/esapi/api.xpack.ml.delete_forecast.go +++ b/esapi/api.xpack.ml.delete_forecast.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_job.go b/esapi/api.xpack.ml.delete_job.go index 32a06c2ada..3822b43e7e 100644 --- a/esapi/api.xpack.ml.delete_job.go +++ b/esapi/api.xpack.ml.delete_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_model_snapshot.go b/esapi/api.xpack.ml.delete_model_snapshot.go index 9f88cf6eaf..b4a75a2422 100644 --- a/esapi/api.xpack.ml.delete_model_snapshot.go +++ b/esapi/api.xpack.ml.delete_model_snapshot.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.estimate_memory_usage.go b/esapi/api.xpack.ml.estimate_memory_usage.go index 64f3b15cfb..267b7d2ab7 100644 --- a/esapi/api.xpack.ml.estimate_memory_usage.go +++ b/esapi/api.xpack.ml.estimate_memory_usage.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.evaluate_data_frame.go b/esapi/api.xpack.ml.evaluate_data_frame.go index 3ec29f50a7..18c59c9cc4 100644 --- a/esapi/api.xpack.ml.evaluate_data_frame.go +++ b/esapi/api.xpack.ml.evaluate_data_frame.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.find_file_structure.go b/esapi/api.xpack.ml.find_file_structure.go index 985a2b3b84..624f2e89d2 100644 --- a/esapi/api.xpack.ml.find_file_structure.go +++ b/esapi/api.xpack.ml.find_file_structure.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.flush_job.go b/esapi/api.xpack.ml.flush_job.go index d584b78b97..d2f1fc40db 100644 --- a/esapi/api.xpack.ml.flush_job.go +++ b/esapi/api.xpack.ml.flush_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.forecast.go b/esapi/api.xpack.ml.forecast.go index 5f2c028c58..2bb5d258a4 100644 --- a/esapi/api.xpack.ml.forecast.go +++ b/esapi/api.xpack.ml.forecast.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_buckets.go b/esapi/api.xpack.ml.get_buckets.go index 4525416e74..5d6e01da6e 100644 --- a/esapi/api.xpack.ml.get_buckets.go +++ b/esapi/api.xpack.ml.get_buckets.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_calendar_events.go b/esapi/api.xpack.ml.get_calendar_events.go index e7dd55dcdc..6b8469e4a0 100644 --- a/esapi/api.xpack.ml.get_calendar_events.go +++ b/esapi/api.xpack.ml.get_calendar_events.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_calendars.go b/esapi/api.xpack.ml.get_calendars.go index 4bc843624b..efb24402b1 100644 --- a/esapi/api.xpack.ml.get_calendars.go +++ b/esapi/api.xpack.ml.get_calendars.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_categories.go b/esapi/api.xpack.ml.get_categories.go index e34b41319c..5c8bd43ba0 100644 --- a/esapi/api.xpack.ml.get_categories.go +++ b/esapi/api.xpack.ml.get_categories.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_data_frame_analytics.go b/esapi/api.xpack.ml.get_data_frame_analytics.go index 4a2dc53bf7..f7045fc4ba 100644 --- a/esapi/api.xpack.ml.get_data_frame_analytics.go +++ b/esapi/api.xpack.ml.get_data_frame_analytics.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go index 8a897154e0..6a3af42177 100644 --- a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go +++ b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_datafeed_stats.go b/esapi/api.xpack.ml.get_datafeed_stats.go index 44cb2f82e2..d70fc2bc17 100644 --- a/esapi/api.xpack.ml.get_datafeed_stats.go +++ b/esapi/api.xpack.ml.get_datafeed_stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_datafeeds.go b/esapi/api.xpack.ml.get_datafeeds.go index ae8cd0b346..0d3c4517e3 100644 --- a/esapi/api.xpack.ml.get_datafeeds.go +++ b/esapi/api.xpack.ml.get_datafeeds.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_filters.go b/esapi/api.xpack.ml.get_filters.go index 8b2241587c..6d1a3a6dee 100644 --- a/esapi/api.xpack.ml.get_filters.go +++ b/esapi/api.xpack.ml.get_filters.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_influencers.go b/esapi/api.xpack.ml.get_influencers.go index 71fc74b6f8..09813dc061 100644 --- a/esapi/api.xpack.ml.get_influencers.go +++ b/esapi/api.xpack.ml.get_influencers.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_job_stats.go b/esapi/api.xpack.ml.get_job_stats.go index 4c63c5292a..250c5297f7 100644 --- a/esapi/api.xpack.ml.get_job_stats.go +++ b/esapi/api.xpack.ml.get_job_stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_jobs.go b/esapi/api.xpack.ml.get_jobs.go index 5a70975713..86d2fbc173 100644 --- a/esapi/api.xpack.ml.get_jobs.go +++ b/esapi/api.xpack.ml.get_jobs.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_model_snapshots.go b/esapi/api.xpack.ml.get_model_snapshots.go index 8d27d0d238..2f97d06428 100644 --- a/esapi/api.xpack.ml.get_model_snapshots.go +++ b/esapi/api.xpack.ml.get_model_snapshots.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_overall_buckets.go b/esapi/api.xpack.ml.get_overall_buckets.go index cb2880f3c2..6291b1e3c3 100644 --- a/esapi/api.xpack.ml.get_overall_buckets.go +++ b/esapi/api.xpack.ml.get_overall_buckets.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_records.go b/esapi/api.xpack.ml.get_records.go index 6ed8c07c6c..0789258632 100644 --- a/esapi/api.xpack.ml.get_records.go +++ b/esapi/api.xpack.ml.get_records.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.info.go b/esapi/api.xpack.ml.info.go index 42e0e253ba..33ae59ac40 100644 --- a/esapi/api.xpack.ml.info.go +++ b/esapi/api.xpack.ml.info.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.open_job.go b/esapi/api.xpack.ml.open_job.go index ea553a9198..765004bcea 100644 --- a/esapi/api.xpack.ml.open_job.go +++ b/esapi/api.xpack.ml.open_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.post_calendar_events.go b/esapi/api.xpack.ml.post_calendar_events.go index e143b68d02..0fcbcc4536 100644 --- a/esapi/api.xpack.ml.post_calendar_events.go +++ b/esapi/api.xpack.ml.post_calendar_events.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.post_data.go b/esapi/api.xpack.ml.post_data.go index 0619ed6ffa..0963dc0654 100644 --- a/esapi/api.xpack.ml.post_data.go +++ b/esapi/api.xpack.ml.post_data.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.preview_datafeed.go b/esapi/api.xpack.ml.preview_datafeed.go index 4388ffe0b2..6c4871d03e 100644 --- a/esapi/api.xpack.ml.preview_datafeed.go +++ b/esapi/api.xpack.ml.preview_datafeed.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_calendar.go b/esapi/api.xpack.ml.put_calendar.go index ab424550f4..d3371de9bd 100644 --- a/esapi/api.xpack.ml.put_calendar.go +++ b/esapi/api.xpack.ml.put_calendar.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_calendar_job.go b/esapi/api.xpack.ml.put_calendar_job.go index 13787cfb2e..c1525ac340 100644 --- a/esapi/api.xpack.ml.put_calendar_job.go +++ b/esapi/api.xpack.ml.put_calendar_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_data_frame_analytics.go b/esapi/api.xpack.ml.put_data_frame_analytics.go index f7f051774c..08ad463411 100644 --- a/esapi/api.xpack.ml.put_data_frame_analytics.go +++ b/esapi/api.xpack.ml.put_data_frame_analytics.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_datafeed.go b/esapi/api.xpack.ml.put_datafeed.go index 3c5252bf09..657a28267d 100644 --- a/esapi/api.xpack.ml.put_datafeed.go +++ b/esapi/api.xpack.ml.put_datafeed.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_filter.go b/esapi/api.xpack.ml.put_filter.go index ccc4a0de90..cef0c72e62 100644 --- a/esapi/api.xpack.ml.put_filter.go +++ b/esapi/api.xpack.ml.put_filter.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_job.go b/esapi/api.xpack.ml.put_job.go index 302fb9c539..16635b3e15 100644 --- a/esapi/api.xpack.ml.put_job.go +++ b/esapi/api.xpack.ml.put_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.revert_model_snapshot.go b/esapi/api.xpack.ml.revert_model_snapshot.go index 32a166a381..b7ff76b1ab 100644 --- a/esapi/api.xpack.ml.revert_model_snapshot.go +++ b/esapi/api.xpack.ml.revert_model_snapshot.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.set_upgrade_mode.go b/esapi/api.xpack.ml.set_upgrade_mode.go index a2b00182b3..f620ab7195 100644 --- a/esapi/api.xpack.ml.set_upgrade_mode.go +++ b/esapi/api.xpack.ml.set_upgrade_mode.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.start_data_frame_analytics.go b/esapi/api.xpack.ml.start_data_frame_analytics.go index 507a9aabd2..23a2f84ac2 100644 --- a/esapi/api.xpack.ml.start_data_frame_analytics.go +++ b/esapi/api.xpack.ml.start_data_frame_analytics.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.start_datafeed.go b/esapi/api.xpack.ml.start_datafeed.go index 08611ea8ba..7a9f503b41 100644 --- a/esapi/api.xpack.ml.start_datafeed.go +++ b/esapi/api.xpack.ml.start_datafeed.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.stop_data_frame_analytics.go b/esapi/api.xpack.ml.stop_data_frame_analytics.go index a8d318e0f5..2674d7a7d4 100644 --- a/esapi/api.xpack.ml.stop_data_frame_analytics.go +++ b/esapi/api.xpack.ml.stop_data_frame_analytics.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.stop_datafeed.go b/esapi/api.xpack.ml.stop_datafeed.go index c9754723a0..6c306ae948 100644 --- a/esapi/api.xpack.ml.stop_datafeed.go +++ b/esapi/api.xpack.ml.stop_datafeed.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.update_datafeed.go b/esapi/api.xpack.ml.update_datafeed.go index c7248ff6a4..e4abe2440d 100644 --- a/esapi/api.xpack.ml.update_datafeed.go +++ b/esapi/api.xpack.ml.update_datafeed.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.update_filter.go b/esapi/api.xpack.ml.update_filter.go index ceac90776b..b4e98d895f 100644 --- a/esapi/api.xpack.ml.update_filter.go +++ b/esapi/api.xpack.ml.update_filter.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.update_job.go b/esapi/api.xpack.ml.update_job.go index 61ec09860b..723e86ed92 100644 --- a/esapi/api.xpack.ml.update_job.go +++ b/esapi/api.xpack.ml.update_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.update_model_snapshot.go b/esapi/api.xpack.ml.update_model_snapshot.go index dfbc3312d9..5345da0cd3 100644 --- a/esapi/api.xpack.ml.update_model_snapshot.go +++ b/esapi/api.xpack.ml.update_model_snapshot.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.validate.go b/esapi/api.xpack.ml.validate.go index 40bb81fe87..a8e0a51045 100644 --- a/esapi/api.xpack.ml.validate.go +++ b/esapi/api.xpack.ml.validate.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.validate_detector.go b/esapi/api.xpack.ml.validate_detector.go index 96568ab8c0..2f9e8efb5c 100644 --- a/esapi/api.xpack.ml.validate_detector.go +++ b/esapi/api.xpack.ml.validate_detector.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.monitoring.bulk.go b/esapi/api.xpack.monitoring.bulk.go index 6427b6d434..c91089482d 100644 --- a/esapi/api.xpack.monitoring.bulk.go +++ b/esapi/api.xpack.monitoring.bulk.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.delete_job.go b/esapi/api.xpack.rollup.delete_job.go index dcdc2ddc5d..40a4a8576e 100644 --- a/esapi/api.xpack.rollup.delete_job.go +++ b/esapi/api.xpack.rollup.delete_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.get_jobs.go b/esapi/api.xpack.rollup.get_jobs.go index 73dc9e5ed2..c8e7d787d1 100644 --- a/esapi/api.xpack.rollup.get_jobs.go +++ b/esapi/api.xpack.rollup.get_jobs.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.get_rollup_caps.go b/esapi/api.xpack.rollup.get_rollup_caps.go index 1cba935ffe..220786a00c 100644 --- a/esapi/api.xpack.rollup.get_rollup_caps.go +++ b/esapi/api.xpack.rollup.get_rollup_caps.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.get_rollup_index_caps.go b/esapi/api.xpack.rollup.get_rollup_index_caps.go index 6591b32c13..8fd0b5f61d 100644 --- a/esapi/api.xpack.rollup.get_rollup_index_caps.go +++ b/esapi/api.xpack.rollup.get_rollup_index_caps.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.put_job.go b/esapi/api.xpack.rollup.put_job.go index a83aeff1cb..a98d55c8f1 100644 --- a/esapi/api.xpack.rollup.put_job.go +++ b/esapi/api.xpack.rollup.put_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.rollup_search.go b/esapi/api.xpack.rollup.rollup_search.go index 97c0d028bb..3ff8eb5708 100644 --- a/esapi/api.xpack.rollup.rollup_search.go +++ b/esapi/api.xpack.rollup.rollup_search.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.start_job.go b/esapi/api.xpack.rollup.start_job.go index 2a2b23f3ec..b8caa69540 100644 --- a/esapi/api.xpack.rollup.start_job.go +++ b/esapi/api.xpack.rollup.start_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.stop_job.go b/esapi/api.xpack.rollup.stop_job.go index 69a43d0b0f..2414c70480 100644 --- a/esapi/api.xpack.rollup.stop_job.go +++ b/esapi/api.xpack.rollup.stop_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.authenticate.go b/esapi/api.xpack.security.authenticate.go index 678ca79fa0..7709a07ddd 100644 --- a/esapi/api.xpack.security.authenticate.go +++ b/esapi/api.xpack.security.authenticate.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.change_password.go b/esapi/api.xpack.security.change_password.go index bdbbfc8a53..d39c786673 100644 --- a/esapi/api.xpack.security.change_password.go +++ b/esapi/api.xpack.security.change_password.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.clear_cached_realms.go b/esapi/api.xpack.security.clear_cached_realms.go index bf4e8052b0..5e7fedc0b2 100644 --- a/esapi/api.xpack.security.clear_cached_realms.go +++ b/esapi/api.xpack.security.clear_cached_realms.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.clear_cached_roles.go b/esapi/api.xpack.security.clear_cached_roles.go index 30863b524a..f78cd26563 100644 --- a/esapi/api.xpack.security.clear_cached_roles.go +++ b/esapi/api.xpack.security.clear_cached_roles.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.create_api_key.go b/esapi/api.xpack.security.create_api_key.go index d3cb21ab75..6859f3c61b 100644 --- a/esapi/api.xpack.security.create_api_key.go +++ b/esapi/api.xpack.security.create_api_key.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.delete_privileges.go b/esapi/api.xpack.security.delete_privileges.go index 65a54d7e79..c0e6751ef2 100644 --- a/esapi/api.xpack.security.delete_privileges.go +++ b/esapi/api.xpack.security.delete_privileges.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.delete_role.go b/esapi/api.xpack.security.delete_role.go index d66390d862..2bbfbfcbf8 100644 --- a/esapi/api.xpack.security.delete_role.go +++ b/esapi/api.xpack.security.delete_role.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.delete_role_mapping.go b/esapi/api.xpack.security.delete_role_mapping.go index e873ebdc9d..a6189e6c44 100644 --- a/esapi/api.xpack.security.delete_role_mapping.go +++ b/esapi/api.xpack.security.delete_role_mapping.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.delete_user.go b/esapi/api.xpack.security.delete_user.go index b1a3f7bbf2..754829c4d9 100644 --- a/esapi/api.xpack.security.delete_user.go +++ b/esapi/api.xpack.security.delete_user.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.disable_user.go b/esapi/api.xpack.security.disable_user.go index a609b3259e..d77c2120d9 100644 --- a/esapi/api.xpack.security.disable_user.go +++ b/esapi/api.xpack.security.disable_user.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.enable_user.go b/esapi/api.xpack.security.enable_user.go index 6c2368c05d..d040b26a92 100644 --- a/esapi/api.xpack.security.enable_user.go +++ b/esapi/api.xpack.security.enable_user.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_api_key.go b/esapi/api.xpack.security.get_api_key.go index caf8c7ecf7..5dd6e0f7b4 100644 --- a/esapi/api.xpack.security.get_api_key.go +++ b/esapi/api.xpack.security.get_api_key.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_builtin_privileges.go b/esapi/api.xpack.security.get_builtin_privileges.go index e2d8531665..c9fd120320 100644 --- a/esapi/api.xpack.security.get_builtin_privileges.go +++ b/esapi/api.xpack.security.get_builtin_privileges.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_privileges.go b/esapi/api.xpack.security.get_privileges.go index 30f72b4952..13bfdca86c 100644 --- a/esapi/api.xpack.security.get_privileges.go +++ b/esapi/api.xpack.security.get_privileges.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_role.go b/esapi/api.xpack.security.get_role.go index f0d7bc7bf2..05850244b1 100644 --- a/esapi/api.xpack.security.get_role.go +++ b/esapi/api.xpack.security.get_role.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_role_mapping.go b/esapi/api.xpack.security.get_role_mapping.go index 0477144310..e344ccddb6 100644 --- a/esapi/api.xpack.security.get_role_mapping.go +++ b/esapi/api.xpack.security.get_role_mapping.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_token.go b/esapi/api.xpack.security.get_token.go index 26382bbec7..1ad8707c6e 100644 --- a/esapi/api.xpack.security.get_token.go +++ b/esapi/api.xpack.security.get_token.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_user.go b/esapi/api.xpack.security.get_user.go index 03802f5943..852a025149 100644 --- a/esapi/api.xpack.security.get_user.go +++ b/esapi/api.xpack.security.get_user.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_user_privileges.go b/esapi/api.xpack.security.get_user_privileges.go index 7ac5f7e550..49db778122 100644 --- a/esapi/api.xpack.security.get_user_privileges.go +++ b/esapi/api.xpack.security.get_user_privileges.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.has_privileges.go b/esapi/api.xpack.security.has_privileges.go index aeec8a1c07..f853697c47 100644 --- a/esapi/api.xpack.security.has_privileges.go +++ b/esapi/api.xpack.security.has_privileges.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.invalidate_api_key.go b/esapi/api.xpack.security.invalidate_api_key.go index b2a96c2479..dfd9272e93 100644 --- a/esapi/api.xpack.security.invalidate_api_key.go +++ b/esapi/api.xpack.security.invalidate_api_key.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.invalidate_token.go b/esapi/api.xpack.security.invalidate_token.go index 16fb6345e0..abcf6db6d5 100644 --- a/esapi/api.xpack.security.invalidate_token.go +++ b/esapi/api.xpack.security.invalidate_token.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.put_privileges.go b/esapi/api.xpack.security.put_privileges.go index cd3ade8c60..d19bb47191 100644 --- a/esapi/api.xpack.security.put_privileges.go +++ b/esapi/api.xpack.security.put_privileges.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.put_role.go b/esapi/api.xpack.security.put_role.go index 390a411b12..9333e5bbf9 100644 --- a/esapi/api.xpack.security.put_role.go +++ b/esapi/api.xpack.security.put_role.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.put_role_mapping.go b/esapi/api.xpack.security.put_role_mapping.go index 60fc66f898..fab71b37a4 100644 --- a/esapi/api.xpack.security.put_role_mapping.go +++ b/esapi/api.xpack.security.put_role_mapping.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.put_user.go b/esapi/api.xpack.security.put_user.go index ade293fcb5..95a452d27d 100644 --- a/esapi/api.xpack.security.put_user.go +++ b/esapi/api.xpack.security.put_user.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.slm.delete_lifecycle.go b/esapi/api.xpack.slm.delete_lifecycle.go index f539014de0..e272f42c43 100644 --- a/esapi/api.xpack.slm.delete_lifecycle.go +++ b/esapi/api.xpack.slm.delete_lifecycle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.slm.execute_lifecycle.go b/esapi/api.xpack.slm.execute_lifecycle.go index c74644ecc7..b5c5653f1a 100644 --- a/esapi/api.xpack.slm.execute_lifecycle.go +++ b/esapi/api.xpack.slm.execute_lifecycle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.slm.get_lifecycle.go b/esapi/api.xpack.slm.get_lifecycle.go index 4a53b7bf21..b511b6c359 100644 --- a/esapi/api.xpack.slm.get_lifecycle.go +++ b/esapi/api.xpack.slm.get_lifecycle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.slm.put_lifecycle.go b/esapi/api.xpack.slm.put_lifecycle.go index dcbab9bc22..997c5fc87d 100644 --- a/esapi/api.xpack.slm.put_lifecycle.go +++ b/esapi/api.xpack.slm.put_lifecycle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.sql.clear_cursor.go b/esapi/api.xpack.sql.clear_cursor.go index 866537e434..a65828b175 100644 --- a/esapi/api.xpack.sql.clear_cursor.go +++ b/esapi/api.xpack.sql.clear_cursor.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.sql.query.go b/esapi/api.xpack.sql.query.go index 22144e138c..33b4120b5d 100644 --- a/esapi/api.xpack.sql.query.go +++ b/esapi/api.xpack.sql.query.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.sql.translate.go b/esapi/api.xpack.sql.translate.go index 0272be981d..9453913be3 100644 --- a/esapi/api.xpack.sql.translate.go +++ b/esapi/api.xpack.sql.translate.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ssl.certificates.go b/esapi/api.xpack.ssl.certificates.go index 12d25b5363..94b7a84508 100644 --- a/esapi/api.xpack.ssl.certificates.go +++ b/esapi/api.xpack.ssl.certificates.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.ack_watch.go b/esapi/api.xpack.watcher.ack_watch.go index 23fd68dc4d..6a415315af 100644 --- a/esapi/api.xpack.watcher.ack_watch.go +++ b/esapi/api.xpack.watcher.ack_watch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.activate_watch.go b/esapi/api.xpack.watcher.activate_watch.go index 85554d5b19..ad59f96f60 100644 --- a/esapi/api.xpack.watcher.activate_watch.go +++ b/esapi/api.xpack.watcher.activate_watch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.deactivate_watch.go b/esapi/api.xpack.watcher.deactivate_watch.go index f39f5d945d..f6b2e77d36 100644 --- a/esapi/api.xpack.watcher.deactivate_watch.go +++ b/esapi/api.xpack.watcher.deactivate_watch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.delete_watch.go b/esapi/api.xpack.watcher.delete_watch.go index 3b153aa25a..0684c521b2 100644 --- a/esapi/api.xpack.watcher.delete_watch.go +++ b/esapi/api.xpack.watcher.delete_watch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.execute_watch.go b/esapi/api.xpack.watcher.execute_watch.go index 3ec836d98f..5e3c5a782a 100644 --- a/esapi/api.xpack.watcher.execute_watch.go +++ b/esapi/api.xpack.watcher.execute_watch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.get_watch.go b/esapi/api.xpack.watcher.get_watch.go index 83f826955b..bf666ebbe9 100644 --- a/esapi/api.xpack.watcher.get_watch.go +++ b/esapi/api.xpack.watcher.get_watch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.put_watch.go b/esapi/api.xpack.watcher.put_watch.go index 5f2e912d92..47e4ceaa5a 100644 --- a/esapi/api.xpack.watcher.put_watch.go +++ b/esapi/api.xpack.watcher.put_watch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.start.go b/esapi/api.xpack.watcher.start.go index 3e1efbee6a..e0ce0fa647 100644 --- a/esapi/api.xpack.watcher.start.go +++ b/esapi/api.xpack.watcher.start.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.stats.go b/esapi/api.xpack.watcher.stats.go index b84a595eea..ed135a9416 100644 --- a/esapi/api.xpack.watcher.stats.go +++ b/esapi/api.xpack.watcher.stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.stop.go b/esapi/api.xpack.watcher.stop.go index b6dd38e896..d21e3f4cf7 100644 --- a/esapi/api.xpack.watcher.stop.go +++ b/esapi/api.xpack.watcher.stop.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.xpack.info.go b/esapi/api.xpack.xpack.info.go index 3921238cf6..c13475f3e3 100644 --- a/esapi/api.xpack.xpack.info.go +++ b/esapi/api.xpack.xpack.info.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.xpack.usage.go b/esapi/api.xpack.xpack.usage.go index 9a254de899..e977dd3397 100644 --- a/esapi/api.xpack.xpack.usage.go +++ b/esapi/api.xpack.xpack.usage.go @@ -1,4 +1,8 @@ -// Code generated from specification version 7.4.0: DO NOT EDIT +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// Code generated from specification version 7.4.1: DO NOT EDIT package esapi diff --git a/esapi/esapi.go b/esapi/esapi.go index a621669213..f7ef9dae0d 100644 --- a/esapi/esapi.go +++ b/esapi/esapi.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package esapi import ( diff --git a/esapi/esapi.request.go b/esapi/esapi.request.go index dbdf517eba..250c350332 100644 --- a/esapi/esapi.request.go +++ b/esapi/esapi.request.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package esapi import ( diff --git a/esapi/esapi.response.go b/esapi/esapi.response.go index 4f8cea128d..d1f8442152 100644 --- a/esapi/esapi.response.go +++ b/esapi/esapi.response.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package esapi import ( diff --git a/esapi/esapi.response_example_test.go b/esapi/esapi.response_example_test.go index c46f78f38d..b06f303ad6 100644 --- a/esapi/esapi.response_example_test.go +++ b/esapi/esapi.response_example_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package esapi_test import ( diff --git a/esapi/esapi_benchmark_test.go b/esapi/esapi_benchmark_test.go index c1da3208d4..7f76bd1922 100644 --- a/esapi/esapi_benchmark_test.go +++ b/esapi/esapi_benchmark_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package esapi_test import ( diff --git a/esapi/esapi_integration_test.go b/esapi/esapi_integration_test.go index a15706f079..685783d27a 100644 --- a/esapi/esapi_integration_test.go +++ b/esapi/esapi_integration_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build integration package esapi_test diff --git a/esapi/esapi_internal_test.go b/esapi/esapi_internal_test.go index 08864dc7d3..abb2f4ddb2 100644 --- a/esapi/esapi_internal_test.go +++ b/esapi/esapi_internal_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build !integration package esapi diff --git a/esapi/esapi_request_internal_test.go b/esapi/esapi_request_internal_test.go index e42b0806da..54273e63c9 100644 --- a/esapi/esapi_request_internal_test.go +++ b/esapi/esapi_request_internal_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build !integration package esapi diff --git a/esapi/esapi_response_internal_test.go b/esapi/esapi_response_internal_test.go index 5f4df6735b..e52dba0c9e 100644 --- a/esapi/esapi_response_internal_test.go +++ b/esapi/esapi_response_internal_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build !integration package esapi diff --git a/estransport/estransport.go b/estransport/estransport.go index 80b0885b81..e46d13fce2 100644 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package estransport import ( diff --git a/estransport/estransport_benchmark_test.go b/estransport/estransport_benchmark_test.go index 830b883aa9..d986687f90 100644 --- a/estransport/estransport_benchmark_test.go +++ b/estransport/estransport_benchmark_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build !integration package estransport_test diff --git a/estransport/estransport_integration_test.go b/estransport/estransport_integration_test.go index 8c446d7c4b..ed1ce5844d 100644 --- a/estransport/estransport_integration_test.go +++ b/estransport/estransport_integration_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build integration,multinode package estransport_test diff --git a/estransport/estransport_internal_test.go b/estransport/estransport_internal_test.go index 5fcc9dff46..4a2b812a27 100644 --- a/estransport/estransport_internal_test.go +++ b/estransport/estransport_internal_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build !integration package estransport diff --git a/estransport/logger.go b/estransport/logger.go index 55d35e9a32..85af2fce55 100644 --- a/estransport/logger.go +++ b/estransport/logger.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package estransport import ( diff --git a/estransport/logger_benchmark_test.go b/estransport/logger_benchmark_test.go index dca7ef553f..bb63a2ebdb 100644 --- a/estransport/logger_benchmark_test.go +++ b/estransport/logger_benchmark_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build !integration package estransport_test diff --git a/estransport/logger_internal_test.go b/estransport/logger_internal_test.go index a546a8763c..865af1f049 100644 --- a/estransport/logger_internal_test.go +++ b/estransport/logger_internal_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build !integration package estransport diff --git a/estransport/selector.go b/estransport/selector.go index 45de0deb59..f4a8d3d530 100644 --- a/estransport/selector.go +++ b/estransport/selector.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package estransport import ( diff --git a/esutil/json_reader.go b/esutil/json_reader.go index 57589fc634..5d5495aca2 100644 --- a/esutil/json_reader.go +++ b/esutil/json_reader.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package esutil import ( diff --git a/esutil/json_reader_benchmark_test.go b/esutil/json_reader_benchmark_test.go index 89137546c4..156e430a09 100644 --- a/esutil/json_reader_benchmark_test.go +++ b/esutil/json_reader_benchmark_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build !integration package esutil_test diff --git a/esutil/json_reader_integration_test.go b/esutil/json_reader_integration_test.go index 0bed4fbf20..7dcf97b6dd 100644 --- a/esutil/json_reader_integration_test.go +++ b/esutil/json_reader_integration_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build integration package esutil_test diff --git a/esutil/json_reader_internal_test.go b/esutil/json_reader_internal_test.go index 3459ec8b90..e22f702e5a 100644 --- a/esutil/json_reader_internal_test.go +++ b/esutil/json_reader_internal_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build !integration package esutil diff --git a/internal/cmd/generate/commands/commands.go b/internal/cmd/generate/commands/commands.go index 06c007895f..47f1098e1f 100644 --- a/internal/cmd/generate/commands/commands.go +++ b/internal/cmd/generate/commands/commands.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package commands import ( diff --git a/internal/cmd/generate/commands/gensource/command.go b/internal/cmd/generate/commands/gensource/command.go index 9786d5c470..1256264e17 100644 --- a/internal/cmd/generate/commands/gensource/command.go +++ b/internal/cmd/generate/commands/gensource/command.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package gensource import ( diff --git a/internal/cmd/generate/commands/gensource/debug.go b/internal/cmd/generate/commands/gensource/debug.go index 429d5eaa56..7c4ff602cc 100644 --- a/internal/cmd/generate/commands/gensource/debug.go +++ b/internal/cmd/generate/commands/gensource/debug.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package gensource import ( diff --git a/internal/cmd/generate/commands/gensource/descriptions.go b/internal/cmd/generate/commands/gensource/descriptions.go index a0f42fbad5..e24b1fc8c9 100644 --- a/internal/cmd/generate/commands/gensource/descriptions.go +++ b/internal/cmd/generate/commands/gensource/descriptions.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package gensource var apiDescriptionsYAML = ` diff --git a/internal/cmd/generate/commands/gensource/generator.go b/internal/cmd/generate/commands/gensource/generator.go index 6b0c32cf39..fb5d07a65e 100644 --- a/internal/cmd/generate/commands/gensource/generator.go +++ b/internal/cmd/generate/commands/gensource/generator.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package gensource import ( diff --git a/internal/cmd/generate/commands/gensource/generator_test.go b/internal/cmd/generate/commands/gensource/generator_test.go index e31608ec20..4c70102965 100644 --- a/internal/cmd/generate/commands/gensource/generator_test.go +++ b/internal/cmd/generate/commands/gensource/generator_test.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package gensource_test import ( diff --git a/internal/cmd/generate/commands/gensource/model.go b/internal/cmd/generate/commands/gensource/model.go index b9eaf559bc..39610d6e3b 100644 --- a/internal/cmd/generate/commands/gensource/model.go +++ b/internal/cmd/generate/commands/gensource/model.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package gensource import ( diff --git a/internal/cmd/generate/commands/gensource/overrides.go b/internal/cmd/generate/commands/gensource/overrides.go index 557e79d28f..07dd14069b 100644 --- a/internal/cmd/generate/commands/gensource/overrides.go +++ b/internal/cmd/generate/commands/gensource/overrides.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package gensource var ( diff --git a/internal/cmd/generate/commands/genstruct/command.go b/internal/cmd/generate/commands/genstruct/command.go index b533f82cc4..671f9b066f 100644 --- a/internal/cmd/generate/commands/genstruct/command.go +++ b/internal/cmd/generate/commands/genstruct/command.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package genstruct import ( diff --git a/internal/cmd/generate/commands/gentests/command.go b/internal/cmd/generate/commands/gentests/command.go index 003d1e688e..e10b183430 100644 --- a/internal/cmd/generate/commands/gentests/command.go +++ b/internal/cmd/generate/commands/gentests/command.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package gentests //go:generate go run gen_api_registry.go diff --git a/internal/cmd/generate/commands/gentests/debug.go b/internal/cmd/generate/commands/gentests/debug.go index b53a8c986a..f15967c4ea 100644 --- a/internal/cmd/generate/commands/gentests/debug.go +++ b/internal/cmd/generate/commands/gentests/debug.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package gentests import ( diff --git a/internal/cmd/generate/commands/gentests/gen_api_registry.go b/internal/cmd/generate/commands/gentests/gen_api_registry.go index 42b53e1041..985b85455b 100644 --- a/internal/cmd/generate/commands/gentests/gen_api_registry.go +++ b/internal/cmd/generate/commands/gentests/gen_api_registry.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + // +build ignore package main diff --git a/internal/cmd/generate/commands/gentests/generator.go b/internal/cmd/generate/commands/gentests/generator.go index 2ab6ac4657..99d68679e1 100644 --- a/internal/cmd/generate/commands/gentests/generator.go +++ b/internal/cmd/generate/commands/gentests/generator.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package gentests import ( diff --git a/internal/cmd/generate/commands/gentests/model.go b/internal/cmd/generate/commands/gentests/model.go index 0308dfb203..aef00c50a1 100644 --- a/internal/cmd/generate/commands/gentests/model.go +++ b/internal/cmd/generate/commands/gentests/model.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package gentests import ( diff --git a/internal/cmd/generate/commands/gentests/patches.go b/internal/cmd/generate/commands/gentests/patches.go index cf14e6d5d9..2ab61cc828 100644 --- a/internal/cmd/generate/commands/gentests/patches.go +++ b/internal/cmd/generate/commands/gentests/patches.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package gentests import ( diff --git a/internal/cmd/generate/commands/gentests/skips.go b/internal/cmd/generate/commands/gentests/skips.go index 42a3bc4f32..6e006dd2a4 100644 --- a/internal/cmd/generate/commands/gentests/skips.go +++ b/internal/cmd/generate/commands/gentests/skips.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package gentests import ( diff --git a/internal/cmd/generate/main.go b/internal/cmd/generate/main.go index a1373bc009..7bcdb5e022 100644 --- a/internal/cmd/generate/main.go +++ b/internal/cmd/generate/main.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package main import ( diff --git a/internal/cmd/generate/utils/chromatize.go b/internal/cmd/generate/utils/chromatize.go index b8e35fd8d0..7aba661bb8 100644 --- a/internal/cmd/generate/utils/chromatize.go +++ b/internal/cmd/generate/utils/chromatize.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package utils import ( diff --git a/internal/cmd/generate/utils/debug.go b/internal/cmd/generate/utils/debug.go index 5b2e44a228..1d86246249 100644 --- a/internal/cmd/generate/utils/debug.go +++ b/internal/cmd/generate/utils/debug.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package utils import ( diff --git a/internal/cmd/generate/utils/map.go b/internal/cmd/generate/utils/map.go index 1292785b82..09a82a6b7e 100644 --- a/internal/cmd/generate/utils/map.go +++ b/internal/cmd/generate/utils/map.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package utils // MapKeys returns the map keys as a slice of strings. diff --git a/internal/cmd/generate/utils/metadata.go b/internal/cmd/generate/utils/metadata.go index d11b74745e..985dd6fbcc 100644 --- a/internal/cmd/generate/utils/metadata.go +++ b/internal/cmd/generate/utils/metadata.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package utils import ( diff --git a/internal/cmd/generate/utils/naming.go b/internal/cmd/generate/utils/naming.go index c39642a411..6372960391 100644 --- a/internal/cmd/generate/utils/naming.go +++ b/internal/cmd/generate/utils/naming.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package utils import "strings" diff --git a/internal/cmd/generate/utils/strings.go b/internal/cmd/generate/utils/strings.go index 5265d41726..4b2399891d 100644 --- a/internal/cmd/generate/utils/strings.go +++ b/internal/cmd/generate/utils/strings.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package utils import ( diff --git a/internal/cmd/generate/utils/terminal.go b/internal/cmd/generate/utils/terminal.go index 73cafb5caf..81bb2be020 100644 --- a/internal/cmd/generate/utils/terminal.go +++ b/internal/cmd/generate/utils/terminal.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package utils import ( diff --git a/internal/version/version.go b/internal/version/version.go index be67e25026..1f10ae8d3e 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package version // Client returns the client version as a string. From d8acaa5faade05290d8b500b8f3892a378f2d2e7 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 14 Oct 2019 11:07:31 +0200 Subject: [PATCH 122/355] Release 7.4.1 --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index 1f10ae8d3e..1aa8b4027f 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -6,4 +6,4 @@ package version // Client returns the client version as a string. // -const Client = "7.4-SNAPSHOT" +const Client = "7.4.1" From 7c0c926d43a6a8faeed5eaac9c6af3bd0751490d Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 14 Oct 2019 11:09:05 +0200 Subject: [PATCH 123/355] Update version to 7.4-SNAPSHOT --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index 1aa8b4027f..1f10ae8d3e 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -6,4 +6,4 @@ package version // Client returns the client version as a string. // -const Client = "7.4.1" +const Client = "7.4-SNAPSHOT" From 3a18b9ee6a4329a4a00f03e2e9d4f57a0dc7d85c Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 17 Oct 2019 16:35:20 +0200 Subject: [PATCH 124/355] Examples: Close the response body in the Bulk API example Fixes #94 (cherry picked from commit ae1f55bef00c0d7c4618c43eab1bd819665ca768) --- _examples/bulk/bulk.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_examples/bulk/bulk.go b/_examples/bulk/bulk.go index 88e299d1f6..b0bbc26a86 100644 --- a/_examples/bulk/bulk.go +++ b/_examples/bulk/bulk.go @@ -236,6 +236,11 @@ func main() { } } } + + // Close the response body, to prevent reaching the limit for goroutines or file handles + // + res.Body.Close() + // Reset the buffer and items counter // buf.Reset() From 5905135fa03eaf7fb0daa0c9676921c066a0b9a2 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 19 Oct 2019 12:35:17 +0200 Subject: [PATCH 125/355] Generator: API: Fix the Apache 2 license header (cherry picked from commit a322a6dab43062ab469672184664cacaf391b93f) --- internal/cmd/generate/commands/gensource/generator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cmd/generate/commands/gensource/generator.go b/internal/cmd/generate/commands/gensource/generator.go index fb5d07a65e..730d1b6f2a 100644 --- a/internal/cmd/generate/commands/gensource/generator.go +++ b/internal/cmd/generate/commands/gensource/generator.go @@ -77,7 +77,7 @@ func (g *Generator) w(s string) { func (g *Generator) genHeader() { g.w(`// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information.` + "\n") g.w("//\n// Code generated") if EsVersion != "" { From 033d4e0de98af7cf299d26759b3fe0ecc28cfd53 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 4 Oct 2019 14:56:36 +0200 Subject: [PATCH 126/355] Dockerfile: Update "gotestsum" to 0.3.5 (cherry picked from commit ee90cd792161194d07ed47d6ac2fb5dc9c43f663) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 312159c61e..acf4a79e34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ FROM golang:${VERSION} RUN apk add --no-cache --quiet make curl git jq unzip tree && \ go get -u golang.org/x/lint/golint && \ - curl -sSL --retry 3 --retry-connrefused https://github.com/gotestyourself/gotestsum/releases/download/v0.3.2/gotestsum_0.3.2_linux_amd64.tar.gz | tar -xz -C /usr/local/bin gotestsum + curl -sSL --retry 3 --retry-connrefused https://github.com/gotestyourself/gotestsum/releases/download/v0.3.5/gotestsum_0.3.5_linux_amd64.tar.gz | tar -xz -C /usr/local/bin gotestsum VOLUME ["/tmp"] From 9219181c309cb9ba067f9cbc1294b9b66c315d2a Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 3 Oct 2019 10:10:04 +0200 Subject: [PATCH 127/355] Examples: Update the apm-agent-go version to 1.5.0 (cherry picked from commit a6f44434ab54a0fda7eb11f7004cbd3ecb6a05e5) --- _examples/instrumentation/go.mod | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_examples/instrumentation/go.mod b/_examples/instrumentation/go.mod index 2a7cebcec1..351a4cdc77 100644 --- a/_examples/instrumentation/go.mod +++ b/_examples/instrumentation/go.mod @@ -11,10 +11,10 @@ require ( github.com/mattn/go-colorable v0.1.0 // indirect github.com/mattn/go-isatty v0.0.4 // indirect - go.elastic.co/apm v1.2.1-0.20190212105052-525c5c425aa9 - go.elastic.co/apm/module/apmelasticsearch v1.2.1-0.20190212105052-525c5c425aa9 + go.elastic.co/apm v1.5.0 + go.elastic.co/apm/module/apmelasticsearch v1.5.0 go.opencensus.io v0.19.0 - golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67 + golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 ) From c47634ccf24dc663d467433d377b101b60a730e6 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 21 Oct 2019 13:48:55 +0200 Subject: [PATCH 128/355] Generator: Tests: Configure the logger when the `DEBUG` environment variable is set (cherry picked from commit 4bdede967dd9546db3817b3aa377dd2cd4994fe5) --- .../cmd/generate/commands/gentests/generator.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/internal/cmd/generate/commands/gentests/generator.go b/internal/cmd/generate/commands/gentests/generator.go index 99d68679e1..2ff6658ce8 100644 --- a/internal/cmd/generate/commands/gentests/generator.go +++ b/internal/cmd/generate/commands/gentests/generator.go @@ -201,11 +201,14 @@ import ( encyaml "gopkg.in/yaml.v2" "context" "crypto/tls" + "os" + "net/url" "testing" "time" "github.com/elastic/go-elasticsearch/v7" "github.com/elastic/go-elasticsearch/v7/esapi" + "github.com/elastic/go-elasticsearch/v7/estransport" ) var ( @@ -226,11 +229,13 @@ func (g *Generator) genInitializeClient() { InsecureSkipVerify: true, }, }, - // Logger: &estransport.TextLogger{ - // Output: os.Stdout, - // // EnableRequestBody: true, - // // EnableResponseBody: true, - // }, + } + if os.Getenv("DEBUG") != "" { + cfg.Logger = &estransport.ColorLogger{ + Output: os.Stdout, + // EnableRequestBody: true, + EnableResponseBody: true, + } } es, eserr := elasticsearch.NewClient(cfg) if eserr != nil { From d3ed97f248c83a2039ddc8fbf9f199025d99bbc5 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 9 Oct 2019 11:38:10 +0200 Subject: [PATCH 129/355] Generator: API: Add returning error when request cannot be created (cherry picked from commit 69614f33228d26de59d64a4c2f7d5c2a771a52c5) --- internal/cmd/generate/commands/gensource/generator.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/cmd/generate/commands/gensource/generator.go b/internal/cmd/generate/commands/gensource/generator.go index 730d1b6f2a..9967441a6e 100644 --- a/internal/cmd/generate/commands/gensource/generator.go +++ b/internal/cmd/generate/commands/gensource/generator.go @@ -718,7 +718,10 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(ctx context.Context, httpBody = "nil" } - g.w(`req, _ := newRequest(method, path.String(), ` + httpBody + `)` + "\n\n") + g.w(`req, err := newRequest(method, path.String(), ` + httpBody + `)` + "\n") + g.w(`if err != nil { + return nil, err + }` + "\n\n") g.w(`if len(params) > 0 { q := req.URL.Query() From 29939aed6fa2e1626ca66fa320858ab539a92eb2 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 22 Oct 2019 16:20:56 +0200 Subject: [PATCH 130/355] Generator: API: Add the helper method for setting the X-Opaque-ID header (cherry picked from commit 3f7b2e8c48b8c8ac651004c259a2f937db94cc7b) --- .../cmd/generate/commands/gensource/generator.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/internal/cmd/generate/commands/gensource/generator.go b/internal/cmd/generate/commands/gensource/generator.go index 9967441a6e..e9f18bc0c5 100644 --- a/internal/cmd/generate/commands/gensource/generator.go +++ b/internal/cmd/generate/commands/gensource/generator.go @@ -434,6 +434,20 @@ func (f ` + g.Endpoint.MethodWithNamespace() + `) WithHeader(h map[string]string } } } +`) + + // Generate methods for the X-Opaque-ID header + g.w(` +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ` + g.Endpoint.MethodWithNamespace() + `) WithOpaqueID(s string) func(*` + g.Endpoint.MethodWithNamespace() + `Request) { + return func(r *` + g.Endpoint.MethodWithNamespace() + `Request) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} `) } From 18de37ee584dea6b3f194a5a489d9efb18660a91 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 30 Oct 2019 08:54:59 +0100 Subject: [PATCH 131/355] API: Update the APIs for Elasticsearch 7.4 (c1c6a413632) --- esapi/api._.go | 6 +- esapi/api.bulk.go | 22 +++++-- esapi/api.cat.aliases.go | 48 +++++++------- esapi/api.cat.allocation.go | 22 +++++-- esapi/api.cat.count.go | 59 +++++++---------- esapi/api.cat.fielddata.go | 61 +++++++----------- esapi/api.cat.health.go | 63 ++++++++----------- esapi/api.cat.help.go | 22 +++++-- esapi/api.cat.indices.go | 22 +++++-- esapi/api.cat.master.go | 22 +++++-- esapi/api.cat.nodeattrs.go | 22 +++++-- esapi/api.cat.nodes.go | 22 +++++-- esapi/api.cat.pending_tasks.go | 22 +++++-- esapi/api.cat.plugins.go | 22 +++++-- esapi/api.cat.recovery.go | 54 ++++++++-------- esapi/api.cat.repositories.go | 22 +++++-- esapi/api.cat.segments.go | 22 +++++-- esapi/api.cat.shards.go | 22 +++++-- esapi/api.cat.snapshots.go | 22 +++++-- esapi/api.cat.tasks.go | 22 +++++-- esapi/api.cat.templates.go | 22 +++++-- esapi/api.cat.thread_pool.go | 22 +++++-- esapi/api.clear_scroll.go | 22 +++++-- esapi/api.cluster.allocation_explain.go | 22 +++++-- esapi/api.cluster.get_settings.go | 22 +++++-- esapi/api.cluster.health.go | 22 +++++-- esapi/api.cluster.pending_tasks.go | 22 +++++-- esapi/api.cluster.put_settings.go | 22 +++++-- esapi/api.cluster.remote_info.go | 22 +++++-- esapi/api.cluster.reroute.go | 22 +++++-- esapi/api.cluster.state.go | 22 +++++-- esapi/api.cluster.stats.go | 22 +++++-- esapi/api.count.go | 22 +++++-- esapi/api.create.go | 22 +++++-- esapi/api.delete.go | 22 +++++-- esapi/api.delete_by_query.go | 22 +++++-- esapi/api.delete_by_query_rethrottle.go | 22 +++++-- esapi/api.delete_script.go | 22 +++++-- esapi/api.exists.go | 22 +++++-- esapi/api.exists_source.go | 22 +++++-- esapi/api.explain.go | 22 +++++-- esapi/api.field_caps.go | 22 +++++-- esapi/api.get.go | 22 +++++-- esapi/api.get_script.go | 22 +++++-- esapi/api.get_source.go | 22 +++++-- esapi/api.index.go | 22 +++++-- esapi/api.indices.analyze.go | 22 +++++-- esapi/api.indices.clear_cache.go | 22 +++++-- esapi/api.indices.clone.go | 22 +++++-- esapi/api.indices.close.go | 22 +++++-- esapi/api.indices.create.go | 22 +++++-- esapi/api.indices.delete.go | 22 +++++-- esapi/api.indices.delete_alias.go | 22 +++++-- esapi/api.indices.delete_template.go | 22 +++++-- esapi/api.indices.exists.go | 22 +++++-- esapi/api.indices.exists_alias.go | 22 +++++-- esapi/api.indices.exists_template.go | 22 +++++-- esapi/api.indices.exists_type.go | 22 +++++-- esapi/api.indices.flush.go | 22 +++++-- esapi/api.indices.flush_synced.go | 22 +++++-- esapi/api.indices.forcemerge.go | 22 +++++-- esapi/api.indices.get.go | 22 +++++-- esapi/api.indices.get_alias.go | 22 +++++-- esapi/api.indices.get_field_mapping.go | 22 +++++-- esapi/api.indices.get_mapping.go | 22 +++++-- esapi/api.indices.get_settings.go | 22 +++++-- esapi/api.indices.get_template.go | 22 +++++-- esapi/api.indices.get_upgrade.go | 22 +++++-- esapi/api.indices.open.go | 22 +++++-- esapi/api.indices.put_alias.go | 22 +++++-- esapi/api.indices.put_mapping.go | 22 +++++-- esapi/api.indices.put_settings.go | 22 +++++-- esapi/api.indices.put_template.go | 22 +++++-- esapi/api.indices.recovery.go | 22 +++++-- esapi/api.indices.refresh.go | 22 +++++-- esapi/api.indices.rollover.go | 22 +++++-- esapi/api.indices.segments.go | 22 +++++-- esapi/api.indices.shard_stores.go | 22 +++++-- esapi/api.indices.shrink.go | 22 +++++-- esapi/api.indices.split.go | 22 +++++-- esapi/api.indices.stats.go | 22 +++++-- esapi/api.indices.update_aliases.go | 22 +++++-- esapi/api.indices.upgrade.go | 22 +++++-- esapi/api.indices.validate_query.go | 22 +++++-- esapi/api.info.go | 22 +++++-- esapi/api.ingest.delete_pipeline.go | 22 +++++-- esapi/api.ingest.get_pipeline.go | 22 +++++-- esapi/api.ingest.processor_grok.go | 22 +++++-- esapi/api.ingest.put_pipeline.go | 22 +++++-- esapi/api.ingest.simulate.go | 22 +++++-- esapi/api.mget.go | 22 +++++-- esapi/api.msearch.go | 22 +++++-- esapi/api.msearch_template.go | 22 +++++-- esapi/api.mtermvectors.go | 22 +++++-- esapi/api.nodes.hot_threads.go | 22 +++++-- esapi/api.nodes.info.go | 22 +++++-- esapi/api.nodes.reload_secure_settings.go | 22 +++++-- esapi/api.nodes.stats.go | 22 +++++-- esapi/api.nodes.usage.go | 22 +++++-- esapi/api.ping.go | 22 +++++-- esapi/api.put_script.go | 22 +++++-- esapi/api.rank_eval.go | 22 +++++-- esapi/api.reindex.go | 22 +++++-- esapi/api.reindex_rethrottle.go | 22 +++++-- esapi/api.render_search_template.go | 22 +++++-- esapi/api.scripts_painless_execute.go | 22 +++++-- esapi/api.scroll.go | 22 +++++-- esapi/api.search.go | 22 +++++-- esapi/api.search_shards.go | 22 +++++-- esapi/api.search_template.go | 22 +++++-- esapi/api.snapshot.cleanup_repository.go | 22 +++++-- esapi/api.snapshot.create.go | 22 +++++-- esapi/api.snapshot.create_repository.go | 22 +++++-- esapi/api.snapshot.delete.go | 22 +++++-- esapi/api.snapshot.delete_repository.go | 22 +++++-- esapi/api.snapshot.get.go | 22 +++++-- esapi/api.snapshot.get_repository.go | 22 +++++-- esapi/api.snapshot.restore.go | 22 +++++-- esapi/api.snapshot.status.go | 22 +++++-- esapi/api.snapshot.verify_repository.go | 22 +++++-- esapi/api.tasks.cancel.go | 22 +++++-- esapi/api.tasks.get.go | 22 +++++-- esapi/api.tasks.list.go | 22 +++++-- esapi/api.termvectors.go | 22 +++++-- esapi/api.update.go | 22 +++++-- esapi/api.update_by_query.go | 22 +++++-- esapi/api.update_by_query_rethrottle.go | 22 +++++-- ...pi.xpack.ccr.delete_auto_follow_pattern.go | 22 +++++-- esapi/api.xpack.ccr.follow.go | 22 +++++-- esapi/api.xpack.ccr.follow_info.go | 22 +++++-- esapi/api.xpack.ccr.follow_stats.go | 22 +++++-- esapi/api.xpack.ccr.forget_follower.go | 22 +++++-- .../api.xpack.ccr.get_auto_follow_pattern.go | 22 +++++-- esapi/api.xpack.ccr.pause_follow.go | 22 +++++-- .../api.xpack.ccr.put_auto_follow_pattern.go | 22 +++++-- esapi/api.xpack.ccr.resume_follow.go | 22 +++++-- esapi/api.xpack.ccr.stats.go | 22 +++++-- esapi/api.xpack.ccr.unfollow.go | 22 +++++-- ....data_frame.delete_data_frame_transform.go | 22 +++++-- ...ack.data_frame.get_data_frame_transform.go | 22 +++++-- ...ta_frame.get_data_frame_transform_stats.go | 22 +++++-- ...data_frame.preview_data_frame_transform.go | 22 +++++-- ...ack.data_frame.put_data_frame_transform.go | 22 +++++-- ...k.data_frame.start_data_frame_transform.go | 22 +++++-- ...ck.data_frame.stop_data_frame_transform.go | 22 +++++-- ....data_frame.update_data_frame_transform.go | 22 +++++-- esapi/api.xpack.graph.explore.go | 22 +++++-- esapi/api.xpack.ilm.delete_lifecycle.go | 22 +++++-- esapi/api.xpack.ilm.explain_lifecycle.go | 22 +++++-- esapi/api.xpack.ilm.get_lifecycle.go | 22 +++++-- esapi/api.xpack.ilm.get_status.go | 22 +++++-- esapi/api.xpack.ilm.move_to_step.go | 22 +++++-- esapi/api.xpack.ilm.put_lifecycle.go | 22 +++++-- esapi/api.xpack.ilm.remove_policy.go | 22 +++++-- esapi/api.xpack.ilm.retry.go | 22 +++++-- esapi/api.xpack.ilm.start.go | 22 +++++-- esapi/api.xpack.ilm.stop.go | 22 +++++-- esapi/api.xpack.indices.freeze.go | 22 +++++-- ...i.xpack.indices.reload_search_analyzers.go | 22 +++++-- esapi/api.xpack.indices.unfreeze.go | 22 +++++-- esapi/api.xpack.license.delete.go | 22 +++++-- esapi/api.xpack.license.get.go | 22 +++++-- esapi/api.xpack.license.get_basic_status.go | 22 +++++-- esapi/api.xpack.license.get_trial_status.go | 22 +++++-- esapi/api.xpack.license.post.go | 22 +++++-- esapi/api.xpack.license.post_start_basic.go | 22 +++++-- esapi/api.xpack.license.post_start_trial.go | 22 +++++-- esapi/api.xpack.migration.deprecations.go | 22 +++++-- esapi/api.xpack.ml.close_job.go | 22 +++++-- esapi/api.xpack.ml.delete_calendar.go | 22 +++++-- esapi/api.xpack.ml.delete_calendar_event.go | 22 +++++-- esapi/api.xpack.ml.delete_calendar_job.go | 22 +++++-- ...pi.xpack.ml.delete_data_frame_analytics.go | 22 +++++-- esapi/api.xpack.ml.delete_datafeed.go | 22 +++++-- esapi/api.xpack.ml.delete_expired_data.go | 22 +++++-- esapi/api.xpack.ml.delete_filter.go | 22 +++++-- esapi/api.xpack.ml.delete_forecast.go | 22 +++++-- esapi/api.xpack.ml.delete_job.go | 22 +++++-- esapi/api.xpack.ml.delete_model_snapshot.go | 22 +++++-- esapi/api.xpack.ml.estimate_memory_usage.go | 22 +++++-- esapi/api.xpack.ml.evaluate_data_frame.go | 22 +++++-- esapi/api.xpack.ml.find_file_structure.go | 22 +++++-- esapi/api.xpack.ml.flush_job.go | 22 +++++-- esapi/api.xpack.ml.forecast.go | 22 +++++-- esapi/api.xpack.ml.get_buckets.go | 22 +++++-- esapi/api.xpack.ml.get_calendar_events.go | 22 +++++-- esapi/api.xpack.ml.get_calendars.go | 22 +++++-- esapi/api.xpack.ml.get_categories.go | 22 +++++-- .../api.xpack.ml.get_data_frame_analytics.go | 22 +++++-- ...xpack.ml.get_data_frame_analytics_stats.go | 22 +++++-- esapi/api.xpack.ml.get_datafeed_stats.go | 22 +++++-- esapi/api.xpack.ml.get_datafeeds.go | 22 +++++-- esapi/api.xpack.ml.get_filters.go | 22 +++++-- esapi/api.xpack.ml.get_influencers.go | 22 +++++-- esapi/api.xpack.ml.get_job_stats.go | 22 +++++-- esapi/api.xpack.ml.get_jobs.go | 22 +++++-- esapi/api.xpack.ml.get_model_snapshots.go | 22 +++++-- esapi/api.xpack.ml.get_overall_buckets.go | 22 +++++-- esapi/api.xpack.ml.get_records.go | 22 +++++-- esapi/api.xpack.ml.info.go | 22 +++++-- esapi/api.xpack.ml.open_job.go | 22 +++++-- esapi/api.xpack.ml.post_calendar_events.go | 22 +++++-- esapi/api.xpack.ml.post_data.go | 22 +++++-- esapi/api.xpack.ml.preview_datafeed.go | 22 +++++-- esapi/api.xpack.ml.put_calendar.go | 22 +++++-- esapi/api.xpack.ml.put_calendar_job.go | 22 +++++-- .../api.xpack.ml.put_data_frame_analytics.go | 22 +++++-- esapi/api.xpack.ml.put_datafeed.go | 22 +++++-- esapi/api.xpack.ml.put_filter.go | 22 +++++-- esapi/api.xpack.ml.put_job.go | 22 +++++-- esapi/api.xpack.ml.revert_model_snapshot.go | 22 +++++-- esapi/api.xpack.ml.set_upgrade_mode.go | 22 +++++-- ...api.xpack.ml.start_data_frame_analytics.go | 22 +++++-- esapi/api.xpack.ml.start_datafeed.go | 22 +++++-- .../api.xpack.ml.stop_data_frame_analytics.go | 22 +++++-- esapi/api.xpack.ml.stop_datafeed.go | 22 +++++-- esapi/api.xpack.ml.update_datafeed.go | 22 +++++-- esapi/api.xpack.ml.update_filter.go | 22 +++++-- esapi/api.xpack.ml.update_job.go | 22 +++++-- esapi/api.xpack.ml.update_model_snapshot.go | 22 +++++-- esapi/api.xpack.ml.validate.go | 22 +++++-- esapi/api.xpack.ml.validate_detector.go | 22 +++++-- esapi/api.xpack.monitoring.bulk.go | 22 +++++-- esapi/api.xpack.rollup.delete_job.go | 22 +++++-- esapi/api.xpack.rollup.get_jobs.go | 22 +++++-- esapi/api.xpack.rollup.get_rollup_caps.go | 22 +++++-- .../api.xpack.rollup.get_rollup_index_caps.go | 22 +++++-- esapi/api.xpack.rollup.put_job.go | 22 +++++-- esapi/api.xpack.rollup.rollup_search.go | 22 +++++-- esapi/api.xpack.rollup.start_job.go | 22 +++++-- esapi/api.xpack.rollup.stop_job.go | 22 +++++-- esapi/api.xpack.security.authenticate.go | 22 +++++-- esapi/api.xpack.security.change_password.go | 22 +++++-- .../api.xpack.security.clear_cached_realms.go | 22 +++++-- .../api.xpack.security.clear_cached_roles.go | 22 +++++-- esapi/api.xpack.security.create_api_key.go | 22 +++++-- esapi/api.xpack.security.delete_privileges.go | 22 +++++-- esapi/api.xpack.security.delete_role.go | 22 +++++-- .../api.xpack.security.delete_role_mapping.go | 22 +++++-- esapi/api.xpack.security.delete_user.go | 22 +++++-- esapi/api.xpack.security.disable_user.go | 22 +++++-- esapi/api.xpack.security.enable_user.go | 22 +++++-- esapi/api.xpack.security.get_api_key.go | 22 +++++-- ...i.xpack.security.get_builtin_privileges.go | 22 +++++-- esapi/api.xpack.security.get_privileges.go | 22 +++++-- esapi/api.xpack.security.get_role.go | 22 +++++-- esapi/api.xpack.security.get_role_mapping.go | 22 +++++-- esapi/api.xpack.security.get_token.go | 22 +++++-- esapi/api.xpack.security.get_user.go | 22 +++++-- .../api.xpack.security.get_user_privileges.go | 22 +++++-- esapi/api.xpack.security.has_privileges.go | 22 +++++-- .../api.xpack.security.invalidate_api_key.go | 22 +++++-- esapi/api.xpack.security.invalidate_token.go | 22 +++++-- esapi/api.xpack.security.put_privileges.go | 22 +++++-- esapi/api.xpack.security.put_role.go | 22 +++++-- esapi/api.xpack.security.put_role_mapping.go | 22 +++++-- esapi/api.xpack.security.put_user.go | 22 +++++-- esapi/api.xpack.slm.delete_lifecycle.go | 22 +++++-- esapi/api.xpack.slm.execute_lifecycle.go | 22 +++++-- esapi/api.xpack.slm.get_lifecycle.go | 32 +++++++--- esapi/api.xpack.slm.put_lifecycle.go | 22 +++++-- esapi/api.xpack.sql.clear_cursor.go | 22 +++++-- esapi/api.xpack.sql.query.go | 22 +++++-- esapi/api.xpack.sql.translate.go | 22 +++++-- esapi/api.xpack.ssl.certificates.go | 22 +++++-- esapi/api.xpack.watcher.ack_watch.go | 22 +++++-- esapi/api.xpack.watcher.activate_watch.go | 22 +++++-- esapi/api.xpack.watcher.deactivate_watch.go | 22 +++++-- esapi/api.xpack.watcher.delete_watch.go | 22 +++++-- esapi/api.xpack.watcher.execute_watch.go | 22 +++++-- esapi/api.xpack.watcher.get_watch.go | 22 +++++-- esapi/api.xpack.watcher.put_watch.go | 22 +++++-- esapi/api.xpack.watcher.start.go | 22 +++++-- esapi/api.xpack.watcher.stats.go | 22 +++++-- esapi/api.xpack.watcher.stop.go | 22 +++++-- esapi/api.xpack.xpack.info.go | 22 +++++-- esapi/api.xpack.xpack.usage.go | 22 +++++-- 277 files changed, 5009 insertions(+), 1254 deletions(-) diff --git a/esapi/api._.go b/esapi/api._.go index f0e0151a7c..1b671bd801 100644 --- a/esapi/api._.go +++ b/esapi/api._.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1 (42824b3731a): DO NOT EDIT +// +// Code generated from specification version 7.4.2 (c1c6a413632): DO NOT EDIT package esapi diff --git a/esapi/api.bulk.go b/esapi/api.bulk.go index c4a8f9c116..e3d2799a35 100644 --- a/esapi/api.bulk.go +++ b/esapi/api.bulk.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -136,7 +136,10 @@ func (r BulkRequest) Do(ctx context.Context, transport Transport) (*Response, er params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -312,3 +315,14 @@ func (f Bulk) WithHeader(h map[string]string) func(*BulkRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Bulk) WithOpaqueID(s string) func(*BulkRequest) { + return func(r *BulkRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.aliases.go b/esapi/api.cat.aliases.go index 5a611ed027..cf6f52cd15 100644 --- a/esapi/api.cat.aliases.go +++ b/esapi/api.cat.aliases.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -11,7 +11,6 @@ import ( "net/http" "strconv" "strings" - "time" ) func newCatAliasesFunc(t Transport) CatAliases { @@ -37,13 +36,12 @@ type CatAliases func(o ...func(*CatAliasesRequest)) (*Response, error) type CatAliasesRequest struct { Name []string - Format string - H []string - Help *bool - Local *bool - MasterTimeout time.Duration - S []string - V *bool + Format string + H []string + Help *bool + Local *bool + S []string + V *bool Pretty bool Human bool @@ -94,10 +92,6 @@ func (r CatAliasesRequest) Do(ctx context.Context, transport Transport) (*Respon params["local"] = strconv.FormatBool(*r.Local) } - if r.MasterTimeout != 0 { - params["master_timeout"] = formatDuration(r.MasterTimeout) - } - if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -122,7 +116,10 @@ func (r CatAliasesRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -210,14 +207,6 @@ func (f CatAliases) WithLocal(v bool) func(*CatAliasesRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. -// -func (f CatAliases) WithMasterTimeout(v time.Duration) func(*CatAliasesRequest) { - return func(r *CatAliasesRequest) { - r.MasterTimeout = v - } -} - // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatAliases) WithS(v ...string) func(*CatAliasesRequest) { @@ -278,3 +267,14 @@ func (f CatAliases) WithHeader(h map[string]string) func(*CatAliasesRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatAliases) WithOpaqueID(s string) func(*CatAliasesRequest) { + return func(r *CatAliasesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.allocation.go b/esapi/api.cat.allocation.go index 7e3911d776..1ee5c872d4 100644 --- a/esapi/api.cat.allocation.go +++ b/esapi/api.cat.allocation.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -127,7 +127,10 @@ func (r CatAllocationRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -291,3 +294,14 @@ func (f CatAllocation) WithHeader(h map[string]string) func(*CatAllocationReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatAllocation) WithOpaqueID(s string) func(*CatAllocationRequest) { + return func(r *CatAllocationRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.count.go b/esapi/api.cat.count.go index 0022713d02..cf48e5335b 100644 --- a/esapi/api.cat.count.go +++ b/esapi/api.cat.count.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -11,7 +11,6 @@ import ( "net/http" "strconv" "strings" - "time" ) func newCatCountFunc(t Transport) CatCount { @@ -37,13 +36,11 @@ type CatCount func(o ...func(*CatCountRequest)) (*Response, error) type CatCountRequest struct { Index []string - Format string - H []string - Help *bool - Local *bool - MasterTimeout time.Duration - S []string - V *bool + Format string + H []string + Help *bool + S []string + V *bool Pretty bool Human bool @@ -90,14 +87,6 @@ func (r CatCountRequest) Do(ctx context.Context, transport Transport) (*Response params["help"] = strconv.FormatBool(*r.Help) } - if r.Local != nil { - params["local"] = strconv.FormatBool(*r.Local) - } - - if r.MasterTimeout != 0 { - params["master_timeout"] = formatDuration(r.MasterTimeout) - } - if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -122,7 +111,10 @@ func (r CatCountRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -202,22 +194,6 @@ func (f CatCount) WithHelp(v bool) func(*CatCountRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). -// -func (f CatCount) WithLocal(v bool) func(*CatCountRequest) { - return func(r *CatCountRequest) { - r.Local = &v - } -} - -// WithMasterTimeout - explicit operation timeout for connection to master node. -// -func (f CatCount) WithMasterTimeout(v time.Duration) func(*CatCountRequest) { - return func(r *CatCountRequest) { - r.MasterTimeout = v - } -} - // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatCount) WithS(v ...string) func(*CatCountRequest) { @@ -278,3 +254,14 @@ func (f CatCount) WithHeader(h map[string]string) func(*CatCountRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatCount) WithOpaqueID(s string) func(*CatCountRequest) { + return func(r *CatCountRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.fielddata.go b/esapi/api.cat.fielddata.go index 6d2bc38ebc..03a146ec42 100644 --- a/esapi/api.cat.fielddata.go +++ b/esapi/api.cat.fielddata.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -11,7 +11,6 @@ import ( "net/http" "strconv" "strings" - "time" ) func newCatFielddataFunc(t Transport) CatFielddata { @@ -37,14 +36,12 @@ type CatFielddata func(o ...func(*CatFielddataRequest)) (*Response, error) type CatFielddataRequest struct { Fields []string - Bytes string - Format string - H []string - Help *bool - Local *bool - MasterTimeout time.Duration - S []string - V *bool + Bytes string + Format string + H []string + Help *bool + S []string + V *bool Pretty bool Human bool @@ -99,14 +96,6 @@ func (r CatFielddataRequest) Do(ctx context.Context, transport Transport) (*Resp params["help"] = strconv.FormatBool(*r.Help) } - if r.Local != nil { - params["local"] = strconv.FormatBool(*r.Local) - } - - if r.MasterTimeout != 0 { - params["master_timeout"] = formatDuration(r.MasterTimeout) - } - if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -131,7 +120,10 @@ func (r CatFielddataRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -219,22 +211,6 @@ func (f CatFielddata) WithHelp(v bool) func(*CatFielddataRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). -// -func (f CatFielddata) WithLocal(v bool) func(*CatFielddataRequest) { - return func(r *CatFielddataRequest) { - r.Local = &v - } -} - -// WithMasterTimeout - explicit operation timeout for connection to master node. -// -func (f CatFielddata) WithMasterTimeout(v time.Duration) func(*CatFielddataRequest) { - return func(r *CatFielddataRequest) { - r.MasterTimeout = v - } -} - // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatFielddata) WithS(v ...string) func(*CatFielddataRequest) { @@ -295,3 +271,14 @@ func (f CatFielddata) WithHeader(h map[string]string) func(*CatFielddataRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatFielddata) WithOpaqueID(s string) func(*CatFielddataRequest) { + return func(r *CatFielddataRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.health.go b/esapi/api.cat.health.go index 8f5eb53a0e..4b0436f30f 100644 --- a/esapi/api.cat.health.go +++ b/esapi/api.cat.health.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -11,7 +11,6 @@ import ( "net/http" "strconv" "strings" - "time" ) func newCatHealthFunc(t Transport) CatHealth { @@ -35,15 +34,13 @@ type CatHealth func(o ...func(*CatHealthRequest)) (*Response, error) // CatHealthRequest configures the Cat Health API request. // type CatHealthRequest struct { - Format string - H []string - Help *bool - Local *bool - MasterTimeout time.Duration - S []string - Time string - Ts *bool - V *bool + Format string + H []string + Help *bool + S []string + Time string + Ts *bool + V *bool Pretty bool Human bool @@ -83,14 +80,6 @@ func (r CatHealthRequest) Do(ctx context.Context, transport Transport) (*Respons params["help"] = strconv.FormatBool(*r.Help) } - if r.Local != nil { - params["local"] = strconv.FormatBool(*r.Local) - } - - if r.MasterTimeout != 0 { - params["master_timeout"] = formatDuration(r.MasterTimeout) - } - if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -123,7 +112,10 @@ func (r CatHealthRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -195,22 +187,6 @@ func (f CatHealth) WithHelp(v bool) func(*CatHealthRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). -// -func (f CatHealth) WithLocal(v bool) func(*CatHealthRequest) { - return func(r *CatHealthRequest) { - r.Local = &v - } -} - -// WithMasterTimeout - explicit operation timeout for connection to master node. -// -func (f CatHealth) WithMasterTimeout(v time.Duration) func(*CatHealthRequest) { - return func(r *CatHealthRequest) { - r.MasterTimeout = v - } -} - // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatHealth) WithS(v ...string) func(*CatHealthRequest) { @@ -287,3 +263,14 @@ func (f CatHealth) WithHeader(h map[string]string) func(*CatHealthRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatHealth) WithOpaqueID(s string) func(*CatHealthRequest) { + return func(r *CatHealthRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.help.go b/esapi/api.cat.help.go index 409f01082f..c8c6a099c2 100644 --- a/esapi/api.cat.help.go +++ b/esapi/api.cat.help.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -87,7 +87,10 @@ func (r CatHelpRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -195,3 +198,14 @@ func (f CatHelp) WithHeader(h map[string]string) func(*CatHelpRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatHelp) WithOpaqueID(s string) func(*CatHelpRequest) { + return func(r *CatHelpRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.indices.go b/esapi/api.cat.indices.go index c506a693fb..1e86d048de 100644 --- a/esapi/api.cat.indices.go +++ b/esapi/api.cat.indices.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -147,7 +147,10 @@ func (r CatIndicesRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -343,3 +346,14 @@ func (f CatIndices) WithHeader(h map[string]string) func(*CatIndicesRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatIndices) WithOpaqueID(s string) func(*CatIndicesRequest) { + return func(r *CatIndicesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.master.go b/esapi/api.cat.master.go index f4078ace6e..8f8421025c 100644 --- a/esapi/api.cat.master.go +++ b/esapi/api.cat.master.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -113,7 +113,10 @@ func (r CatMasterRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -261,3 +264,14 @@ func (f CatMaster) WithHeader(h map[string]string) func(*CatMasterRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatMaster) WithOpaqueID(s string) func(*CatMasterRequest) { + return func(r *CatMasterRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.nodeattrs.go b/esapi/api.cat.nodeattrs.go index 5f09270a46..bb720b5859 100644 --- a/esapi/api.cat.nodeattrs.go +++ b/esapi/api.cat.nodeattrs.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -113,7 +113,10 @@ func (r CatNodeattrsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -261,3 +264,14 @@ func (f CatNodeattrs) WithHeader(h map[string]string) func(*CatNodeattrsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatNodeattrs) WithOpaqueID(s string) func(*CatNodeattrsRequest) { + return func(r *CatNodeattrsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.nodes.go b/esapi/api.cat.nodes.go index 6283d878f3..645477f74f 100644 --- a/esapi/api.cat.nodes.go +++ b/esapi/api.cat.nodes.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -128,7 +128,10 @@ func (r CatNodesRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -300,3 +303,14 @@ func (f CatNodes) WithHeader(h map[string]string) func(*CatNodesRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatNodes) WithOpaqueID(s string) func(*CatNodesRequest) { + return func(r *CatNodesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.pending_tasks.go b/esapi/api.cat.pending_tasks.go index 0089be371c..2cab935e8a 100644 --- a/esapi/api.cat.pending_tasks.go +++ b/esapi/api.cat.pending_tasks.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -118,7 +118,10 @@ func (r CatPendingTasksRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -274,3 +277,14 @@ func (f CatPendingTasks) WithHeader(h map[string]string) func(*CatPendingTasksRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatPendingTasks) WithOpaqueID(s string) func(*CatPendingTasksRequest) { + return func(r *CatPendingTasksRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.plugins.go b/esapi/api.cat.plugins.go index aae6f6fdb7..c0b502e497 100644 --- a/esapi/api.cat.plugins.go +++ b/esapi/api.cat.plugins.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -113,7 +113,10 @@ func (r CatPluginsRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -261,3 +264,14 @@ func (f CatPlugins) WithHeader(h map[string]string) func(*CatPluginsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatPlugins) WithOpaqueID(s string) func(*CatPluginsRequest) { + return func(r *CatPluginsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.recovery.go b/esapi/api.cat.recovery.go index 7c77737c6e..8111a875ee 100644 --- a/esapi/api.cat.recovery.go +++ b/esapi/api.cat.recovery.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -11,7 +11,6 @@ import ( "net/http" "strconv" "strings" - "time" ) func newCatRecoveryFunc(t Transport) CatRecovery { @@ -37,16 +36,15 @@ type CatRecovery func(o ...func(*CatRecoveryRequest)) (*Response, error) type CatRecoveryRequest struct { Index []string - ActiveOnly *bool - Bytes string - Detailed *bool - Format string - H []string - Help *bool - MasterTimeout time.Duration - S []string - Time string - V *bool + ActiveOnly *bool + Bytes string + Detailed *bool + Format string + H []string + Help *bool + S []string + Time string + V *bool Pretty bool Human bool @@ -109,10 +107,6 @@ func (r CatRecoveryRequest) Do(ctx context.Context, transport Transport) (*Respo params["index"] = strings.Join(r.Index, ",") } - if r.MasterTimeout != 0 { - params["master_timeout"] = formatDuration(r.MasterTimeout) - } - if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -141,7 +135,10 @@ func (r CatRecoveryRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -245,14 +242,6 @@ func (f CatRecovery) WithHelp(v bool) func(*CatRecoveryRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. -// -func (f CatRecovery) WithMasterTimeout(v time.Duration) func(*CatRecoveryRequest) { - return func(r *CatRecoveryRequest) { - r.MasterTimeout = v - } -} - // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatRecovery) WithS(v ...string) func(*CatRecoveryRequest) { @@ -321,3 +310,14 @@ func (f CatRecovery) WithHeader(h map[string]string) func(*CatRecoveryRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatRecovery) WithOpaqueID(s string) func(*CatRecoveryRequest) { + return func(r *CatRecoveryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.repositories.go b/esapi/api.cat.repositories.go index 122e14e3a7..917a43d470 100644 --- a/esapi/api.cat.repositories.go +++ b/esapi/api.cat.repositories.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -113,7 +113,10 @@ func (r CatRepositoriesRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -261,3 +264,14 @@ func (f CatRepositories) WithHeader(h map[string]string) func(*CatRepositoriesRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatRepositories) WithOpaqueID(s string) func(*CatRepositoriesRequest) { + return func(r *CatRepositoriesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.segments.go b/esapi/api.cat.segments.go index 17f59601cb..2f4150a78b 100644 --- a/esapi/api.cat.segments.go +++ b/esapi/api.cat.segments.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -116,7 +116,10 @@ func (r CatSegmentsRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -264,3 +267,14 @@ func (f CatSegments) WithHeader(h map[string]string) func(*CatSegmentsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatSegments) WithOpaqueID(s string) func(*CatSegmentsRequest) { + return func(r *CatSegmentsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.shards.go b/esapi/api.cat.shards.go index c4522c39ca..a9ba9843bd 100644 --- a/esapi/api.cat.shards.go +++ b/esapi/api.cat.shards.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -132,7 +132,10 @@ func (r CatShardsRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -304,3 +307,14 @@ func (f CatShards) WithHeader(h map[string]string) func(*CatShardsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatShards) WithOpaqueID(s string) func(*CatShardsRequest) { + return func(r *CatShardsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.snapshots.go b/esapi/api.cat.snapshots.go index 2a8c5ed3d6..c8675e241b 100644 --- a/esapi/api.cat.snapshots.go +++ b/esapi/api.cat.snapshots.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -127,7 +127,10 @@ func (r CatSnapshotsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -291,3 +294,14 @@ func (f CatSnapshots) WithHeader(h map[string]string) func(*CatSnapshotsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatSnapshots) WithOpaqueID(s string) func(*CatSnapshotsRequest) { + return func(r *CatSnapshotsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.tasks.go b/esapi/api.cat.tasks.go index 9dfe68c291..3a395e59f9 100644 --- a/esapi/api.cat.tasks.go +++ b/esapi/api.cat.tasks.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -127,7 +127,10 @@ func (r CatTasksRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -299,3 +302,14 @@ func (f CatTasks) WithHeader(h map[string]string) func(*CatTasksRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatTasks) WithOpaqueID(s string) func(*CatTasksRequest) { + return func(r *CatTasksRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.templates.go b/esapi/api.cat.templates.go index 48d4acfade..6457d33f10 100644 --- a/esapi/api.cat.templates.go +++ b/esapi/api.cat.templates.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -122,7 +122,10 @@ func (r CatTemplatesRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -278,3 +281,14 @@ func (f CatTemplates) WithHeader(h map[string]string) func(*CatTemplatesRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatTemplates) WithOpaqueID(s string) func(*CatTemplatesRequest) { + return func(r *CatTemplatesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cat.thread_pool.go b/esapi/api.cat.thread_pool.go index 1d3d8beefc..39b1eb07e0 100644 --- a/esapi/api.cat.thread_pool.go +++ b/esapi/api.cat.thread_pool.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -128,7 +128,10 @@ func (r CatThreadPoolRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -292,3 +295,14 @@ func (f CatThreadPool) WithHeader(h map[string]string) func(*CatThreadPoolReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatThreadPool) WithOpaqueID(s string) func(*CatThreadPoolRequest) { + return func(r *CatThreadPoolRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.clear_scroll.go b/esapi/api.clear_scroll.go index 7777e39910..93356c10c6 100644 --- a/esapi/api.clear_scroll.go +++ b/esapi/api.clear_scroll.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -87,7 +87,10 @@ func (r ClearScrollRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -199,3 +202,14 @@ func (f ClearScroll) WithHeader(h map[string]string) func(*ClearScrollRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClearScroll) WithOpaqueID(s string) func(*ClearScrollRequest) { + return func(r *ClearScrollRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cluster.allocation_explain.go b/esapi/api.cluster.allocation_explain.go index a2e738b697..8eaf24ad19 100644 --- a/esapi/api.cluster.allocation_explain.go +++ b/esapi/api.cluster.allocation_explain.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -90,7 +90,10 @@ func (r ClusterAllocationExplainRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -210,3 +213,14 @@ func (f ClusterAllocationExplain) WithHeader(h map[string]string) func(*ClusterA } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterAllocationExplain) WithOpaqueID(s string) func(*ClusterAllocationExplainRequest) { + return func(r *ClusterAllocationExplainRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cluster.get_settings.go b/esapi/api.cluster.get_settings.go index e6e02684d4..2021da301c 100644 --- a/esapi/api.cluster.get_settings.go +++ b/esapi/api.cluster.get_settings.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -98,7 +98,10 @@ func (r ClusterGetSettingsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -222,3 +225,14 @@ func (f ClusterGetSettings) WithHeader(h map[string]string) func(*ClusterGetSett } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterGetSettings) WithOpaqueID(s string) func(*ClusterGetSettingsRequest) { + return func(r *ClusterGetSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cluster.health.go b/esapi/api.cluster.health.go index aee3972bdb..14278c5b70 100644 --- a/esapi/api.cluster.health.go +++ b/esapi/api.cluster.health.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -142,7 +142,10 @@ func (r ClusterHealthRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -330,3 +333,14 @@ func (f ClusterHealth) WithHeader(h map[string]string) func(*ClusterHealthReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterHealth) WithOpaqueID(s string) func(*ClusterHealthRequest) { + return func(r *ClusterHealthRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cluster.pending_tasks.go b/esapi/api.cluster.pending_tasks.go index 2a36d102e0..065edda3f3 100644 --- a/esapi/api.cluster.pending_tasks.go +++ b/esapi/api.cluster.pending_tasks.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -89,7 +89,10 @@ func (r ClusterPendingTasksRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -197,3 +200,14 @@ func (f ClusterPendingTasks) WithHeader(h map[string]string) func(*ClusterPendin } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterPendingTasks) WithOpaqueID(s string) func(*ClusterPendingTasksRequest) { + return func(r *ClusterPendingTasksRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cluster.put_settings.go b/esapi/api.cluster.put_settings.go index 5982d52c55..d2e505c73e 100644 --- a/esapi/api.cluster.put_settings.go +++ b/esapi/api.cluster.put_settings.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -96,7 +96,10 @@ func (r ClusterPutSettingsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -216,3 +219,14 @@ func (f ClusterPutSettings) WithHeader(h map[string]string) func(*ClusterPutSett } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterPutSettings) WithOpaqueID(s string) func(*ClusterPutSettingsRequest) { + return func(r *ClusterPutSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cluster.remote_info.go b/esapi/api.cluster.remote_info.go index 128193f4b0..b7f079e5f3 100644 --- a/esapi/api.cluster.remote_info.go +++ b/esapi/api.cluster.remote_info.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r ClusterRemoteInfoRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f ClusterRemoteInfo) WithHeader(h map[string]string) func(*ClusterRemoteIn } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterRemoteInfo) WithOpaqueID(s string) func(*ClusterRemoteInfoRequest) { + return func(r *ClusterRemoteInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cluster.reroute.go b/esapi/api.cluster.reroute.go index a21d9ac84b..b0a243fd3f 100644 --- a/esapi/api.cluster.reroute.go +++ b/esapi/api.cluster.reroute.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -111,7 +111,10 @@ func (r ClusterRerouteRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -263,3 +266,14 @@ func (f ClusterReroute) WithHeader(h map[string]string) func(*ClusterRerouteRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterReroute) WithOpaqueID(s string) func(*ClusterRerouteRequest) { + return func(r *ClusterRerouteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cluster.state.go b/esapi/api.cluster.state.go index 878c0a07a1..fea2e01a6f 100644 --- a/esapi/api.cluster.state.go +++ b/esapi/api.cluster.state.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -133,7 +133,10 @@ func (r ClusterStateRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -305,3 +308,14 @@ func (f ClusterState) WithHeader(h map[string]string) func(*ClusterStateRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterState) WithOpaqueID(s string) func(*ClusterStateRequest) { + return func(r *ClusterStateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.cluster.stats.go b/esapi/api.cluster.stats.go index a6732fe2d8..0c53027342 100644 --- a/esapi/api.cluster.stats.go +++ b/esapi/api.cluster.stats.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -99,7 +99,10 @@ func (r ClusterStatsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -215,3 +218,14 @@ func (f ClusterStats) WithHeader(h map[string]string) func(*ClusterStatsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterStats) WithOpaqueID(s string) func(*ClusterStatsRequest) { + return func(r *ClusterStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.count.go b/esapi/api.count.go index 6f2d2f23e5..9dcca1f30c 100644 --- a/esapi/api.count.go +++ b/esapi/api.count.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -162,7 +162,10 @@ func (r CountRequest) Do(ctx context.Context, transport Transport) (*Response, e params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -394,3 +397,14 @@ func (f Count) WithHeader(h map[string]string) func(*CountRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Count) WithOpaqueID(s string) func(*CountRequest) { + return func(r *CountRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.create.go b/esapi/api.create.go index 19ff97403f..733862819f 100644 --- a/esapi/api.create.go +++ b/esapi/api.create.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -135,7 +135,10 @@ func (r CreateRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -295,3 +298,14 @@ func (f Create) WithHeader(h map[string]string) func(*CreateRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Create) WithOpaqueID(s string) func(*CreateRequest) { + return func(r *CreateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.delete.go b/esapi/api.delete.go index 9760d70f29..af98c846c1 100644 --- a/esapi/api.delete.go +++ b/esapi/api.delete.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -133,7 +133,10 @@ func (r DeleteRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -297,3 +300,14 @@ func (f Delete) WithHeader(h map[string]string) func(*DeleteRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Delete) WithOpaqueID(s string) func(*DeleteRequest) { + return func(r *DeleteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.delete_by_query.go b/esapi/api.delete_by_query.go index 4ea8fc5e4e..ca83f61391 100644 --- a/esapi/api.delete_by_query.go +++ b/esapi/api.delete_by_query.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -251,7 +251,10 @@ func (r DeleteByQueryRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -611,3 +614,14 @@ func (f DeleteByQuery) WithHeader(h map[string]string) func(*DeleteByQueryReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DeleteByQuery) WithOpaqueID(s string) func(*DeleteByQueryRequest) { + return func(r *DeleteByQueryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.delete_by_query_rethrottle.go b/esapi/api.delete_by_query_rethrottle.go index 6e99b0527a..b6fe1126b2 100644 --- a/esapi/api.delete_by_query_rethrottle.go +++ b/esapi/api.delete_by_query_rethrottle.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -89,7 +89,10 @@ func (r DeleteByQueryRethrottleRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -189,3 +192,14 @@ func (f DeleteByQueryRethrottle) WithHeader(h map[string]string) func(*DeleteByQ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DeleteByQueryRethrottle) WithOpaqueID(s string) func(*DeleteByQueryRethrottleRequest) { + return func(r *DeleteByQueryRethrottleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.delete_script.go b/esapi/api.delete_script.go index b575744544..3de04b59bc 100644 --- a/esapi/api.delete_script.go +++ b/esapi/api.delete_script.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -92,7 +92,10 @@ func (r DeleteScriptRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -200,3 +203,14 @@ func (f DeleteScript) WithHeader(h map[string]string) func(*DeleteScriptRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DeleteScript) WithOpaqueID(s string) func(*DeleteScriptRequest) { + return func(r *DeleteScriptRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.exists.go b/esapi/api.exists.go index 2b6ae3aa11..b259a3394e 100644 --- a/esapi/api.exists.go +++ b/esapi/api.exists.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -142,7 +142,10 @@ func (r ExistsRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -322,3 +325,14 @@ func (f Exists) WithHeader(h map[string]string) func(*ExistsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Exists) WithOpaqueID(s string) func(*ExistsRequest) { + return func(r *ExistsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.exists_source.go b/esapi/api.exists_source.go index 62bd3df440..9dc3adde71 100644 --- a/esapi/api.exists_source.go +++ b/esapi/api.exists_source.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -135,7 +135,10 @@ func (r ExistsSourceRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -307,3 +310,14 @@ func (f ExistsSource) WithHeader(h map[string]string) func(*ExistsSourceRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ExistsSource) WithOpaqueID(s string) func(*ExistsSourceRequest) { + return func(r *ExistsSourceRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.explain.go b/esapi/api.explain.go index 994601eab0..474fef1af3 100644 --- a/esapi/api.explain.go +++ b/esapi/api.explain.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -157,7 +157,10 @@ func (r ExplainRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -365,3 +368,14 @@ func (f Explain) WithHeader(h map[string]string) func(*ExplainRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Explain) WithOpaqueID(s string) func(*ExplainRequest) { + return func(r *ExplainRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.field_caps.go b/esapi/api.field_caps.go index 51910b6193..1a0a7b19a3 100644 --- a/esapi/api.field_caps.go +++ b/esapi/api.field_caps.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -109,7 +109,10 @@ func (r FieldCapsRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -249,3 +252,14 @@ func (f FieldCaps) WithHeader(h map[string]string) func(*FieldCapsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f FieldCaps) WithOpaqueID(s string) func(*FieldCapsRequest) { + return func(r *FieldCapsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.get.go b/esapi/api.get.go index 4892edbd10..ca66c8c08d 100644 --- a/esapi/api.get.go +++ b/esapi/api.get.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -142,7 +142,10 @@ func (r GetRequest) Do(ctx context.Context, transport Transport) (*Response, err params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -322,3 +325,14 @@ func (f Get) WithHeader(h map[string]string) func(*GetRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Get) WithOpaqueID(s string) func(*GetRequest) { + return func(r *GetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.get_script.go b/esapi/api.get_script.go index 3810f9c338..ae7700621e 100644 --- a/esapi/api.get_script.go +++ b/esapi/api.get_script.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -87,7 +87,10 @@ func (r GetScriptRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -187,3 +190,14 @@ func (f GetScript) WithHeader(h map[string]string) func(*GetScriptRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f GetScript) WithOpaqueID(s string) func(*GetScriptRequest) { + return func(r *GetScriptRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.get_source.go b/esapi/api.get_source.go index 4c1e156414..722aed056f 100644 --- a/esapi/api.get_source.go +++ b/esapi/api.get_source.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -139,7 +139,10 @@ func (r GetSourceRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -311,3 +314,14 @@ func (f GetSource) WithHeader(h map[string]string) func(*GetSourceRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f GetSource) WithOpaqueID(s string) func(*GetSourceRequest) { + return func(r *GetSourceRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.index.go b/esapi/api.index.go index 5fb7b63b17..1f47ec642d 100644 --- a/esapi/api.index.go +++ b/esapi/api.index.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -152,7 +152,10 @@ func (r IndexRequest) Do(ctx context.Context, transport Transport) (*Response, e params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -344,3 +347,14 @@ func (f Index) WithHeader(h map[string]string) func(*IndexRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Index) WithOpaqueID(s string) func(*IndexRequest) { + return func(r *IndexRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.analyze.go b/esapi/api.indices.analyze.go index cb83865e6c..70b7c085f8 100644 --- a/esapi/api.indices.analyze.go +++ b/esapi/api.indices.analyze.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -89,7 +89,10 @@ func (r IndicesAnalyzeRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -201,3 +204,14 @@ func (f IndicesAnalyze) WithHeader(h map[string]string) func(*IndicesAnalyzeRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesAnalyze) WithOpaqueID(s string) func(*IndicesAnalyzeRequest) { + return func(r *IndicesAnalyzeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.clear_cache.go b/esapi/api.indices.clear_cache.go index 91fc41774c..bef018627f 100644 --- a/esapi/api.indices.clear_cache.go +++ b/esapi/api.indices.clear_cache.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -125,7 +125,10 @@ func (r IndicesClearCacheRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -281,3 +284,14 @@ func (f IndicesClearCache) WithHeader(h map[string]string) func(*IndicesClearCac } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesClearCache) WithOpaqueID(s string) func(*IndicesClearCacheRequest) { + return func(r *IndicesClearCacheRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.clone.go b/esapi/api.indices.clone.go index a73b444811..18794e23e2 100644 --- a/esapi/api.indices.clone.go +++ b/esapi/api.indices.clone.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -104,7 +104,10 @@ func (r IndicesCloneRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -232,3 +235,14 @@ func (f IndicesClone) WithHeader(h map[string]string) func(*IndicesCloneRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesClone) WithOpaqueID(s string) func(*IndicesCloneRequest) { + return func(r *IndicesCloneRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.close.go b/esapi/api.indices.close.go index ddd5f70012..8341441429 100644 --- a/esapi/api.indices.close.go +++ b/esapi/api.indices.close.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -113,7 +113,10 @@ func (r IndicesCloseRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -253,3 +256,14 @@ func (f IndicesClose) WithHeader(h map[string]string) func(*IndicesCloseRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesClose) WithOpaqueID(s string) func(*IndicesCloseRequest) { + return func(r *IndicesCloseRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.create.go b/esapi/api.indices.create.go index 0df011f60a..b25f2ed9d2 100644 --- a/esapi/api.indices.create.go +++ b/esapi/api.indices.create.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -104,7 +104,10 @@ func (r IndicesCreateRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -240,3 +243,14 @@ func (f IndicesCreate) WithHeader(h map[string]string) func(*IndicesCreateReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesCreate) WithOpaqueID(s string) func(*IndicesCreateRequest) { + return func(r *IndicesCreateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.delete.go b/esapi/api.indices.delete.go index 886037a031..33f979aa64 100644 --- a/esapi/api.indices.delete.go +++ b/esapi/api.indices.delete.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -106,7 +106,10 @@ func (r IndicesDeleteRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -238,3 +241,14 @@ func (f IndicesDelete) WithHeader(h map[string]string) func(*IndicesDeleteReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesDelete) WithOpaqueID(s string) func(*IndicesDeleteRequest) { + return func(r *IndicesDeleteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.delete_alias.go b/esapi/api.indices.delete_alias.go index 02eaee3823..ef6761540d 100644 --- a/esapi/api.indices.delete_alias.go +++ b/esapi/api.indices.delete_alias.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -96,7 +96,10 @@ func (r IndicesDeleteAliasRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -204,3 +207,14 @@ func (f IndicesDeleteAlias) WithHeader(h map[string]string) func(*IndicesDeleteA } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesDeleteAlias) WithOpaqueID(s string) func(*IndicesDeleteAliasRequest) { + return func(r *IndicesDeleteAliasRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.delete_template.go b/esapi/api.indices.delete_template.go index 99293e3e42..54769ae6cd 100644 --- a/esapi/api.indices.delete_template.go +++ b/esapi/api.indices.delete_template.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -92,7 +92,10 @@ func (r IndicesDeleteTemplateRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -200,3 +203,14 @@ func (f IndicesDeleteTemplate) WithHeader(h map[string]string) func(*IndicesDele } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesDeleteTemplate) WithOpaqueID(s string) func(*IndicesDeleteTemplateRequest) { + return func(r *IndicesDeleteTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.exists.go b/esapi/api.indices.exists.go index 6c1033e6a5..6c960f1f6a 100644 --- a/esapi/api.indices.exists.go +++ b/esapi/api.indices.exists.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -110,7 +110,10 @@ func (r IndicesExistsRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -250,3 +253,14 @@ func (f IndicesExists) WithHeader(h map[string]string) func(*IndicesExistsReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesExists) WithOpaqueID(s string) func(*IndicesExistsRequest) { + return func(r *IndicesExistsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.exists_alias.go b/esapi/api.indices.exists_alias.go index bcdcad5112..d46a0c4eb3 100644 --- a/esapi/api.indices.exists_alias.go +++ b/esapi/api.indices.exists_alias.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -108,7 +108,10 @@ func (r IndicesExistsAliasRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -240,3 +243,14 @@ func (f IndicesExistsAlias) WithHeader(h map[string]string) func(*IndicesExistsA } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesExistsAlias) WithOpaqueID(s string) func(*IndicesExistsAliasRequest) { + return func(r *IndicesExistsAliasRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.exists_template.go b/esapi/api.indices.exists_template.go index c50e06af3f..f07f0822df 100644 --- a/esapi/api.indices.exists_template.go +++ b/esapi/api.indices.exists_template.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -98,7 +98,10 @@ func (r IndicesExistsTemplateRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -214,3 +217,14 @@ func (f IndicesExistsTemplate) WithHeader(h map[string]string) func(*IndicesExis } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesExistsTemplate) WithOpaqueID(s string) func(*IndicesExistsTemplateRequest) { + return func(r *IndicesExistsTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.exists_type.go b/esapi/api.indices.exists_type.go index b8f7673c54..948af83b74 100644 --- a/esapi/api.indices.exists_type.go +++ b/esapi/api.indices.exists_type.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -105,7 +105,10 @@ func (r IndicesExistsDocumentTypeRequest) Do(ctx context.Context, transport Tran params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -237,3 +240,14 @@ func (f IndicesExistsDocumentType) WithHeader(h map[string]string) func(*Indices } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesExistsDocumentType) WithOpaqueID(s string) func(*IndicesExistsDocumentTypeRequest) { + return func(r *IndicesExistsDocumentTypeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.flush.go b/esapi/api.indices.flush.go index 9897649936..aa4ba1778e 100644 --- a/esapi/api.indices.flush.go +++ b/esapi/api.indices.flush.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -109,7 +109,10 @@ func (r IndicesFlushRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -249,3 +252,14 @@ func (f IndicesFlush) WithHeader(h map[string]string) func(*IndicesFlushRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesFlush) WithOpaqueID(s string) func(*IndicesFlushRequest) { + return func(r *IndicesFlushRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.flush_synced.go b/esapi/api.indices.flush_synced.go index dd39e632b3..f2ad6fc8f1 100644 --- a/esapi/api.indices.flush_synced.go +++ b/esapi/api.indices.flush_synced.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -101,7 +101,10 @@ func (r IndicesFlushSyncedRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -225,3 +228,14 @@ func (f IndicesFlushSynced) WithHeader(h map[string]string) func(*IndicesFlushSy } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesFlushSynced) WithOpaqueID(s string) func(*IndicesFlushSyncedRequest) { + return func(r *IndicesFlushSyncedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.forcemerge.go b/esapi/api.indices.forcemerge.go index 825ecb280e..c25559a5d4 100644 --- a/esapi/api.indices.forcemerge.go +++ b/esapi/api.indices.forcemerge.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -114,7 +114,10 @@ func (r IndicesForcemergeRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -262,3 +265,14 @@ func (f IndicesForcemerge) WithHeader(h map[string]string) func(*IndicesForcemer } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesForcemerge) WithOpaqueID(s string) func(*IndicesForcemergeRequest) { + return func(r *IndicesForcemergeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.get.go b/esapi/api.indices.get.go index 4acc011dbf..48360170c6 100644 --- a/esapi/api.indices.get.go +++ b/esapi/api.indices.get.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -121,7 +121,10 @@ func (r IndicesGetRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -277,3 +280,14 @@ func (f IndicesGet) WithHeader(h map[string]string) func(*IndicesGetRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesGet) WithOpaqueID(s string) func(*IndicesGetRequest) { + return func(r *IndicesGetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.get_alias.go b/esapi/api.indices.get_alias.go index f9da62a3bb..c2b99ec008 100644 --- a/esapi/api.indices.get_alias.go +++ b/esapi/api.indices.get_alias.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -110,7 +110,10 @@ func (r IndicesGetAliasRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -250,3 +253,14 @@ func (f IndicesGetAlias) WithHeader(h map[string]string) func(*IndicesGetAliasRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesGetAlias) WithOpaqueID(s string) func(*IndicesGetAliasRequest) { + return func(r *IndicesGetAliasRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.get_field_mapping.go b/esapi/api.indices.get_field_mapping.go index ce688e6885..da068fc52b 100644 --- a/esapi/api.indices.get_field_mapping.go +++ b/esapi/api.indices.get_field_mapping.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -125,7 +125,10 @@ func (r IndicesGetFieldMappingRequest) Do(ctx context.Context, transport Transpo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -281,3 +284,14 @@ func (f IndicesGetFieldMapping) WithHeader(h map[string]string) func(*IndicesGet } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesGetFieldMapping) WithOpaqueID(s string) func(*IndicesGetFieldMappingRequest) { + return func(r *IndicesGetFieldMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.get_mapping.go b/esapi/api.indices.get_mapping.go index 3d65941446..7454e050c1 100644 --- a/esapi/api.indices.get_mapping.go +++ b/esapi/api.indices.get_mapping.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -120,7 +120,10 @@ func (r IndicesGetMappingRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -276,3 +279,14 @@ func (f IndicesGetMapping) WithHeader(h map[string]string) func(*IndicesGetMappi } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesGetMapping) WithOpaqueID(s string) func(*IndicesGetMappingRequest) { + return func(r *IndicesGetMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.get_settings.go b/esapi/api.indices.get_settings.go index ab2d2cb4cd..5347513e6f 100644 --- a/esapi/api.indices.get_settings.go +++ b/esapi/api.indices.get_settings.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -126,7 +126,10 @@ func (r IndicesGetSettingsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -290,3 +293,14 @@ func (f IndicesGetSettings) WithHeader(h map[string]string) func(*IndicesGetSett } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesGetSettings) WithOpaqueID(s string) func(*IndicesGetSettingsRequest) { + return func(r *IndicesGetSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.get_template.go b/esapi/api.indices.get_template.go index 72f71baecd..9aec941738 100644 --- a/esapi/api.indices.get_template.go +++ b/esapi/api.indices.get_template.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -105,7 +105,10 @@ func (r IndicesGetTemplateRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -237,3 +240,14 @@ func (f IndicesGetTemplate) WithHeader(h map[string]string) func(*IndicesGetTemp } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesGetTemplate) WithOpaqueID(s string) func(*IndicesGetTemplateRequest) { + return func(r *IndicesGetTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.get_upgrade.go b/esapi/api.indices.get_upgrade.go index 1ec09844cf..6470cb4a42 100644 --- a/esapi/api.indices.get_upgrade.go +++ b/esapi/api.indices.get_upgrade.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -99,7 +99,10 @@ func (r IndicesGetUpgradeRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -223,3 +226,14 @@ func (f IndicesGetUpgrade) WithHeader(h map[string]string) func(*IndicesGetUpgra } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesGetUpgrade) WithOpaqueID(s string) func(*IndicesGetUpgradeRequest) { + return func(r *IndicesGetUpgradeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.open.go b/esapi/api.indices.open.go index b2b6c1e6de..3820050e96 100644 --- a/esapi/api.indices.open.go +++ b/esapi/api.indices.open.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -113,7 +113,10 @@ func (r IndicesOpenRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -253,3 +256,14 @@ func (f IndicesOpen) WithHeader(h map[string]string) func(*IndicesOpenRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesOpen) WithOpaqueID(s string) func(*IndicesOpenRequest) { + return func(r *IndicesOpenRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.put_alias.go b/esapi/api.indices.put_alias.go index 91dccf0dc1..b480032a4b 100644 --- a/esapi/api.indices.put_alias.go +++ b/esapi/api.indices.put_alias.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -99,7 +99,10 @@ func (r IndicesPutAliasRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -219,3 +222,14 @@ func (f IndicesPutAlias) WithHeader(h map[string]string) func(*IndicesPutAliasRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesPutAlias) WithOpaqueID(s string) func(*IndicesPutAliasRequest) { + return func(r *IndicesPutAliasRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.put_mapping.go b/esapi/api.indices.put_mapping.go index 5adf2883c8..1f2d242526 100644 --- a/esapi/api.indices.put_mapping.go +++ b/esapi/api.indices.put_mapping.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -123,7 +123,10 @@ func (r IndicesPutMappingRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -283,3 +286,14 @@ func (f IndicesPutMapping) WithHeader(h map[string]string) func(*IndicesPutMappi } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesPutMapping) WithOpaqueID(s string) func(*IndicesPutMappingRequest) { + return func(r *IndicesPutMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.put_settings.go b/esapi/api.indices.put_settings.go index 9ab4d2d1bb..c3fe9bb406 100644 --- a/esapi/api.indices.put_settings.go +++ b/esapi/api.indices.put_settings.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -123,7 +123,10 @@ func (r IndicesPutSettingsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -283,3 +286,14 @@ func (f IndicesPutSettings) WithHeader(h map[string]string) func(*IndicesPutSett } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesPutSettings) WithOpaqueID(s string) func(*IndicesPutSettingsRequest) { + return func(r *IndicesPutSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.put_template.go b/esapi/api.indices.put_template.go index 90c4a7c087..a0af6b1c61 100644 --- a/esapi/api.indices.put_template.go +++ b/esapi/api.indices.put_template.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -116,7 +116,10 @@ func (r IndicesPutTemplateRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -260,3 +263,14 @@ func (f IndicesPutTemplate) WithHeader(h map[string]string) func(*IndicesPutTemp } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesPutTemplate) WithOpaqueID(s string) func(*IndicesPutTemplateRequest) { + return func(r *IndicesPutTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.recovery.go b/esapi/api.indices.recovery.go index 03522431bc..36025c122e 100644 --- a/esapi/api.indices.recovery.go +++ b/esapi/api.indices.recovery.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -94,7 +94,10 @@ func (r IndicesRecoveryRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -210,3 +213,14 @@ func (f IndicesRecovery) WithHeader(h map[string]string) func(*IndicesRecoveryRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesRecovery) WithOpaqueID(s string) func(*IndicesRecoveryRequest) { + return func(r *IndicesRecoveryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.refresh.go b/esapi/api.indices.refresh.go index fcacf18850..cceac0769f 100644 --- a/esapi/api.indices.refresh.go +++ b/esapi/api.indices.refresh.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -99,7 +99,10 @@ func (r IndicesRefreshRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -223,3 +226,14 @@ func (f IndicesRefresh) WithHeader(h map[string]string) func(*IndicesRefreshRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesRefresh) WithOpaqueID(s string) func(*IndicesRefreshRequest) { + return func(r *IndicesRefreshRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.rollover.go b/esapi/api.indices.rollover.go index 71939a8fd1..de44011884 100644 --- a/esapi/api.indices.rollover.go +++ b/esapi/api.indices.rollover.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -117,7 +117,10 @@ func (r IndicesRolloverRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -269,3 +272,14 @@ func (f IndicesRollover) WithHeader(h map[string]string) func(*IndicesRolloverRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesRollover) WithOpaqueID(s string) func(*IndicesRolloverRequest) { + return func(r *IndicesRolloverRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.segments.go b/esapi/api.indices.segments.go index 5bed542d53..e221fa3439 100644 --- a/esapi/api.indices.segments.go +++ b/esapi/api.indices.segments.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -104,7 +104,10 @@ func (r IndicesSegmentsRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -236,3 +239,14 @@ func (f IndicesSegments) WithHeader(h map[string]string) func(*IndicesSegmentsRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesSegments) WithOpaqueID(s string) func(*IndicesSegmentsRequest) { + return func(r *IndicesSegmentsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.shard_stores.go b/esapi/api.indices.shard_stores.go index a29de23a10..0f1388be1a 100644 --- a/esapi/api.indices.shard_stores.go +++ b/esapi/api.indices.shard_stores.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -104,7 +104,10 @@ func (r IndicesShardStoresRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -236,3 +239,14 @@ func (f IndicesShardStores) WithHeader(h map[string]string) func(*IndicesShardSt } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesShardStores) WithOpaqueID(s string) func(*IndicesShardStoresRequest) { + return func(r *IndicesShardStoresRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.shrink.go b/esapi/api.indices.shrink.go index 90ae42d2c2..81a30d7580 100644 --- a/esapi/api.indices.shrink.go +++ b/esapi/api.indices.shrink.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -110,7 +110,10 @@ func (r IndicesShrinkRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -246,3 +249,14 @@ func (f IndicesShrink) WithHeader(h map[string]string) func(*IndicesShrinkReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesShrink) WithOpaqueID(s string) func(*IndicesShrinkRequest) { + return func(r *IndicesShrinkRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.split.go b/esapi/api.indices.split.go index 5b330d6ced..cf623a676e 100644 --- a/esapi/api.indices.split.go +++ b/esapi/api.indices.split.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -110,7 +110,10 @@ func (r IndicesSplitRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -246,3 +249,14 @@ func (f IndicesSplit) WithHeader(h map[string]string) func(*IndicesSplitRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesSplit) WithOpaqueID(s string) func(*IndicesSplitRequest) { + return func(r *IndicesSplitRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.stats.go b/esapi/api.indices.stats.go index 2d67f0ae04..347976b8bc 100644 --- a/esapi/api.indices.stats.go +++ b/esapi/api.indices.stats.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -140,7 +140,10 @@ func (r IndicesStatsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -328,3 +331,14 @@ func (f IndicesStats) WithHeader(h map[string]string) func(*IndicesStatsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesStats) WithOpaqueID(s string) func(*IndicesStatsRequest) { + return func(r *IndicesStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.update_aliases.go b/esapi/api.indices.update_aliases.go index 027439e7b3..05ae25734e 100644 --- a/esapi/api.indices.update_aliases.go +++ b/esapi/api.indices.update_aliases.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -90,7 +90,10 @@ func (r IndicesUpdateAliasesRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -202,3 +205,14 @@ func (f IndicesUpdateAliases) WithHeader(h map[string]string) func(*IndicesUpdat } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesUpdateAliases) WithOpaqueID(s string) func(*IndicesUpdateAliasesRequest) { + return func(r *IndicesUpdateAliasesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.upgrade.go b/esapi/api.indices.upgrade.go index a0a94429e0..3028fc0433 100644 --- a/esapi/api.indices.upgrade.go +++ b/esapi/api.indices.upgrade.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -109,7 +109,10 @@ func (r IndicesUpgradeRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -249,3 +252,14 @@ func (f IndicesUpgrade) WithHeader(h map[string]string) func(*IndicesUpgradeRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesUpgrade) WithOpaqueID(s string) func(*IndicesUpgradeRequest) { + return func(r *IndicesUpgradeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.indices.validate_query.go b/esapi/api.indices.validate_query.go index ddef49ecb7..277a2505cc 100644 --- a/esapi/api.indices.validate_query.go +++ b/esapi/api.indices.validate_query.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -154,7 +154,10 @@ func (r IndicesValidateQueryRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -370,3 +373,14 @@ func (f IndicesValidateQuery) WithHeader(h map[string]string) func(*IndicesValid } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesValidateQuery) WithOpaqueID(s string) func(*IndicesValidateQueryRequest) { + return func(r *IndicesValidateQueryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.info.go b/esapi/api.info.go index 35ba32df1a..08e0da39b2 100644 --- a/esapi/api.info.go +++ b/esapi/api.info.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r InfoRequest) Do(ctx context.Context, transport Transport) (*Response, er params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -159,3 +162,14 @@ func (f Info) WithHeader(h map[string]string) func(*InfoRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Info) WithOpaqueID(s string) func(*InfoRequest) { + return func(r *InfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.ingest.delete_pipeline.go b/esapi/api.ingest.delete_pipeline.go index 31713dcc7b..262d982c1d 100644 --- a/esapi/api.ingest.delete_pipeline.go +++ b/esapi/api.ingest.delete_pipeline.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -94,7 +94,10 @@ func (r IngestDeletePipelineRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -202,3 +205,14 @@ func (f IngestDeletePipeline) WithHeader(h map[string]string) func(*IngestDelete } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IngestDeletePipeline) WithOpaqueID(s string) func(*IngestDeletePipelineRequest) { + return func(r *IngestDeletePipelineRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.ingest.get_pipeline.go b/esapi/api.ingest.get_pipeline.go index 6ce38e8527..dac2655af4 100644 --- a/esapi/api.ingest.get_pipeline.go +++ b/esapi/api.ingest.get_pipeline.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -91,7 +91,10 @@ func (r IngestGetPipelineRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -199,3 +202,14 @@ func (f IngestGetPipeline) WithHeader(h map[string]string) func(*IngestGetPipeli } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IngestGetPipeline) WithOpaqueID(s string) func(*IngestGetPipelineRequest) { + return func(r *IngestGetPipelineRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.ingest.processor_grok.go b/esapi/api.ingest.processor_grok.go index fb1ee1cb5b..c812d27063 100644 --- a/esapi/api.ingest.processor_grok.go +++ b/esapi/api.ingest.processor_grok.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r IngestProcessorGrokRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f IngestProcessorGrok) WithHeader(h map[string]string) func(*IngestProcess } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IngestProcessorGrok) WithOpaqueID(s string) func(*IngestProcessorGrokRequest) { + return func(r *IngestProcessorGrokRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.ingest.put_pipeline.go b/esapi/api.ingest.put_pipeline.go index d0238728ad..ffcbc3468c 100644 --- a/esapi/api.ingest.put_pipeline.go +++ b/esapi/api.ingest.put_pipeline.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -97,7 +97,10 @@ func (r IngestPutPipelineRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -209,3 +212,14 @@ func (f IngestPutPipeline) WithHeader(h map[string]string) func(*IngestPutPipeli } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IngestPutPipeline) WithOpaqueID(s string) func(*IngestPutPipelineRequest) { + return func(r *IngestPutPipelineRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.ingest.simulate.go b/esapi/api.ingest.simulate.go index c77e6c3402..5c040e203d 100644 --- a/esapi/api.ingest.simulate.go +++ b/esapi/api.ingest.simulate.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -96,7 +96,10 @@ func (r IngestSimulateRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -208,3 +211,14 @@ func (f IngestSimulate) WithHeader(h map[string]string) func(*IngestSimulateRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IngestSimulate) WithOpaqueID(s string) func(*IngestSimulateRequest) { + return func(r *IngestSimulateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.mget.go b/esapi/api.mget.go index 84854c1d8d..f776b798be 100644 --- a/esapi/api.mget.go +++ b/esapi/api.mget.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -132,7 +132,10 @@ func (r MgetRequest) Do(ctx context.Context, transport Transport) (*Response, er params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -308,3 +311,14 @@ func (f Mget) WithHeader(h map[string]string) func(*MgetRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Mget) WithOpaqueID(s string) func(*MgetRequest) { + return func(r *MgetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.msearch.go b/esapi/api.msearch.go index cec1319683..b26d8c2dd8 100644 --- a/esapi/api.msearch.go +++ b/esapi/api.msearch.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -127,7 +127,10 @@ func (r MsearchRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -295,3 +298,14 @@ func (f Msearch) WithHeader(h map[string]string) func(*MsearchRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Msearch) WithOpaqueID(s string) func(*MsearchRequest) { + return func(r *MsearchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.msearch_template.go b/esapi/api.msearch_template.go index 3c14827c0c..86fa94dd89 100644 --- a/esapi/api.msearch_template.go +++ b/esapi/api.msearch_template.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -114,7 +114,10 @@ func (r MsearchTemplateRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -258,3 +261,14 @@ func (f MsearchTemplate) WithHeader(h map[string]string) func(*MsearchTemplateRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MsearchTemplate) WithOpaqueID(s string) func(*MsearchTemplateRequest) { + return func(r *MsearchTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.mtermvectors.go b/esapi/api.mtermvectors.go index c4b500a603..7a1ea1244d 100644 --- a/esapi/api.mtermvectors.go +++ b/esapi/api.mtermvectors.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -152,7 +152,10 @@ func (r MtermvectorsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -368,3 +371,14 @@ func (f Mtermvectors) WithHeader(h map[string]string) func(*MtermvectorsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Mtermvectors) WithOpaqueID(s string) func(*MtermvectorsRequest) { + return func(r *MtermvectorsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.nodes.hot_threads.go b/esapi/api.nodes.hot_threads.go index 863939a028..c09c543fe1 100644 --- a/esapi/api.nodes.hot_threads.go +++ b/esapi/api.nodes.hot_threads.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -119,7 +119,10 @@ func (r NodesHotThreadsRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -267,3 +270,14 @@ func (f NodesHotThreads) WithHeader(h map[string]string) func(*NodesHotThreadsRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f NodesHotThreads) WithOpaqueID(s string) func(*NodesHotThreadsRequest) { + return func(r *NodesHotThreadsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.nodes.info.go b/esapi/api.nodes.info.go index 290953055d..10ba753dd0 100644 --- a/esapi/api.nodes.info.go +++ b/esapi/api.nodes.info.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -100,7 +100,10 @@ func (r NodesInfoRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -224,3 +227,14 @@ func (f NodesInfo) WithHeader(h map[string]string) func(*NodesInfoRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f NodesInfo) WithOpaqueID(s string) func(*NodesInfoRequest) { + return func(r *NodesInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.nodes.reload_secure_settings.go b/esapi/api.nodes.reload_secure_settings.go index 29fe28c40b..085446fe6c 100644 --- a/esapi/api.nodes.reload_secure_settings.go +++ b/esapi/api.nodes.reload_secure_settings.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -91,7 +91,10 @@ func (r NodesReloadSecureSettingsRequest) Do(ctx context.Context, transport Tran params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -199,3 +202,14 @@ func (f NodesReloadSecureSettings) WithHeader(h map[string]string) func(*NodesRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f NodesReloadSecureSettings) WithOpaqueID(s string) func(*NodesReloadSecureSettingsRequest) { + return func(r *NodesReloadSecureSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.nodes.stats.go b/esapi/api.nodes.stats.go index 69d1653021..254e0e04da 100644 --- a/esapi/api.nodes.stats.go +++ b/esapi/api.nodes.stats.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -137,7 +137,10 @@ func (r NodesStatsRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -317,3 +320,14 @@ func (f NodesStats) WithHeader(h map[string]string) func(*NodesStatsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f NodesStats) WithOpaqueID(s string) func(*NodesStatsRequest) { + return func(r *NodesStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.nodes.usage.go b/esapi/api.nodes.usage.go index 171a46842a..522f589491 100644 --- a/esapi/api.nodes.usage.go +++ b/esapi/api.nodes.usage.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -96,7 +96,10 @@ func (r NodesUsageRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -212,3 +215,14 @@ func (f NodesUsage) WithHeader(h map[string]string) func(*NodesUsageRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f NodesUsage) WithOpaqueID(s string) func(*NodesUsageRequest) { + return func(r *NodesUsageRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.ping.go b/esapi/api.ping.go index 28a64c31d8..b90ed55816 100644 --- a/esapi/api.ping.go +++ b/esapi/api.ping.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r PingRequest) Do(ctx context.Context, transport Transport) (*Response, er params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f Ping) WithHeader(h map[string]string) func(*PingRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Ping) WithOpaqueID(s string) func(*PingRequest) { + return func(r *PingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.put_script.go b/esapi/api.put_script.go index f2631528f8..1d21342415 100644 --- a/esapi/api.put_script.go +++ b/esapi/api.put_script.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -105,7 +105,10 @@ func (r PutScriptRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -225,3 +228,14 @@ func (f PutScript) WithHeader(h map[string]string) func(*PutScriptRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f PutScript) WithOpaqueID(s string) func(*PutScriptRequest) { + return func(r *PutScriptRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.rank_eval.go b/esapi/api.rank_eval.go index f008c99fe8..7eb75aa74a 100644 --- a/esapi/api.rank_eval.go +++ b/esapi/api.rank_eval.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -102,7 +102,10 @@ func (r RankEvalRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -230,3 +233,14 @@ func (f RankEval) WithHeader(h map[string]string) func(*RankEvalRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f RankEval) WithOpaqueID(s string) func(*RankEvalRequest) { + return func(r *RankEvalRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.reindex.go b/esapi/api.reindex.go index fa9a9a78ce..f2cd8dac13 100644 --- a/esapi/api.reindex.go +++ b/esapi/api.reindex.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -123,7 +123,10 @@ func (r ReindexRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -283,3 +286,14 @@ func (f Reindex) WithHeader(h map[string]string) func(*ReindexRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Reindex) WithOpaqueID(s string) func(*ReindexRequest) { + return func(r *ReindexRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.reindex_rethrottle.go b/esapi/api.reindex_rethrottle.go index ea07eeb678..80418ba52d 100644 --- a/esapi/api.reindex_rethrottle.go +++ b/esapi/api.reindex_rethrottle.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -89,7 +89,10 @@ func (r ReindexRethrottleRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -189,3 +192,14 @@ func (f ReindexRethrottle) WithHeader(h map[string]string) func(*ReindexRethrott } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ReindexRethrottle) WithOpaqueID(s string) func(*ReindexRethrottleRequest) { + return func(r *ReindexRethrottleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.render_search_template.go b/esapi/api.render_search_template.go index 774a879c0a..77e9870164 100644 --- a/esapi/api.render_search_template.go +++ b/esapi/api.render_search_template.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -87,7 +87,10 @@ func (r RenderSearchTemplateRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -199,3 +202,14 @@ func (f RenderSearchTemplate) WithHeader(h map[string]string) func(*RenderSearch } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f RenderSearchTemplate) WithOpaqueID(s string) func(*RenderSearchTemplateRequest) { + return func(r *RenderSearchTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.scripts_painless_execute.go b/esapi/api.scripts_painless_execute.go index 7f0f32f818..4f58827e71 100644 --- a/esapi/api.scripts_painless_execute.go +++ b/esapi/api.scripts_painless_execute.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -78,7 +78,10 @@ func (r ScriptsPainlessExecuteRequest) Do(ctx context.Context, transport Transpo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -182,3 +185,14 @@ func (f ScriptsPainlessExecute) WithHeader(h map[string]string) func(*ScriptsPai } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ScriptsPainlessExecute) WithOpaqueID(s string) func(*ScriptsPainlessExecuteRequest) { + return func(r *ScriptsPainlessExecuteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.scroll.go b/esapi/api.scroll.go index 8a63ff3115..bfc86ebe1d 100644 --- a/esapi/api.scroll.go +++ b/esapi/api.scroll.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -97,7 +97,10 @@ func (r ScrollRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -225,3 +228,14 @@ func (f Scroll) WithHeader(h map[string]string) func(*ScrollRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Scroll) WithOpaqueID(s string) func(*ScrollRequest) { + return func(r *ScrollRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.search.go b/esapi/api.search.go index 14f70f8545..4d4ccda010 100644 --- a/esapi/api.search.go +++ b/esapi/api.search.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -304,7 +304,10 @@ func (r SearchRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -760,3 +763,14 @@ func (f Search) WithHeader(h map[string]string) func(*SearchRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Search) WithOpaqueID(s string) func(*SearchRequest) { + return func(r *SearchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.search_shards.go b/esapi/api.search_shards.go index 0dc6481e27..d4f1d0551c 100644 --- a/esapi/api.search_shards.go +++ b/esapi/api.search_shards.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -114,7 +114,10 @@ func (r SearchShardsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -262,3 +265,14 @@ func (f SearchShards) WithHeader(h map[string]string) func(*SearchShardsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SearchShards) WithOpaqueID(s string) func(*SearchShardsRequest) { + return func(r *SearchShardsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.search_template.go b/esapi/api.search_template.go index b683f232a8..92d4623c92 100644 --- a/esapi/api.search_template.go +++ b/esapi/api.search_template.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -155,7 +155,10 @@ func (r SearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -363,3 +366,14 @@ func (f SearchTemplate) WithHeader(h map[string]string) func(*SearchTemplateRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SearchTemplate) WithOpaqueID(s string) func(*SearchTemplateRequest) { + return func(r *SearchTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.snapshot.cleanup_repository.go b/esapi/api.snapshot.cleanup_repository.go index 57a0b43035..a82a6fd779 100644 --- a/esapi/api.snapshot.cleanup_repository.go +++ b/esapi/api.snapshot.cleanup_repository.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -97,7 +97,10 @@ func (r SnapshotCleanupRepositoryRequest) Do(ctx context.Context, transport Tran params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -217,3 +220,14 @@ func (f SnapshotCleanupRepository) WithHeader(h map[string]string) func(*Snapsho } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotCleanupRepository) WithOpaqueID(s string) func(*SnapshotCleanupRepositoryRequest) { + return func(r *SnapshotCleanupRepositoryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.snapshot.create.go b/esapi/api.snapshot.create.go index ec485e0ab3..e42ddb4a28 100644 --- a/esapi/api.snapshot.create.go +++ b/esapi/api.snapshot.create.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -99,7 +99,10 @@ func (r SnapshotCreateRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -219,3 +222,14 @@ func (f SnapshotCreate) WithHeader(h map[string]string) func(*SnapshotCreateRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotCreate) WithOpaqueID(s string) func(*SnapshotCreateRequest) { + return func(r *SnapshotCreateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.snapshot.create_repository.go b/esapi/api.snapshot.create_repository.go index abc06a49e7..3a883306e4 100644 --- a/esapi/api.snapshot.create_repository.go +++ b/esapi/api.snapshot.create_repository.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -101,7 +101,10 @@ func (r SnapshotCreateRepositoryRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -221,3 +224,14 @@ func (f SnapshotCreateRepository) WithHeader(h map[string]string) func(*Snapshot } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotCreateRepository) WithOpaqueID(s string) func(*SnapshotCreateRepositoryRequest) { + return func(r *SnapshotCreateRepositoryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.snapshot.delete.go b/esapi/api.snapshot.delete.go index 67afb05ba1..a515795645 100644 --- a/esapi/api.snapshot.delete.go +++ b/esapi/api.snapshot.delete.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -90,7 +90,10 @@ func (r SnapshotDeleteRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -190,3 +193,14 @@ func (f SnapshotDelete) WithHeader(h map[string]string) func(*SnapshotDeleteRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotDelete) WithOpaqueID(s string) func(*SnapshotDeleteRequest) { + return func(r *SnapshotDeleteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.snapshot.delete_repository.go b/esapi/api.snapshot.delete_repository.go index b0295a17df..24c931b295 100644 --- a/esapi/api.snapshot.delete_repository.go +++ b/esapi/api.snapshot.delete_repository.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -92,7 +92,10 @@ func (r SnapshotDeleteRepositoryRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -200,3 +203,14 @@ func (f SnapshotDeleteRepository) WithHeader(h map[string]string) func(*Snapshot } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotDeleteRepository) WithOpaqueID(s string) func(*SnapshotDeleteRepositoryRequest) { + return func(r *SnapshotDeleteRepositoryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.snapshot.get.go b/esapi/api.snapshot.get.go index b83ad7a431..310310fdbb 100644 --- a/esapi/api.snapshot.get.go +++ b/esapi/api.snapshot.get.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -101,7 +101,10 @@ func (r SnapshotGetRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -217,3 +220,14 @@ func (f SnapshotGet) WithHeader(h map[string]string) func(*SnapshotGetRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotGet) WithOpaqueID(s string) func(*SnapshotGetRequest) { + return func(r *SnapshotGetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.snapshot.get_repository.go b/esapi/api.snapshot.get_repository.go index ee68289b0a..806d8beadd 100644 --- a/esapi/api.snapshot.get_repository.go +++ b/esapi/api.snapshot.get_repository.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -95,7 +95,10 @@ func (r SnapshotGetRepositoryRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -211,3 +214,14 @@ func (f SnapshotGetRepository) WithHeader(h map[string]string) func(*SnapshotGet } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotGetRepository) WithOpaqueID(s string) func(*SnapshotGetRepositoryRequest) { + return func(r *SnapshotGetRepositoryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.snapshot.restore.go b/esapi/api.snapshot.restore.go index 7d92634582..b82a95d5db 100644 --- a/esapi/api.snapshot.restore.go +++ b/esapi/api.snapshot.restore.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -101,7 +101,10 @@ func (r SnapshotRestoreRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -221,3 +224,14 @@ func (f SnapshotRestore) WithHeader(h map[string]string) func(*SnapshotRestoreRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotRestore) WithOpaqueID(s string) func(*SnapshotRestoreRequest) { + return func(r *SnapshotRestoreRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.snapshot.status.go b/esapi/api.snapshot.status.go index b07ff266c7..bf8cb900d7 100644 --- a/esapi/api.snapshot.status.go +++ b/esapi/api.snapshot.status.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -102,7 +102,10 @@ func (r SnapshotStatusRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -226,3 +229,14 @@ func (f SnapshotStatus) WithHeader(h map[string]string) func(*SnapshotStatusRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotStatus) WithOpaqueID(s string) func(*SnapshotStatusRequest) { + return func(r *SnapshotStatusRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.snapshot.verify_repository.go b/esapi/api.snapshot.verify_repository.go index cb2a4a2ed2..8285b4a0c3 100644 --- a/esapi/api.snapshot.verify_repository.go +++ b/esapi/api.snapshot.verify_repository.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -94,7 +94,10 @@ func (r SnapshotVerifyRepositoryRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -202,3 +205,14 @@ func (f SnapshotVerifyRepository) WithHeader(h map[string]string) func(*Snapshot } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotVerifyRepository) WithOpaqueID(s string) func(*SnapshotVerifyRepositoryRequest) { + return func(r *SnapshotVerifyRepositoryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.tasks.cancel.go b/esapi/api.tasks.cancel.go index 953b707901..7304a06854 100644 --- a/esapi/api.tasks.cancel.go +++ b/esapi/api.tasks.cancel.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -100,7 +100,10 @@ func (r TasksCancelRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -224,3 +227,14 @@ func (f TasksCancel) WithHeader(h map[string]string) func(*TasksCancelRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f TasksCancel) WithOpaqueID(s string) func(*TasksCancelRequest) { + return func(r *TasksCancelRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.tasks.get.go b/esapi/api.tasks.get.go index 10ebf58cff..24a88b2570 100644 --- a/esapi/api.tasks.get.go +++ b/esapi/api.tasks.get.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -93,7 +93,10 @@ func (r TasksGetRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -201,3 +204,14 @@ func (f TasksGet) WithHeader(h map[string]string) func(*TasksGetRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f TasksGet) WithOpaqueID(s string) func(*TasksGetRequest) { + return func(r *TasksGetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.tasks.list.go b/esapi/api.tasks.list.go index 14251a505a..5c8d6f684c 100644 --- a/esapi/api.tasks.list.go +++ b/esapi/api.tasks.list.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -113,7 +113,10 @@ func (r TasksListRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -261,3 +264,14 @@ func (f TasksList) WithHeader(h map[string]string) func(*TasksListRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f TasksList) WithOpaqueID(s string) func(*TasksListRequest) { + return func(r *TasksListRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.termvectors.go b/esapi/api.termvectors.go index 21b073517c..083a8f0cea 100644 --- a/esapi/api.termvectors.go +++ b/esapi/api.termvectors.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -154,7 +154,10 @@ func (r TermvectorsRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -362,3 +365,14 @@ func (f Termvectors) WithHeader(h map[string]string) func(*TermvectorsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Termvectors) WithOpaqueID(s string) func(*TermvectorsRequest) { + return func(r *TermvectorsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.update.go b/esapi/api.update.go index d88923428d..10c46ceef9 100644 --- a/esapi/api.update.go +++ b/esapi/api.update.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -153,7 +153,10 @@ func (r UpdateRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -345,3 +348,14 @@ func (f Update) WithHeader(h map[string]string) func(*UpdateRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Update) WithOpaqueID(s string) func(*UpdateRequest) { + return func(r *UpdateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.update_by_query.go b/esapi/api.update_by_query.go index af1c8f1076..c802954231 100644 --- a/esapi/api.update_by_query.go +++ b/esapi/api.update_by_query.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -267,7 +267,10 @@ func (r UpdateByQueryRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -659,3 +662,14 @@ func (f UpdateByQuery) WithHeader(h map[string]string) func(*UpdateByQueryReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f UpdateByQuery) WithOpaqueID(s string) func(*UpdateByQueryRequest) { + return func(r *UpdateByQueryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.update_by_query_rethrottle.go b/esapi/api.update_by_query_rethrottle.go index 054297c6a1..478c51c2df 100644 --- a/esapi/api.update_by_query_rethrottle.go +++ b/esapi/api.update_by_query_rethrottle.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -89,7 +89,10 @@ func (r UpdateByQueryRethrottleRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -189,3 +192,14 @@ func (f UpdateByQueryRethrottle) WithHeader(h map[string]string) func(*UpdateByQ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f UpdateByQueryRethrottle) WithOpaqueID(s string) func(*UpdateByQueryRethrottleRequest) { + return func(r *UpdateByQueryRethrottleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go index 8987581993..dd05d70f68 100644 --- a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r CCRDeleteAutoFollowPatternRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f CCRDeleteAutoFollowPattern) WithHeader(h map[string]string) func(*CCRDel } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRDeleteAutoFollowPattern) WithOpaqueID(s string) func(*CCRDeleteAutoFollowPatternRequest) { + return func(r *CCRDeleteAutoFollowPatternRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ccr.follow.go b/esapi/api.xpack.ccr.follow.go index a2284d44c8..5d6da91961 100644 --- a/esapi/api.xpack.ccr.follow.go +++ b/esapi/api.xpack.ccr.follow.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -91,7 +91,10 @@ func (r CCRFollowRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -195,3 +198,14 @@ func (f CCRFollow) WithHeader(h map[string]string) func(*CCRFollowRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRFollow) WithOpaqueID(s string) func(*CCRFollowRequest) { + return func(r *CCRFollowRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ccr.follow_info.go b/esapi/api.xpack.ccr.follow_info.go index 85d3dec9d4..c346281006 100644 --- a/esapi/api.xpack.ccr.follow_info.go +++ b/esapi/api.xpack.ccr.follow_info.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r CCRFollowInfoRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f CCRFollowInfo) WithHeader(h map[string]string) func(*CCRFollowInfoReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRFollowInfo) WithOpaqueID(s string) func(*CCRFollowInfoRequest) { + return func(r *CCRFollowInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ccr.follow_stats.go b/esapi/api.xpack.ccr.follow_stats.go index 8e901fe044..ece6ecab74 100644 --- a/esapi/api.xpack.ccr.follow_stats.go +++ b/esapi/api.xpack.ccr.follow_stats.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r CCRFollowStatsRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f CCRFollowStats) WithHeader(h map[string]string) func(*CCRFollowStatsRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRFollowStats) WithOpaqueID(s string) func(*CCRFollowStatsRequest) { + return func(r *CCRFollowStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ccr.forget_follower.go b/esapi/api.xpack.ccr.forget_follower.go index ca3ae1aaac..2ed2cf63b7 100644 --- a/esapi/api.xpack.ccr.forget_follower.go +++ b/esapi/api.xpack.ccr.forget_follower.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -85,7 +85,10 @@ func (r CCRForgetFollowerRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -181,3 +184,14 @@ func (f CCRForgetFollower) WithHeader(h map[string]string) func(*CCRForgetFollow } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRForgetFollower) WithOpaqueID(s string) func(*CCRForgetFollowerRequest) { + return func(r *CCRForgetFollowerRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ccr.get_auto_follow_pattern.go b/esapi/api.xpack.ccr.get_auto_follow_pattern.go index 00d31cf4c6..69f07fad1e 100644 --- a/esapi/api.xpack.ccr.get_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.get_auto_follow_pattern.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -84,7 +84,10 @@ func (r CCRGetAutoFollowPatternRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -184,3 +187,14 @@ func (f CCRGetAutoFollowPattern) WithHeader(h map[string]string) func(*CCRGetAut } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRGetAutoFollowPattern) WithOpaqueID(s string) func(*CCRGetAutoFollowPatternRequest) { + return func(r *CCRGetAutoFollowPatternRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ccr.pause_follow.go b/esapi/api.xpack.ccr.pause_follow.go index f3d75a2a7e..0b5ea6df4a 100644 --- a/esapi/api.xpack.ccr.pause_follow.go +++ b/esapi/api.xpack.ccr.pause_follow.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r CCRPauseFollowRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f CCRPauseFollow) WithHeader(h map[string]string) func(*CCRPauseFollowRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRPauseFollow) WithOpaqueID(s string) func(*CCRPauseFollowRequest) { + return func(r *CCRPauseFollowRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ccr.put_auto_follow_pattern.go b/esapi/api.xpack.ccr.put_auto_follow_pattern.go index f5152244c4..95b0164f4e 100644 --- a/esapi/api.xpack.ccr.put_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.put_auto_follow_pattern.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -85,7 +85,10 @@ func (r CCRPutAutoFollowPatternRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -181,3 +184,14 @@ func (f CCRPutAutoFollowPattern) WithHeader(h map[string]string) func(*CCRPutAut } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRPutAutoFollowPattern) WithOpaqueID(s string) func(*CCRPutAutoFollowPatternRequest) { + return func(r *CCRPutAutoFollowPatternRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ccr.resume_follow.go b/esapi/api.xpack.ccr.resume_follow.go index 5b09958506..b40a987641 100644 --- a/esapi/api.xpack.ccr.resume_follow.go +++ b/esapi/api.xpack.ccr.resume_follow.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -85,7 +85,10 @@ func (r CCRResumeFollowRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -189,3 +192,14 @@ func (f CCRResumeFollow) WithHeader(h map[string]string) func(*CCRResumeFollowRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRResumeFollow) WithOpaqueID(s string) func(*CCRResumeFollowRequest) { + return func(r *CCRResumeFollowRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ccr.stats.go b/esapi/api.xpack.ccr.stats.go index 01c34c848a..27e3e379a1 100644 --- a/esapi/api.xpack.ccr.stats.go +++ b/esapi/api.xpack.ccr.stats.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r CCRStatsRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f CCRStats) WithHeader(h map[string]string) func(*CCRStatsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRStats) WithOpaqueID(s string) func(*CCRStatsRequest) { + return func(r *CCRStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ccr.unfollow.go b/esapi/api.xpack.ccr.unfollow.go index 0ca35509ca..76773ba418 100644 --- a/esapi/api.xpack.ccr.unfollow.go +++ b/esapi/api.xpack.ccr.unfollow.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r CCRUnfollowRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f CCRUnfollow) WithHeader(h map[string]string) func(*CCRUnfollowRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRUnfollow) WithOpaqueID(s string) func(*CCRUnfollowRequest) { + return func(r *CCRUnfollowRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame.delete_data_frame_transform.go b/esapi/api.xpack.data_frame.delete_data_frame_transform.go index 5d53be1bfd..666d5e5c6d 100644 --- a/esapi/api.xpack.data_frame.delete_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.delete_data_frame_transform.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -89,7 +89,10 @@ func (r DataFrameDeleteDataFrameTransformRequest) Do(ctx context.Context, transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -189,3 +192,14 @@ func (f DataFrameDeleteDataFrameTransform) WithHeader(h map[string]string) func( } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFrameDeleteDataFrameTransform) WithOpaqueID(s string) func(*DataFrameDeleteDataFrameTransformRequest) { + return func(r *DataFrameDeleteDataFrameTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame.get_data_frame_transform.go b/esapi/api.xpack.data_frame.get_data_frame_transform.go index 27a650fd2c..8a5ad8eb83 100644 --- a/esapi/api.xpack.data_frame.get_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.get_data_frame_transform.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -101,7 +101,10 @@ func (r DataFrameGetDataFrameTransformRequest) Do(ctx context.Context, transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -225,3 +228,14 @@ func (f DataFrameGetDataFrameTransform) WithHeader(h map[string]string) func(*Da } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFrameGetDataFrameTransform) WithOpaqueID(s string) func(*DataFrameGetDataFrameTransformRequest) { + return func(r *DataFrameGetDataFrameTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go b/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go index b16b62ca59..a149109463 100644 --- a/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go +++ b/esapi/api.xpack.data_frame.get_data_frame_transform_stats.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -101,7 +101,10 @@ func (r DataFrameGetDataFrameTransformStatsRequest) Do(ctx context.Context, tran params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -217,3 +220,14 @@ func (f DataFrameGetDataFrameTransformStats) WithHeader(h map[string]string) fun } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFrameGetDataFrameTransformStats) WithOpaqueID(s string) func(*DataFrameGetDataFrameTransformStatsRequest) { + return func(r *DataFrameGetDataFrameTransformStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame.preview_data_frame_transform.go b/esapi/api.xpack.data_frame.preview_data_frame_transform.go index 6ca8717ccf..1e7741223a 100644 --- a/esapi/api.xpack.data_frame.preview_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.preview_data_frame_transform.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -78,7 +78,10 @@ func (r DataFramePreviewDataFrameTransformRequest) Do(ctx context.Context, trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f DataFramePreviewDataFrameTransform) WithHeader(h map[string]string) func } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFramePreviewDataFrameTransform) WithOpaqueID(s string) func(*DataFramePreviewDataFrameTransformRequest) { + return func(r *DataFramePreviewDataFrameTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame.put_data_frame_transform.go b/esapi/api.xpack.data_frame.put_data_frame_transform.go index 148a0dc45b..015ebcd62d 100644 --- a/esapi/api.xpack.data_frame.put_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.put_data_frame_transform.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -92,7 +92,10 @@ func (r DataFramePutDataFrameTransformRequest) Do(ctx context.Context, transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -196,3 +199,14 @@ func (f DataFramePutDataFrameTransform) WithHeader(h map[string]string) func(*Da } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFramePutDataFrameTransform) WithOpaqueID(s string) func(*DataFramePutDataFrameTransformRequest) { + return func(r *DataFramePutDataFrameTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame.start_data_frame_transform.go b/esapi/api.xpack.data_frame.start_data_frame_transform.go index acf38ef9aa..3d80ebc829 100644 --- a/esapi/api.xpack.data_frame.start_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.start_data_frame_transform.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -91,7 +91,10 @@ func (r DataFrameStartDataFrameTransformRequest) Do(ctx context.Context, transpo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -191,3 +194,14 @@ func (f DataFrameStartDataFrameTransform) WithHeader(h map[string]string) func(* } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFrameStartDataFrameTransform) WithOpaqueID(s string) func(*DataFrameStartDataFrameTransformRequest) { + return func(r *DataFrameStartDataFrameTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame.stop_data_frame_transform.go b/esapi/api.xpack.data_frame.stop_data_frame_transform.go index d42b4975d5..82f8e4c164 100644 --- a/esapi/api.xpack.data_frame.stop_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.stop_data_frame_transform.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -102,7 +102,10 @@ func (r DataFrameStopDataFrameTransformRequest) Do(ctx context.Context, transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -218,3 +221,14 @@ func (f DataFrameStopDataFrameTransform) WithHeader(h map[string]string) func(*D } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFrameStopDataFrameTransform) WithOpaqueID(s string) func(*DataFrameStopDataFrameTransformRequest) { + return func(r *DataFrameStopDataFrameTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame.update_data_frame_transform.go b/esapi/api.xpack.data_frame.update_data_frame_transform.go index 5a2c334a25..aa6ce82f19 100644 --- a/esapi/api.xpack.data_frame.update_data_frame_transform.go +++ b/esapi/api.xpack.data_frame.update_data_frame_transform.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -94,7 +94,10 @@ func (r DataFrameUpdateDataFrameTransformRequest) Do(ctx context.Context, transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -198,3 +201,14 @@ func (f DataFrameUpdateDataFrameTransform) WithHeader(h map[string]string) func( } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFrameUpdateDataFrameTransform) WithOpaqueID(s string) func(*DataFrameUpdateDataFrameTransformRequest) { + return func(r *DataFrameUpdateDataFrameTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.graph.explore.go b/esapi/api.xpack.graph.explore.go index 43ef4dbc02..363550d9d8 100644 --- a/esapi/api.xpack.graph.explore.go +++ b/esapi/api.xpack.graph.explore.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -102,7 +102,10 @@ func (r GraphExploreRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -230,3 +233,14 @@ func (f GraphExplore) WithHeader(h map[string]string) func(*GraphExploreRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f GraphExplore) WithOpaqueID(s string) func(*GraphExploreRequest) { + return func(r *GraphExploreRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ilm.delete_lifecycle.go b/esapi/api.xpack.ilm.delete_lifecycle.go index 2cb13430c3..526e575d9c 100644 --- a/esapi/api.xpack.ilm.delete_lifecycle.go +++ b/esapi/api.xpack.ilm.delete_lifecycle.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r ILMDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f ILMDeleteLifecycle) WithHeader(h map[string]string) func(*ILMDeleteLifec } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMDeleteLifecycle) WithOpaqueID(s string) func(*ILMDeleteLifecycleRequest) { + return func(r *ILMDeleteLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ilm.explain_lifecycle.go b/esapi/api.xpack.ilm.explain_lifecycle.go index 98f32e68d4..e63a519151 100644 --- a/esapi/api.xpack.ilm.explain_lifecycle.go +++ b/esapi/api.xpack.ilm.explain_lifecycle.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -94,7 +94,10 @@ func (r ILMExplainLifecycleRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -202,3 +205,14 @@ func (f ILMExplainLifecycle) WithHeader(h map[string]string) func(*ILMExplainLif } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMExplainLifecycle) WithOpaqueID(s string) func(*ILMExplainLifecycleRequest) { + return func(r *ILMExplainLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ilm.get_lifecycle.go b/esapi/api.xpack.ilm.get_lifecycle.go index 0023cdeba1..799e7f4eb1 100644 --- a/esapi/api.xpack.ilm.get_lifecycle.go +++ b/esapi/api.xpack.ilm.get_lifecycle.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -84,7 +84,10 @@ func (r ILMGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -184,3 +187,14 @@ func (f ILMGetLifecycle) WithHeader(h map[string]string) func(*ILMGetLifecycleRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMGetLifecycle) WithOpaqueID(s string) func(*ILMGetLifecycleRequest) { + return func(r *ILMGetLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ilm.get_status.go b/esapi/api.xpack.ilm.get_status.go index 68d2cd522f..19ae52aff5 100644 --- a/esapi/api.xpack.ilm.get_status.go +++ b/esapi/api.xpack.ilm.get_status.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r ILMGetStatusRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f ILMGetStatus) WithHeader(h map[string]string) func(*ILMGetStatusRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMGetStatus) WithOpaqueID(s string) func(*ILMGetStatusRequest) { + return func(r *ILMGetStatusRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ilm.move_to_step.go b/esapi/api.xpack.ilm.move_to_step.go index 23278d7a9f..007736528c 100644 --- a/esapi/api.xpack.ilm.move_to_step.go +++ b/esapi/api.xpack.ilm.move_to_step.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -85,7 +85,10 @@ func (r ILMMoveToStepRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -189,3 +192,14 @@ func (f ILMMoveToStep) WithHeader(h map[string]string) func(*ILMMoveToStepReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMMoveToStep) WithOpaqueID(s string) func(*ILMMoveToStepRequest) { + return func(r *ILMMoveToStepRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ilm.put_lifecycle.go b/esapi/api.xpack.ilm.put_lifecycle.go index 1baab94fc1..c9cc63e5e5 100644 --- a/esapi/api.xpack.ilm.put_lifecycle.go +++ b/esapi/api.xpack.ilm.put_lifecycle.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -85,7 +85,10 @@ func (r ILMPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -189,3 +192,14 @@ func (f ILMPutLifecycle) WithHeader(h map[string]string) func(*ILMPutLifecycleRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMPutLifecycle) WithOpaqueID(s string) func(*ILMPutLifecycleRequest) { + return func(r *ILMPutLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ilm.remove_policy.go b/esapi/api.xpack.ilm.remove_policy.go index 8908d2559b..a54730c99d 100644 --- a/esapi/api.xpack.ilm.remove_policy.go +++ b/esapi/api.xpack.ilm.remove_policy.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r ILMRemovePolicyRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f ILMRemovePolicy) WithHeader(h map[string]string) func(*ILMRemovePolicyRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMRemovePolicy) WithOpaqueID(s string) func(*ILMRemovePolicyRequest) { + return func(r *ILMRemovePolicyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ilm.retry.go b/esapi/api.xpack.ilm.retry.go index 061c8a7e23..13eeb767f7 100644 --- a/esapi/api.xpack.ilm.retry.go +++ b/esapi/api.xpack.ilm.retry.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r ILMRetryRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f ILMRetry) WithHeader(h map[string]string) func(*ILMRetryRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMRetry) WithOpaqueID(s string) func(*ILMRetryRequest) { + return func(r *ILMRetryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ilm.start.go b/esapi/api.xpack.ilm.start.go index 70e229d3b2..704d1c22a6 100644 --- a/esapi/api.xpack.ilm.start.go +++ b/esapi/api.xpack.ilm.start.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r ILMStartRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f ILMStart) WithHeader(h map[string]string) func(*ILMStartRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMStart) WithOpaqueID(s string) func(*ILMStartRequest) { + return func(r *ILMStartRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ilm.stop.go b/esapi/api.xpack.ilm.stop.go index dd2ed11ed5..100f988b9d 100644 --- a/esapi/api.xpack.ilm.stop.go +++ b/esapi/api.xpack.ilm.stop.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r ILMStopRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f ILMStop) WithHeader(h map[string]string) func(*ILMStopRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMStop) WithOpaqueID(s string) func(*ILMStopRequest) { + return func(r *ILMStopRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.indices.freeze.go b/esapi/api.xpack.indices.freeze.go index 92ee8d79a9..2d3dbde26e 100644 --- a/esapi/api.xpack.indices.freeze.go +++ b/esapi/api.xpack.indices.freeze.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -113,7 +113,10 @@ func (r IndicesFreezeRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -253,3 +256,14 @@ func (f IndicesFreeze) WithHeader(h map[string]string) func(*IndicesFreezeReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesFreeze) WithOpaqueID(s string) func(*IndicesFreezeRequest) { + return func(r *IndicesFreezeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.indices.reload_search_analyzers.go b/esapi/api.xpack.indices.reload_search_analyzers.go index 4e06af8c10..9085257d2c 100644 --- a/esapi/api.xpack.indices.reload_search_analyzers.go +++ b/esapi/api.xpack.indices.reload_search_analyzers.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -97,7 +97,10 @@ func (r IndicesReloadSearchAnalyzersRequest) Do(ctx context.Context, transport T params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -213,3 +216,14 @@ func (f IndicesReloadSearchAnalyzers) WithHeader(h map[string]string) func(*Indi } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesReloadSearchAnalyzers) WithOpaqueID(s string) func(*IndicesReloadSearchAnalyzersRequest) { + return func(r *IndicesReloadSearchAnalyzersRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.indices.unfreeze.go b/esapi/api.xpack.indices.unfreeze.go index 8e2addff1e..974ebc1d85 100644 --- a/esapi/api.xpack.indices.unfreeze.go +++ b/esapi/api.xpack.indices.unfreeze.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -113,7 +113,10 @@ func (r IndicesUnfreezeRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -253,3 +256,14 @@ func (f IndicesUnfreeze) WithHeader(h map[string]string) func(*IndicesUnfreezeRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesUnfreeze) WithOpaqueID(s string) func(*IndicesUnfreezeRequest) { + return func(r *IndicesUnfreezeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.license.delete.go b/esapi/api.xpack.license.delete.go index 925fc4e49d..f100563ede 100644 --- a/esapi/api.xpack.license.delete.go +++ b/esapi/api.xpack.license.delete.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r LicenseDeleteRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f LicenseDelete) WithHeader(h map[string]string) func(*LicenseDeleteReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f LicenseDelete) WithOpaqueID(s string) func(*LicenseDeleteRequest) { + return func(r *LicenseDeleteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.license.get.go b/esapi/api.xpack.license.get.go index 544f34f284..a689b41b84 100644 --- a/esapi/api.xpack.license.get.go +++ b/esapi/api.xpack.license.get.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r LicenseGetRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -182,3 +185,14 @@ func (f LicenseGet) WithHeader(h map[string]string) func(*LicenseGetRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f LicenseGet) WithOpaqueID(s string) func(*LicenseGetRequest) { + return func(r *LicenseGetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.license.get_basic_status.go b/esapi/api.xpack.license.get_basic_status.go index 3c3d5e5f85..3e7e0d7df9 100644 --- a/esapi/api.xpack.license.get_basic_status.go +++ b/esapi/api.xpack.license.get_basic_status.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r LicenseGetBasicStatusRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f LicenseGetBasicStatus) WithHeader(h map[string]string) func(*LicenseGetB } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f LicenseGetBasicStatus) WithOpaqueID(s string) func(*LicenseGetBasicStatusRequest) { + return func(r *LicenseGetBasicStatusRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.license.get_trial_status.go b/esapi/api.xpack.license.get_trial_status.go index b81611d4af..e2330bd85d 100644 --- a/esapi/api.xpack.license.get_trial_status.go +++ b/esapi/api.xpack.license.get_trial_status.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r LicenseGetTrialStatusRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f LicenseGetTrialStatus) WithHeader(h map[string]string) func(*LicenseGetT } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f LicenseGetTrialStatus) WithOpaqueID(s string) func(*LicenseGetTrialStatusRequest) { + return func(r *LicenseGetTrialStatusRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.license.post.go b/esapi/api.xpack.license.post.go index 64762db07d..e7492f431b 100644 --- a/esapi/api.xpack.license.post.go +++ b/esapi/api.xpack.license.post.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -85,7 +85,10 @@ func (r LicensePostRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -197,3 +200,14 @@ func (f LicensePost) WithHeader(h map[string]string) func(*LicensePostRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f LicensePost) WithOpaqueID(s string) func(*LicensePostRequest) { + return func(r *LicensePostRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.license.post_start_basic.go b/esapi/api.xpack.license.post_start_basic.go index b5949cbcbf..09ae9763f4 100644 --- a/esapi/api.xpack.license.post_start_basic.go +++ b/esapi/api.xpack.license.post_start_basic.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r LicensePostStartBasicRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -182,3 +185,14 @@ func (f LicensePostStartBasic) WithHeader(h map[string]string) func(*LicensePost } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f LicensePostStartBasic) WithOpaqueID(s string) func(*LicensePostStartBasicRequest) { + return func(r *LicensePostStartBasicRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.license.post_start_trial.go b/esapi/api.xpack.license.post_start_trial.go index 3eb9b17acd..069ddff3ff 100644 --- a/esapi/api.xpack.license.post_start_trial.go +++ b/esapi/api.xpack.license.post_start_trial.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -87,7 +87,10 @@ func (r LicensePostStartTrialRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -195,3 +198,14 @@ func (f LicensePostStartTrial) WithHeader(h map[string]string) func(*LicensePost } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f LicensePostStartTrial) WithOpaqueID(s string) func(*LicensePostStartTrialRequest) { + return func(r *LicensePostStartTrialRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.migration.deprecations.go b/esapi/api.xpack.migration.deprecations.go index 23bd2252d2..57973fa702 100644 --- a/esapi/api.xpack.migration.deprecations.go +++ b/esapi/api.xpack.migration.deprecations.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -84,7 +84,10 @@ func (r MigrationDeprecationsRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -184,3 +187,14 @@ func (f MigrationDeprecations) WithHeader(h map[string]string) func(*MigrationDe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MigrationDeprecations) WithOpaqueID(s string) func(*MigrationDeprecationsRequest) { + return func(r *MigrationDeprecationsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.close_job.go b/esapi/api.xpack.ml.close_job.go index 8ae616c004..2434205546 100644 --- a/esapi/api.xpack.ml.close_job.go +++ b/esapi/api.xpack.ml.close_job.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -105,7 +105,10 @@ func (r MLCloseJobRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -233,3 +236,14 @@ func (f MLCloseJob) WithHeader(h map[string]string) func(*MLCloseJobRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLCloseJob) WithOpaqueID(s string) func(*MLCloseJobRequest) { + return func(r *MLCloseJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.delete_calendar.go b/esapi/api.xpack.ml.delete_calendar.go index 76ca9cc441..1f4a4c7cf9 100644 --- a/esapi/api.xpack.ml.delete_calendar.go +++ b/esapi/api.xpack.ml.delete_calendar.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -80,7 +80,10 @@ func (r MLDeleteCalendarRequest) Do(ctx context.Context, transport Transport) (* params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -172,3 +175,14 @@ func (f MLDeleteCalendar) WithHeader(h map[string]string) func(*MLDeleteCalendar } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLDeleteCalendar) WithOpaqueID(s string) func(*MLDeleteCalendarRequest) { + return func(r *MLDeleteCalendarRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.delete_calendar_event.go b/esapi/api.xpack.ml.delete_calendar_event.go index 83101891d1..466aab4b0a 100644 --- a/esapi/api.xpack.ml.delete_calendar_event.go +++ b/esapi/api.xpack.ml.delete_calendar_event.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -85,7 +85,10 @@ func (r MLDeleteCalendarEventRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -177,3 +180,14 @@ func (f MLDeleteCalendarEvent) WithHeader(h map[string]string) func(*MLDeleteCal } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLDeleteCalendarEvent) WithOpaqueID(s string) func(*MLDeleteCalendarEventRequest) { + return func(r *MLDeleteCalendarEventRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.delete_calendar_job.go b/esapi/api.xpack.ml.delete_calendar_job.go index 1c96d6697c..74b2c88965 100644 --- a/esapi/api.xpack.ml.delete_calendar_job.go +++ b/esapi/api.xpack.ml.delete_calendar_job.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -85,7 +85,10 @@ func (r MLDeleteCalendarJobRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -177,3 +180,14 @@ func (f MLDeleteCalendarJob) WithHeader(h map[string]string) func(*MLDeleteCalen } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLDeleteCalendarJob) WithOpaqueID(s string) func(*MLDeleteCalendarJobRequest) { + return func(r *MLDeleteCalendarJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.delete_data_frame_analytics.go b/esapi/api.xpack.ml.delete_data_frame_analytics.go index 82393d68a1..271eefa9a4 100644 --- a/esapi/api.xpack.ml.delete_data_frame_analytics.go +++ b/esapi/api.xpack.ml.delete_data_frame_analytics.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -84,7 +84,10 @@ func (r MLDeleteDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -176,3 +179,14 @@ func (f MLDeleteDataFrameAnalytics) WithHeader(h map[string]string) func(*MLDele } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLDeleteDataFrameAnalytics) WithOpaqueID(s string) func(*MLDeleteDataFrameAnalyticsRequest) { + return func(r *MLDeleteDataFrameAnalyticsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.delete_datafeed.go b/esapi/api.xpack.ml.delete_datafeed.go index 844c9097ec..b52c392a34 100644 --- a/esapi/api.xpack.ml.delete_datafeed.go +++ b/esapi/api.xpack.ml.delete_datafeed.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -89,7 +89,10 @@ func (r MLDeleteDatafeedRequest) Do(ctx context.Context, transport Transport) (* params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -189,3 +192,14 @@ func (f MLDeleteDatafeed) WithHeader(h map[string]string) func(*MLDeleteDatafeed } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLDeleteDatafeed) WithOpaqueID(s string) func(*MLDeleteDatafeedRequest) { + return func(r *MLDeleteDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.delete_expired_data.go b/esapi/api.xpack.ml.delete_expired_data.go index a44a44f31a..f14fcf69b0 100644 --- a/esapi/api.xpack.ml.delete_expired_data.go +++ b/esapi/api.xpack.ml.delete_expired_data.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -73,7 +73,10 @@ func (r MLDeleteExpiredDataRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -165,3 +168,14 @@ func (f MLDeleteExpiredData) WithHeader(h map[string]string) func(*MLDeleteExpir } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLDeleteExpiredData) WithOpaqueID(s string) func(*MLDeleteExpiredDataRequest) { + return func(r *MLDeleteExpiredDataRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.delete_filter.go b/esapi/api.xpack.ml.delete_filter.go index ad7c070256..77d4a8936a 100644 --- a/esapi/api.xpack.ml.delete_filter.go +++ b/esapi/api.xpack.ml.delete_filter.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -80,7 +80,10 @@ func (r MLDeleteFilterRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -172,3 +175,14 @@ func (f MLDeleteFilter) WithHeader(h map[string]string) func(*MLDeleteFilterRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLDeleteFilter) WithOpaqueID(s string) func(*MLDeleteFilterRequest) { + return func(r *MLDeleteFilterRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.delete_forecast.go b/esapi/api.xpack.ml.delete_forecast.go index 65db92911b..6e62690ed5 100644 --- a/esapi/api.xpack.ml.delete_forecast.go +++ b/esapi/api.xpack.ml.delete_forecast.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -102,7 +102,10 @@ func (r MLDeleteForecastRequest) Do(ctx context.Context, transport Transport) (* params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -218,3 +221,14 @@ func (f MLDeleteForecast) WithHeader(h map[string]string) func(*MLDeleteForecast } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLDeleteForecast) WithOpaqueID(s string) func(*MLDeleteForecastRequest) { + return func(r *MLDeleteForecastRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.delete_job.go b/esapi/api.xpack.ml.delete_job.go index 3822b43e7e..3f2efa7fca 100644 --- a/esapi/api.xpack.ml.delete_job.go +++ b/esapi/api.xpack.ml.delete_job.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -94,7 +94,10 @@ func (r MLDeleteJobRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -202,3 +205,14 @@ func (f MLDeleteJob) WithHeader(h map[string]string) func(*MLDeleteJobRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLDeleteJob) WithOpaqueID(s string) func(*MLDeleteJobRequest) { + return func(r *MLDeleteJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.delete_model_snapshot.go b/esapi/api.xpack.ml.delete_model_snapshot.go index b4a75a2422..5a255b6351 100644 --- a/esapi/api.xpack.ml.delete_model_snapshot.go +++ b/esapi/api.xpack.ml.delete_model_snapshot.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -87,7 +87,10 @@ func (r MLDeleteModelSnapshotRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -179,3 +182,14 @@ func (f MLDeleteModelSnapshot) WithHeader(h map[string]string) func(*MLDeleteMod } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLDeleteModelSnapshot) WithOpaqueID(s string) func(*MLDeleteModelSnapshotRequest) { + return func(r *MLDeleteModelSnapshotRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.estimate_memory_usage.go b/esapi/api.xpack.ml.estimate_memory_usage.go index 267b7d2ab7..736c8f59c8 100644 --- a/esapi/api.xpack.ml.estimate_memory_usage.go +++ b/esapi/api.xpack.ml.estimate_memory_usage.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -78,7 +78,10 @@ func (r MLEstimateMemoryUsageRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f MLEstimateMemoryUsage) WithHeader(h map[string]string) func(*MLEstimateM } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLEstimateMemoryUsage) WithOpaqueID(s string) func(*MLEstimateMemoryUsageRequest) { + return func(r *MLEstimateMemoryUsageRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.evaluate_data_frame.go b/esapi/api.xpack.ml.evaluate_data_frame.go index 18c59c9cc4..873389c4c9 100644 --- a/esapi/api.xpack.ml.evaluate_data_frame.go +++ b/esapi/api.xpack.ml.evaluate_data_frame.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -78,7 +78,10 @@ func (r MLEvaluateDataFrameRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f MLEvaluateDataFrame) WithHeader(h map[string]string) func(*MLEvaluateDat } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLEvaluateDataFrame) WithOpaqueID(s string) func(*MLEvaluateDataFrameRequest) { + return func(r *MLEvaluateDataFrameRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.find_file_structure.go b/esapi/api.xpack.ml.find_file_structure.go index 624f2e89d2..3a971404ba 100644 --- a/esapi/api.xpack.ml.find_file_structure.go +++ b/esapi/api.xpack.ml.find_file_structure.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -151,7 +151,10 @@ func (r MLFindFileStructureRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -359,3 +362,14 @@ func (f MLFindFileStructure) WithHeader(h map[string]string) func(*MLFindFileStr } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLFindFileStructure) WithOpaqueID(s string) func(*MLFindFileStructureRequest) { + return func(r *MLFindFileStructureRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.flush_job.go b/esapi/api.xpack.ml.flush_job.go index d2f1fc40db..3248d428e8 100644 --- a/esapi/api.xpack.ml.flush_job.go +++ b/esapi/api.xpack.ml.flush_job.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -114,7 +114,10 @@ func (r MLFlushJobRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -258,3 +261,14 @@ func (f MLFlushJob) WithHeader(h map[string]string) func(*MLFlushJobRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLFlushJob) WithOpaqueID(s string) func(*MLFlushJobRequest) { + return func(r *MLFlushJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.forecast.go b/esapi/api.xpack.ml.forecast.go index 2bb5d258a4..3ac8308aed 100644 --- a/esapi/api.xpack.ml.forecast.go +++ b/esapi/api.xpack.ml.forecast.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -94,7 +94,10 @@ func (r MLForecastRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -202,3 +205,14 @@ func (f MLForecast) WithHeader(h map[string]string) func(*MLForecastRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLForecast) WithOpaqueID(s string) func(*MLForecastRequest) { + return func(r *MLForecastRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_buckets.go b/esapi/api.xpack.ml.get_buckets.go index 5d6e01da6e..7a97bbd50d 100644 --- a/esapi/api.xpack.ml.get_buckets.go +++ b/esapi/api.xpack.ml.get_buckets.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -142,7 +142,10 @@ func (r MLGetBucketsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -326,3 +329,14 @@ func (f MLGetBuckets) WithHeader(h map[string]string) func(*MLGetBucketsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetBuckets) WithOpaqueID(s string) func(*MLGetBucketsRequest) { + return func(r *MLGetBucketsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_calendar_events.go b/esapi/api.xpack.ml.get_calendar_events.go index 6b8469e4a0..5d9270a8bb 100644 --- a/esapi/api.xpack.ml.get_calendar_events.go +++ b/esapi/api.xpack.ml.get_calendar_events.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -110,7 +110,10 @@ func (r MLGetCalendarEventsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -242,3 +245,14 @@ func (f MLGetCalendarEvents) WithHeader(h map[string]string) func(*MLGetCalendar } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetCalendarEvents) WithOpaqueID(s string) func(*MLGetCalendarEventsRequest) { + return func(r *MLGetCalendarEventsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_calendars.go b/esapi/api.xpack.ml.get_calendars.go index efb24402b1..fc3d0c45b1 100644 --- a/esapi/api.xpack.ml.get_calendars.go +++ b/esapi/api.xpack.ml.get_calendars.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -97,7 +97,10 @@ func (r MLGetCalendarsRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -225,3 +228,14 @@ func (f MLGetCalendars) WithHeader(h map[string]string) func(*MLGetCalendarsRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetCalendars) WithOpaqueID(s string) func(*MLGetCalendarsRequest) { + return func(r *MLGetCalendarsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_categories.go b/esapi/api.xpack.ml.get_categories.go index 5c8bd43ba0..dde18805ff 100644 --- a/esapi/api.xpack.ml.get_categories.go +++ b/esapi/api.xpack.ml.get_categories.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -108,7 +108,10 @@ func (r MLGetCategoriesRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -236,3 +239,14 @@ func (f MLGetCategories) WithHeader(h map[string]string) func(*MLGetCategoriesRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetCategories) WithOpaqueID(s string) func(*MLGetCategoriesRequest) { + return func(r *MLGetCategoriesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_data_frame_analytics.go b/esapi/api.xpack.ml.get_data_frame_analytics.go index f7045fc4ba..106a3dee17 100644 --- a/esapi/api.xpack.ml.get_data_frame_analytics.go +++ b/esapi/api.xpack.ml.get_data_frame_analytics.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -103,7 +103,10 @@ func (r MLGetDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -227,3 +230,14 @@ func (f MLGetDataFrameAnalytics) WithHeader(h map[string]string) func(*MLGetData } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetDataFrameAnalytics) WithOpaqueID(s string) func(*MLGetDataFrameAnalyticsRequest) { + return func(r *MLGetDataFrameAnalyticsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go index 6a3af42177..5feae82aba 100644 --- a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go +++ b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -105,7 +105,10 @@ func (r MLGetDataFrameAnalyticsStatsRequest) Do(ctx context.Context, transport T params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -229,3 +232,14 @@ func (f MLGetDataFrameAnalyticsStats) WithHeader(h map[string]string) func(*MLGe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetDataFrameAnalyticsStats) WithOpaqueID(s string) func(*MLGetDataFrameAnalyticsStatsRequest) { + return func(r *MLGetDataFrameAnalyticsStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_datafeed_stats.go b/esapi/api.xpack.ml.get_datafeed_stats.go index d70fc2bc17..31e2ec82b4 100644 --- a/esapi/api.xpack.ml.get_datafeed_stats.go +++ b/esapi/api.xpack.ml.get_datafeed_stats.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -93,7 +93,10 @@ func (r MLGetDatafeedStatsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -201,3 +204,14 @@ func (f MLGetDatafeedStats) WithHeader(h map[string]string) func(*MLGetDatafeedS } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetDatafeedStats) WithOpaqueID(s string) func(*MLGetDatafeedStatsRequest) { + return func(r *MLGetDatafeedStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_datafeeds.go b/esapi/api.xpack.ml.get_datafeeds.go index 0d3c4517e3..e4ed5f2a43 100644 --- a/esapi/api.xpack.ml.get_datafeeds.go +++ b/esapi/api.xpack.ml.get_datafeeds.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -91,7 +91,10 @@ func (r MLGetDatafeedsRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -199,3 +202,14 @@ func (f MLGetDatafeeds) WithHeader(h map[string]string) func(*MLGetDatafeedsRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetDatafeeds) WithOpaqueID(s string) func(*MLGetDatafeedsRequest) { + return func(r *MLGetDatafeedsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_filters.go b/esapi/api.xpack.ml.get_filters.go index 6d1a3a6dee..05ef5f4a08 100644 --- a/esapi/api.xpack.ml.get_filters.go +++ b/esapi/api.xpack.ml.get_filters.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -94,7 +94,10 @@ func (r MLGetFiltersRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -210,3 +213,14 @@ func (f MLGetFilters) WithHeader(h map[string]string) func(*MLGetFiltersRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetFilters) WithOpaqueID(s string) func(*MLGetFiltersRequest) { + return func(r *MLGetFiltersRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_influencers.go b/esapi/api.xpack.ml.get_influencers.go index 09813dc061..87811fe51e 100644 --- a/esapi/api.xpack.ml.get_influencers.go +++ b/esapi/api.xpack.ml.get_influencers.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -132,7 +132,10 @@ func (r MLGetInfluencersRequest) Do(ctx context.Context, transport Transport) (* params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -300,3 +303,14 @@ func (f MLGetInfluencers) WithHeader(h map[string]string) func(*MLGetInfluencers } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetInfluencers) WithOpaqueID(s string) func(*MLGetInfluencersRequest) { + return func(r *MLGetInfluencersRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_job_stats.go b/esapi/api.xpack.ml.get_job_stats.go index 250c5297f7..562d749a4a 100644 --- a/esapi/api.xpack.ml.get_job_stats.go +++ b/esapi/api.xpack.ml.get_job_stats.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -93,7 +93,10 @@ func (r MLGetJobStatsRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -201,3 +204,14 @@ func (f MLGetJobStats) WithHeader(h map[string]string) func(*MLGetJobStatsReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetJobStats) WithOpaqueID(s string) func(*MLGetJobStatsRequest) { + return func(r *MLGetJobStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_jobs.go b/esapi/api.xpack.ml.get_jobs.go index 86d2fbc173..8ba393e496 100644 --- a/esapi/api.xpack.ml.get_jobs.go +++ b/esapi/api.xpack.ml.get_jobs.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -91,7 +91,10 @@ func (r MLGetJobsRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -199,3 +202,14 @@ func (f MLGetJobs) WithHeader(h map[string]string) func(*MLGetJobsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetJobs) WithOpaqueID(s string) func(*MLGetJobsRequest) { + return func(r *MLGetJobsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_model_snapshots.go b/esapi/api.xpack.ml.get_model_snapshots.go index 2f97d06428..afe4041998 100644 --- a/esapi/api.xpack.ml.get_model_snapshots.go +++ b/esapi/api.xpack.ml.get_model_snapshots.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -125,7 +125,10 @@ func (r MLGetModelSnapshotsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -285,3 +288,14 @@ func (f MLGetModelSnapshots) WithHeader(h map[string]string) func(*MLGetModelSna } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetModelSnapshots) WithOpaqueID(s string) func(*MLGetModelSnapshotsRequest) { + return func(r *MLGetModelSnapshotsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_overall_buckets.go b/esapi/api.xpack.ml.get_overall_buckets.go index 6291b1e3c3..3e481138f9 100644 --- a/esapi/api.xpack.ml.get_overall_buckets.go +++ b/esapi/api.xpack.ml.get_overall_buckets.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -127,7 +127,10 @@ func (r MLGetOverallBucketsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -287,3 +290,14 @@ func (f MLGetOverallBuckets) WithHeader(h map[string]string) func(*MLGetOverallB } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetOverallBuckets) WithOpaqueID(s string) func(*MLGetOverallBucketsRequest) { + return func(r *MLGetOverallBucketsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.get_records.go b/esapi/api.xpack.ml.get_records.go index 0789258632..b513c1e8e3 100644 --- a/esapi/api.xpack.ml.get_records.go +++ b/esapi/api.xpack.ml.get_records.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -132,7 +132,10 @@ func (r MLGetRecordsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -300,3 +303,14 @@ func (f MLGetRecords) WithHeader(h map[string]string) func(*MLGetRecordsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLGetRecords) WithOpaqueID(s string) func(*MLGetRecordsRequest) { + return func(r *MLGetRecordsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.info.go b/esapi/api.xpack.ml.info.go index 33ae59ac40..1df931ab65 100644 --- a/esapi/api.xpack.ml.info.go +++ b/esapi/api.xpack.ml.info.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -73,7 +73,10 @@ func (r MLInfoRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -165,3 +168,14 @@ func (f MLInfo) WithHeader(h map[string]string) func(*MLInfoRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLInfo) WithOpaqueID(s string) func(*MLInfoRequest) { + return func(r *MLInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.open_job.go b/esapi/api.xpack.ml.open_job.go index 765004bcea..1eca338006 100644 --- a/esapi/api.xpack.ml.open_job.go +++ b/esapi/api.xpack.ml.open_job.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -84,7 +84,10 @@ func (r MLOpenJobRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -176,3 +179,14 @@ func (f MLOpenJob) WithHeader(h map[string]string) func(*MLOpenJobRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLOpenJob) WithOpaqueID(s string) func(*MLOpenJobRequest) { + return func(r *MLOpenJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.post_calendar_events.go b/esapi/api.xpack.ml.post_calendar_events.go index 0fcbcc4536..54c64a47b5 100644 --- a/esapi/api.xpack.ml.post_calendar_events.go +++ b/esapi/api.xpack.ml.post_calendar_events.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -85,7 +85,10 @@ func (r MLPostCalendarEventsRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -181,3 +184,14 @@ func (f MLPostCalendarEvents) WithHeader(h map[string]string) func(*MLPostCalend } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLPostCalendarEvents) WithOpaqueID(s string) func(*MLPostCalendarEventsRequest) { + return func(r *MLPostCalendarEventsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.post_data.go b/esapi/api.xpack.ml.post_data.go index 0963dc0654..39c9dcc670 100644 --- a/esapi/api.xpack.ml.post_data.go +++ b/esapi/api.xpack.ml.post_data.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -98,7 +98,10 @@ func (r MLPostDataRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -210,3 +213,14 @@ func (f MLPostData) WithHeader(h map[string]string) func(*MLPostDataRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLPostData) WithOpaqueID(s string) func(*MLPostDataRequest) { + return func(r *MLPostDataRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.preview_datafeed.go b/esapi/api.xpack.ml.preview_datafeed.go index 6c4871d03e..2b3b0ca694 100644 --- a/esapi/api.xpack.ml.preview_datafeed.go +++ b/esapi/api.xpack.ml.preview_datafeed.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -84,7 +84,10 @@ func (r MLPreviewDatafeedRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -176,3 +179,14 @@ func (f MLPreviewDatafeed) WithHeader(h map[string]string) func(*MLPreviewDatafe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLPreviewDatafeed) WithOpaqueID(s string) func(*MLPreviewDatafeedRequest) { + return func(r *MLPreviewDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.put_calendar.go b/esapi/api.xpack.ml.put_calendar.go index d3371de9bd..85510a7e2a 100644 --- a/esapi/api.xpack.ml.put_calendar.go +++ b/esapi/api.xpack.ml.put_calendar.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -83,7 +83,10 @@ func (r MLPutCalendarRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -187,3 +190,14 @@ func (f MLPutCalendar) WithHeader(h map[string]string) func(*MLPutCalendarReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLPutCalendar) WithOpaqueID(s string) func(*MLPutCalendarRequest) { + return func(r *MLPutCalendarRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.put_calendar_job.go b/esapi/api.xpack.ml.put_calendar_job.go index c1525ac340..17438ff724 100644 --- a/esapi/api.xpack.ml.put_calendar_job.go +++ b/esapi/api.xpack.ml.put_calendar_job.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -85,7 +85,10 @@ func (r MLPutCalendarJobRequest) Do(ctx context.Context, transport Transport) (* params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -177,3 +180,14 @@ func (f MLPutCalendarJob) WithHeader(h map[string]string) func(*MLPutCalendarJob } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLPutCalendarJob) WithOpaqueID(s string) func(*MLPutCalendarJobRequest) { + return func(r *MLPutCalendarJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.put_data_frame_analytics.go b/esapi/api.xpack.ml.put_data_frame_analytics.go index 08ad463411..0ca69a4e2b 100644 --- a/esapi/api.xpack.ml.put_data_frame_analytics.go +++ b/esapi/api.xpack.ml.put_data_frame_analytics.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -87,7 +87,10 @@ func (r MLPutDataFrameAnalyticsRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -183,3 +186,14 @@ func (f MLPutDataFrameAnalytics) WithHeader(h map[string]string) func(*MLPutData } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLPutDataFrameAnalytics) WithOpaqueID(s string) func(*MLPutDataFrameAnalyticsRequest) { + return func(r *MLPutDataFrameAnalyticsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.put_datafeed.go b/esapi/api.xpack.ml.put_datafeed.go index 657a28267d..1928479982 100644 --- a/esapi/api.xpack.ml.put_datafeed.go +++ b/esapi/api.xpack.ml.put_datafeed.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -85,7 +85,10 @@ func (r MLPutDatafeedRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -181,3 +184,14 @@ func (f MLPutDatafeed) WithHeader(h map[string]string) func(*MLPutDatafeedReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLPutDatafeed) WithOpaqueID(s string) func(*MLPutDatafeedRequest) { + return func(r *MLPutDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.put_filter.go b/esapi/api.xpack.ml.put_filter.go index cef0c72e62..27b279244c 100644 --- a/esapi/api.xpack.ml.put_filter.go +++ b/esapi/api.xpack.ml.put_filter.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -83,7 +83,10 @@ func (r MLPutFilterRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -179,3 +182,14 @@ func (f MLPutFilter) WithHeader(h map[string]string) func(*MLPutFilterRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLPutFilter) WithOpaqueID(s string) func(*MLPutFilterRequest) { + return func(r *MLPutFilterRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.put_job.go b/esapi/api.xpack.ml.put_job.go index 16635b3e15..d62ce4a367 100644 --- a/esapi/api.xpack.ml.put_job.go +++ b/esapi/api.xpack.ml.put_job.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -85,7 +85,10 @@ func (r MLPutJobRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -181,3 +184,14 @@ func (f MLPutJob) WithHeader(h map[string]string) func(*MLPutJobRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLPutJob) WithOpaqueID(s string) func(*MLPutJobRequest) { + return func(r *MLPutJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.revert_model_snapshot.go b/esapi/api.xpack.ml.revert_model_snapshot.go index b7ff76b1ab..d68299dd83 100644 --- a/esapi/api.xpack.ml.revert_model_snapshot.go +++ b/esapi/api.xpack.ml.revert_model_snapshot.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -99,7 +99,10 @@ func (r MLRevertModelSnapshotRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -211,3 +214,14 @@ func (f MLRevertModelSnapshot) WithHeader(h map[string]string) func(*MLRevertMod } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLRevertModelSnapshot) WithOpaqueID(s string) func(*MLRevertModelSnapshotRequest) { + return func(r *MLRevertModelSnapshotRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.set_upgrade_mode.go b/esapi/api.xpack.ml.set_upgrade_mode.go index f620ab7195..c2727fc53a 100644 --- a/esapi/api.xpack.ml.set_upgrade_mode.go +++ b/esapi/api.xpack.ml.set_upgrade_mode.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -88,7 +88,10 @@ func (r MLSetUpgradeModeRequest) Do(ctx context.Context, transport Transport) (* params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -196,3 +199,14 @@ func (f MLSetUpgradeMode) WithHeader(h map[string]string) func(*MLSetUpgradeMode } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLSetUpgradeMode) WithOpaqueID(s string) func(*MLSetUpgradeModeRequest) { + return func(r *MLSetUpgradeModeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.start_data_frame_analytics.go b/esapi/api.xpack.ml.start_data_frame_analytics.go index 23a2f84ac2..89619ee384 100644 --- a/esapi/api.xpack.ml.start_data_frame_analytics.go +++ b/esapi/api.xpack.ml.start_data_frame_analytics.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -96,7 +96,10 @@ func (r MLStartDataFrameAnalyticsRequest) Do(ctx context.Context, transport Tran params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -208,3 +211,14 @@ func (f MLStartDataFrameAnalytics) WithHeader(h map[string]string) func(*MLStart } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLStartDataFrameAnalytics) WithOpaqueID(s string) func(*MLStartDataFrameAnalyticsRequest) { + return func(r *MLStartDataFrameAnalyticsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.start_datafeed.go b/esapi/api.xpack.ml.start_datafeed.go index 7a9f503b41..c8544705f5 100644 --- a/esapi/api.xpack.ml.start_datafeed.go +++ b/esapi/api.xpack.ml.start_datafeed.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -104,7 +104,10 @@ func (r MLStartDatafeedRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -232,3 +235,14 @@ func (f MLStartDatafeed) WithHeader(h map[string]string) func(*MLStartDatafeedRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLStartDatafeed) WithOpaqueID(s string) func(*MLStartDatafeedRequest) { + return func(r *MLStartDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.stop_data_frame_analytics.go b/esapi/api.xpack.ml.stop_data_frame_analytics.go index 2674d7a7d4..f71e074da1 100644 --- a/esapi/api.xpack.ml.stop_data_frame_analytics.go +++ b/esapi/api.xpack.ml.stop_data_frame_analytics.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -107,7 +107,10 @@ func (r MLStopDataFrameAnalyticsRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -235,3 +238,14 @@ func (f MLStopDataFrameAnalytics) WithHeader(h map[string]string) func(*MLStopDa } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLStopDataFrameAnalytics) WithOpaqueID(s string) func(*MLStopDataFrameAnalyticsRequest) { + return func(r *MLStopDataFrameAnalyticsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.stop_datafeed.go b/esapi/api.xpack.ml.stop_datafeed.go index 6c306ae948..ea45c1fe8c 100644 --- a/esapi/api.xpack.ml.stop_datafeed.go +++ b/esapi/api.xpack.ml.stop_datafeed.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -102,7 +102,10 @@ func (r MLStopDatafeedRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -218,3 +221,14 @@ func (f MLStopDatafeed) WithHeader(h map[string]string) func(*MLStopDatafeedRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLStopDatafeed) WithOpaqueID(s string) func(*MLStopDatafeedRequest) { + return func(r *MLStopDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.update_datafeed.go b/esapi/api.xpack.ml.update_datafeed.go index e4abe2440d..1c30417513 100644 --- a/esapi/api.xpack.ml.update_datafeed.go +++ b/esapi/api.xpack.ml.update_datafeed.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -87,7 +87,10 @@ func (r MLUpdateDatafeedRequest) Do(ctx context.Context, transport Transport) (* params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -183,3 +186,14 @@ func (f MLUpdateDatafeed) WithHeader(h map[string]string) func(*MLUpdateDatafeed } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLUpdateDatafeed) WithOpaqueID(s string) func(*MLUpdateDatafeedRequest) { + return func(r *MLUpdateDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.update_filter.go b/esapi/api.xpack.ml.update_filter.go index b4e98d895f..275f32d83b 100644 --- a/esapi/api.xpack.ml.update_filter.go +++ b/esapi/api.xpack.ml.update_filter.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -85,7 +85,10 @@ func (r MLUpdateFilterRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -181,3 +184,14 @@ func (f MLUpdateFilter) WithHeader(h map[string]string) func(*MLUpdateFilterRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLUpdateFilter) WithOpaqueID(s string) func(*MLUpdateFilterRequest) { + return func(r *MLUpdateFilterRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.update_job.go b/esapi/api.xpack.ml.update_job.go index 723e86ed92..d685313555 100644 --- a/esapi/api.xpack.ml.update_job.go +++ b/esapi/api.xpack.ml.update_job.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -87,7 +87,10 @@ func (r MLUpdateJobRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -183,3 +186,14 @@ func (f MLUpdateJob) WithHeader(h map[string]string) func(*MLUpdateJobRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLUpdateJob) WithOpaqueID(s string) func(*MLUpdateJobRequest) { + return func(r *MLUpdateJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.update_model_snapshot.go b/esapi/api.xpack.ml.update_model_snapshot.go index 5345da0cd3..9b72a752fa 100644 --- a/esapi/api.xpack.ml.update_model_snapshot.go +++ b/esapi/api.xpack.ml.update_model_snapshot.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -92,7 +92,10 @@ func (r MLUpdateModelSnapshotRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -188,3 +191,14 @@ func (f MLUpdateModelSnapshot) WithHeader(h map[string]string) func(*MLUpdateMod } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLUpdateModelSnapshot) WithOpaqueID(s string) func(*MLUpdateModelSnapshotRequest) { + return func(r *MLUpdateModelSnapshotRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.validate.go b/esapi/api.xpack.ml.validate.go index a8e0a51045..3befaf2d10 100644 --- a/esapi/api.xpack.ml.validate.go +++ b/esapi/api.xpack.ml.validate.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -76,7 +76,10 @@ func (r MLValidateRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -172,3 +175,14 @@ func (f MLValidate) WithHeader(h map[string]string) func(*MLValidateRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLValidate) WithOpaqueID(s string) func(*MLValidateRequest) { + return func(r *MLValidateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ml.validate_detector.go b/esapi/api.xpack.ml.validate_detector.go index 2f9e8efb5c..0fe2cb5bff 100644 --- a/esapi/api.xpack.ml.validate_detector.go +++ b/esapi/api.xpack.ml.validate_detector.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -76,7 +76,10 @@ func (r MLValidateDetectorRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -172,3 +175,14 @@ func (f MLValidateDetector) WithHeader(h map[string]string) func(*MLValidateDete } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MLValidateDetector) WithOpaqueID(s string) func(*MLValidateDetectorRequest) { + return func(r *MLValidateDetectorRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.monitoring.bulk.go b/esapi/api.xpack.monitoring.bulk.go index c91089482d..559f94e2ba 100644 --- a/esapi/api.xpack.monitoring.bulk.go +++ b/esapi/api.xpack.monitoring.bulk.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -103,7 +103,10 @@ func (r MonitoringBulkRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -231,3 +234,14 @@ func (f MonitoringBulk) WithHeader(h map[string]string) func(*MonitoringBulkRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MonitoringBulk) WithOpaqueID(s string) func(*MonitoringBulkRequest) { + return func(r *MonitoringBulkRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.rollup.delete_job.go b/esapi/api.xpack.rollup.delete_job.go index 40a4a8576e..61cb6dd977 100644 --- a/esapi/api.xpack.rollup.delete_job.go +++ b/esapi/api.xpack.rollup.delete_job.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -80,7 +80,10 @@ func (r RollupDeleteJobRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -172,3 +175,14 @@ func (f RollupDeleteJob) WithHeader(h map[string]string) func(*RollupDeleteJobRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f RollupDeleteJob) WithOpaqueID(s string) func(*RollupDeleteJobRequest) { + return func(r *RollupDeleteJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.rollup.get_jobs.go b/esapi/api.xpack.rollup.get_jobs.go index c8e7d787d1..d69f9406cc 100644 --- a/esapi/api.xpack.rollup.get_jobs.go +++ b/esapi/api.xpack.rollup.get_jobs.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r RollupGetJobsRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -182,3 +185,14 @@ func (f RollupGetJobs) WithHeader(h map[string]string) func(*RollupGetJobsReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f RollupGetJobs) WithOpaqueID(s string) func(*RollupGetJobsRequest) { + return func(r *RollupGetJobsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.rollup.get_rollup_caps.go b/esapi/api.xpack.rollup.get_rollup_caps.go index 220786a00c..e0ba8636c7 100644 --- a/esapi/api.xpack.rollup.get_rollup_caps.go +++ b/esapi/api.xpack.rollup.get_rollup_caps.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r RollupGetRollupCapsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -182,3 +185,14 @@ func (f RollupGetRollupCaps) WithHeader(h map[string]string) func(*RollupGetRoll } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f RollupGetRollupCaps) WithOpaqueID(s string) func(*RollupGetRollupCapsRequest) { + return func(r *RollupGetRollupCapsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.rollup.get_rollup_index_caps.go b/esapi/api.xpack.rollup.get_rollup_index_caps.go index 8fd0b5f61d..e9d82f3a81 100644 --- a/esapi/api.xpack.rollup.get_rollup_index_caps.go +++ b/esapi/api.xpack.rollup.get_rollup_index_caps.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -80,7 +80,10 @@ func (r RollupGetRollupIndexCapsRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -172,3 +175,14 @@ func (f RollupGetRollupIndexCaps) WithHeader(h map[string]string) func(*RollupGe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f RollupGetRollupIndexCaps) WithOpaqueID(s string) func(*RollupGetRollupIndexCapsRequest) { + return func(r *RollupGetRollupIndexCapsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.rollup.put_job.go b/esapi/api.xpack.rollup.put_job.go index a98d55c8f1..3c84cb2c7f 100644 --- a/esapi/api.xpack.rollup.put_job.go +++ b/esapi/api.xpack.rollup.put_job.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -83,7 +83,10 @@ func (r RollupPutJobRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -179,3 +182,14 @@ func (f RollupPutJob) WithHeader(h map[string]string) func(*RollupPutJobRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f RollupPutJob) WithOpaqueID(s string) func(*RollupPutJobRequest) { + return func(r *RollupPutJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.rollup.rollup_search.go b/esapi/api.xpack.rollup.rollup_search.go index 3ff8eb5708..418d0a17b3 100644 --- a/esapi/api.xpack.rollup.rollup_search.go +++ b/esapi/api.xpack.rollup.rollup_search.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -98,7 +98,10 @@ func (r RollupRollupSearchRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -218,3 +221,14 @@ func (f RollupRollupSearch) WithHeader(h map[string]string) func(*RollupRollupSe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f RollupRollupSearch) WithOpaqueID(s string) func(*RollupRollupSearchRequest) { + return func(r *RollupRollupSearchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.rollup.start_job.go b/esapi/api.xpack.rollup.start_job.go index b8caa69540..c93e069822 100644 --- a/esapi/api.xpack.rollup.start_job.go +++ b/esapi/api.xpack.rollup.start_job.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r RollupStartJobRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f RollupStartJob) WithHeader(h map[string]string) func(*RollupStartJobRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f RollupStartJob) WithOpaqueID(s string) func(*RollupStartJobRequest) { + return func(r *RollupStartJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.rollup.stop_job.go b/esapi/api.xpack.rollup.stop_job.go index 2414c70480..9d08c3675a 100644 --- a/esapi/api.xpack.rollup.stop_job.go +++ b/esapi/api.xpack.rollup.stop_job.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -95,7 +95,10 @@ func (r RollupStopJobRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -203,3 +206,14 @@ func (f RollupStopJob) WithHeader(h map[string]string) func(*RollupStopJobReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f RollupStopJob) WithOpaqueID(s string) func(*RollupStopJobRequest) { + return func(r *RollupStopJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.authenticate.go b/esapi/api.xpack.security.authenticate.go index 7709a07ddd..1dc5008178 100644 --- a/esapi/api.xpack.security.authenticate.go +++ b/esapi/api.xpack.security.authenticate.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r SecurityAuthenticateRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f SecurityAuthenticate) WithHeader(h map[string]string) func(*SecurityAuth } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityAuthenticate) WithOpaqueID(s string) func(*SecurityAuthenticateRequest) { + return func(r *SecurityAuthenticateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.change_password.go b/esapi/api.xpack.security.change_password.go index d39c786673..3527b317a8 100644 --- a/esapi/api.xpack.security.change_password.go +++ b/esapi/api.xpack.security.change_password.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -95,7 +95,10 @@ func (r SecurityChangePasswordRequest) Do(ctx context.Context, transport Transpo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -207,3 +210,14 @@ func (f SecurityChangePassword) WithHeader(h map[string]string) func(*SecurityCh } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityChangePassword) WithOpaqueID(s string) func(*SecurityChangePasswordRequest) { + return func(r *SecurityChangePasswordRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.clear_cached_realms.go b/esapi/api.xpack.security.clear_cached_realms.go index 5e7fedc0b2..b95804cfb4 100644 --- a/esapi/api.xpack.security.clear_cached_realms.go +++ b/esapi/api.xpack.security.clear_cached_realms.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -90,7 +90,10 @@ func (r SecurityClearCachedRealmsRequest) Do(ctx context.Context, transport Tran params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -190,3 +193,14 @@ func (f SecurityClearCachedRealms) WithHeader(h map[string]string) func(*Securit } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityClearCachedRealms) WithOpaqueID(s string) func(*SecurityClearCachedRealmsRequest) { + return func(r *SecurityClearCachedRealmsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.clear_cached_roles.go b/esapi/api.xpack.security.clear_cached_roles.go index f78cd26563..98f05b722e 100644 --- a/esapi/api.xpack.security.clear_cached_roles.go +++ b/esapi/api.xpack.security.clear_cached_roles.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -84,7 +84,10 @@ func (r SecurityClearCachedRolesRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -176,3 +179,14 @@ func (f SecurityClearCachedRoles) WithHeader(h map[string]string) func(*Security } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityClearCachedRoles) WithOpaqueID(s string) func(*SecurityClearCachedRolesRequest) { + return func(r *SecurityClearCachedRolesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.create_api_key.go b/esapi/api.xpack.security.create_api_key.go index 6859f3c61b..8592ee5484 100644 --- a/esapi/api.xpack.security.create_api_key.go +++ b/esapi/api.xpack.security.create_api_key.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -84,7 +84,10 @@ func (r SecurityCreateAPIKeyRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -188,3 +191,14 @@ func (f SecurityCreateAPIKey) WithHeader(h map[string]string) func(*SecurityCrea } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityCreateAPIKey) WithOpaqueID(s string) func(*SecurityCreateAPIKeyRequest) { + return func(r *SecurityCreateAPIKeyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.delete_privileges.go b/esapi/api.xpack.security.delete_privileges.go index c0e6751ef2..b353b18f86 100644 --- a/esapi/api.xpack.security.delete_privileges.go +++ b/esapi/api.xpack.security.delete_privileges.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -89,7 +89,10 @@ func (r SecurityDeletePrivilegesRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -189,3 +192,14 @@ func (f SecurityDeletePrivileges) WithHeader(h map[string]string) func(*Security } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityDeletePrivileges) WithOpaqueID(s string) func(*SecurityDeletePrivilegesRequest) { + return func(r *SecurityDeletePrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.delete_role.go b/esapi/api.xpack.security.delete_role.go index 2bbfbfcbf8..055659eb14 100644 --- a/esapi/api.xpack.security.delete_role.go +++ b/esapi/api.xpack.security.delete_role.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -88,7 +88,10 @@ func (r SecurityDeleteRoleRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -188,3 +191,14 @@ func (f SecurityDeleteRole) WithHeader(h map[string]string) func(*SecurityDelete } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityDeleteRole) WithOpaqueID(s string) func(*SecurityDeleteRoleRequest) { + return func(r *SecurityDeleteRoleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.delete_role_mapping.go b/esapi/api.xpack.security.delete_role_mapping.go index a6189e6c44..8f4360c39c 100644 --- a/esapi/api.xpack.security.delete_role_mapping.go +++ b/esapi/api.xpack.security.delete_role_mapping.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -88,7 +88,10 @@ func (r SecurityDeleteRoleMappingRequest) Do(ctx context.Context, transport Tran params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -188,3 +191,14 @@ func (f SecurityDeleteRoleMapping) WithHeader(h map[string]string) func(*Securit } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityDeleteRoleMapping) WithOpaqueID(s string) func(*SecurityDeleteRoleMappingRequest) { + return func(r *SecurityDeleteRoleMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.delete_user.go b/esapi/api.xpack.security.delete_user.go index 754829c4d9..9e457b0fc8 100644 --- a/esapi/api.xpack.security.delete_user.go +++ b/esapi/api.xpack.security.delete_user.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -88,7 +88,10 @@ func (r SecurityDeleteUserRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -188,3 +191,14 @@ func (f SecurityDeleteUser) WithHeader(h map[string]string) func(*SecurityDelete } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityDeleteUser) WithOpaqueID(s string) func(*SecurityDeleteUserRequest) { + return func(r *SecurityDeleteUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.disable_user.go b/esapi/api.xpack.security.disable_user.go index d77c2120d9..04f74c5885 100644 --- a/esapi/api.xpack.security.disable_user.go +++ b/esapi/api.xpack.security.disable_user.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -90,7 +90,10 @@ func (r SecurityDisableUserRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -190,3 +193,14 @@ func (f SecurityDisableUser) WithHeader(h map[string]string) func(*SecurityDisab } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityDisableUser) WithOpaqueID(s string) func(*SecurityDisableUserRequest) { + return func(r *SecurityDisableUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.enable_user.go b/esapi/api.xpack.security.enable_user.go index d040b26a92..a81ec177ec 100644 --- a/esapi/api.xpack.security.enable_user.go +++ b/esapi/api.xpack.security.enable_user.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -90,7 +90,10 @@ func (r SecurityEnableUserRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -190,3 +193,14 @@ func (f SecurityEnableUser) WithHeader(h map[string]string) func(*SecurityEnable } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityEnableUser) WithOpaqueID(s string) func(*SecurityEnableUserRequest) { + return func(r *SecurityEnableUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.get_api_key.go b/esapi/api.xpack.security.get_api_key.go index 5dd6e0f7b4..2b56a65c92 100644 --- a/esapi/api.xpack.security.get_api_key.go +++ b/esapi/api.xpack.security.get_api_key.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -96,7 +96,10 @@ func (r SecurityGetAPIKeyRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -220,3 +223,14 @@ func (f SecurityGetAPIKey) WithHeader(h map[string]string) func(*SecurityGetAPIK } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityGetAPIKey) WithOpaqueID(s string) func(*SecurityGetAPIKeyRequest) { + return func(r *SecurityGetAPIKeyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.get_builtin_privileges.go b/esapi/api.xpack.security.get_builtin_privileges.go index c9fd120320..8d1ead3f67 100644 --- a/esapi/api.xpack.security.get_builtin_privileges.go +++ b/esapi/api.xpack.security.get_builtin_privileges.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r SecurityGetBuiltinPrivilegesRequest) Do(ctx context.Context, transport T params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f SecurityGetBuiltinPrivileges) WithHeader(h map[string]string) func(*Secu } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityGetBuiltinPrivileges) WithOpaqueID(s string) func(*SecurityGetBuiltinPrivilegesRequest) { + return func(r *SecurityGetBuiltinPrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.get_privileges.go b/esapi/api.xpack.security.get_privileges.go index 13bfdca86c..a88b36152b 100644 --- a/esapi/api.xpack.security.get_privileges.go +++ b/esapi/api.xpack.security.get_privileges.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -89,7 +89,10 @@ func (r SecurityGetPrivilegesRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -197,3 +200,14 @@ func (f SecurityGetPrivileges) WithHeader(h map[string]string) func(*SecurityGet } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityGetPrivileges) WithOpaqueID(s string) func(*SecurityGetPrivilegesRequest) { + return func(r *SecurityGetPrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.get_role.go b/esapi/api.xpack.security.get_role.go index 05850244b1..01fa74e07d 100644 --- a/esapi/api.xpack.security.get_role.go +++ b/esapi/api.xpack.security.get_role.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -84,7 +84,10 @@ func (r SecurityGetRoleRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -184,3 +187,14 @@ func (f SecurityGetRole) WithHeader(h map[string]string) func(*SecurityGetRoleRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityGetRole) WithOpaqueID(s string) func(*SecurityGetRoleRequest) { + return func(r *SecurityGetRoleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.get_role_mapping.go b/esapi/api.xpack.security.get_role_mapping.go index e344ccddb6..e95d2036f5 100644 --- a/esapi/api.xpack.security.get_role_mapping.go +++ b/esapi/api.xpack.security.get_role_mapping.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -84,7 +84,10 @@ func (r SecurityGetRoleMappingRequest) Do(ctx context.Context, transport Transpo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -184,3 +187,14 @@ func (f SecurityGetRoleMapping) WithHeader(h map[string]string) func(*SecurityGe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityGetRoleMapping) WithOpaqueID(s string) func(*SecurityGetRoleMappingRequest) { + return func(r *SecurityGetRoleMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.get_token.go b/esapi/api.xpack.security.get_token.go index 1ad8707c6e..e9389663e9 100644 --- a/esapi/api.xpack.security.get_token.go +++ b/esapi/api.xpack.security.get_token.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -78,7 +78,10 @@ func (r SecurityGetTokenRequest) Do(ctx context.Context, transport Transport) (* params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f SecurityGetToken) WithHeader(h map[string]string) func(*SecurityGetToken } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityGetToken) WithOpaqueID(s string) func(*SecurityGetTokenRequest) { + return func(r *SecurityGetTokenRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.get_user.go b/esapi/api.xpack.security.get_user.go index 852a025149..f9b8878a00 100644 --- a/esapi/api.xpack.security.get_user.go +++ b/esapi/api.xpack.security.get_user.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -84,7 +84,10 @@ func (r SecurityGetUserRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -184,3 +187,14 @@ func (f SecurityGetUser) WithHeader(h map[string]string) func(*SecurityGetUserRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityGetUser) WithOpaqueID(s string) func(*SecurityGetUserRequest) { + return func(r *SecurityGetUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.get_user_privileges.go b/esapi/api.xpack.security.get_user_privileges.go index 49db778122..7e2a6811ff 100644 --- a/esapi/api.xpack.security.get_user_privileges.go +++ b/esapi/api.xpack.security.get_user_privileges.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r SecurityGetUserPrivilegesRequest) Do(ctx context.Context, transport Tran params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f SecurityGetUserPrivileges) WithHeader(h map[string]string) func(*Securit } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityGetUserPrivileges) WithOpaqueID(s string) func(*SecurityGetUserPrivilegesRequest) { + return func(r *SecurityGetUserPrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.has_privileges.go b/esapi/api.xpack.security.has_privileges.go index f853697c47..8de167f9b2 100644 --- a/esapi/api.xpack.security.has_privileges.go +++ b/esapi/api.xpack.security.has_privileges.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -89,7 +89,10 @@ func (r SecurityHasPrivilegesRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -193,3 +196,14 @@ func (f SecurityHasPrivileges) WithHeader(h map[string]string) func(*SecurityHas } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityHasPrivileges) WithOpaqueID(s string) func(*SecurityHasPrivilegesRequest) { + return func(r *SecurityHasPrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.invalidate_api_key.go b/esapi/api.xpack.security.invalidate_api_key.go index dfd9272e93..f885723cbd 100644 --- a/esapi/api.xpack.security.invalidate_api_key.go +++ b/esapi/api.xpack.security.invalidate_api_key.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -78,7 +78,10 @@ func (r SecurityInvalidateAPIKeyRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f SecurityInvalidateAPIKey) WithHeader(h map[string]string) func(*Security } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityInvalidateAPIKey) WithOpaqueID(s string) func(*SecurityInvalidateAPIKeyRequest) { + return func(r *SecurityInvalidateAPIKeyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.invalidate_token.go b/esapi/api.xpack.security.invalidate_token.go index abcf6db6d5..2bc4fe3b58 100644 --- a/esapi/api.xpack.security.invalidate_token.go +++ b/esapi/api.xpack.security.invalidate_token.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -78,7 +78,10 @@ func (r SecurityInvalidateTokenRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f SecurityInvalidateToken) WithHeader(h map[string]string) func(*SecurityI } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityInvalidateToken) WithOpaqueID(s string) func(*SecurityInvalidateTokenRequest) { + return func(r *SecurityInvalidateTokenRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.put_privileges.go b/esapi/api.xpack.security.put_privileges.go index d19bb47191..7cd92efe43 100644 --- a/esapi/api.xpack.security.put_privileges.go +++ b/esapi/api.xpack.security.put_privileges.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r SecurityPutPrivilegesRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -186,3 +189,14 @@ func (f SecurityPutPrivileges) WithHeader(h map[string]string) func(*SecurityPut } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityPutPrivileges) WithOpaqueID(s string) func(*SecurityPutPrivilegesRequest) { + return func(r *SecurityPutPrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.put_role.go b/esapi/api.xpack.security.put_role.go index 9333e5bbf9..0babd4f29e 100644 --- a/esapi/api.xpack.security.put_role.go +++ b/esapi/api.xpack.security.put_role.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -91,7 +91,10 @@ func (r SecurityPutRoleRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -195,3 +198,14 @@ func (f SecurityPutRole) WithHeader(h map[string]string) func(*SecurityPutRoleRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityPutRole) WithOpaqueID(s string) func(*SecurityPutRoleRequest) { + return func(r *SecurityPutRoleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.put_role_mapping.go b/esapi/api.xpack.security.put_role_mapping.go index fab71b37a4..00dfae13eb 100644 --- a/esapi/api.xpack.security.put_role_mapping.go +++ b/esapi/api.xpack.security.put_role_mapping.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -91,7 +91,10 @@ func (r SecurityPutRoleMappingRequest) Do(ctx context.Context, transport Transpo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -195,3 +198,14 @@ func (f SecurityPutRoleMapping) WithHeader(h map[string]string) func(*SecurityPu } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityPutRoleMapping) WithOpaqueID(s string) func(*SecurityPutRoleMappingRequest) { + return func(r *SecurityPutRoleMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.security.put_user.go b/esapi/api.xpack.security.put_user.go index 95a452d27d..b4aca3ced5 100644 --- a/esapi/api.xpack.security.put_user.go +++ b/esapi/api.xpack.security.put_user.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -91,7 +91,10 @@ func (r SecurityPutUserRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -195,3 +198,14 @@ func (f SecurityPutUser) WithHeader(h map[string]string) func(*SecurityPutUserRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityPutUser) WithOpaqueID(s string) func(*SecurityPutUserRequest) { + return func(r *SecurityPutUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.slm.delete_lifecycle.go b/esapi/api.xpack.slm.delete_lifecycle.go index e272f42c43..56a131f2b0 100644 --- a/esapi/api.xpack.slm.delete_lifecycle.go +++ b/esapi/api.xpack.slm.delete_lifecycle.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r SlmDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f SlmDeleteLifecycle) WithHeader(h map[string]string) func(*SlmDeleteLifec } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SlmDeleteLifecycle) WithOpaqueID(s string) func(*SlmDeleteLifecycleRequest) { + return func(r *SlmDeleteLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.slm.execute_lifecycle.go b/esapi/api.xpack.slm.execute_lifecycle.go index b5c5653f1a..4ace01b581 100644 --- a/esapi/api.xpack.slm.execute_lifecycle.go +++ b/esapi/api.xpack.slm.execute_lifecycle.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -84,7 +84,10 @@ func (r SlmExecuteLifecycleRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -176,3 +179,14 @@ func (f SlmExecuteLifecycle) WithHeader(h map[string]string) func(*SlmExecuteLif } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SlmExecuteLifecycle) WithOpaqueID(s string) func(*SlmExecuteLifecycleRequest) { + return func(r *SlmExecuteLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.slm.get_lifecycle.go b/esapi/api.xpack.slm.get_lifecycle.go index b511b6c359..0a4af1c97d 100644 --- a/esapi/api.xpack.slm.get_lifecycle.go +++ b/esapi/api.xpack.slm.get_lifecycle.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -33,7 +33,7 @@ type SlmGetLifecycle func(o ...func(*SlmGetLifecycleRequest)) (*Response, error) // SlmGetLifecycleRequest configures the Slm Get Lifecycle API request. // type SlmGetLifecycleRequest struct { - PolicyID string + PolicyID []string Pretty bool Human bool @@ -56,14 +56,14 @@ func (r SlmGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*R method = "GET" - path.Grow(1 + len("_slm") + 1 + len("policy") + 1 + len(r.PolicyID)) + path.Grow(1 + len("_slm") + 1 + len("policy") + 1 + len(strings.Join(r.PolicyID, ","))) path.WriteString("/") path.WriteString("_slm") path.WriteString("/") path.WriteString("policy") - if r.PolicyID != "" { + if len(r.PolicyID) > 0 { path.WriteString("/") - path.WriteString(r.PolicyID) + path.WriteString(strings.Join(r.PolicyID, ",")) } params = make(map[string]string) @@ -84,7 +84,10 @@ func (r SlmGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -134,7 +137,7 @@ func (f SlmGetLifecycle) WithContext(v context.Context) func(*SlmGetLifecycleReq // WithPolicyID - comma-separated list of snapshot lifecycle policies to retrieve. // -func (f SlmGetLifecycle) WithPolicyID(v string) func(*SlmGetLifecycleRequest) { +func (f SlmGetLifecycle) WithPolicyID(v ...string) func(*SlmGetLifecycleRequest) { return func(r *SlmGetLifecycleRequest) { r.PolicyID = v } @@ -184,3 +187,14 @@ func (f SlmGetLifecycle) WithHeader(h map[string]string) func(*SlmGetLifecycleRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SlmGetLifecycle) WithOpaqueID(s string) func(*SlmGetLifecycleRequest) { + return func(r *SlmGetLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.slm.put_lifecycle.go b/esapi/api.xpack.slm.put_lifecycle.go index 997c5fc87d..cd50103526 100644 --- a/esapi/api.xpack.slm.put_lifecycle.go +++ b/esapi/api.xpack.slm.put_lifecycle.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -85,7 +85,10 @@ func (r SlmPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -189,3 +192,14 @@ func (f SlmPutLifecycle) WithHeader(h map[string]string) func(*SlmPutLifecycleRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SlmPutLifecycle) WithOpaqueID(s string) func(*SlmPutLifecycleRequest) { + return func(r *SlmPutLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.sql.clear_cursor.go b/esapi/api.xpack.sql.clear_cursor.go index a65828b175..08a6180757 100644 --- a/esapi/api.xpack.sql.clear_cursor.go +++ b/esapi/api.xpack.sql.clear_cursor.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -76,7 +76,10 @@ func (r SQLClearCursorRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -172,3 +175,14 @@ func (f SQLClearCursor) WithHeader(h map[string]string) func(*SQLClearCursorRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SQLClearCursor) WithOpaqueID(s string) func(*SQLClearCursorRequest) { + return func(r *SQLClearCursorRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.sql.query.go b/esapi/api.xpack.sql.query.go index 33b4120b5d..39730dd7d6 100644 --- a/esapi/api.xpack.sql.query.go +++ b/esapi/api.xpack.sql.query.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r SQLQueryRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -186,3 +189,14 @@ func (f SQLQuery) WithHeader(h map[string]string) func(*SQLQueryRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SQLQuery) WithOpaqueID(s string) func(*SQLQueryRequest) { + return func(r *SQLQueryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.sql.translate.go b/esapi/api.xpack.sql.translate.go index 9453913be3..73113c912c 100644 --- a/esapi/api.xpack.sql.translate.go +++ b/esapi/api.xpack.sql.translate.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -76,7 +76,10 @@ func (r SQLTranslateRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -172,3 +175,14 @@ func (f SQLTranslate) WithHeader(h map[string]string) func(*SQLTranslateRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SQLTranslate) WithOpaqueID(s string) func(*SQLTranslateRequest) { + return func(r *SQLTranslateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ssl.certificates.go b/esapi/api.xpack.ssl.certificates.go index 94b7a84508..904a06c2e3 100644 --- a/esapi/api.xpack.ssl.certificates.go +++ b/esapi/api.xpack.ssl.certificates.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r SSLCertificatesRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f SSLCertificates) WithHeader(h map[string]string) func(*SSLCertificatesRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SSLCertificates) WithOpaqueID(s string) func(*SSLCertificatesRequest) { + return func(r *SSLCertificatesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.watcher.ack_watch.go b/esapi/api.xpack.watcher.ack_watch.go index 6a415315af..32b1f1cd01 100644 --- a/esapi/api.xpack.watcher.ack_watch.go +++ b/esapi/api.xpack.watcher.ack_watch.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -89,7 +89,10 @@ func (r WatcherAckWatchRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -189,3 +192,14 @@ func (f WatcherAckWatch) WithHeader(h map[string]string) func(*WatcherAckWatchRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f WatcherAckWatch) WithOpaqueID(s string) func(*WatcherAckWatchRequest) { + return func(r *WatcherAckWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.watcher.activate_watch.go b/esapi/api.xpack.watcher.activate_watch.go index ad59f96f60..cd2146d7fc 100644 --- a/esapi/api.xpack.watcher.activate_watch.go +++ b/esapi/api.xpack.watcher.activate_watch.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -84,7 +84,10 @@ func (r WatcherActivateWatchRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -176,3 +179,14 @@ func (f WatcherActivateWatch) WithHeader(h map[string]string) func(*WatcherActiv } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f WatcherActivateWatch) WithOpaqueID(s string) func(*WatcherActivateWatchRequest) { + return func(r *WatcherActivateWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.watcher.deactivate_watch.go b/esapi/api.xpack.watcher.deactivate_watch.go index f6b2e77d36..a5124e3985 100644 --- a/esapi/api.xpack.watcher.deactivate_watch.go +++ b/esapi/api.xpack.watcher.deactivate_watch.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -84,7 +84,10 @@ func (r WatcherDeactivateWatchRequest) Do(ctx context.Context, transport Transpo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -176,3 +179,14 @@ func (f WatcherDeactivateWatch) WithHeader(h map[string]string) func(*WatcherDea } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f WatcherDeactivateWatch) WithOpaqueID(s string) func(*WatcherDeactivateWatchRequest) { + return func(r *WatcherDeactivateWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.watcher.delete_watch.go b/esapi/api.xpack.watcher.delete_watch.go index 0684c521b2..1274e041e1 100644 --- a/esapi/api.xpack.watcher.delete_watch.go +++ b/esapi/api.xpack.watcher.delete_watch.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r WatcherDeleteWatchRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f WatcherDeleteWatch) WithHeader(h map[string]string) func(*WatcherDeleteW } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f WatcherDeleteWatch) WithOpaqueID(s string) func(*WatcherDeleteWatchRequest) { + return func(r *WatcherDeleteWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.watcher.execute_watch.go b/esapi/api.xpack.watcher.execute_watch.go index 5e3c5a782a..9fbdbf92d7 100644 --- a/esapi/api.xpack.watcher.execute_watch.go +++ b/esapi/api.xpack.watcher.execute_watch.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -96,7 +96,10 @@ func (r WatcherExecuteWatchRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -216,3 +219,14 @@ func (f WatcherExecuteWatch) WithHeader(h map[string]string) func(*WatcherExecut } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f WatcherExecuteWatch) WithOpaqueID(s string) func(*WatcherExecuteWatchRequest) { + return func(r *WatcherExecuteWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.watcher.get_watch.go b/esapi/api.xpack.watcher.get_watch.go index bf666ebbe9..3f089353fa 100644 --- a/esapi/api.xpack.watcher.get_watch.go +++ b/esapi/api.xpack.watcher.get_watch.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -82,7 +82,10 @@ func (r WatcherGetWatchRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -174,3 +177,14 @@ func (f WatcherGetWatch) WithHeader(h map[string]string) func(*WatcherGetWatchRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f WatcherGetWatch) WithOpaqueID(s string) func(*WatcherGetWatchRequest) { + return func(r *WatcherGetWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.watcher.put_watch.go b/esapi/api.xpack.watcher.put_watch.go index 47e4ceaa5a..9361d07d21 100644 --- a/esapi/api.xpack.watcher.put_watch.go +++ b/esapi/api.xpack.watcher.put_watch.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -107,7 +107,10 @@ func (r WatcherPutWatchRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -243,3 +246,14 @@ func (f WatcherPutWatch) WithHeader(h map[string]string) func(*WatcherPutWatchRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f WatcherPutWatch) WithOpaqueID(s string) func(*WatcherPutWatchRequest) { + return func(r *WatcherPutWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.watcher.start.go b/esapi/api.xpack.watcher.start.go index e0ce0fa647..b0f096242d 100644 --- a/esapi/api.xpack.watcher.start.go +++ b/esapi/api.xpack.watcher.start.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r WatcherStartRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f WatcherStart) WithHeader(h map[string]string) func(*WatcherStartRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f WatcherStart) WithOpaqueID(s string) func(*WatcherStartRequest) { + return func(r *WatcherStartRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.watcher.stats.go b/esapi/api.xpack.watcher.stats.go index ed135a9416..b2f8b19e34 100644 --- a/esapi/api.xpack.watcher.stats.go +++ b/esapi/api.xpack.watcher.stats.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -95,7 +95,10 @@ func (r WatcherStatsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -203,3 +206,14 @@ func (f WatcherStats) WithHeader(h map[string]string) func(*WatcherStatsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f WatcherStats) WithOpaqueID(s string) func(*WatcherStatsRequest) { + return func(r *WatcherStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.watcher.stop.go b/esapi/api.xpack.watcher.stop.go index d21e3f4cf7..d02a1fcc45 100644 --- a/esapi/api.xpack.watcher.stop.go +++ b/esapi/api.xpack.watcher.stop.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -75,7 +75,10 @@ func (r WatcherStopRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -167,3 +170,14 @@ func (f WatcherStop) WithHeader(h map[string]string) func(*WatcherStopRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f WatcherStop) WithOpaqueID(s string) func(*WatcherStopRequest) { + return func(r *WatcherStopRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.xpack.info.go b/esapi/api.xpack.xpack.info.go index c13475f3e3..c02762e67a 100644 --- a/esapi/api.xpack.xpack.info.go +++ b/esapi/api.xpack.xpack.info.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -81,7 +81,10 @@ func (r XPackInfoRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -181,3 +184,14 @@ func (f XPackInfo) WithHeader(h map[string]string) func(*XPackInfoRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackInfo) WithOpaqueID(s string) func(*XPackInfoRequest) { + return func(r *XPackInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.xpack.usage.go b/esapi/api.xpack.xpack.usage.go index e977dd3397..15d1c6c30e 100644 --- a/esapi/api.xpack.xpack.usage.go +++ b/esapi/api.xpack.xpack.usage.go @@ -1,8 +1,8 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. - -// Code generated from specification version 7.4.1: DO NOT EDIT +// +// Code generated from specification version 7.4.2: DO NOT EDIT package esapi @@ -80,7 +80,10 @@ func (r XPackUsageRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -180,3 +183,14 @@ func (f XPackUsage) WithHeader(h map[string]string) func(*XPackUsageRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackUsage) WithOpaqueID(s string) func(*XPackUsageRequest) { + return func(r *XPackUsageRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} From 4cfb2d7b99a123895c32ba4673d28a9351514521 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 22 Oct 2019 16:22:00 +0200 Subject: [PATCH 132/355] API: Add integration test for X-Opaque-ID and tasks (cherry picked from commit 8efb73c32e7fa9d1e2e905d9ec112d51382cabf4) --- esapi/esapi_integration_test.go | 131 ++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/esapi/esapi_integration_test.go b/esapi/esapi_integration_test.go index 685783d27a..e33d87a8ae 100644 --- a/esapi/esapi_integration_test.go +++ b/esapi/esapi_integration_test.go @@ -7,6 +7,7 @@ package esapi_test import ( + "bytes" "encoding/json" "fmt" "strings" @@ -14,6 +15,7 @@ import ( "time" "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" ) func TestAPI(t *testing.T) { @@ -62,4 +64,133 @@ func TestAPI(t *testing.T) { t.Errorf("Unexpected response body: doesn't start with '[200 OK] ---'; %s", res.String()) } }) + + t.Run("OpaqueID", func(t *testing.T) { + var ( + buf bytes.Buffer + + res *esapi.Response + err error + + requestID = "reindex-123" + ) + + es, err := elasticsearch.NewDefaultClient() + if err != nil { + t.Fatalf("Error creating the client: %s\n", err) + } + + // Prepare indices + // + es.Indices.Delete([]string{"test", "reindexed"}, es.Indices.Delete.WithIgnoreUnavailable(true)) + + // Index data + // + for j := 1; j <= 1000; j++ { + meta := []byte(fmt.Sprintf(`{ "index" : { "_id" : "%d" } }%s`, j, "\n")) + data := []byte(`{"content":"` + strings.Repeat("ABC", 100) + `"}`) + data = append(data, "\n"...) + + buf.Grow(len(meta) + len(data)) + buf.Write(meta) + buf.Write(data) + } + res, err = es.Bulk(bytes.NewReader(buf.Bytes()), es.Bulk.WithIndex("test"), es.Bulk.WithRefresh("true")) + if err != nil { + t.Fatalf("Failed to index data: %s", err) + } + res.Body.Close() + if res.IsError() { + t.Fatalf("Failed to index data: %s", res.Status()) + } + + // Launch reindexing task with wait_for_completion=false + // + res, err = es.Reindex( + strings.NewReader(`{"source":{"index":"test"}, "dest": {"index":"reindexed"}}`), + es.Reindex.WithWaitForCompletion(false), + es.Reindex.WithRequestsPerSecond(1), + es.Reindex.WithOpaqueID(requestID)) + if err != nil { + t.Fatalf("Failed to reindex: %s", err) + } + if res.IsError() { + t.Fatalf("Failed to reindex: %s", res.Status()) + } + time.Sleep(10 * time.Millisecond) + + res, err = es.Tasks.List(es.Tasks.List.WithPretty()) + if err != nil { + t.Fatalf("ERROR: %s", err) + } + res.Body.Close() + if res.IsError() { + t.Fatalf("Failed to get tasks: %s", res.Status()) + } + + // Get the list of tasks + // + res, err = es.Tasks.List(es.Tasks.List.WithPretty()) + if err != nil { + t.Fatalf("ERROR: %s", err) + } + defer res.Body.Close() + + if res.IsError() { + t.Fatalf("Failed to get tasks: %s", res.Status()) + } + + type task struct { + Node string + ID int + Action string + RunningTime time.Duration `json:"running_time_in_nanos"` + Cancellable bool + Headers map[string]interface{} + } + + type node struct { + Tasks map[string]task + } + + var nodes map[string]map[string]node + if err := json.NewDecoder(res.Body).Decode(&nodes); err != nil { + t.Fatalf("Failed to decode response: %s", err) + } + + var hasReindexTask bool + + for _, n := range nodes["nodes"] { + for taskID, task := range n.Tasks { + if task.Headers["X-Opaque-Id"] == requestID { + if strings.Contains(task.Action, "reindex") { + hasReindexTask = true + } + fmt.Printf("* %s, %s | %s (%s)\n", requestID, taskID, task.Action, task.RunningTime) + } + } + } + + if !hasReindexTask { + t.Errorf("Expected reindex task in %+v", nodes["nodes"]) + } + + for _, n := range nodes["nodes"] { + for taskID, task := range n.Tasks { + if task.Headers["X-Opaque-Id"] == requestID { + if task.Cancellable { + fmt.Printf("=> Closing task %s\n", taskID) + res, err = es.Tasks.Cancel(es.Tasks.Cancel.WithTaskID(taskID)) + if err != nil { + t.Fatalf("ERROR: %s", err) + } + res.Body.Close() + if res.IsError() { + t.Fatalf("Failed to cancel task: %s", res) + } + } + } + } + } + }) } From 3577217785804b31e2758962b952e0ab75eadb0b Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 8 Oct 2019 09:53:01 +0200 Subject: [PATCH 133/355] Transport: Add support for request retries This patch adds the configuration parameters and supporting logic for retrying a failed request: a feature common to official Elasticsearch clients. Executable example: ```golang //+build ignore package main import ( "context" "fmt" "log" "math" "net" "net/http" "os" "os/signal" "strings" "syscall" "time" "github.com/elastic/go-elasticsearch/v8" "github.com/elastic/go-elasticsearch/v8/esapi" "github.com/elastic/go-elasticsearch/v8/estransport" "github.com/cenkalti/backoff" ) var ( _ = fmt.Print _ = context.WithTimeout _ = math.Exp _ = strings.NewReader _ = http.DefaultClient ) func main() { log.SetFlags(0) ticker := time.NewTicker(time.Second) defer ticker.Stop() aborted := make(chan os.Signal) signal.Notify(aborted, os.Interrupt, syscall.SIGTERM) retryBackoff := backoff.NewExponentialBackOff() retryBackoff.InitialInterval = time.Second _ = retryBackoff cfg := elasticsearch.Config{ Addresses: []string{ "http://localhost:9200", // "http://localhost:1000", // "http://localhost:2000", // "http://localhost:3000", "http://localhost:4000", "http://localhost:5000", // "http://localhost:6000", // "http://localhost:7000", // "http://localhost:8000", // "http://localhost:9200", // "http://localhost:9000", // "http://localhost:9201", // "http://localhost:9202", }, Logger: &estransport.ColorLogger{ Output: os.Stdout, EnableRequestBody: true, EnableResponseBody: true, }, // RetryOnStatus: []int{404}, // EnableRetryOnTimeout: true, // MaxRetries: 10, // RetryBackoff: func(i int) time.Duration { // d := time.Duration(i) * time.Second // fmt.Printf("Attempt: %d | Sleeping for %s...\n", i, d) // return d // }, // RetryBackoff: func(i int) time.Duration { // d := time.Duration(math.Exp2(float64(i))) * time.Second // fmt.Printf("Attempt: %d | Sleeping for %s...\n", i, d) // return d // }, RetryBackoff: func(i int) time.Duration { if i == 1 { retryBackoff.Reset() } d := retryBackoff.NextBackOff() fmt.Printf("Attempt: %d | Sleeping for %s...\n", i, d) return d }, // Transport: &http.Transport{ // ResponseHeaderTimeout: time.Millisecond, // }, } es, err := elasticsearch.NewClient(cfg) if err != nil { log.Fatalf("Error creating the client: %s", err) } log.Println("Client ready with URLs:", es.Transport.(*estransport.Client).URLs()) go func() { <-aborted log.Println("\nDone!") os.Exit(0) }() for { select { case <-ticker.C: var ( res *esapi.Response err error ) // res, err = es.Info() // ctx, cancel := context.WithTimeout(context.Background(), time.Nanosecond) // defer cancel() // res, err = es.Info(es.Info.WithContext(ctx)) // es.Search(es.Search.WithTimeout(time.Nanosecond)) // res, err = es.Get("test", "MISSING") res, err = es.Index("test", strings.NewReader(`{"foo":"bar"}`)) if err != nil { if e, ok := err.(net.Error); ok { log.Fatalf("Error getting response: [%T]: %s (timeout:%v)", e, e, e.Timeout()) } else { log.Fatalf("Error getting response: [%T]: %s", err, err) } } if res.IsError() { log.Fatalf("Error response: %s", res.Status()) } } } } ``` Closes #67 (cherry picked from commit 7f37b7b9a63588ce18b365d4e07917dbda8e55a0) --- doc.go | 4 +- elasticsearch.go | 14 ++ esapi/doc.go | 5 +- esapi/esapi.request.go | 31 +-- estransport/doc.go | 13 +- estransport/estransport.go | 135 ++++++++--- estransport/estransport_internal_test.go | 291 ++++++++++++++++++++++- estransport/logger.go | 28 ++- 8 files changed, 448 insertions(+), 73 deletions(-) diff --git a/doc.go b/doc.go index 57fb06da81..853036c026 100644 --- a/doc.go +++ b/doc.go @@ -42,6 +42,8 @@ Call the Elasticsearch APIs by invoking the corresponding methods on the client: log.Println(res) -See the github.com/elastic/go-elasticsearch/esapi package for more information and examples. +See the github.com/elastic/go-elasticsearch/esapi package for more information about using the API. + +See the github.com/elastic/go-elasticsearch/estransport package for more information about configuring the transport. */ package elasticsearch diff --git a/elasticsearch.go b/elasticsearch.go index 334918e59c..c38d8a321e 100644 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -12,6 +12,7 @@ import ( "net/url" "os" "strings" + "time" "github.com/elastic/go-elasticsearch/v7/esapi" "github.com/elastic/go-elasticsearch/v7/estransport" @@ -36,6 +37,13 @@ type Config struct { CloudID string // Endpoint for the Elastic Service (https://elastic.co/cloud). APIKey string // Base64-encoded token for authorization; if set, overrides username and password. + RetryOnStatus []int // List of status codes for retry. Default: 502, 503, 504. + DisableRetry bool // Default: false. + EnableRetryOnTimeout bool // Default: false. + MaxRetries int // Default: 3. + + RetryBackoff func(attempt int) time.Duration // Optional backoff duration. Default: nil. + Transport http.RoundTripper // The HTTP transport object. Logger estransport.Logger // The logger object. } @@ -116,6 +124,12 @@ func NewClient(cfg Config) (*Client, error) { Password: cfg.Password, APIKey: cfg.APIKey, + RetryOnStatus: cfg.RetryOnStatus, + DisableRetry: cfg.DisableRetry, + EnableRetryOnTimeout: cfg.EnableRetryOnTimeout, + MaxRetries: cfg.MaxRetries, + RetryBackoff: cfg.RetryBackoff, + Transport: cfg.Transport, Logger: cfg.Logger, }) diff --git a/esapi/doc.go b/esapi/doc.go index 12d0815e43..f522175f99 100644 --- a/esapi/doc.go +++ b/esapi/doc.go @@ -85,10 +85,11 @@ about the API endpoints and parameters. The Go API is generated from the Elasticsearch JSON specification at https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/api by the internal package available at -https://github.com/elastic/go-elasticsearch/tree/master/internal/cmd/generate/commands. +https://github.com/elastic/go-elasticsearch/tree/master/internal/cmd/generate/commands/gensource. The API is tested by integration tests common to all Elasticsearch official clients, generated from the -source at https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/test. The generator is provided by the internal package internal/cmd/generate. +source at https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/test. +The generator is provided by the internal package available at internal/cmd/generate/commands/gentests. */ package esapi diff --git a/esapi/esapi.request.go b/esapi/esapi.request.go index 250c350332..d967fc61f5 100644 --- a/esapi/esapi.request.go +++ b/esapi/esapi.request.go @@ -5,13 +5,9 @@ package esapi import ( - "bytes" "context" "io" - "io/ioutil" "net/http" - "net/url" - "strings" ) const ( @@ -31,30 +27,5 @@ type Request interface { // newRequest creates an HTTP request. // func newRequest(method, path string, body io.Reader) (*http.Request, error) { - r := http.Request{ - Method: method, - URL: &url.URL{Path: path}, - Proto: "HTTP/1.1", - ProtoMajor: 1, - ProtoMinor: 1, - Header: make(http.Header), - } - - if body != nil { - switch b := body.(type) { - case *bytes.Buffer: - r.Body = ioutil.NopCloser(body) - r.ContentLength = int64(b.Len()) - case *bytes.Reader: - r.Body = ioutil.NopCloser(body) - r.ContentLength = int64(b.Len()) - case *strings.Reader: - r.Body = ioutil.NopCloser(body) - r.ContentLength = int64(b.Len()) - default: - r.Body = ioutil.NopCloser(body) - } - } - - return &r, nil + return http.NewRequest(method, path, body) } diff --git a/estransport/doc.go b/estransport/doc.go index aa3eba3f95..e65e34284f 100644 --- a/estransport/doc.go +++ b/estransport/doc.go @@ -4,12 +4,23 @@ Package estransport provides the transport layer for the Elasticsearch client. It is automatically included in the client provided by the github.com/elastic/go-elasticsearch package and is not intended for direct use: to configure the client, use the elasticsearch.Config struct. -The default HTTP transport of the client is http.Transport. +The default HTTP transport of the client is http.Transport; use the Transport option to customize it; +see the _examples/customization.go file in this repository for information. The package defines the "Selector" interface for getting a URL from the list. At the moment, the implementation is rather minimal: the client takes a slice of url.URL pointers, and round-robins across them when performing the request. +The package will automatically retry requests on network-related errors, and on specific +response status codes (by default 502, 503, 504). Use the RetryOnStatus option to customize the list. +The transport will not retry a timeout network error, unless enabled by setting EnableRetryOnTimeout to true. + +Use the MaxRetries option to configure the number of retries, and set DisableRetry to true +to disable the retry behaviour altogether. + +By default, the retry will be performed without any delay; to configure a backoff interval, +implement the RetryBackoff option function; see an example in the package unit tests for information. + The package defines the "Logger" interface for logging information about request and response. It comes with several bundled loggers for logging in text and JSON. diff --git a/estransport/estransport.go b/estransport/estransport.go index e46d13fce2..5500ea8a6c 100644 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -9,6 +9,7 @@ import ( "fmt" "io" "io/ioutil" + "net" "net/http" "net/url" "regexp" @@ -26,6 +27,9 @@ const Version = version.Client var ( userAgent string reGoVersion = regexp.MustCompile(`go(\d+\.\d+\..+)`) + + defaultMaxRetries = 3 + defaultRetryOnStatus = [...]int{502, 503, 504} ) func init() { @@ -46,6 +50,12 @@ type Config struct { Password string APIKey string + RetryOnStatus []int + DisableRetry bool + EnableRetryOnTimeout bool + MaxRetries int + RetryBackoff func(attempt int) time.Duration + Transport http.RoundTripper Logger Logger } @@ -58,6 +68,12 @@ type Client struct { password string apikey string + retryOnStatus []int + disableRetry bool + enableRetryOnTimeout bool + maxRetries int + retryBackoff func(attempt int) time.Duration + transport http.RoundTripper selector Selector logger Logger @@ -72,12 +88,26 @@ func New(cfg Config) *Client { cfg.Transport = http.DefaultTransport } + if len(cfg.RetryOnStatus) == 0 { + cfg.RetryOnStatus = defaultRetryOnStatus[:] + } + + if cfg.MaxRetries == 0 { + cfg.MaxRetries = defaultMaxRetries + } + return &Client{ urls: cfg.URLs, username: cfg.Username, password: cfg.Password, apikey: cfg.APIKey, + retryOnStatus: cfg.RetryOnStatus, + disableRetry: cfg.DisableRetry, + enableRetryOnTimeout: cfg.EnableRetryOnTimeout, + maxRetries: cfg.MaxRetries, + retryBackoff: cfg.RetryBackoff, + transport: cfg.Transport, selector: NewRoundRobinSelector(cfg.URLs...), logger: cfg.Logger, @@ -88,41 +118,86 @@ func New(cfg Config) *Client { // func (c *Client) Perform(req *http.Request) (*http.Response, error) { var ( - dupReqBody io.Reader - ) + res *http.Response + err error - // Get URL from the Selector - // - u, err := c.getURL() - if err != nil { - // TODO(karmi): Log error - return nil, fmt.Errorf("cannot get URL: %s", err) - } + dupReqBodyForLog io.ReadCloser + ) // Update request // - c.setURL(u, req) - c.setUserAgent(req) - c.setAuthorization(u, req) + c.setReqUserAgent(req) + + for i := 1; i <= c.maxRetries; i++ { + var ( + nodeURL *url.URL + shouldRetry bool + ) + + // Get URL from the Selector + // + nodeURL, err = c.getURL() + if err != nil { + // TODO(karmi): Log error + return nil, fmt.Errorf("cannot get URL: %s", err) + } - // Duplicate request body for logger - // - if c.logger != nil && c.logger.RequestBodyEnabled() { - if req.Body != nil && req.Body != http.NoBody { - dupReqBody, req.Body, _ = duplicateBody(req.Body) + // Update request + // + c.setReqURL(nodeURL, req) + c.setReqAuth(nodeURL, req) + + // Duplicate request body for logger + // + if c.logger != nil && c.logger.RequestBodyEnabled() { + if req.Body != nil && req.Body != http.NoBody { + dupReqBodyForLog, req.Body, _ = duplicateBody(req.Body) + } } - } - // Set up time measures and execute the request - // - start := time.Now().UTC() - res, err := c.transport.RoundTrip(req) - dur := time.Since(start) + // Set up time measures and execute the request + // + start := time.Now().UTC() + res, err = c.transport.RoundTrip(req) + dur := time.Since(start) - // Log request and response - // - if c.logger != nil { - c.logRoundTrip(req, res, dupReqBody, err, start, dur) + // Log request and response + // + if c.logger != nil { + c.logRoundTrip(req, res, dupReqBodyForLog, err, start, dur) + } + + // Retry only on network errors, but don't retry on timeout errors, unless configured + // + if err != nil { + if err, ok := err.(net.Error); ok { + if (!err.Timeout() || c.enableRetryOnTimeout) && !c.disableRetry { + shouldRetry = true + } + } + } + + // Retry on configured response statuses + // + if res != nil && !c.disableRetry { + for _, code := range c.retryOnStatus { + if res.StatusCode == code { + shouldRetry = true + } + } + } + + // Break if retry should not be performed + // + if !shouldRetry { + break + } + + // Delay the retry if a backoff function is configured + // + if c.retryBackoff != nil { + time.Sleep(c.retryBackoff(i)) + } } // TODO(karmi): Wrap error @@ -139,7 +214,7 @@ func (c *Client) getURL() (*url.URL, error) { return c.selector.Select() } -func (c *Client) setURL(u *url.URL, req *http.Request) *http.Request { +func (c *Client) setReqURL(u *url.URL, req *http.Request) *http.Request { req.URL.Scheme = u.Scheme req.URL.Host = u.Host @@ -154,7 +229,7 @@ func (c *Client) setURL(u *url.URL, req *http.Request) *http.Request { return req } -func (c *Client) setAuthorization(u *url.URL, req *http.Request) *http.Request { +func (c *Client) setReqAuth(u *url.URL, req *http.Request) *http.Request { if _, ok := req.Header["Authorization"]; !ok { if u.User != nil { password, _ := u.User.Password() @@ -180,7 +255,7 @@ func (c *Client) setAuthorization(u *url.URL, req *http.Request) *http.Request { return req } -func (c *Client) setUserAgent(req *http.Request) *http.Request { +func (c *Client) setReqUserAgent(req *http.Request) *http.Request { req.Header.Set("User-Agent", userAgent) return req } diff --git a/estransport/estransport_internal_test.go b/estransport/estransport_internal_test.go index 4a2b812a27..eb6f28eb1e 100644 --- a/estransport/estransport_internal_test.go +++ b/estransport/estransport_internal_test.go @@ -10,8 +10,10 @@ import ( "fmt" "net/http" "net/url" + "reflect" "strings" "testing" + "time" ) var ( @@ -26,6 +28,11 @@ func (t *mockTransp) RoundTrip(req *http.Request) (*http.Response, error) { return t.RoundTripFunc(req) } +type mockNetError struct{ error } + +func (e *mockNetError) Timeout() bool { return false } +func (e *mockNetError) Temporary() bool { return false } + func TestTransport(t *testing.T) { t.Run("Interface", func(t *testing.T) { var _ Interface = New(Config{}) @@ -61,6 +68,53 @@ func TestTransport(t *testing.T) { }) } +func TestTransportConfig(t *testing.T) { + t.Run("Defaults", func(t *testing.T) { + tp := New(Config{}) + + if !reflect.DeepEqual(tp.retryOnStatus, []int{502, 503, 504}) { + t.Errorf("Unexpected retryOnStatus: %v", tp.retryOnStatus) + } + + if tp.disableRetry { + t.Errorf("Unexpected disableRetry: %v", tp.disableRetry) + } + + if tp.enableRetryOnTimeout { + t.Errorf("Unexpected enableRetryOnTimeout: %v", tp.enableRetryOnTimeout) + } + + if tp.maxRetries != 3 { + t.Errorf("Unexpected maxRetries: %v", tp.maxRetries) + } + }) + + t.Run("Custom", func(t *testing.T) { + tp := New(Config{ + RetryOnStatus: []int{404, 408}, + DisableRetry: true, + EnableRetryOnTimeout: true, + MaxRetries: 5, + }) + + if !reflect.DeepEqual(tp.retryOnStatus, []int{404, 408}) { + t.Errorf("Unexpected retryOnStatus: %v", tp.retryOnStatus) + } + + if !tp.disableRetry { + t.Errorf("Unexpected disableRetry: %v", tp.disableRetry) + } + + if !tp.enableRetryOnTimeout { + t.Errorf("Unexpected enableRetryOnTimeout: %v", tp.enableRetryOnTimeout) + } + + if tp.maxRetries != 5 { + t.Errorf("Unexpected maxRetries: %v", tp.maxRetries) + } + }) +} + func TestTransportPerform(t *testing.T) { t.Run("Executes", func(t *testing.T) { u, _ := url.Parse("https://foo.com/bar") @@ -87,7 +141,7 @@ func TestTransportPerform(t *testing.T) { tp := New(Config{URLs: []*url.URL{u}}) req, _ := http.NewRequest("GET", "/abc", nil) - tp.setURL(u, req) + tp.setReqURL(u, req) expected := "https://foo.com/bar/abc" @@ -101,7 +155,7 @@ func TestTransportPerform(t *testing.T) { tp := New(Config{URLs: []*url.URL{u}}) req, _ := http.NewRequest("GET", "/", nil) - tp.setAuthorization(u, req) + tp.setReqAuth(u, req) username, password, ok := req.BasicAuth() if !ok { @@ -118,7 +172,7 @@ func TestTransportPerform(t *testing.T) { tp := New(Config{URLs: []*url.URL{u}, Username: "foo", Password: "bar"}) req, _ := http.NewRequest("GET", "/", nil) - tp.setAuthorization(u, req) + tp.setReqAuth(u, req) username, password, ok := req.BasicAuth() if !ok { @@ -135,7 +189,7 @@ func TestTransportPerform(t *testing.T) { tp := New(Config{URLs: []*url.URL{u}, APIKey: "Zm9vYmFy"}) // foobar req, _ := http.NewRequest("GET", "/", nil) - tp.setAuthorization(u, req) + tp.setReqAuth(u, req) value := req.Header.Get("Authorization") if value == "" { @@ -152,7 +206,7 @@ func TestTransportPerform(t *testing.T) { tp := New(Config{URLs: []*url.URL{u}}) req, _ := http.NewRequest("GET", "/abc", nil) - tp.setUserAgent(req) + tp.setReqUserAgent(req) if !strings.HasPrefix(req.UserAgent(), "go-elasticsearch") { t.Errorf("Unexpected user agent: %s", req.UserAgent()) @@ -175,6 +229,233 @@ func TestTransportPerform(t *testing.T) { }) } +func TestTransportPerformRetries(t *testing.T) { + t.Run("Retry request on network error and return the response", func(t *testing.T) { + var ( + i int + numReqs = 2 + ) + + u, _ := url.Parse("http://foo.bar") + tp := New(Config{ + URLs: []*url.URL{u, u, u}, + Transport: &mockTransp{ + RoundTripFunc: func(req *http.Request) (*http.Response, error) { + i++ + fmt.Printf("Request #%d", i) + if i == numReqs { + fmt.Print(": OK\n") + return &http.Response{Status: "OK"}, nil + } + fmt.Print(": ERR\n") + return nil, &mockNetError{error: fmt.Errorf("Mock network error (%d)", i)} + }, + }}) + + req, _ := http.NewRequest("GET", "/abc", nil) + + res, err := tp.Perform(req) + + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if res.Status != "OK" { + t.Errorf("Unexpected response: %+v", res) + } + + if i != numReqs { + t.Errorf("Unexpected number of requests, want=%d, got=%d", numReqs, i) + } + }) + + t.Run("Retry request on 5xx response and return new response", func(t *testing.T) { + var ( + i int + numReqs = 2 + ) + + u, _ := url.Parse("http://foo.bar") + tp := New(Config{ + URLs: []*url.URL{u, u, u}, + Transport: &mockTransp{ + RoundTripFunc: func(req *http.Request) (*http.Response, error) { + i++ + fmt.Printf("Request #%d", i) + if i == numReqs { + fmt.Print(": 200\n") + return &http.Response{StatusCode: 200}, nil + } + fmt.Print(": 502\n") + return &http.Response{StatusCode: 502}, nil + }, + }}) + + req, _ := http.NewRequest("GET", "/abc", nil) + + res, err := tp.Perform(req) + + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if res.StatusCode != 200 { + t.Errorf("Unexpected response: %+v", res) + } + + if i != numReqs { + t.Errorf("Unexpected number of requests, want=%d, got=%d", numReqs, i) + } + }) + + t.Run("Retry request and return error when max retries exhausted", func(t *testing.T) { + var ( + i int + numReqs = 3 + ) + + u, _ := url.Parse("http://foo.bar") + tp := New(Config{ + URLs: []*url.URL{u, u, u}, + Transport: &mockTransp{ + RoundTripFunc: func(req *http.Request) (*http.Response, error) { + i++ + fmt.Printf("Request #%d", i) + fmt.Print(": ERR\n") + return nil, &mockNetError{error: fmt.Errorf("Mock network error (%d)", i)} + }, + }}) + + req, _ := http.NewRequest("GET", "/abc", nil) + + res, err := tp.Perform(req) + + if err == nil { + t.Fatalf("Expected error, got: %v", err) + } + + if res != nil { + t.Errorf("Unexpected response: %+v", res) + } + + if i != numReqs { + t.Errorf("Unexpected number of requests, want=%d, got=%d", numReqs, i) + } + }) + + t.Run("Don't retry request on regular error", func(t *testing.T) { + var i int + + u, _ := url.Parse("http://foo.bar") + tp := New(Config{ + URLs: []*url.URL{u, u, u}, + Transport: &mockTransp{ + RoundTripFunc: func(req *http.Request) (*http.Response, error) { + i++ + fmt.Printf("Request #%d", i) + fmt.Print(": ERR\n") + return nil, fmt.Errorf("Mock regular error (%d)", i) + }, + }}) + + req, _ := http.NewRequest("GET", "/abc", nil) + + res, err := tp.Perform(req) + + if err == nil { + t.Fatalf("Expected error, got: %v", err) + } + + if res != nil { + t.Errorf("Unexpected response: %+v", res) + } + + if i != 1 { + t.Errorf("Unexpected number of requests, want=%d, got=%d", 1, i) + } + }) + + t.Run("Don't retry request when retries are disabled", func(t *testing.T) { + var i int + + u, _ := url.Parse("http://foo.bar") + tp := New(Config{ + URLs: []*url.URL{u, u, u}, + Transport: &mockTransp{ + RoundTripFunc: func(req *http.Request) (*http.Response, error) { + i++ + fmt.Printf("Request #%d", i) + fmt.Print(": ERR\n") + return nil, &mockNetError{error: fmt.Errorf("Mock network error (%d)", i)} + }, + }, + DisableRetry: true, + }) + + req, _ := http.NewRequest("GET", "/abc", nil) + tp.Perform(req) + + if i != 1 { + t.Errorf("Unexpected number of requests, want=%d, got=%d", 1, i) + } + }) + + t.Run("Delay the retry with a backoff function", func(t *testing.T) { + var ( + i int + numReqs = 3 + start = time.Now() + expectedDuration = time.Duration(numReqs*100) * time.Millisecond + ) + + u, _ := url.Parse("http://foo.bar") + tp := New(Config{ + URLs: []*url.URL{u, u, u}, + Transport: &mockTransp{ + RoundTripFunc: func(req *http.Request) (*http.Response, error) { + i++ + fmt.Printf("Request #%d", i) + if i == numReqs { + fmt.Print(": OK\n") + return &http.Response{Status: "OK"}, nil + } + fmt.Print(": ERR\n") + return nil, &mockNetError{error: fmt.Errorf("Mock network error (%d)", i)} + }, + }, + + // A simple incremental backoff function + // + RetryBackoff: func(i int) time.Duration { + d := time.Duration(i) * 100 * time.Millisecond + fmt.Printf("Attempt: %d | Sleeping for %s...\n", i, d) + return d + }, + }) + + req, _ := http.NewRequest("GET", "/abc", nil) + + res, err := tp.Perform(req) + end := time.Since(start) + + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if res.Status != "OK" { + t.Errorf("Unexpected response: %+v", res) + } + + if i != numReqs { + t.Errorf("Unexpected number of requests, want=%d, got=%d", numReqs, i) + } + + if end < expectedDuration { + t.Errorf("Unexpected duration, want=>%s, got=%s", expectedDuration, end) + } + }) +} + func TestTransportSelector(t *testing.T) { t.Run("Nil value", func(t *testing.T) { tp := New(Config{URLs: []*url.URL{nil}}) diff --git a/estransport/logger.go b/estransport/logger.go index 85af2fce55..263c80c5a5 100644 --- a/estransport/logger.go +++ b/estransport/logger.go @@ -74,7 +74,12 @@ func (l *TextLogger) LogRoundTrip(req *http.Request, res *http.Response, err err ) if l.RequestBodyEnabled() && req != nil && req.Body != nil && req.Body != http.NoBody { var buf bytes.Buffer - buf.ReadFrom(req.Body) + if req.GetBody != nil { + b, _ := req.GetBody() + buf.ReadFrom(b) + } else { + buf.ReadFrom(req.Body) + } logBodyAsText(l.Output, &buf, ">") } if l.ResponseBodyEnabled() && res != nil && res.Body != nil && res.Body != http.NoBody { @@ -134,7 +139,12 @@ func (l *ColorLogger) LogRoundTrip(req *http.Request, res *http.Response, err er if l.RequestBodyEnabled() && req != nil && req.Body != nil && req.Body != http.NoBody { var buf bytes.Buffer - buf.ReadFrom(req.Body) + if req.GetBody != nil { + b, _ := req.GetBody() + buf.ReadFrom(b) + } else { + buf.ReadFrom(req.Body) + } fmt.Fprint(l.Output, "\x1b[2m") logBodyAsText(l.Output, &buf, " »") fmt.Fprint(l.Output, "\x1b[0m") @@ -211,7 +221,12 @@ func (l *CurlLogger) LogRoundTrip(req *http.Request, res *http.Response, err err if req != nil && req.Body != nil && req.Body != http.NoBody { var buf bytes.Buffer - buf.ReadFrom(req.Body) + if req.GetBody != nil { + b, _ := req.GetBody() + buf.ReadFrom(b) + } else { + buf.ReadFrom(req.Body) + } b.Grow(buf.Len()) b.WriteString(" -d \\\n'") @@ -314,7 +329,12 @@ func (l *JSONLogger) LogRoundTrip(req *http.Request, res *http.Response, err err appendQuote(req.Method) if l.RequestBodyEnabled() && req != nil && req.Body != nil && req.Body != http.NoBody { var buf bytes.Buffer - buf.ReadFrom(req.Body) + if req.GetBody != nil { + b, _ := req.GetBody() + buf.ReadFrom(b) + } else { + buf.ReadFrom(req.Body) + } b.Grow(buf.Len() + 8) b.WriteString(`,"body":`) From fb7bdd15c1e392734922bece65d3c203a4aefb95 Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Wed, 9 Oct 2019 15:22:48 +0800 Subject: [PATCH 134/355] Transport: Fix error when request body was drained during retry The changes introduced in 7f37b7b caused a bug: when the request has been retried, the body was already drained, and therefore wasn't sent. This patch fixes the bug by defining the `GetBody()` method for the request. Closes #92 (cherry picked from commit f4e764f18a3a5a154b0643d8055c83fd58d90b0a) --- estransport/estransport.go | 37 +++++++++++++++--------- estransport/estransport_internal_test.go | 35 ++++++++++++++++++++++ 2 files changed, 58 insertions(+), 14 deletions(-) diff --git a/estransport/estransport.go b/estransport/estransport.go index 5500ea8a6c..fff937d1cc 100644 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -120,14 +120,26 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { var ( res *http.Response err error - - dupReqBodyForLog io.ReadCloser ) // Update request // c.setReqUserAgent(req) + if req.Body != nil && req.Body != http.NoBody && req.GetBody == nil { + if !c.disableRetry || (c.logger != nil && c.logger.RequestBodyEnabled()) { + var buf bytes.Buffer + buf.ReadFrom(req.Body) + req.GetBody = func() (io.ReadCloser, error) { + r := buf + return ioutil.NopCloser(&r), nil + } + if req.Body, err = req.GetBody(); err != nil { + return nil, fmt.Errorf("cannot get request body: %s", err) + } + } + } + for i := 1; i <= c.maxRetries; i++ { var ( nodeURL *url.URL @@ -147,12 +159,12 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { c.setReqURL(nodeURL, req) c.setReqAuth(nodeURL, req) - // Duplicate request body for logger - // - if c.logger != nil && c.logger.RequestBodyEnabled() { - if req.Body != nil && req.Body != http.NoBody { - dupReqBodyForLog, req.Body, _ = duplicateBody(req.Body) + if !c.disableRetry && i > 1 && req.Body != nil && req.Body != http.NoBody { + body, err := req.GetBody() + if err != nil { + return nil, fmt.Errorf("cannot get request body: %s", err) } + req.Body = body } // Set up time measures and execute the request @@ -164,7 +176,10 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { // Log request and response // if c.logger != nil { - c.logRoundTrip(req, res, dupReqBodyForLog, err, start, dur) + if c.logger.RequestBodyEnabled() && req.Body != nil && req.Body != http.NoBody { + req.Body, _ = req.GetBody() + } + c.logRoundTrip(req, res, err, start, dur) } // Retry only on network errors, but don't retry on timeout errors, unless configured @@ -263,7 +278,6 @@ func (c *Client) setReqUserAgent(req *http.Request) *http.Request { func (c *Client) logRoundTrip( req *http.Request, res *http.Response, - reqBody io.Reader, err error, start time.Time, dur time.Duration, @@ -272,11 +286,6 @@ func (c *Client) logRoundTrip( if res != nil { dupRes = *res } - if c.logger.RequestBodyEnabled() { - if req.Body != nil && req.Body != http.NoBody { - req.Body = ioutil.NopCloser(reqBody) - } - } if c.logger.ResponseBodyEnabled() { if res != nil && res.Body != nil && res.Body != http.NoBody { b1, b2, _ := duplicateBody(res.Body) diff --git a/estransport/estransport_internal_test.go b/estransport/estransport_internal_test.go index eb6f28eb1e..c0e56c6de2 100644 --- a/estransport/estransport_internal_test.go +++ b/estransport/estransport_internal_test.go @@ -8,6 +8,7 @@ package estransport import ( "fmt" + "io/ioutil" "net/http" "net/url" "reflect" @@ -343,6 +344,40 @@ func TestTransportPerformRetries(t *testing.T) { } }) + t.Run("Reset request body during retry", func(t *testing.T) { + var bodies []string + u, _ := url.Parse("https://foo.com/bar") + tp := New(Config{ + URLs: []*url.URL{u}, + Transport: &mockTransp{ + RoundTripFunc: func(req *http.Request) (*http.Response, error) { + body, err := ioutil.ReadAll(req.Body) + if err != nil { + panic(err) + } + bodies = append(bodies, string(body)) + return &http.Response{Status: "MOCK", StatusCode: 502}, nil + }, + }}, + ) + + req, _ := http.NewRequest("POST", "/abc", strings.NewReader("FOOBAR")) + res, err := tp.Perform(req) + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + _ = res + + if n := len(bodies); n != 3 { + t.Fatalf("expected 3 requests, got %d", n) + } + for i, body := range bodies { + if body != "FOOBAR" { + t.Fatalf("request %d body: expected %q, got %q", i, "FOOBAR", body) + } + } + }) + t.Run("Don't retry request on regular error", func(t *testing.T) { var i int From fa26ddf093655cdc19e82280668d9790a16ce619 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 9 Oct 2019 10:57:58 +0200 Subject: [PATCH 135/355] Transport: Add integration test for duplicating and resetting the request body (cherry picked from commit 79ac51cdae63bbd2b93bc1893d6d7dc1ae462800) --- .../estransport_integration_multinode_test.go | 72 +++++++++++++++ estransport/estransport_integration_test.go | 90 +++++++++---------- 2 files changed, 116 insertions(+), 46 deletions(-) create mode 100644 estransport/estransport_integration_multinode_test.go diff --git a/estransport/estransport_integration_multinode_test.go b/estransport/estransport_integration_multinode_test.go new file mode 100644 index 0000000000..dda9e136f2 --- /dev/null +++ b/estransport/estransport_integration_multinode_test.go @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build integration,multinode + +package estransport_test + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + "testing" + + "github.com/elastic/go-elasticsearch/v8/estransport" +) + +var ( + _ = fmt.Print +) + +func TestTransportSelector(t *testing.T) { + NodeName := func(t *testing.T, transport estransport.Interface) string { + req, err := http.NewRequest("GET", "/", nil) + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + res, err := transport.Perform(req) + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + fmt.Printf("> GET %s\n", req.URL) + + r := struct { + Name string + }{} + + if err := json.NewDecoder(res.Body).Decode(&r); err != nil { + t.Fatalf("Error parsing the response body: %s", err) + } + + return r.Name + } + + t.Run("RoundRobin", func(t *testing.T) { + var ( + node string + ) + transport := estransport.New(estransport.Config{URLs: []*url.URL{ + {Scheme: "http", Host: "localhost:9200"}, + {Scheme: "http", Host: "localhost:9201"}, + }}) + + node = NodeName(t, transport) + if node != "es1" { + t.Errorf("Unexpected node, want=e1, got=%s", node) + } + + node = NodeName(t, transport) + if node != "es2" { + t.Errorf("Unexpected node, want=e1, got=%s", node) + } + + node = NodeName(t, transport) + if node != "es1" { + t.Errorf("Unexpected node, want=e1, got=%s", node) + } + }) +} diff --git a/estransport/estransport_integration_test.go b/estransport/estransport_integration_test.go index ed1ce5844d..cbecc632dd 100644 --- a/estransport/estransport_integration_test.go +++ b/estransport/estransport_integration_test.go @@ -2,73 +2,71 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -// +build integration,multinode +// +build integration package estransport_test import ( - "encoding/json" + "bytes" "fmt" + "io" + "io/ioutil" "net/http" + "net/http/httptest" "net/url" + "strings" "testing" "github.com/elastic/go-elasticsearch/v7/estransport" + "github.com/elastic/go-elasticsearch/v7/esutil" ) var ( _ = fmt.Print ) -func TestTransportSelector(t *testing.T) { +func TestTransportRetries(t *testing.T) { + var counter int - NodeName := func(t *testing.T, transport estransport.Interface) string { - req, err := http.NewRequest("GET", "/", nil) - if err != nil { - t.Fatalf("Unexpected error: %s", err) - } + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + counter++ - res, err := transport.Perform(req) - if err != nil { - t.Fatalf("Unexpected error: %s", err) - } + body, _ := ioutil.ReadAll(r.Body) + fmt.Println("req.Body:", string(body)) - fmt.Printf("> GET %s\n", req.URL) + http.Error(w, "FAKE 502", http.StatusBadGateway) + })) + serverURL, _ := url.Parse(server.URL) - r := struct { - Name string - }{} + transport := estransport.New(estransport.Config{URLs: []*url.URL{serverURL}}) - if err := json.NewDecoder(res.Body).Decode(&r); err != nil { - t.Fatalf("Error parsing the response body: %s", err) - } - - return r.Name + bodies := []io.Reader{ + strings.NewReader(`FAKE`), + esutil.NewJSONReader(`FAKE`), } - t.Run("RoundRobin", func(t *testing.T) { - var ( - node string - ) - transport := estransport.New(estransport.Config{URLs: []*url.URL{ - {Scheme: "http", Host: "localhost:9200"}, - {Scheme: "http", Host: "localhost:9201"}, - }}) - - node = NodeName(t, transport) - if node != "es1" { - t.Errorf("Unexpected node, want=e1, got=%s", node) - } - - node = NodeName(t, transport) - if node != "es2" { - t.Errorf("Unexpected node, want=e1, got=%s", node) - } - - node = NodeName(t, transport) - if node != "es1" { - t.Errorf("Unexpected node, want=e1, got=%s", node) - } - - }) + for _, body := range bodies { + t.Run(fmt.Sprintf("Reset the %T request body", body), func(t *testing.T) { + counter = 0 + + req, err := http.NewRequest("GET", "/", body) + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + res, err := transport.Perform(req) + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + body, _ := ioutil.ReadAll(res.Body) + + fmt.Println("> GET", req.URL) + fmt.Printf("< %s (tries: %d)\n", bytes.TrimSpace(body), counter) + + if counter != 3 { + t.Errorf("Unexpected number of retries, want=3, got=%d", counter) + } + }) + } } From b23c215ea350064493778fcad8d9cbd051d0fc7c Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 28 Oct 2019 09:42:58 +0100 Subject: [PATCH 136/355] Transport: Add connection pool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds support for the "connection pool" feature, standard in official Elasticsearch clients, which maintains state for node connections passed in configuration, and removes connections with failures from the list of live connections. It periodically adds them back to the list, with an exponentional backoff delay. The main parts of the implementation are contained in the connection.go file. The implementation short-circuits the connection pooling when only a single URL has been passed in configuration — common when using Elastic Cloud or a proxy/load balancer in front of Elasticsearch. When multiple URLs are passed, they are added to the list of live connections, and returned in a round-robin fashion from the Next() method. When the connection fails to respond to a request, it is removed from the list of live connections, put into the list of dead connections, and scheduled for a "resurrect" attempt. In case no live connection is available, a dead connection is forcibly resurrected. A sync.Mutex is used for synchronization. For easier debugging, the implementation allows to use the EnableDebugLogger option to print debugging statements related to connection management to STDOUT. This patch also adds support for collecting and getting client metrics: number of requests and failures, statistics for specific response codes, and the contents of the live/dead connection lists. An example for usage with the expvar package is provided in _examples/instrumentation/expvar.go. Integration with APM and other instrumentation tools will be researched and documented in future. Closes #95 (cherry picked from commit 365fc2458d4135cdd9613cb6bcb772d41e81522f) --- _examples/instrumentation/Makefile | 1 + _examples/instrumentation/expvar.go | 132 ++++++++ elasticsearch.go | 15 + elasticsearch_internal_test.go | 13 + estransport/connection.go | 280 ++++++++++++++++ estransport/connection_benchmark_test.go | 206 ++++++++++++ estransport/connection_integration_test.go | 139 ++++++++ estransport/connection_internal_test.go | 353 +++++++++++++++++++++ estransport/doc.go | 10 +- estransport/estransport.go | 113 ++++++- estransport/estransport_internal_test.go | 156 ++++----- estransport/logger.go | 27 ++ estransport/metrics.go | 195 ++++++++++++ estransport/metrics_internal_test.go | 132 ++++++++ estransport/selector.go | 58 ---- 15 files changed, 1660 insertions(+), 170 deletions(-) create mode 100644 _examples/instrumentation/expvar.go create mode 100644 estransport/connection.go create mode 100644 estransport/connection_benchmark_test.go create mode 100644 estransport/connection_integration_test.go create mode 100644 estransport/connection_internal_test.go create mode 100644 estransport/metrics.go create mode 100644 estransport/metrics_internal_test.go delete mode 100644 estransport/selector.go diff --git a/_examples/instrumentation/Makefile b/_examples/instrumentation/Makefile index 0e16dc3ae1..5188c8666c 100644 --- a/_examples/instrumentation/Makefile +++ b/_examples/instrumentation/Makefile @@ -1,4 +1,5 @@ test: + go build -o /dev/null expvar.go go build -o /dev/null opencensus.go go build -o /dev/null apmelasticsearch.go diff --git a/_examples/instrumentation/expvar.go b/_examples/instrumentation/expvar.go new file mode 100644 index 0000000000..4b90f481c0 --- /dev/null +++ b/_examples/instrumentation/expvar.go @@ -0,0 +1,132 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +package main + +import ( + "expvar" + "fmt" + "io" + "log" + "os" + "os/signal" + "runtime" + "strings" + "syscall" + "time" + + // Import the "expvar" and "pprof" package >>>>>>>>>> + + "net/http" + _ "net/http/pprof" + // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + "golang.org/x/crypto/ssh/terminal" + + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/estransport" +) + +var ( + tWidth, _, _ = terminal.GetSize(int(os.Stdout.Fd())) +) + +func init() { + runtime.SetMutexProfileFraction(10) +} + +func main() { + log.SetFlags(0) + + ticker := time.NewTicker(time.Second) + defer ticker.Stop() + + aborted := make(chan os.Signal) + signal.Notify(aborted, os.Interrupt, syscall.SIGINT, syscall.SIGTERM) + + go func() { + <-aborted + + log.Println("\nDone!\n") + os.Exit(0) + }() + + log.Println(strings.Repeat("─", tWidth)) + log.Println("Open to see all exported variables.") + log.Println(strings.Repeat("─", tWidth)) + + // Start the debug server >>>>>>>>>>>>>>>>>>>>>>>>>>> + go func() { log.Fatalln(http.ListenAndServe("localhost:6060", nil)) }() + // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + for i := 1; i <= 2; i++ { + go func(i int) { + log.Printf("==> Starting server on ", i) + if err := http.ListenAndServe( + fmt.Sprintf("localhost:1000%d", i), + http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { io.WriteString(w, "OK\n") }), + ); err != nil && err != http.ErrServerClosed { + log.Fatalf("Unable to start server: %s", err) + } + }(i) + } + + es, err := elasticsearch.NewClient( + elasticsearch.Config{ + Addresses: []string{ + "http://localhost:10001", + "http://localhost:10002", + "http://localhost:10003", + }, + + Logger: &estransport.ColorLogger{Output: os.Stdout}, + DisableRetry: true, + EnableDebugLogger: true, + + // Enable metric collection >>>>>>>>>>>>>>>>>>>>>>>>> + EnableMetrics: true, + // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + }) + if err != nil { + log.Fatal("ERROR: %s", err) + } + + // Publish client metrics to expvar >>>>>>>>>>>>>>>>> + expvar.Publish("go-elasticsearch", expvar.Func(func() interface{} { m, _ := es.Metrics(); return m })) + // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + for { + select { + case t := <-ticker.C: + + go func() { + if res, _ := es.Info(); res != nil { + res.Body.Close() + } + }() + + go func() { + if res, _ := es.Cluster.Health(); res != nil { + res.Body.Close() + } + }() + + if t.Second()%5 == 0 { + m, err := es.Metrics() + if err != nil { + log.Printf("\x1b[31;1mUnable to get metrics: %s\x1b[0m", err) + continue + } + log.Println("███", fmt.Sprintf("\x1b[1m%s\x1b[0m", "Metrics"), strings.Repeat("█", tWidth-12)) + log.Printf( + ""+ + " \x1b[2mRequests: \x1b[0m %d\n"+ + " \x1b[2mFailures: \x1b[0m %d\n"+ + " \x1b[2mLive nodes:\x1b[0m %s", + m.Requests, m.Failures, m.Live) + log.Println(strings.Repeat("─", tWidth)) + } + } + } +} diff --git a/elasticsearch.go b/elasticsearch.go index c38d8a321e..3c4491075f 100644 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -42,6 +42,9 @@ type Config struct { EnableRetryOnTimeout bool // Default: false. MaxRetries int // Default: 3. + EnableMetrics bool // Enable the metrics collection. + EnableDebugLogger bool // Enable the debug logging. + RetryBackoff func(attempt int) time.Duration // Optional backoff duration. Default: nil. Transport http.RoundTripper // The HTTP transport object. @@ -130,6 +133,9 @@ func NewClient(cfg Config) (*Client, error) { MaxRetries: cfg.MaxRetries, RetryBackoff: cfg.RetryBackoff, + EnableMetrics: cfg.EnableMetrics, + EnableDebugLogger: cfg.EnableDebugLogger, + Transport: cfg.Transport, Logger: cfg.Logger, }) @@ -143,6 +149,15 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { return c.Transport.Perform(req) } +// Metrics returns the client metrics. +// +func (c *Client) Metrics() (estransport.Metrics, error) { + if mt, ok := c.Transport.(estransport.Measurable); ok { + return mt.Metrics() + } + return estransport.Metrics{}, errors.New("transport is missing method Metrics()") +} + // addrsFromEnvironment returns a list of addresses by splitting // the ELASTICSEARCH_URL environment variable with comma, or an empty list. // diff --git a/elasticsearch_internal_test.go b/elasticsearch_internal_test.go index 92081ad7d9..615f837957 100644 --- a/elasticsearch_internal_test.go +++ b/elasticsearch_internal_test.go @@ -279,3 +279,16 @@ func TestVersion(t *testing.T) { t.Error("Version is empty") } } + +func TestClientMetrics(t *testing.T) { + c, _ := NewClient(Config{EnableMetrics: true}) + + m, err := c.Metrics() + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + + if m.Requests != 0 { + t.Errorf("Unexpected output: %s", m) + } +} diff --git a/estransport/connection.go b/estransport/connection.go new file mode 100644 index 0000000000..71669d7887 --- /dev/null +++ b/estransport/connection.go @@ -0,0 +1,280 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +package estransport + +import ( + "errors" + "fmt" + "math" + "net/url" + "sort" + "sync" + "time" +) + +var ( + defaultResurrectTimeoutInitial = 60 * time.Second + defaultResurrectTimeoutFactorCutoff = 5 +) + +// ConnectionPool defines the interface for the connection pool. +// +type ConnectionPool interface { + Next() (*Connection, error) + Remove(*Connection) error +} + +// Connection represents a connection to a node. +// +type Connection struct { + sync.Mutex + + URL *url.URL + Dead bool + DeadSince time.Time + Failures int +} + +type singleConnectionPool struct { + connection *Connection + + metrics *metrics + enableMetrics bool + + debugLogger DebuggingLogger +} + +type roundRobinConnectionPool struct { + sync.Mutex + + curr int // Index of the current connection + live []*Connection // List of live connections + dead []*Connection // List of dead connections + orig []*url.URL // List of original URLs, passed in during initialization + + metrics *metrics + enableMetrics bool + + debugLogger DebuggingLogger +} + +func newSingleConnectionPool(u *url.URL) *singleConnectionPool { + cp := singleConnectionPool{connection: &Connection{URL: u}} + + return &cp +} + +func newRoundRobinConnectionPool(u ...*url.URL) *roundRobinConnectionPool { + var conns []*Connection + for _, url := range u { + conns = append(conns, &Connection{URL: url}) + } + + cp := roundRobinConnectionPool{live: conns, orig: u, curr: -1} + + if cp.enableMetrics { + cp.metrics.Lock() + cp.metrics.live = cp.live + cp.metrics.dead = cp.dead + cp.metrics.Unlock() + } + + return &cp +} + +// Next returns the connection from pool. +// +func (cp *singleConnectionPool) Next() (*Connection, error) { + return cp.connection, nil +} + +// Remove is a no-op for single connection pool. +// +func (cp *singleConnectionPool) Remove(c *Connection) error { + return nil +} + +// Next returns a connection from pool, or an error. +// +func (cp *roundRobinConnectionPool) Next() (*Connection, error) { + var c *Connection + + cp.Lock() + defer cp.Unlock() + + // Return next live connection + if len(cp.live) > 0 { + cp.curr = (cp.curr + 1) % len(cp.live) + return cp.live[cp.curr], nil + + } else if len(cp.dead) > 0 { + // Try to resurrect a dead connection if no live connections are available + if cp.debugLogger != nil { + cp.debugLogger.Log("Resurrecting connection ") + } + c, cp.dead = cp.dead[len(cp.dead)-1], cp.dead[:len(cp.dead)-1] // Pop item + c.Lock() + if cp.debugLogger != nil { + cp.debugLogger.Log(c.URL.String() + "\n") + } + c.markAsLive() + cp.live = append(cp.live, c) + c.Unlock() + + return c, nil + } + + return nil, errors.New("no connection available") +} + +// Remove removes a connection from the pool. +// +func (cp *roundRobinConnectionPool) Remove(c *Connection) error { + cp.Lock() + defer cp.Unlock() + + c.Lock() + + if c.Dead { + if cp.debugLogger != nil { + cp.debugLogger.Logf("Already removed %s\n", c.URL) + } + c.Unlock() + return nil + } + + if cp.debugLogger != nil { + cp.debugLogger.Logf("Removing %s...\n", c.URL) + } + c.markAsDead() + cp.scheduleResurrect(c) + c.Unlock() + + // Push item to dead list and sort slice by number of failures + cp.dead = append(cp.dead, c) + sort.Slice(cp.dead, func(i, j int) bool { + c1 := cp.dead[i] + c2 := cp.dead[j] + c1.Lock() + c2.Lock() + defer c1.Unlock() + defer c2.Unlock() + + res := c1.Failures > c2.Failures + return res + }) + + // Check if connection exists in the list. Return nil if it doesn't, + // because another goroutine might have already removed it. + index := -1 + for i, conn := range cp.live { + if conn == c { + index = i + } + } + if index < 0 { + return nil + } + + // Remove item; https://github.com/golang/go/wiki/SliceTricks + copy(cp.live[index:], cp.live[index+1:]) + cp.live = cp.live[:len(cp.live)-1] + + if cp.enableMetrics { + cp.metrics.Lock() + cp.metrics.dead = cp.dead + cp.metrics.live = cp.live + cp.metrics.Unlock() + } + + return nil +} + +// Resurrect removes the connection from the dead list and adds it to the pool. +// +// TODO(karmi): Add a pluggable strategy as argument, eg. "optimistic", "ping". +// +func (cp *roundRobinConnectionPool) Resurrect(c *Connection) error { + cp.Lock() + defer cp.Unlock() + + c.Lock() + defer c.Unlock() + + if !c.Dead { + if cp.debugLogger != nil { + cp.debugLogger.Logf("Already resurrected %s\n", c.URL) + } + return nil + } + + if cp.debugLogger != nil { + cp.debugLogger.Logf("Resurrecting %s\n", c.URL) + } + + c.markAsLive() + + cp.live = append(cp.live, c) + index := -1 + for i, conn := range cp.dead { + if conn == c { + index = i + } + } + if index >= 0 { + // Remove item; https://github.com/golang/go/wiki/SliceTricks + copy(cp.dead[index:], cp.dead[index+1:]) + cp.dead = cp.dead[:len(cp.dead)-1] + } + + if cp.enableMetrics { + cp.metrics.Lock() + cp.metrics.dead = cp.dead + cp.metrics.live = cp.live + cp.metrics.Unlock() + } + + return nil +} + +// scheduleResurrect schedules the connection to be resurrected. +// +func (cp *roundRobinConnectionPool) scheduleResurrect(c *Connection) { + factor := math.Min(float64(c.Failures-1), float64(defaultResurrectTimeoutFactorCutoff)) + timeout := time.Duration(defaultResurrectTimeoutInitial.Seconds() * math.Exp2(factor) * float64(time.Second)) + if cp.debugLogger != nil { + cp.debugLogger.Logf("Resurrect %s (failures=%d, factor=%1.1f, timeout=%s) in %s\n", c.URL, c.Failures, factor, timeout, c.DeadSince.Add(timeout).Sub(time.Now().UTC()).Truncate(time.Second)) + } + + time.AfterFunc(timeout, func() { cp.Resurrect(c) }) +} + +// markAsDead marks the connection as dead. +// +func (c *Connection) markAsDead() { + c.Dead = true + c.DeadSince = time.Now().UTC() + c.Failures++ +} + +// markAsLive marks the connection as alive. +// +func (c *Connection) markAsLive() { + c.Dead = false +} + +// markAsHealthy marks the connection as healthy. +// +func (c *Connection) markAsHealthy() { + c.Dead = false + c.DeadSince = time.Time{} + c.Failures = 0 +} + +func (c *Connection) String() string { + c.Lock() + defer c.Unlock() + return fmt.Sprintf("<%s> dead=%v failures=%d", c.URL, c.Dead, c.Failures) +} diff --git a/estransport/connection_benchmark_test.go b/estransport/connection_benchmark_test.go new file mode 100644 index 0000000000..e201fffd29 --- /dev/null +++ b/estransport/connection_benchmark_test.go @@ -0,0 +1,206 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build !integration + +package estransport + +import ( + "fmt" + "log" + "net/http" + "net/url" + "testing" + + _ "net/http/pprof" +) + +func init() { + go func() { log.Fatalln(http.ListenAndServe("localhost:6060", nil)) }() +} + +func BenchmarkSingleConnectionPool(b *testing.B) { + b.ReportAllocs() + + b.Run("Next()", func(b *testing.B) { + pool := newSingleConnectionPool(&url.URL{Scheme: "http", Host: "foo1"}) + + b.Run("Single ", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := pool.Next() + if err != nil { + b.Errorf("Unexpected error: %v", err) + } + } + }) + + b.Run("Parallel (1000)", func(b *testing.B) { + b.SetParallelism(1000) + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + _, err := pool.Next() + if err != nil { + b.Errorf("Unexpected error: %v", err) + } + } + }) + }) + }) + + b.Run("Remove()", func(b *testing.B) { + pool := newSingleConnectionPool(&url.URL{Scheme: "http", Host: "foo1"}) + + b.Run("Single ", func(b *testing.B) { + c, _ := pool.Next() + + for i := 0; i < b.N; i++ { + if err := pool.Remove(c); err != nil { + b.Errorf("Unexpected error: %v", err) + } + } + }) + + b.Run("Parallel (1000)", func(b *testing.B) { + b.SetParallelism(1000) + b.RunParallel(func(pb *testing.PB) { + c, _ := pool.Next() + + for pb.Next() { + if err := pool.Remove(c); err != nil { + b.Errorf("Unexpected error: %v", err) + } + } + }) + }) + }) +} + +func BenchmarkRoundRobinConnectionPool(b *testing.B) { + b.ReportAllocs() + + var urls []*url.URL + for i := 0; i < 1000; i++ { + urls = append(urls, &url.URL{Scheme: "http", Host: fmt.Sprintf("foo%d", i)}) + } + + b.Run("Next()", func(b *testing.B) { + pool := newRoundRobinConnectionPool(urls...) + + b.Run("Single ", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err := pool.Next() + if err != nil { + b.Errorf("Unexpected error: %v", err) + } + } + }) + + b.Run("Parallel (100)", func(b *testing.B) { + b.SetParallelism(100) + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + _, err := pool.Next() + if err != nil { + b.Errorf("Unexpected error: %v", err) + } + } + }) + }) + + b.Run("Parallel (1000)", func(b *testing.B) { + b.SetParallelism(1000) + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + _, err := pool.Next() + if err != nil { + b.Errorf("Unexpected error: %v", err) + } + } + }) + }) + }) + + b.Run("Remove()", func(b *testing.B) { + pool := newRoundRobinConnectionPool(urls...) + + b.Run("Single ", func(b *testing.B) { + c, _ := pool.Next() + + for i := 0; i < b.N; i++ { + if err := pool.Remove(c); err != nil { + b.Errorf("Unexpected error: %v", err) + } + } + }) + + b.Run("Parallel (10)", func(b *testing.B) { + b.SetParallelism(10) + b.RunParallel(func(pb *testing.PB) { + c, _ := pool.Next() + + for pb.Next() { + if err := pool.Remove(c); err != nil { + b.Errorf("Unexpected error: %v", err) + } + } + }) + }) + + b.Run("Parallel (100)", func(b *testing.B) { + b.SetParallelism(100) + b.RunParallel(func(pb *testing.PB) { + c, _ := pool.Next() + + for pb.Next() { + if err := pool.Remove(c); err != nil { + b.Errorf("Unexpected error: %v", err) + } + } + }) + }) + }) + + b.Run("Resurrect()", func(b *testing.B) { + pool := newRoundRobinConnectionPool(urls...) + + b.Run("Single ", func(b *testing.B) { + c, _ := pool.Next() + pool.Remove(c) + + for i := 0; i < b.N; i++ { + if err := pool.Resurrect(c); err != nil { + b.Errorf("Unexpected error: %v", err) + } + } + }) + + b.Run("Parallel (10)", func(b *testing.B) { + b.SetParallelism(10) + b.RunParallel(func(pb *testing.PB) { + c, _ := pool.Next() + pool.Remove(c) + + for pb.Next() { + if err := pool.Resurrect(c); err != nil { + b.Errorf("Unexpected error: %v", err) + } + } + }) + }) + + b.Run("Parallel (100)", func(b *testing.B) { + b.SetParallelism(100) + b.RunParallel(func(pb *testing.PB) { + c, _ := pool.Next() + pool.Remove(c) + + for pb.Next() { + if err := pool.Resurrect(c); err != nil { + b.Errorf("Unexpected error: %v", err) + } + } + }) + }) + }) +} diff --git a/estransport/connection_integration_test.go b/estransport/connection_integration_test.go new file mode 100644 index 0000000000..db3d9c0113 --- /dev/null +++ b/estransport/connection_integration_test.go @@ -0,0 +1,139 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build integration + +package estransport + +import ( + "fmt" + "net/http" + "net/url" + "os" + "testing" + "time" +) + +func NewServer(addr string, handler http.Handler) *http.Server { + return &http.Server{Addr: addr, Handler: handler} +} + +func TestRoundRobinConnectionPool(t *testing.T) { + defaultResurrectTimeoutInitial = time.Second + defer func() { defaultResurrectTimeoutInitial = 60 * time.Second }() + + var ( + server *http.Server + servers []*http.Server + serverURLs []*url.URL + serverHosts []string + numServers = 3 + + defaultHandler = func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "OK") } + ) + + for i := 1; i <= numServers; i++ { + s := NewServer(fmt.Sprintf("localhost:1000%d", i), http.HandlerFunc(defaultHandler)) + + go func(s *http.Server) { + if err := s.ListenAndServe(); err != nil && err != http.ErrServerClosed { + t.Fatalf("Unable to start server: %s", err) + } + }(s) + + defer func(s *http.Server) { s.Close() }(s) + + servers = append(servers, s) + time.Sleep(time.Millisecond) + } + + for _, s := range servers { + u, _ := url.Parse("http://" + s.Addr) + serverURLs = append(serverURLs, u) + serverHosts = append(serverHosts, u.String()) + } + + fmt.Printf("==> Started %d servers on %s\n", numServers, serverHosts) + + transport := New( + Config{ + URLs: serverURLs, + Logger: &TextLogger{Output: os.Stdout}, + + EnableDebugLogger: true, + }) + + pool := transport.pool.(*roundRobinConnectionPool) + + for i := 1; i <= 9; i++ { + req, _ := http.NewRequest("GET", "/", nil) + res, err := transport.Perform(req) + if err != nil { + t.Errorf("Unexpected error: %v", err) + } + if res.StatusCode != 200 { + t.Errorf("Unexpected status code, want=200, got=%d", res.StatusCode) + } + } + + if len(pool.live) != 3 { + t.Errorf("Unexpected number of live connections, want=3, got=%d", len(pool.live)) + } + + server = servers[1] + fmt.Printf("==> Closing server: %s\n", server.Addr) + if err := server.Close(); err != nil { + t.Fatalf("Unable to close server: %s", err) + } + + for i := 1; i <= 9; i++ { + req, _ := http.NewRequest("GET", "/", nil) + res, err := transport.Perform(req) + if err != nil { + t.Errorf("Unexpected error: %v", err) + } + if res.StatusCode != 200 { + t.Errorf("Unexpected status code, want=200, got=%d", res.StatusCode) + } + } + + if len(pool.live) != 2 { + t.Errorf("Unexpected number of live connections, want=2, got=%d", len(pool.live)) + } + + if len(pool.dead) != 1 { + t.Errorf("Unexpected number of dead connections, want=1, got=%d", len(pool.dead)) + } + + server = NewServer("localhost:10002", http.HandlerFunc(defaultHandler)) + servers[1] = server + fmt.Printf("==> Starting server: %s\n", server.Addr) + go func() { + if err := server.ListenAndServe(); err != nil { + t.Fatalf("Unable to start server: %s", err) + } + }() + + fmt.Println("==> Waiting 1.25s for resurrection...") + time.Sleep(1250 * time.Millisecond) + + for i := 1; i <= 9; i++ { + req, _ := http.NewRequest("GET", "/", nil) + res, err := transport.Perform(req) + if err != nil { + t.Errorf("Unexpected error: %v", err) + } + if res.StatusCode != 200 { + t.Errorf("Unexpected status code, want=200, got=%d", res.StatusCode) + } + } + + if len(pool.live) != 3 { + t.Errorf("Unexpected number of live connections, want=3, got=%d", len(pool.live)) + } + + if len(pool.dead) != 0 { + t.Errorf("Unexpected number of dead connections, want=0, got=%d", len(pool.dead)) + } +} diff --git a/estransport/connection_internal_test.go b/estransport/connection_internal_test.go new file mode 100644 index 0000000000..9c9d781565 --- /dev/null +++ b/estransport/connection_internal_test.go @@ -0,0 +1,353 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build !integration + +package estransport + +import ( + "net/url" + "testing" + "time" +) + +func TestSingleConnectionPoolNext(t *testing.T) { + t.Run("Single URL", func(t *testing.T) { + pool := newSingleConnectionPool(&url.URL{Scheme: "http", Host: "foo1"}) + + for i := 0; i < 7; i++ { + c, err := pool.Next() + if err != nil { + t.Errorf("Unexpected error: %s", err) + } + + if c.URL.String() != "http://foo1" { + t.Errorf("Unexpected URL, want=http://foo1, got=%s", c.URL) + } + } + }) +} + +func TestSingleConnectionPoolRemove(t *testing.T) { + t.Run("Noop", func(t *testing.T) { + pool := newSingleConnectionPool(&url.URL{Scheme: "http", Host: "foo1"}) + + if err := pool.Remove(&Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}}); err != nil { + t.Errorf("Unexpected error: %s", err) + } + }) +} + +func TestRoundRobinConnectionPoolNext(t *testing.T) { + t.Run("No URL", func(t *testing.T) { + pool := newRoundRobinConnectionPool() + + c, err := pool.Next() + if err == nil { + t.Errorf("Expected error, but got: %s", c.URL) + } + }) + + t.Run("Two URLs", func(t *testing.T) { + var c *Connection + + pool := newRoundRobinConnectionPool( + &url.URL{Scheme: "http", Host: "foo1"}, + &url.URL{Scheme: "http", Host: "foo2"}) + + c, _ = pool.Next() + if c.URL.String() != "http://foo1" { + t.Errorf("Unexpected URL, want=foo1, got=%s", c.URL) + } + + c, _ = pool.Next() + if c.URL.String() != "http://foo2" { + t.Errorf("Unexpected URL, want=http://foo2, got=%s", c.URL) + } + + c, _ = pool.Next() + if c.URL.String() != "http://foo1" { + t.Errorf("Unexpected URL, want=http://foo1, got=%s", c.URL) + } + }) + + t.Run("Three URLs", func(t *testing.T) { + pool := newRoundRobinConnectionPool( + &url.URL{Scheme: "http", Host: "foo1"}, + &url.URL{Scheme: "http", Host: "foo2"}, + &url.URL{Scheme: "http", Host: "foo3"}) + + var expected string + for i := 0; i < 11; i++ { + c, err := pool.Next() + + if err != nil { + t.Errorf("Unexpected error: %s", err) + } + + switch i % len(pool.live) { + case 0: + expected = "http://foo1" + case 1: + expected = "http://foo2" + case 2: + expected = "http://foo3" + default: + t.Fatalf("Unexpected i %% 3: %d", i%3) + } + + if c.URL.String() != expected { + t.Errorf("Unexpected URL, want=%s, got=%s", expected, c.URL) + } + } + }) + + t.Run("Resurrect dead connection when no live is available", func(t *testing.T) { + pool := &roundRobinConnectionPool{ + live: []*Connection{}, + dead: []*Connection{ + &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}, Failures: 3}, + &Connection{URL: &url.URL{Scheme: "http", Host: "foo2"}, Failures: 1}, + }, + } + + c, err := pool.Next() + if err != nil { + t.Errorf("Unexpected error: %s", err) + } + + if c == nil { + t.Errorf("Expected connection, got nil: %s", c) + } + + if c.URL.String() != "http://foo2" { + t.Errorf("Expected , got: %s", c.URL.String()) + } + + if c.Dead { + t.Errorf("Expected connection to be live, got: %s", c) + } + + if len(pool.live) != 1 { + t.Errorf("Expected 1 connection in live list, got: %s", pool.live) + } + + if len(pool.dead) != 1 { + t.Errorf("Expected 1 connection in dead list, got: %s", pool.dead) + } + }) + + t.Run("Cut off the index", func(t *testing.T) { + pool := &roundRobinConnectionPool{ + curr: 99, + live: []*Connection{ + &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}}, + &Connection{URL: &url.URL{Scheme: "http", Host: "foo2"}}, + &Connection{URL: &url.URL{Scheme: "http", Host: "foo3"}}, + &Connection{URL: &url.URL{Scheme: "http", Host: "foo4"}}, + }, + } + + c, err := pool.Next() + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + // Return first connection + if c.URL.String() != "http://foo1" { + t.Errorf("Expected http://foo1, got: %s", c.URL.String()) + } + + // Reset the index; (cp.curr + 1) % len(cp.live) + if pool.curr != 0 { + t.Errorf("Expected curr to be 0, got: %d", pool.curr) + } + }) +} + +func TestRoundRobinConnectionPoolRemove(t *testing.T) { + t.Run("Remove connection, mark it, and sort dead connections", func(t *testing.T) { + pool := &roundRobinConnectionPool{ + live: []*Connection{ + &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}}, + &Connection{URL: &url.URL{Scheme: "http", Host: "foo2"}}, + }, + dead: []*Connection{ + &Connection{URL: &url.URL{Scheme: "http", Host: "foo3"}, Failures: 0}, + &Connection{URL: &url.URL{Scheme: "http", Host: "foo4"}, Failures: 99}, + }, + } + + conn := pool.live[0] + + if err := pool.Remove(conn); err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if !conn.Dead { + t.Errorf("Expected the connection to be dead; %s", conn) + } + + if len(pool.live) != 1 { + t.Errorf("Expected 1 live connection, got: %d", len(pool.live)) + } + + if len(pool.dead) != 3 { + t.Errorf("Expected 3 dead connections, got: %d", len(pool.dead)) + } + + expected := []string{ + "http://foo4", + "http://foo1", + "http://foo3", + } + + for i, u := range expected { + if pool.dead[i].URL.String() != u { + t.Errorf("Unexpected value for item %d in pool.dead: %s", i, pool.dead[i].URL.String()) + } + } + }) + + t.Run("Short circuit when the connection is already dead", func(t *testing.T) { + pool := newRoundRobinConnectionPool( + &url.URL{Scheme: "http", Host: "foo1"}, + &url.URL{Scheme: "http", Host: "foo2"}, + &url.URL{Scheme: "http", Host: "foo3"}) + + conn := pool.live[0] + conn.Dead = true + + if err := pool.Remove(conn); err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if len(pool.dead) != 0 { + t.Errorf("Expected the dead list to be empty, got: %s", pool.dead) + } + }) + + t.Run("Short circuit when the connection is already removed from live list", func(t *testing.T) { + pool := newRoundRobinConnectionPool( + &url.URL{Scheme: "http", Host: "foo1"}, + &url.URL{Scheme: "http", Host: "foo2"}, + &url.URL{Scheme: "http", Host: "foo3"}) + + conn := pool.live[0] + + // Remove connection manually + index := 0 + copy(pool.live[index:], pool.live[index+1:]) + pool.live = pool.live[:len(pool.live)-1] + + if err := pool.Remove(conn); err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if len(pool.live) != 2 { + t.Errorf("Expected 2 live connections, got: %s", pool.live) + } + + if len(pool.dead) != 1 { + t.Logf("pool.dead: %s", pool.dead) + t.Errorf("Expected 1 dead connection, got: %s", pool.dead) + } + }) +} + +func TestRoundRobinConnectionPoolResurrect(t *testing.T) { + t.Run("Mark the connection as dead and add/remove it to the lists", func(t *testing.T) { + pool := &roundRobinConnectionPool{ + live: []*Connection{}, + dead: []*Connection{&Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}, Dead: true}}, + } + + conn := pool.dead[0] + + if err := pool.Resurrect(conn); err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if conn.Dead { + t.Errorf("Expected connection to be dead, got: %s", conn) + } + + if len(pool.dead) != 0 { + t.Errorf("Expected no dead connections, got: %s", pool.dead) + } + + if len(pool.live) != 1 { + t.Errorf("Expected 1 live connection, got: %s", pool.live) + } + }) + + t.Run("Short circuit when the connection is already marked as live", func(t *testing.T) { + pool := &roundRobinConnectionPool{} + + conn := &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}, Dead: false} + + if err := pool.Resurrect(conn); err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if len(pool.live) != 0 { + t.Errorf("Expected no live connections, got: %s", pool.live) + } + + if len(pool.dead) != 0 { + t.Errorf("Expected no dead connections, got: %s", pool.dead) + } + }) + + t.Run("Short circuit removal when the connection is not in the dead list", func(t *testing.T) { + pool := &roundRobinConnectionPool{ + dead: []*Connection{&Connection{URL: &url.URL{Scheme: "http", Host: "bar"}, Dead: true}}, + } + + conn := &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}, Dead: true} + + if err := pool.Resurrect(conn); err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if len(pool.live) != 1 { + t.Errorf("Expected 1 live connection, got: %s", pool.live) + } + + if len(pool.dead) != 1 { + t.Errorf("Expected 1 dead connection, got: %s", pool.dead) + } + }) + + t.Run("Schedule resurrect", func(t *testing.T) { + defaultResurrectTimeoutInitial = 0 + defer func() { defaultResurrectTimeoutInitial = 60 * time.Second }() + + pool := &roundRobinConnectionPool{ + live: []*Connection{}, + dead: []*Connection{ + &Connection{ + URL: &url.URL{Scheme: "http", Host: "foo1"}, + Failures: 100, + Dead: true, + DeadSince: time.Now().UTC(), + }, + }, + } + + conn := pool.dead[0] + pool.scheduleResurrect(conn) + time.Sleep(50 * time.Millisecond) + + pool.Lock() + defer pool.Unlock() + + if len(pool.live) != 1 { + t.Errorf("Expected 1 live connection, got: %s", pool.live) + } + if len(pool.dead) != 0 { + t.Errorf("Expected no dead connections, got: %s", pool.dead) + } + }) +} diff --git a/estransport/doc.go b/estransport/doc.go index e65e34284f..f3573bc86d 100644 --- a/estransport/doc.go +++ b/estransport/doc.go @@ -7,10 +7,6 @@ and is not intended for direct use: to configure the client, use the elasticsear The default HTTP transport of the client is http.Transport; use the Transport option to customize it; see the _examples/customization.go file in this repository for information. -The package defines the "Selector" interface for getting a URL from the list. At the moment, -the implementation is rather minimal: the client takes a slice of url.URL pointers, -and round-robins across them when performing the request. - The package will automatically retry requests on network-related errors, and on specific response status codes (by default 502, 503, 504). Use the RetryOnStatus option to customize the list. The transport will not retry a timeout network error, unless enabled by setting EnableRetryOnTimeout to true. @@ -21,8 +17,14 @@ to disable the retry behaviour altogether. By default, the retry will be performed without any delay; to configure a backoff interval, implement the RetryBackoff option function; see an example in the package unit tests for information. +When multiple addresses are passed in configuration, the package will use them in a round-robin fashion, +and will keep track of live and dead nodes. The status of dead nodes is checked periodically. + The package defines the "Logger" interface for logging information about request and response. It comes with several bundled loggers for logging in text and JSON. +Use the EnableMetrics option to enable metric collection and export. + +Use the EnableDebugLogger option to enable the debugging logger for connection management. */ package estransport diff --git a/estransport/estransport.go b/estransport/estransport.go index fff937d1cc..6d1547d377 100644 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -12,6 +12,7 @@ import ( "net" "net/http" "net/url" + "os" "regexp" "runtime" "strings" @@ -56,6 +57,9 @@ type Config struct { MaxRetries int RetryBackoff func(attempt int) time.Duration + EnableMetrics bool + EnableDebugLogger bool + Transport http.RoundTripper Logger Logger } @@ -74,8 +78,14 @@ type Client struct { maxRetries int retryBackoff func(attempt int) time.Duration + enableMetrics bool + metrics *metrics + + enableDebugLogger bool + debugLogger DebuggingLogger + transport http.RoundTripper - selector Selector + pool ConnectionPool logger Logger } @@ -96,7 +106,14 @@ func New(cfg Config) *Client { cfg.MaxRetries = defaultMaxRetries } - return &Client{ + var pool ConnectionPool + if len(cfg.URLs) == 1 { + pool = newSingleConnectionPool(cfg.URLs[0]) + } else { + pool = newRoundRobinConnectionPool(cfg.URLs...) + } + + client := Client{ urls: cfg.URLs, username: cfg.Username, password: cfg.Password, @@ -108,10 +125,40 @@ func New(cfg Config) *Client { maxRetries: cfg.MaxRetries, retryBackoff: cfg.RetryBackoff, + enableMetrics: cfg.EnableMetrics, + enableDebugLogger: cfg.EnableDebugLogger, + transport: cfg.Transport, - selector: NewRoundRobinSelector(cfg.URLs...), + pool: pool, logger: cfg.Logger, } + + if cfg.EnableMetrics { + // FIXME(karmi): Type assertion to interface + if pool, ok := client.pool.(*singleConnectionPool); ok { + client.metrics = &metrics{responses: make(map[int]int)} + pool.enableMetrics = true + pool.metrics = client.metrics + } + if pool, ok := client.pool.(*roundRobinConnectionPool); ok { + client.metrics = &metrics{responses: make(map[int]int)} + pool.enableMetrics = true + pool.metrics = client.metrics + } + } + + if cfg.EnableDebugLogger { + client.debugLogger = &debugLogger{Output: os.Stdout} + + if pool, ok := client.pool.(*singleConnectionPool); ok { + pool.debugLogger = client.debugLogger + } + if pool, ok := client.pool.(*roundRobinConnectionPool); ok { + pool.debugLogger = client.debugLogger + } + } + + return &client } // Perform executes the request and returns a response or error. @@ -122,6 +169,14 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { err error ) + // Record metrics, when enabled + // + if c.enableMetrics { + c.metrics.Lock() + c.metrics.requests++ + c.metrics.Unlock() + } + // Update request // c.setReqUserAgent(req) @@ -141,23 +196,26 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { } for i := 1; i <= c.maxRetries; i++ { + // fmt.Printf("Attempt %d\n", i) var ( - nodeURL *url.URL + conn *Connection shouldRetry bool ) - // Get URL from the Selector + // Get connection from the pool // - nodeURL, err = c.getURL() + conn, err = c.getConnection() if err != nil { - // TODO(karmi): Log error - return nil, fmt.Errorf("cannot get URL: %s", err) + if c.logger != nil { + c.logRoundTrip(req, nil, err, time.Time{}, time.Duration(0)) + } + return nil, fmt.Errorf("cannot get connection: %s", err) } // Update request // - c.setReqURL(nodeURL, req) - c.setReqAuth(nodeURL, req) + c.setReqURL(conn.URL, req) + c.setReqAuth(conn.URL, req) if !c.disableRetry && i > 1 && req.Body != nil && req.Body != http.NoBody { body, err := req.GetBody() @@ -182,14 +240,38 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { c.logRoundTrip(req, res, err, start, dur) } - // Retry only on network errors, but don't retry on timeout errors, unless configured - // if err != nil { + // Record metrics, when enabled + // + if c.enableMetrics { + c.metrics.Lock() + c.metrics.failures++ + c.metrics.Unlock() + } + + // Remove the connection from pool + // + c.pool.Remove(conn) + + // Retry only on network errors, but don't retry on timeout errors, unless configured + // if err, ok := err.(net.Error); ok { if (!err.Timeout() || c.enableRetryOnTimeout) && !c.disableRetry { shouldRetry = true } } + } else { + // Reset the failure counter + // + conn.Lock() + conn.markAsHealthy() + conn.Unlock() + } + + if res != nil && c.enableMetrics { + c.metrics.Lock() + c.metrics.responses[res.StatusCode]++ + c.metrics.Unlock() } // Retry on configured response statuses @@ -221,12 +303,15 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { // URLs returns a list of transport URLs. // +// TODO(karmi): Refactor to take into account live, dead, orig lists. +// +// func (c *Client) URLs() []*url.URL { return c.urls } -func (c *Client) getURL() (*url.URL, error) { - return c.selector.Select() +func (c *Client) getConnection() (*Connection, error) { + return c.pool.Next() } func (c *Client) setReqURL(u *url.URL, req *http.Request) *http.Request { diff --git a/estransport/estransport_internal_test.go b/estransport/estransport_internal_test.go index c0e56c6de2..94eeb402a7 100644 --- a/estransport/estransport_internal_test.go +++ b/estransport/estransport_internal_test.go @@ -116,6 +116,65 @@ func TestTransportConfig(t *testing.T) { }) } +func TestTransportConnectionPool(t *testing.T) { + t.Run("Single URL", func(t *testing.T) { + tp := New(Config{URLs: []*url.URL{{Scheme: "http", Host: "foo1"}}}) + + if _, ok := tp.pool.(*singleConnectionPool); !ok { + t.Errorf("Expected connection to be singleConnectionPool, got: %T", tp) + } + + conn, err := tp.pool.Next() + if err != nil { + t.Errorf("Unexpected error: %s", err) + } + + if conn.URL.String() != "http://foo1" { + t.Errorf("Unexpected URL, want=http://foo1, got=%s", conn.URL) + } + }) + + t.Run("Two URLs", func(t *testing.T) { + var ( + conn *Connection + err error + ) + + tp := New(Config{URLs: []*url.URL{ + {Scheme: "http", Host: "foo1"}, + {Scheme: "http", Host: "foo2"}, + }}) + + if _, ok := tp.pool.(*roundRobinConnectionPool); !ok { + t.Errorf("Expected connection to be roundRobinConnectionPool, got: %T", tp) + } + + conn, err = tp.pool.Next() + if err != nil { + t.Errorf("Unexpected error: %s", err) + } + if conn.URL.String() != "http://foo1" { + t.Errorf("Unexpected URL, want=foo1, got=%s", conn.URL) + } + + conn, err = tp.pool.Next() + if err != nil { + t.Errorf("Unexpected error: %s", err) + } + if conn.URL.String() != "http://foo2" { + t.Errorf("Unexpected URL, want=http://foo2, got=%s", conn.URL) + } + + conn, err = tp.pool.Next() + if err != nil { + t.Errorf("Unexpected error: %s", err) + } + if conn.URL.String() != "http://foo1" { + t.Errorf("Unexpected URL, want=http://foo1, got=%s", conn.URL) + } + }) +} + func TestTransportPerform(t *testing.T) { t.Run("Executes", func(t *testing.T) { u, _ := url.Parse("https://foo.com/bar") @@ -223,9 +282,9 @@ func TestTransportPerform(t *testing.T) { req, _ := http.NewRequest("GET", "/abc", nil) - res, err := tp.Perform(req) - if err.Error() != "cannot get URL: No URL available" { - t.Fatalf("Expected error `cannot get URL`: but got error %v, response %v", err, res) + _, err := tp.Perform(req) + if err.Error() != `cannot get connection: no connection available` { + t.Fatalf("Expected error `cannot get URL`: but got error %q", err) } }) } @@ -491,97 +550,6 @@ func TestTransportPerformRetries(t *testing.T) { }) } -func TestTransportSelector(t *testing.T) { - t.Run("Nil value", func(t *testing.T) { - tp := New(Config{URLs: []*url.URL{nil}}) - - u, err := tp.selector.Select() - if err == nil { - t.Errorf("Expected error, but got %s", u) - } - }) - - t.Run("No URL", func(t *testing.T) { - tp := New(Config{}) - - u, err := tp.selector.Select() - if err == nil { - t.Errorf("Expected error, but got %s", u) - } - }) - - t.Run("Single URL", func(t *testing.T) { - tp := New(Config{URLs: []*url.URL{{Scheme: "http", Host: "localhost:9200"}}}) - - for i := 0; i < 7; i++ { - u, err := tp.selector.Select() - if err != nil { - t.Errorf("Unexpected error: %s", err) - } - - if u.String() != "http://localhost:9200" { - t.Errorf("Unexpected URL, want=http://localhost:9200, got=%s", u) - } - } - }) - - t.Run("Two URLs", func(t *testing.T) { - var u *url.URL - - tp := New(Config{URLs: []*url.URL{ - {Scheme: "http", Host: "localhost:9200"}, - {Scheme: "http", Host: "localhost:9201"}, - }}) - - u, _ = tp.selector.Select() - if u.String() != "http://localhost:9200" { - t.Errorf("Unexpected URL, want=http://localhost:9200, got=%s", u) - } - - u, _ = tp.selector.Select() - if u.String() != "http://localhost:9201" { - t.Errorf("Unexpected URL, want=http://localhost:9201, got=%s", u) - } - - u, _ = tp.selector.Select() - if u.String() != "http://localhost:9200" { - t.Errorf("Unexpected URL, want=http://localhost:9200, got=%s", u) - } - }) - - t.Run("Three URLs", func(t *testing.T) { - tp := New(Config{URLs: []*url.URL{ - {Scheme: "http", Host: "localhost:9200"}, - {Scheme: "http", Host: "localhost:9201"}, - {Scheme: "http", Host: "localhost:9202"}, - }}) - - var expected string - for i := 0; i < 11; i++ { - u, err := tp.selector.Select() - - if err != nil { - t.Errorf("Unexpected error: %s", err) - } - - switch i % 3 { - case 0: - expected = "http://localhost:9200" - case 1: - expected = "http://localhost:9201" - case 2: - expected = "http://localhost:9202" - default: - t.Fatalf("Unexpected i %% 3: %d", i%3) - } - - if u.String() != expected { - t.Errorf("Unexpected URL, want=%s, got=%s", expected, u) - } - } - }) -} - func TestURLs(t *testing.T) { t.Run("Returns URLs", func(t *testing.T) { tp := New(Config{URLs: []*url.URL{ diff --git a/estransport/logger.go b/estransport/logger.go index 263c80c5a5..02b922dd29 100644 --- a/estransport/logger.go +++ b/estransport/logger.go @@ -30,6 +30,13 @@ type Logger interface { ResponseBodyEnabled() bool } +// DebuggingLogger defines the interface for a debugging logger. +// +type DebuggingLogger interface { + Log(a ...interface{}) error + Logf(format string, a ...interface{}) error +} + // TextLogger prints the log message in plain text. // type TextLogger struct { @@ -62,6 +69,12 @@ type JSONLogger struct { EnableResponseBody bool } +// debugLogger prints debug messages as plain text. +// +type debugLogger struct { + Output io.Writer +} + // LogRoundTrip prints the information about request and response. // func (l *TextLogger) LogRoundTrip(req *http.Request, res *http.Response, err error, start time.Time, dur time.Duration) error { @@ -375,6 +388,20 @@ func (l *JSONLogger) RequestBodyEnabled() bool { return l.EnableRequestBody } // ResponseBodyEnabled returns true when the response body should be logged. func (l *JSONLogger) ResponseBodyEnabled() bool { return l.EnableResponseBody } +// Log prints the arguments to output in default format. +// +func (l *debugLogger) Log(a ...interface{}) error { + _, err := fmt.Fprint(l.Output, a...) + return err +} + +// Logf prints formats the arguments and prints them to output. +// +func (l *debugLogger) Logf(format string, a ...interface{}) error { + _, err := fmt.Fprintf(l.Output, format, a...) + return err +} + func logBodyAsText(dst io.Writer, body io.Reader, prefix string) { scanner := bufio.NewScanner(body) for scanner.Scan() { diff --git a/estransport/metrics.go b/estransport/metrics.go new file mode 100644 index 0000000000..e8fe7d4c1a --- /dev/null +++ b/estransport/metrics.go @@ -0,0 +1,195 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +package estransport + +import ( + "encoding/json" + "errors" + "fmt" + "strconv" + "strings" + "sync" + "time" +) + +// For expvar, do something like this: +// +// expvar.Publish("go-elasticsearch", expvar.Func(func() interface{} { +// m, _ := es.Metrics() +// return m +// })) + +// Measurable defines the interface for transports supporting metrics. +// +type Measurable interface { + Metrics() (Metrics, error) +} + +// Metrics represents the transport metrics. +// +type Metrics struct { + Requests int `json:"requests"` + Failures int `json:"failures"` + Responses map[int]int `json:"responses"` + + Live []connectionMetric `json:"live,omitempty"` + Dead []connectionMetric `json:"dead,omitempty"` +} + +// connectionMetric represents metric information for a connection. +// +type connectionMetric struct { + URL string `json:"url"` + Failures int `json:"failures,omitempty"` + DeadSince nullableTime `json:"dead_since,omitempty"` + ResurrectIn time.Duration `json:"resurrect_in,omitempty"` +} + +// nullableTime allows to return time zero value as nil. +// +type nullableTime struct{ time.Time } + +// metrics represents the inner state of metrics. +// +type metrics struct { + sync.RWMutex + + requests int + failures int + responses map[int]int + + live []*Connection + dead []*Connection +} + +// Metrics returns the transport metrics. +// +func (c *Client) Metrics() (Metrics, error) { + if !c.enableMetrics { + return Metrics{}, errors.New("transport metrics not enabled") + } + c.metrics.RLock() + defer c.metrics.RUnlock() + + if lockable, ok := c.pool.(sync.Locker); ok { + lockable.Lock() + defer lockable.Unlock() + } + + m := Metrics{ + Requests: c.metrics.requests, + Failures: c.metrics.failures, + Responses: c.metrics.responses, + } + + // FIXME(karmi): Type assertion to interface + if pool, ok := c.pool.(*roundRobinConnectionPool); ok { + for _, c := range pool.live { + c.Lock() + m.Live = append(m.Live, connectionMetric{URL: c.URL.String()}) + c.Unlock() + } + + for _, c := range pool.dead { + c.Lock() + m.Dead = append(m.Dead, connectionMetric{ + URL: c.URL.String(), + Failures: c.Failures, + DeadSince: nullableTime{c.DeadSince}, + // FIXME(karmi): Take factor into account + ResurrectIn: c.DeadSince.Add(defaultResurrectTimeoutInitial).Sub(time.Now().UTC()).Truncate(time.Second), + }) + c.Unlock() + } + } + + return m, nil +} + +// String returns the metrics as a string. +// +func (m Metrics) String() string { + var ( + i int + b strings.Builder + ) + b.WriteString("{") + + b.WriteString("Requests:") + b.WriteString(strconv.Itoa(m.Requests)) + + b.WriteString(" Failures:") + b.WriteString(strconv.Itoa(m.Failures)) + + if len(m.Responses) > 0 { + b.WriteString(" Responses: ") + b.WriteString("[") + + for code, num := range m.Responses { + b.WriteString(strconv.Itoa(code)) + b.WriteString(":") + b.WriteString(strconv.Itoa(num)) + if i+1 < len(m.Responses) { + b.WriteString(", ") + } + i++ + } + b.WriteString("]") + } + + b.WriteString(" Live: [") + for i, c := range m.Live { + b.WriteString(c.String()) + if i+1 < len(m.Live) { + b.WriteString(", ") + } + i++ + } + b.WriteString("]") + + b.WriteString(" Dead: [") + for i, c := range m.Dead { + b.WriteString(c.String()) + if i+1 < len(m.Dead) { + b.WriteString(", ") + } + i++ + } + b.WriteString("]") + + b.WriteString("}") + return b.String() +} + +// String returns the connection information as a string. +// +func (cm connectionMetric) String() string { + var b strings.Builder + b.WriteString("{") + b.WriteString(cm.URL) + if cm.Failures > 0 { + fmt.Fprintf(&b, " failures=%d", cm.Failures) + } + if !cm.DeadSince.IsZero() { + fmt.Fprintf(&b, " dead_since=%s", cm.DeadSince.Local().Format(time.Stamp)) + } + if cm.ResurrectIn > time.Duration(0) { + fmt.Fprintf(&b, " resurrect_in=%s", cm.ResurrectIn) + } + b.WriteString("}") + return b.String() +} + +// MarshallJSON encodes zero value of time as nil. +// +// NOTE: isEmptyValue() doesn't handle time values. +// https://golang.org/src/encoding/json/encode.go?s=10804:10846#L318 +// +func (t nullableTime) MarshalJSON() ([]byte, error) { + if t.IsZero() { + return []byte(`null`), nil + } + return json.Marshal(t.Time) +} diff --git a/estransport/metrics_internal_test.go b/estransport/metrics_internal_test.go new file mode 100644 index 0000000000..0e43d3cfcb --- /dev/null +++ b/estransport/metrics_internal_test.go @@ -0,0 +1,132 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build !integration + +package estransport + +import ( + "fmt" + "net/http" + "net/url" + "regexp" + "strconv" + "strings" + "testing" + "time" +) + +func TestMetrics(t *testing.T) { + t.Run("Metrics()", func(t *testing.T) { + tp := New( + Config{ + URLs: []*url.URL{ + {Scheme: "http", Host: "foo1"}, + {Scheme: "http", Host: "foo2"}, + {Scheme: "http", Host: "foo3"}, + }, + DisableRetry: true, + EnableMetrics: true, + }, + ) + + tp.metrics.requests = 3 + tp.metrics.failures = 4 + tp.metrics.responses[200] = 1 + tp.metrics.responses[404] = 2 + + req, _ := http.NewRequest("HEAD", "/", nil) + tp.Perform(req) + + m, err := tp.Metrics() + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + fmt.Println(m) + + if m.Requests != 4 { + t.Errorf("Unexpected output, want=4, got=%d", m.Requests) + } + if m.Failures != 5 { + t.Errorf("Unexpected output, want=5, got=%d", m.Failures) + } + if len(m.Responses) != 2 { + t.Errorf("Unexpected output: %+v", m.Responses) + } + if len(m.Live) != 2 { + t.Errorf("Unexpected output: %+v", m.Live) + } + if len(m.Dead) != 1 { + t.Errorf("Unexpected output: %+v", m.Dead) + } + }) + + t.Run("Metrics() when not enabled", func(t *testing.T) { + tp := New(Config{}) + + _, err := tp.Metrics() + if err == nil { + t.Fatalf("Expected error, got: %v", err) + } + }) + + t.Run("String()", func(t *testing.T) { + var m connectionMetric + + m = connectionMetric{ + URL: "http://foo1", + Failures: 0, + DeadSince: nullableTime{time.Time{}}, + ResurrectIn: time.Duration(0), + } + + if m.String() != "{http://foo1}" { + t.Errorf("Unexpected output: %s", m) + } + + tt, _ := time.Parse(time.RFC3339, "2010-11-11T11:00:00Z") + m = connectionMetric{ + URL: "http://foo2", + Failures: 123, + DeadSince: nullableTime{tt}, + ResurrectIn: time.Duration(100), + } + + match, err := regexp.MatchString( + `{http://foo2 failures=123 dead_since=Nov 11 \d+:00:00 resurrect_in=100ns}`, + m.String(), + ) + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if !match { + t.Errorf("Unexpected output: %s", m) + } + }) + + t.Run("nullableTime.MarshalJSON()", func(t *testing.T) { + var ( + j []byte + err error + ) + + j, err = nullableTime{time.Now()}.MarshalJSON() + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + if !strings.HasPrefix(string(j), `"`+strconv.Itoa(time.Now().Year())) { + t.Errorf("Unexpected value: %s", j) + } + + j, err = nullableTime{}.MarshalJSON() + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + if string(j) != `null` { + t.Errorf("Unexpected value: %s", j) + } + }) +} diff --git a/estransport/selector.go b/estransport/selector.go deleted file mode 100644 index f4a8d3d530..0000000000 --- a/estransport/selector.go +++ /dev/null @@ -1,58 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more agreements. -// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. - -package estransport - -import ( - "container/ring" - "errors" - "net/url" - "sync" -) - -// Selector defines the interface for selecting URLs for performing request. -// -type Selector interface { - Select() (*url.URL, error) -} - -// RoundRobinSelector implements a round-robin selection strategy. -// -type RoundRobinSelector struct { - sync.Mutex - ring *ring.Ring -} - -// Select returns a URL or error from the list of URLs in a round-robin fashion. -// -func (r *RoundRobinSelector) Select() (*url.URL, error) { - r.Lock() - defer r.Unlock() - - if r.ring.Len() < 1 { - return nil, errors.New("No URL available") - } - - v := r.ring.Value - if ov, ok := v.(*url.URL); !ok || ov == nil { - return nil, errors.New("No URL available") - } - - r.ring = r.ring.Next() - return v.(*url.URL), nil -} - -// NewRoundRobinSelector creates a new RoundRobinSelector. -// -func NewRoundRobinSelector(urls ...*url.URL) *RoundRobinSelector { - r := RoundRobinSelector{} - - r.ring = ring.New(len(urls)) - for _, u := range urls { - r.ring.Value = u - r.ring = r.ring.Next() - } - - return &r -} From e27317e250388ab78184a4f741752529186a3620 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 30 Oct 2019 09:46:26 +0100 Subject: [PATCH 137/355] Transport: Fix incorrect package version in multinode integration test --- estransport/estransport_integration_multinode_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/estransport/estransport_integration_multinode_test.go b/estransport/estransport_integration_multinode_test.go index dda9e136f2..b91a0c421d 100644 --- a/estransport/estransport_integration_multinode_test.go +++ b/estransport/estransport_integration_multinode_test.go @@ -13,7 +13,7 @@ import ( "net/url" "testing" - "github.com/elastic/go-elasticsearch/v8/estransport" + "github.com/elastic/go-elasticsearch/v7/estransport" ) var ( From bae830f81d97c5e1869fc2a0d8e60c1135883f63 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 9 Oct 2019 11:58:09 +0200 Subject: [PATCH 138/355] Generator: Tests: URL escape string parameters for ID fields Fixes failures such as https://clients-ci.elastic.co/job/elastic+go-elasticsearch+master/ELASTICSEARCH_VERSION=8.0.0-SNAPSHOT,GO_VERSION=1-alpine,TEST_SUITE=xpack,label=linux/lastCompletedBuild/testReport/(root)/command-line-arguments/TestXPack_TransformTransformsCrud_Test_Invalid_Transform_Id/ (cherry picked from commit bbddf24d4973e9e92080bd27f77b50e635a1c0f6) --- .../cmd/generate/commands/gentests/generator.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/internal/cmd/generate/commands/gentests/generator.go b/internal/cmd/generate/commands/gentests/generator.go index 2ff6658ce8..a36f1a11d3 100644 --- a/internal/cmd/generate/commands/gentests/generator.go +++ b/internal/cmd/generate/commands/gentests/generator.go @@ -199,10 +199,11 @@ func (g *Generator) genFileHeader() { import ( encjson "encoding/json" encyaml "gopkg.in/yaml.v2" + "fmt" "context" "crypto/tls" - "os" "net/url" + "os" "testing" "time" @@ -213,10 +214,11 @@ import ( var ( // Prevent compilation errors for unused packages + _ = fmt.Printf _ = encjson.NewDecoder _ = encyaml.NewDecoder _ = tls.Certificate{} - _ = fmt.Printf + _ = url.QueryEscape )` + "\n") } @@ -966,7 +968,12 @@ func (g *Generator) genAction(a Action, skipBody ...bool) { } value = fmt.Sprintf("%d", dur.Nanoseconds()) default: - value = fmt.Sprintf("%q", v) + if strings.HasSuffix(k, "ID") { + value = fmt.Sprintf("url.QueryEscape(%q)", v) + } else { + value = fmt.Sprintf("%q", v) + } + } } g.w(value) From 670aacb012e0f3e0c6a1a4cbe87c89be46b53bd9 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 31 Oct 2019 15:43:20 +0100 Subject: [PATCH 139/355] Makefile: Disable SSL verification when starting cluster (cherry picked from commit 3b337b9b436f2c3cbf915647765ce5973da2fd42) --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index f74ec9fb56..f60a52605e 100644 --- a/Makefile +++ b/Makefile @@ -254,10 +254,12 @@ else $(eval xpack_env += --env "xpack.security.http.ssl.key=certs/testnode.key") $(eval xpack_env += --env "xpack.security.http.ssl.certificate=certs/testnode.crt") $(eval xpack_env += --env "xpack.security.http.ssl.certificate_authorities=certs/ca.crt") + $(eval xpack_env += --env "xpack.security.http.ssl.verification_mode=none") $(eval xpack_env += --env "xpack.security.transport.ssl.enabled=true") $(eval xpack_env += --env "xpack.security.transport.ssl.key=certs/testnode.key") $(eval xpack_env += --env "xpack.security.transport.ssl.certificate=certs/testnode.crt") $(eval xpack_env += --env "xpack.security.transport.ssl.certificate_authorities=certs/ca.crt") + $(eval xpack_env += --env "xpack.security.transport.ssl.verification_mode=none") $(eval xpack_volumes += --volume "$(PWD)/.jenkins/certs/testnode.crt:/usr/share/elasticsearch/config/certs/testnode.crt") $(eval xpack_volumes += --volume "$(PWD)/.jenkins/certs/testnode.key:/usr/share/elasticsearch/config/certs/testnode.key") $(eval xpack_volumes += --volume "$(PWD)/.jenkins/certs/ca.crt:/usr/share/elasticsearch/config/certs/ca.crt") From 0254d48ee8789eb3ff74089a7b2e647c8513813a Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 6 Nov 2019 09:21:33 -0500 Subject: [PATCH 140/355] Remove the default port when parsing CloudID into address Closes 81 (cherry picked from commit 0b113bc5565fac1ca591beefd00b2050c143b680) --- elasticsearch.go | 7 ++----- elasticsearch_internal_test.go | 35 ++++++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/elasticsearch.go b/elasticsearch.go index 3c4491075f..8b48eae6e8 100644 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -193,10 +193,7 @@ func addrsToURLs(addrs []string) ([]*url.URL, error) { // See: https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html // func addrFromCloudID(input string) (string, error) { - var ( - port = 9243 - scheme = "https://" - ) + var scheme = "https://" values := strings.Split(input, ":") if len(values) != 2 { @@ -207,5 +204,5 @@ func addrFromCloudID(input string) (string, error) { return "", err } parts := strings.Split(string(data), "$") - return fmt.Sprintf("%s%s.%s:%d", scheme, parts[1], parts[0], port), nil + return fmt.Sprintf("%s%s.%s", scheme, parts[1], parts[0]), nil } diff --git a/elasticsearch_internal_test.go b/elasticsearch_internal_test.go index 615f837957..6f847a0ff8 100644 --- a/elasticsearch_internal_test.go +++ b/elasticsearch_internal_test.go @@ -98,6 +98,7 @@ func TestClientConfiguration(t *testing.T) { }) t.Run("With CloudID", func(t *testing.T) { + // bar.cloud.es.io$abc123$def456 c, err := NewClient(Config{CloudID: "foo:YmFyLmNsb3VkLmVzLmlvJGFiYzEyMyRkZWY0NTY="}) if err != nil { t.Fatalf("Unexpected error: %s", err) @@ -105,8 +106,8 @@ func TestClientConfiguration(t *testing.T) { u := c.Transport.(*estransport.Client).URLs()[0].String() - if u != "https://abc123.bar.cloud.es.io:9243" { - t.Errorf("Unexpected URL, want=https://abc123.bar.cloud.es.io:9243, got=%s", u) + if u != "https://abc123.bar.cloud.es.io" { + t.Errorf("Unexpected URL, want=https://abc123.bar.cloud.es.io, got=%s", u) } }) @@ -237,16 +238,30 @@ func TestAddrsToURLs(t *testing.T) { func TestCloudID(t *testing.T) { t.Run("Parse", func(t *testing.T) { - input := "name:" + base64.StdEncoding.EncodeToString([]byte("host$es$kibana")) - expected := "https://es.host:9243" - - actual, err := addrFromCloudID(input) - if err != nil { - t.Errorf("Unexpected error: %s", err) + var testdata = []struct { + in string + out string + }{ + { + in: "name:" + base64.StdEncoding.EncodeToString([]byte("host$es$kibana")), + out: "https://es.host", + }, + { + in: "name:" + base64.StdEncoding.EncodeToString([]byte("host:9243$es$kibana")), + out: "https://es.host:9243", + }, } - if actual != expected { - t.Errorf("Unexpected output, want=%q, got=%q", expected, actual) + + for _, tt := range testdata { + actual, err := addrFromCloudID(tt.in) + if err != nil { + t.Errorf("Unexpected error: %s", err) + } + if actual != tt.out { + t.Errorf("Unexpected output, want=%q, got=%q", tt.out, actual) + } } + }) t.Run("Invalid format", func(t *testing.T) { From 44daba1f27f0cbf077c13f88c170fdb9c92beb4f Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 12 Nov 2019 18:49:03 +0100 Subject: [PATCH 141/355] Fix incorrect handling of addresses from environment and configuration (cherry picked from commit 8e2b6095b305a4942495f2ff98b5dc429d5107d6) --- elasticsearch.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/elasticsearch.go b/elasticsearch.go index 8b48eae6e8..2196c69f23 100644 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -104,10 +104,9 @@ func NewClient(cfg Config) (*Client, error) { addrs = append(addrs, cloudAddrs) } else { if len(envAddrs) > 0 { - addrs = append(envAddrs, envAddrs...) - } - if len(cfg.Addresses) > 0 { - addrs = append(envAddrs, cfg.Addresses...) + addrs = append(addrs, envAddrs...) + } else if len(cfg.Addresses) > 0 { + addrs = append(addrs, cfg.Addresses...) } } From cf9f4d000e7bfd26add7012c1957f2f9516106d0 Mon Sep 17 00:00:00 2001 From: Erik Dubbelboer Date: Fri, 25 Oct 2019 18:40:35 +0200 Subject: [PATCH 142/355] Examples: Improve the "valyala/fasthttp" example Closes #97 (cherry picked from commit 0c70c42419ebf49a02ba25893b8acabb4dfe99f5) --- _examples/fasthttp/README.md | 6 +++--- _examples/fasthttp/fasthttp.go | 25 ++++++++++++------------- _examples/fasthttp/go.mod | 2 +- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/_examples/fasthttp/README.md b/_examples/fasthttp/README.md index 9dd59a92c0..df093a6c88 100644 --- a/_examples/fasthttp/README.md +++ b/_examples/fasthttp/README.md @@ -9,11 +9,11 @@ request and response object between `net/http` and `fasthttp`. To run the example: go run cmd/main.go - # 1000 requests in 1.15 (870.2 req/s) | min: 785.292µs / max: 10.553253ms / mean: 1.052083ms + # 1000 requests in 1.07 (933.4 req/s) | min: 749.961µs / max: 10.003318ms / mean: 1.013992ms To run the benchmarks: make bench - BenchmarkHTTPClient/Info()-4 2000 8721355 ns/op 16279 B/op 131 allocs/op - BenchmarkFastHTTPClient/Info()-4 10000 1182717 ns/op 3075 B/op 39 allocs/op + BenchmarkHTTPClient/Info()-4 1591 7139770 ns/op 16725 B/op 132 allocs/op + BenchmarkFastHTTPClient/Info()-4 10000 1315049 ns/op 2255 B/op 24 allocs/op diff --git a/_examples/fasthttp/fasthttp.go b/_examples/fasthttp/fasthttp.go index 2a9ef5026f..6301b314f0 100644 --- a/_examples/fasthttp/fasthttp.go +++ b/_examples/fasthttp/fasthttp.go @@ -5,10 +5,9 @@ package fasthttp import ( - "bytes" - "io" "io/ioutil" "net/http" + "strings" "github.com/valyala/fasthttp" ) @@ -22,8 +21,13 @@ type Transport struct{} // func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { freq := fasthttp.AcquireRequest() + defer fasthttp.ReleaseRequest(freq) + fres := fasthttp.AcquireResponse() + defer fasthttp.ReleaseResponse(fres) + t.copyRequest(freq, req) + err := fasthttp.Do(freq, fres) if err != nil { return nil, err @@ -35,11 +39,9 @@ func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { return res, nil } -// copyRequest converts http.Request to fasthttp.Request +// copyRequest converts a http.Request to fasthttp.Request // func (t *Transport) copyRequest(dst *fasthttp.Request, src *http.Request) *fasthttp.Request { - dst.Reset() - dst.SetHost(src.Host) dst.SetRequestURI(src.URL.String()) @@ -53,16 +55,13 @@ func (t *Transport) copyRequest(dst *fasthttp.Request, src *http.Request) *fasth } if src.Body != nil { - var b bytes.Buffer - io.Copy(&b, src.Body) - - dst.SetBody(b.Bytes()) + dst.SetBodyStream(src.Body, -1) } return dst } -// copyResponse converts http.Response to fasthttp.Response +// copyResponse converts a http.Response to fasthttp.Response // func (t *Transport) copyResponse(dst *http.Response, src *fasthttp.Response) *http.Response { dst.StatusCode = src.StatusCode() @@ -71,9 +70,9 @@ func (t *Transport) copyResponse(dst *http.Response, src *fasthttp.Response) *ht dst.Header.Set(string(k), string(v)) }) - if src.Body != nil { - dst.Body = ioutil.NopCloser(bytes.NewReader(src.Body())) - } + // Cast to a string to make a copy seeing as src.Body() won't + // be valid after the response is released back to the pool (fasthttp.ReleaseResponse). + dst.Body = ioutil.NopCloser(strings.NewReader(string(src.Body()))) return dst } diff --git a/_examples/fasthttp/go.mod b/_examples/fasthttp/go.mod index 33f9054246..95d04d3c75 100644 --- a/_examples/fasthttp/go.mod +++ b/_examples/fasthttp/go.mod @@ -6,5 +6,5 @@ replace github.com/elastic/go-elasticsearch/v7 => ../.. require ( github.com/elastic/go-elasticsearch/v7 v7.0.0-20190407092644-3fb2a278216b - github.com/valyala/fasthttp v1.1.0 + github.com/valyala/fasthttp v1.5.0 ) From 5420bedd4261ef7982102a208216d0110c1e407b Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Wed, 30 Oct 2019 22:06:15 +1100 Subject: [PATCH 143/355] estransport: refactor Next/Resurrect Refactor Next and Resurrect to share most of the code. This fixes a bug whereby metrics would not have been updated. (cherry picked from commit 360c6930c17c38393357e479127bad1fc5ef217d) --- estransport/connection.go | 46 +++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/estransport/connection.go b/estransport/connection.go index 71669d7887..03659617d5 100644 --- a/estransport/connection.go +++ b/estransport/connection.go @@ -99,8 +99,6 @@ func (cp *singleConnectionPool) Remove(c *Connection) error { // Next returns a connection from pool, or an error. // func (cp *roundRobinConnectionPool) Next() (*Connection, error) { - var c *Connection - cp.Lock() defer cp.Unlock() @@ -108,24 +106,15 @@ func (cp *roundRobinConnectionPool) Next() (*Connection, error) { if len(cp.live) > 0 { cp.curr = (cp.curr + 1) % len(cp.live) return cp.live[cp.curr], nil - } else if len(cp.dead) > 0 { - // Try to resurrect a dead connection if no live connections are available - if cp.debugLogger != nil { - cp.debugLogger.Log("Resurrecting connection ") - } - c, cp.dead = cp.dead[len(cp.dead)-1], cp.dead[:len(cp.dead)-1] // Pop item + // No live connections are available, resurrect one + // of the dead connections with the fewest failures. + c := cp.dead[len(cp.dead)-1] + cp.dead = cp.dead[:len(cp.dead)-1] c.Lock() - if cp.debugLogger != nil { - cp.debugLogger.Log(c.URL.String() + "\n") - } - c.markAsLive() - cp.live = append(cp.live, c) - c.Unlock() - - return c, nil + defer c.Unlock() + return c, cp.resurrectLocked(c, false) } - return nil, errors.New("no connection available") } @@ -209,7 +198,10 @@ func (cp *roundRobinConnectionPool) Resurrect(c *Connection) error { } return nil } + return cp.resurrectLocked(c, true) +} +func (cp *roundRobinConnectionPool) resurrectLocked(c *Connection, removeDead bool) error { if cp.debugLogger != nil { cp.debugLogger.Logf("Resurrecting %s\n", c.URL) } @@ -217,16 +209,18 @@ func (cp *roundRobinConnectionPool) Resurrect(c *Connection) error { c.markAsLive() cp.live = append(cp.live, c) - index := -1 - for i, conn := range cp.dead { - if conn == c { - index = i + if removeDead { + index := -1 + for i, conn := range cp.dead { + if conn == c { + index = i + } + } + if index >= 0 { + // Remove item; https://github.com/golang/go/wiki/SliceTricks + copy(cp.dead[index:], cp.dead[index+1:]) + cp.dead = cp.dead[:len(cp.dead)-1] } - } - if index >= 0 { - // Remove item; https://github.com/golang/go/wiki/SliceTricks - copy(cp.dead[index:], cp.dead[index+1:]) - cp.dead = cp.dead[:len(cp.dead)-1] } if cp.enableMetrics { From b0ea5c285bc857f8b7c9fc76a9fb6d534d4b5c2c Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Wed, 30 Oct 2019 22:10:25 +1100 Subject: [PATCH 144/355] estransport: remove enableMetrics These fields are redundant, as you can check that metrics is non-nil. (cherry picked from commit 5ac2b990a2a48ae9b4a776229cf905f9af921dac) --- estransport/connection.go | 17 +++++------------ estransport/estransport.go | 12 ++++-------- estransport/metrics.go | 2 +- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/estransport/connection.go b/estransport/connection.go index 03659617d5..fb51dae1fe 100644 --- a/estransport/connection.go +++ b/estransport/connection.go @@ -40,8 +40,7 @@ type Connection struct { type singleConnectionPool struct { connection *Connection - metrics *metrics - enableMetrics bool + metrics *metrics debugLogger DebuggingLogger } @@ -54,8 +53,7 @@ type roundRobinConnectionPool struct { dead []*Connection // List of dead connections orig []*url.URL // List of original URLs, passed in during initialization - metrics *metrics - enableMetrics bool + metrics *metrics debugLogger DebuggingLogger } @@ -74,12 +72,7 @@ func newRoundRobinConnectionPool(u ...*url.URL) *roundRobinConnectionPool { cp := roundRobinConnectionPool{live: conns, orig: u, curr: -1} - if cp.enableMetrics { - cp.metrics.Lock() - cp.metrics.live = cp.live - cp.metrics.dead = cp.dead - cp.metrics.Unlock() - } + // BUG the transport's metrics should be initialised with the live list return &cp } @@ -171,7 +164,7 @@ func (cp *roundRobinConnectionPool) Remove(c *Connection) error { copy(cp.live[index:], cp.live[index+1:]) cp.live = cp.live[:len(cp.live)-1] - if cp.enableMetrics { + if cp.metrics != nil { cp.metrics.Lock() cp.metrics.dead = cp.dead cp.metrics.live = cp.live @@ -223,7 +216,7 @@ func (cp *roundRobinConnectionPool) resurrectLocked(c *Connection, removeDead bo } } - if cp.enableMetrics { + if cp.metrics != nil { cp.metrics.Lock() cp.metrics.dead = cp.dead cp.metrics.live = cp.live diff --git a/estransport/estransport.go b/estransport/estransport.go index 6d1547d377..d95e856406 100644 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -78,8 +78,7 @@ type Client struct { maxRetries int retryBackoff func(attempt int) time.Duration - enableMetrics bool - metrics *metrics + metrics *metrics enableDebugLogger bool debugLogger DebuggingLogger @@ -125,7 +124,6 @@ func New(cfg Config) *Client { maxRetries: cfg.MaxRetries, retryBackoff: cfg.RetryBackoff, - enableMetrics: cfg.EnableMetrics, enableDebugLogger: cfg.EnableDebugLogger, transport: cfg.Transport, @@ -137,12 +135,10 @@ func New(cfg Config) *Client { // FIXME(karmi): Type assertion to interface if pool, ok := client.pool.(*singleConnectionPool); ok { client.metrics = &metrics{responses: make(map[int]int)} - pool.enableMetrics = true pool.metrics = client.metrics } if pool, ok := client.pool.(*roundRobinConnectionPool); ok { client.metrics = &metrics{responses: make(map[int]int)} - pool.enableMetrics = true pool.metrics = client.metrics } } @@ -171,7 +167,7 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { // Record metrics, when enabled // - if c.enableMetrics { + if c.metrics != nil { c.metrics.Lock() c.metrics.requests++ c.metrics.Unlock() @@ -243,7 +239,7 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { if err != nil { // Record metrics, when enabled // - if c.enableMetrics { + if c.metrics != nil { c.metrics.Lock() c.metrics.failures++ c.metrics.Unlock() @@ -268,7 +264,7 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { conn.Unlock() } - if res != nil && c.enableMetrics { + if res != nil && c.metrics != nil { c.metrics.Lock() c.metrics.responses[res.StatusCode]++ c.metrics.Unlock() diff --git a/estransport/metrics.go b/estransport/metrics.go index e8fe7d4c1a..bc496ae06a 100644 --- a/estransport/metrics.go +++ b/estransport/metrics.go @@ -67,7 +67,7 @@ type metrics struct { // Metrics returns the transport metrics. // func (c *Client) Metrics() (Metrics, error) { - if !c.enableMetrics { + if c.metrics == nil { return Metrics{}, errors.New("transport metrics not enabled") } c.metrics.RLock() From 39e4c99fe2f2eaf8a42ddb3d01dca29dc61e9370 Mon Sep 17 00:00:00 2001 From: XD-DENG Date: Fri, 20 Sep 2019 22:57:24 +0800 Subject: [PATCH 145/355] Fix typo in error message Closes #89 (cherry picked from commit 9bf0926362c08d2380150eb6295982bef22d5872) --- elasticsearch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elasticsearch.go b/elasticsearch.go index 2196c69f23..6c32b6fc98 100644 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -93,7 +93,7 @@ func NewClient(cfg Config) (*Client, error) { } if len(cfg.Addresses) > 0 && cfg.CloudID != "" { - return nil, errors.New("cannot create client: both Adresses and CloudID are set") + return nil, errors.New("cannot create client: both Addresses and CloudID are set") } if cfg.CloudID != "" { From 98d0e048cabfb33add8d4e62e02287db8ec50dbf Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 16 Nov 2019 09:50:24 +0100 Subject: [PATCH 146/355] Transport: Refactored the connection pool This patch refactors the connection pool implementation to be cleaner and more aligned with the architecture of other official clients. It introduces the "Selector" component, which allows to customize the logic for selecting connections from the pool without replacing the entire connection pool implementation. It introduces the "ConnectionPoolFunc" configuration option, as a constructor function to be used when initializing a custom connection pool implementation. Many connection pool methods have been renamed to tighten up the semantics (eg. `Remove()` => `OnFailure()`, etc). The support for client metrics has been refactored as well, to better support custom connection pool implementations. Related: #95, #100 (cherry picked from commit dcd99f55c03130bcd414ce6c53e2eac2ba753114) --- _examples/instrumentation/expvar.go | 9 +- elasticsearch.go | 14 +- estransport/connection.go | 214 +++++++++++++-------- estransport/connection_benchmark_test.go | 160 +++++++++++---- estransport/connection_integration_test.go | 4 +- estransport/connection_internal_test.go | 208 ++++++++++---------- estransport/doc.go | 11 +- estransport/estransport.go | 83 +++----- estransport/estransport_internal_test.go | 68 ++++++- estransport/logger.go | 10 +- estransport/logger_internal_test.go | 15 ++ estransport/metrics.go | 102 ++++------ estransport/metrics_internal_test.go | 53 +---- 13 files changed, 550 insertions(+), 401 deletions(-) diff --git a/_examples/instrumentation/expvar.go b/_examples/instrumentation/expvar.go index 4b90f481c0..8b4d9fa4c8 100644 --- a/_examples/instrumentation/expvar.go +++ b/_examples/instrumentation/expvar.go @@ -17,7 +17,6 @@ import ( "time" // Import the "expvar" and "pprof" package >>>>>>>>>> - "net/http" _ "net/http/pprof" // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @@ -121,10 +120,10 @@ func main() { log.Println("███", fmt.Sprintf("\x1b[1m%s\x1b[0m", "Metrics"), strings.Repeat("█", tWidth-12)) log.Printf( ""+ - " \x1b[2mRequests: \x1b[0m %d\n"+ - " \x1b[2mFailures: \x1b[0m %d\n"+ - " \x1b[2mLive nodes:\x1b[0m %s", - m.Requests, m.Failures, m.Live) + " \x1b[2mRequests: \x1b[0m %d\n"+ + " \x1b[2mFailures: \x1b[0m %d\n"+ + " \x1b[2mConnections:\x1b[0m %s", + m.Requests, m.Failures, m.Connections) log.Println(strings.Repeat("─", tWidth)) } } diff --git a/elasticsearch.go b/elasticsearch.go index 6c32b6fc98..d131211981 100644 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -47,8 +47,12 @@ type Config struct { RetryBackoff func(attempt int) time.Duration // Optional backoff duration. Default: nil. - Transport http.RoundTripper // The HTTP transport object. - Logger estransport.Logger // The logger object. + Transport http.RoundTripper // The HTTP transport object. + Logger estransport.Logger // The logger object. + Selector estransport.Selector // The selector object. + + // Optional constructor function for a custom ConnectionPool. Default: nil. + ConnectionPoolFunc func([]*estransport.Connection, estransport.Selector) estransport.ConnectionPool } // Client represents the Elasticsearch client. @@ -135,8 +139,10 @@ func NewClient(cfg Config) (*Client, error) { EnableMetrics: cfg.EnableMetrics, EnableDebugLogger: cfg.EnableDebugLogger, - Transport: cfg.Transport, - Logger: cfg.Logger, + Transport: cfg.Transport, + Logger: cfg.Logger, + Selector: cfg.Selector, + ConnectionPoolFunc: cfg.ConnectionPoolFunc, }) return &Client{Transport: tp, API: esapi.New(tp)}, nil diff --git a/estransport/connection.go b/estransport/connection.go index fb51dae1fe..57b90f0d03 100644 --- a/estransport/connection.go +++ b/estransport/connection.go @@ -19,11 +19,19 @@ var ( defaultResurrectTimeoutFactorCutoff = 5 ) +// Selector defines the interface for selecting connections from the pool. +// +type Selector interface { + Select([]*Connection) (*Connection, error) +} + // ConnectionPool defines the interface for the connection pool. // type ConnectionPool interface { - Next() (*Connection, error) - Remove(*Connection) error + Next() (*Connection, error) // Next returns the next available connection. + OnSuccess(*Connection) error // OnSuccess reports that the connection was successful. + OnFailure(*Connection) error // OnFailure reports that the connection failed. + URLs() []*url.URL // URLs returns the list of URLs of available connections. } // Connection represents a connection to a node. @@ -32,7 +40,7 @@ type Connection struct { sync.Mutex URL *url.URL - Dead bool + IsDead bool DeadSince time.Time Failures int } @@ -41,40 +49,34 @@ type singleConnectionPool struct { connection *Connection metrics *metrics - - debugLogger DebuggingLogger } -type roundRobinConnectionPool struct { +type statusConnectionPool struct { sync.Mutex - curr int // Index of the current connection - live []*Connection // List of live connections - dead []*Connection // List of dead connections - orig []*url.URL // List of original URLs, passed in during initialization + live []*Connection // List of live connections + dead []*Connection // List of dead connections + selector Selector metrics *metrics - - debugLogger DebuggingLogger } -func newSingleConnectionPool(u *url.URL) *singleConnectionPool { - cp := singleConnectionPool{connection: &Connection{URL: u}} +type roundRobinSelector struct { + sync.Mutex - return &cp + curr int // Index of the current connection } -func newRoundRobinConnectionPool(u ...*url.URL) *roundRobinConnectionPool { - var conns []*Connection - for _, url := range u { - conns = append(conns, &Connection{URL: url}) +// NewConnectionPool creates and returns a default connection pool. +// +func NewConnectionPool(conns []*Connection, selector Selector) (ConnectionPool, error) { + if len(conns) == 1 { + return &singleConnectionPool{connection: conns[0]}, nil } - - cp := roundRobinConnectionPool{live: conns, orig: u, curr: -1} - - // BUG the transport's metrics should be initialised with the live list - - return &cp + if selector == nil { + selector = &roundRobinSelector{curr: -1} + } + return &statusConnectionPool{live: conns, selector: selector}, nil } // Next returns the connection from pool. @@ -83,52 +85,74 @@ func (cp *singleConnectionPool) Next() (*Connection, error) { return cp.connection, nil } -// Remove is a no-op for single connection pool. -// -func (cp *singleConnectionPool) Remove(c *Connection) error { - return nil -} +// OnSuccess is a no-op for single connection pool. +func (cp *singleConnectionPool) OnSuccess(c *Connection) error { return nil } + +// OnFailure is a no-op for single connection pool. +func (cp *singleConnectionPool) OnFailure(c *Connection) error { return nil } + +// URLs returns the list of URLs of available connections. +func (cp *singleConnectionPool) URLs() []*url.URL { return []*url.URL{cp.connection.URL} } + +func (cp *singleConnectionPool) connections() []*Connection { return []*Connection{cp.connection} } // Next returns a connection from pool, or an error. // -func (cp *roundRobinConnectionPool) Next() (*Connection, error) { +func (cp *statusConnectionPool) Next() (*Connection, error) { cp.Lock() defer cp.Unlock() // Return next live connection if len(cp.live) > 0 { - cp.curr = (cp.curr + 1) % len(cp.live) - return cp.live[cp.curr], nil + return cp.selector.Select(cp.live) } else if len(cp.dead) > 0 { - // No live connections are available, resurrect one - // of the dead connections with the fewest failures. + // No live connection is available, resurrect one of the dead ones. c := cp.dead[len(cp.dead)-1] cp.dead = cp.dead[:len(cp.dead)-1] c.Lock() defer c.Unlock() - return c, cp.resurrectLocked(c, false) + cp.resurrect(c, false) + return c, nil } return nil, errors.New("no connection available") } -// Remove removes a connection from the pool. +// OnSuccess marks the connection as successful. // -func (cp *roundRobinConnectionPool) Remove(c *Connection) error { +func (cp *statusConnectionPool) OnSuccess(c *Connection) error { + c.Lock() + defer c.Unlock() + + // Short-circuit for live connection + if !c.IsDead { + return nil + } + + c.markAsHealthy() + + cp.Lock() + defer cp.Unlock() + return cp.resurrect(c, true) +} + +// OnFailure marks the connection as failed. +// +func (cp *statusConnectionPool) OnFailure(c *Connection) error { cp.Lock() defer cp.Unlock() c.Lock() - if c.Dead { - if cp.debugLogger != nil { - cp.debugLogger.Logf("Already removed %s\n", c.URL) + if c.IsDead { + if debugLogger != nil { + debugLogger.Logf("Already removed %s\n", c.URL) } c.Unlock() return nil } - if cp.debugLogger != nil { - cp.debugLogger.Logf("Removing %s...\n", c.URL) + if debugLogger != nil { + debugLogger.Logf("Removing %s...\n", c.URL) } c.markAsDead() cp.scheduleResurrect(c) @@ -148,8 +172,7 @@ func (cp *roundRobinConnectionPool) Remove(c *Connection) error { return res }) - // Check if connection exists in the list. Return nil if it doesn't, - // because another goroutine might have already removed it. + // Check if connection exists in the list, return error if not. index := -1 for i, conn := range cp.live { if conn == c { @@ -157,46 +180,45 @@ func (cp *roundRobinConnectionPool) Remove(c *Connection) error { } } if index < 0 { - return nil + return errors.New("connection not in live list") } // Remove item; https://github.com/golang/go/wiki/SliceTricks copy(cp.live[index:], cp.live[index+1:]) cp.live = cp.live[:len(cp.live)-1] - if cp.metrics != nil { - cp.metrics.Lock() - cp.metrics.dead = cp.dead - cp.metrics.live = cp.live - cp.metrics.Unlock() - } - return nil } -// Resurrect removes the connection from the dead list and adds it to the pool. +// URLs returns the list of URLs of available connections. // -// TODO(karmi): Add a pluggable strategy as argument, eg. "optimistic", "ping". -// -func (cp *roundRobinConnectionPool) Resurrect(c *Connection) error { +func (cp *statusConnectionPool) URLs() []*url.URL { + var urls []*url.URL + cp.Lock() defer cp.Unlock() - c.Lock() - defer c.Unlock() - - if !c.Dead { - if cp.debugLogger != nil { - cp.debugLogger.Logf("Already resurrected %s\n", c.URL) - } - return nil + for _, c := range cp.live { + urls = append(urls, c.URL) } - return cp.resurrectLocked(c, true) + + return urls } -func (cp *roundRobinConnectionPool) resurrectLocked(c *Connection, removeDead bool) error { - if cp.debugLogger != nil { - cp.debugLogger.Logf("Resurrecting %s\n", c.URL) +func (cp *statusConnectionPool) connections() []*Connection { + var conns []*Connection + conns = append(conns, cp.live...) + conns = append(conns, cp.dead...) + return conns +} + +// resurrect adds the connection to the list of available connections. +// When removeDead is true, it also removes it from the dead list. +// The calling code is responsible for locking. +// +func (cp *statusConnectionPool) resurrect(c *Connection, removeDead bool) error { + if debugLogger != nil { + debugLogger.Logf("Resurrecting %s\n", c.URL) } c.markAsLive() @@ -216,52 +238,74 @@ func (cp *roundRobinConnectionPool) resurrectLocked(c *Connection, removeDead bo } } - if cp.metrics != nil { - cp.metrics.Lock() - cp.metrics.dead = cp.dead - cp.metrics.live = cp.live - cp.metrics.Unlock() - } - return nil } // scheduleResurrect schedules the connection to be resurrected. // -func (cp *roundRobinConnectionPool) scheduleResurrect(c *Connection) { +func (cp *statusConnectionPool) scheduleResurrect(c *Connection) { factor := math.Min(float64(c.Failures-1), float64(defaultResurrectTimeoutFactorCutoff)) timeout := time.Duration(defaultResurrectTimeoutInitial.Seconds() * math.Exp2(factor) * float64(time.Second)) - if cp.debugLogger != nil { - cp.debugLogger.Logf("Resurrect %s (failures=%d, factor=%1.1f, timeout=%s) in %s\n", c.URL, c.Failures, factor, timeout, c.DeadSince.Add(timeout).Sub(time.Now().UTC()).Truncate(time.Second)) + if debugLogger != nil { + debugLogger.Logf("Resurrect %s (failures=%d, factor=%1.1f, timeout=%s) in %s\n", c.URL, c.Failures, factor, timeout, c.DeadSince.Add(timeout).Sub(time.Now().UTC()).Truncate(time.Second)) } - time.AfterFunc(timeout, func() { cp.Resurrect(c) }) + time.AfterFunc(timeout, func() { + cp.Lock() + defer cp.Unlock() + + c.Lock() + defer c.Unlock() + + if !c.IsDead { + if debugLogger != nil { + debugLogger.Logf("Already resurrected %s\n", c.URL) + } + return + } + + cp.resurrect(c, true) + }) +} + +// Select returns the connection in a round-robin fashion. +// +func (s *roundRobinSelector) Select(conns []*Connection) (*Connection, error) { + s.Lock() + defer s.Unlock() + + s.curr = (s.curr + 1) % len(conns) + return conns[s.curr], nil } // markAsDead marks the connection as dead. // func (c *Connection) markAsDead() { - c.Dead = true - c.DeadSince = time.Now().UTC() + c.IsDead = true + if c.DeadSince.IsZero() { + c.DeadSince = time.Now().UTC() + } c.Failures++ } // markAsLive marks the connection as alive. // func (c *Connection) markAsLive() { - c.Dead = false + c.IsDead = false } // markAsHealthy marks the connection as healthy. // func (c *Connection) markAsHealthy() { - c.Dead = false + c.IsDead = false c.DeadSince = time.Time{} c.Failures = 0 } +// String returns a readable connection representation. +// func (c *Connection) String() string { c.Lock() defer c.Unlock() - return fmt.Sprintf("<%s> dead=%v failures=%d", c.URL, c.Dead, c.Failures) + return fmt.Sprintf("<%s> dead=%v failures=%d", c.URL, c.IsDead, c.Failures) } diff --git a/estransport/connection_benchmark_test.go b/estransport/connection_benchmark_test.go index e201fffd29..30b64d92c1 100644 --- a/estransport/connection_benchmark_test.go +++ b/estransport/connection_benchmark_test.go @@ -24,9 +24,9 @@ func BenchmarkSingleConnectionPool(b *testing.B) { b.ReportAllocs() b.Run("Next()", func(b *testing.B) { - pool := newSingleConnectionPool(&url.URL{Scheme: "http", Host: "foo1"}) + pool := &singleConnectionPool{connection: &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}}} - b.Run("Single ", func(b *testing.B) { + b.Run("Single ", func(b *testing.B) { for i := 0; i < b.N; i++ { _, err := pool.Next() if err != nil { @@ -48,14 +48,14 @@ func BenchmarkSingleConnectionPool(b *testing.B) { }) }) - b.Run("Remove()", func(b *testing.B) { - pool := newSingleConnectionPool(&url.URL{Scheme: "http", Host: "foo1"}) + b.Run("OnFailure()", func(b *testing.B) { + pool := &singleConnectionPool{connection: &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}}} - b.Run("Single ", func(b *testing.B) { + b.Run("Single ", func(b *testing.B) { c, _ := pool.Next() for i := 0; i < b.N; i++ { - if err := pool.Remove(c); err != nil { + if err := pool.OnFailure(c); err != nil { b.Errorf("Unexpected error: %v", err) } } @@ -67,7 +67,7 @@ func BenchmarkSingleConnectionPool(b *testing.B) { c, _ := pool.Next() for pb.Next() { - if err := pool.Remove(c); err != nil { + if err := pool.OnFailure(c); err != nil { b.Errorf("Unexpected error: %v", err) } } @@ -76,18 +76,21 @@ func BenchmarkSingleConnectionPool(b *testing.B) { }) } -func BenchmarkRoundRobinConnectionPool(b *testing.B) { +func BenchmarkStatusConnectionPool(b *testing.B) { b.ReportAllocs() - var urls []*url.URL + var conns []*Connection for i := 0; i < 1000; i++ { - urls = append(urls, &url.URL{Scheme: "http", Host: fmt.Sprintf("foo%d", i)}) + conns = append(conns, &Connection{URL: &url.URL{Scheme: "http", Host: fmt.Sprintf("foo%d", i)}}) } b.Run("Next()", func(b *testing.B) { - pool := newRoundRobinConnectionPool(urls...) + pool := &statusConnectionPool{ + live: conns, + selector: &roundRobinSelector{curr: -1}, + } - b.Run("Single ", func(b *testing.B) { + b.Run("Single ", func(b *testing.B) { for i := 0; i < b.N; i++ { _, err := pool.Next() if err != nil { @@ -121,14 +124,20 @@ func BenchmarkRoundRobinConnectionPool(b *testing.B) { }) }) - b.Run("Remove()", func(b *testing.B) { - pool := newRoundRobinConnectionPool(urls...) + b.Run("OnFailure()", func(b *testing.B) { + pool := &statusConnectionPool{ + live: conns, + selector: &roundRobinSelector{curr: -1}, + } - b.Run("Single ", func(b *testing.B) { - c, _ := pool.Next() + b.Run("Single ", func(b *testing.B) { + c, err := pool.Next() + if err != nil { + b.Fatalf("Unexpected error: %s", err) + } for i := 0; i < b.N; i++ { - if err := pool.Remove(c); err != nil { + if err := pool.OnFailure(c); err != nil { b.Errorf("Unexpected error: %v", err) } } @@ -137,10 +146,13 @@ func BenchmarkRoundRobinConnectionPool(b *testing.B) { b.Run("Parallel (10)", func(b *testing.B) { b.SetParallelism(10) b.RunParallel(func(pb *testing.PB) { - c, _ := pool.Next() + c, err := pool.Next() + if err != nil { + b.Fatalf("Unexpected error: %s", err) + } for pb.Next() { - if err := pool.Remove(c); err != nil { + if err := pool.OnFailure(c); err != nil { b.Errorf("Unexpected error: %v", err) } } @@ -150,10 +162,13 @@ func BenchmarkRoundRobinConnectionPool(b *testing.B) { b.Run("Parallel (100)", func(b *testing.B) { b.SetParallelism(100) b.RunParallel(func(pb *testing.PB) { - c, _ := pool.Next() + c, err := pool.Next() + if err != nil { + b.Fatalf("Unexpected error: %s", err) + } for pb.Next() { - if err := pool.Remove(c); err != nil { + if err := pool.OnFailure(c); err != nil { b.Errorf("Unexpected error: %v", err) } } @@ -161,15 +176,20 @@ func BenchmarkRoundRobinConnectionPool(b *testing.B) { }) }) - b.Run("Resurrect()", func(b *testing.B) { - pool := newRoundRobinConnectionPool(urls...) + b.Run("OnSuccess()", func(b *testing.B) { + pool := &statusConnectionPool{ + live: conns, + selector: &roundRobinSelector{curr: -1}, + } - b.Run("Single ", func(b *testing.B) { - c, _ := pool.Next() - pool.Remove(c) + b.Run("Single ", func(b *testing.B) { + c, err := pool.Next() + if err != nil { + b.Fatalf("Unexpected error: %s", err) + } for i := 0; i < b.N; i++ { - if err := pool.Resurrect(c); err != nil { + if err := pool.OnSuccess(c); err != nil { b.Errorf("Unexpected error: %v", err) } } @@ -178,11 +198,13 @@ func BenchmarkRoundRobinConnectionPool(b *testing.B) { b.Run("Parallel (10)", func(b *testing.B) { b.SetParallelism(10) b.RunParallel(func(pb *testing.PB) { - c, _ := pool.Next() - pool.Remove(c) + c, err := pool.Next() + if err != nil { + b.Fatalf("Unexpected error: %s", err) + } for pb.Next() { - if err := pool.Resurrect(c); err != nil { + if err := pool.OnSuccess(c); err != nil { b.Errorf("Unexpected error: %v", err) } } @@ -192,13 +214,85 @@ func BenchmarkRoundRobinConnectionPool(b *testing.B) { b.Run("Parallel (100)", func(b *testing.B) { b.SetParallelism(100) b.RunParallel(func(pb *testing.PB) { - c, _ := pool.Next() - pool.Remove(c) + c, err := pool.Next() + if err != nil { + b.Fatalf("Unexpected error: %s", err) + } + + for pb.Next() { + if err := pool.OnSuccess(c); err != nil { + b.Errorf("Unexpected error: %v", err) + } + } + }) + }) + }) + + b.Run("resurrect()", func(b *testing.B) { + pool := &statusConnectionPool{ + live: conns, + selector: &roundRobinSelector{curr: -1}, + } + + b.Run("Single", func(b *testing.B) { + c, err := pool.Next() + if err != nil { + b.Fatalf("Unexpected error: %s", err) + } + err = pool.OnFailure(c) + if err != nil { + b.Fatalf("Unexpected error: %s", err) + } + + for i := 0; i < b.N; i++ { + pool.Lock() + if err := pool.resurrect(c, true); err != nil { + b.Errorf("Unexpected error: %v", err) + } + pool.Unlock() + } + }) + + b.Run("Parallel (10)", func(b *testing.B) { + b.SetParallelism(10) + b.RunParallel(func(pb *testing.PB) { + c, err := pool.Next() + if err != nil { + b.Fatalf("Unexpected error: %s", err) + } + err = pool.OnFailure(c) + if err != nil { + b.Fatalf("Unexpected error: %s", err) + } + + for pb.Next() { + pool.Lock() + if err := pool.resurrect(c, true); err != nil { + b.Errorf("Unexpected error: %v", err) + } + pool.Unlock() + } + }) + }) + + b.Run("Parallel (100)", func(b *testing.B) { + b.SetParallelism(100) + b.RunParallel(func(pb *testing.PB) { + c, err := pool.Next() + if err != nil { + b.Fatalf("Unexpected error: %s", err) + } + err = pool.OnFailure(c) + if err != nil { + b.Fatalf("Unexpected error: %s", err) + } for pb.Next() { - if err := pool.Resurrect(c); err != nil { + pool.Lock() + if err := pool.resurrect(c, true); err != nil { b.Errorf("Unexpected error: %v", err) } + pool.Unlock() } }) }) diff --git a/estransport/connection_integration_test.go b/estransport/connection_integration_test.go index db3d9c0113..e848522732 100644 --- a/estransport/connection_integration_test.go +++ b/estransport/connection_integration_test.go @@ -19,7 +19,7 @@ func NewServer(addr string, handler http.Handler) *http.Server { return &http.Server{Addr: addr, Handler: handler} } -func TestRoundRobinConnectionPool(t *testing.T) { +func TestStatusConnectionPool(t *testing.T) { defaultResurrectTimeoutInitial = time.Second defer func() { defaultResurrectTimeoutInitial = 60 * time.Second }() @@ -64,7 +64,7 @@ func TestRoundRobinConnectionPool(t *testing.T) { EnableDebugLogger: true, }) - pool := transport.pool.(*roundRobinConnectionPool) + pool := transport.pool.(*statusConnectionPool) for i := 1; i <= 9; i++ { req, _ := http.NewRequest("GET", "/", nil) diff --git a/estransport/connection_internal_test.go b/estransport/connection_internal_test.go index 9c9d781565..1b8aaf20a8 100644 --- a/estransport/connection_internal_test.go +++ b/estransport/connection_internal_test.go @@ -8,13 +8,16 @@ package estransport import ( "net/url" + "regexp" "testing" "time" ) func TestSingleConnectionPoolNext(t *testing.T) { t.Run("Single URL", func(t *testing.T) { - pool := newSingleConnectionPool(&url.URL{Scheme: "http", Host: "foo1"}) + pool := &singleConnectionPool{ + connection: &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}}, + } for i := 0; i < 7; i++ { c, err := pool.Next() @@ -29,19 +32,21 @@ func TestSingleConnectionPoolNext(t *testing.T) { }) } -func TestSingleConnectionPoolRemove(t *testing.T) { +func TestSingleConnectionPoolOnFailure(t *testing.T) { t.Run("Noop", func(t *testing.T) { - pool := newSingleConnectionPool(&url.URL{Scheme: "http", Host: "foo1"}) + pool := &singleConnectionPool{ + connection: &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}}, + } - if err := pool.Remove(&Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}}); err != nil { + if err := pool.OnFailure(&Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}}); err != nil { t.Errorf("Unexpected error: %s", err) } }) } -func TestRoundRobinConnectionPoolNext(t *testing.T) { +func TestStatusConnectionPoolNext(t *testing.T) { t.Run("No URL", func(t *testing.T) { - pool := newRoundRobinConnectionPool() + pool := &statusConnectionPool{} c, err := pool.Next() if err == nil { @@ -52,11 +57,16 @@ func TestRoundRobinConnectionPoolNext(t *testing.T) { t.Run("Two URLs", func(t *testing.T) { var c *Connection - pool := newRoundRobinConnectionPool( - &url.URL{Scheme: "http", Host: "foo1"}, - &url.URL{Scheme: "http", Host: "foo2"}) + pool := &statusConnectionPool{ + live: []*Connection{ + &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}}, + &Connection{URL: &url.URL{Scheme: "http", Host: "foo2"}}, + }, + selector: &roundRobinSelector{curr: -1}, + } c, _ = pool.Next() + if c.URL.String() != "http://foo1" { t.Errorf("Unexpected URL, want=foo1, got=%s", c.URL) } @@ -73,10 +83,14 @@ func TestRoundRobinConnectionPoolNext(t *testing.T) { }) t.Run("Three URLs", func(t *testing.T) { - pool := newRoundRobinConnectionPool( - &url.URL{Scheme: "http", Host: "foo1"}, - &url.URL{Scheme: "http", Host: "foo2"}, - &url.URL{Scheme: "http", Host: "foo3"}) + pool := &statusConnectionPool{ + live: []*Connection{ + &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}}, + &Connection{URL: &url.URL{Scheme: "http", Host: "foo2"}}, + &Connection{URL: &url.URL{Scheme: "http", Host: "foo3"}}, + }, + selector: &roundRobinSelector{curr: -1}, + } var expected string for i := 0; i < 11; i++ { @@ -104,12 +118,13 @@ func TestRoundRobinConnectionPoolNext(t *testing.T) { }) t.Run("Resurrect dead connection when no live is available", func(t *testing.T) { - pool := &roundRobinConnectionPool{ + pool := &statusConnectionPool{ live: []*Connection{}, dead: []*Connection{ &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}, Failures: 3}, &Connection{URL: &url.URL{Scheme: "http", Host: "foo2"}, Failures: 1}, }, + selector: &roundRobinSelector{curr: -1}, } c, err := pool.Next() @@ -125,7 +140,7 @@ func TestRoundRobinConnectionPoolNext(t *testing.T) { t.Errorf("Expected , got: %s", c.URL.String()) } - if c.Dead { + if c.IsDead { t.Errorf("Expected connection to be live, got: %s", c) } @@ -137,38 +152,44 @@ func TestRoundRobinConnectionPoolNext(t *testing.T) { t.Errorf("Expected 1 connection in dead list, got: %s", pool.dead) } }) +} - t.Run("Cut off the index", func(t *testing.T) { - pool := &roundRobinConnectionPool{ - curr: 99, - live: []*Connection{ - &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}}, - &Connection{URL: &url.URL{Scheme: "http", Host: "foo2"}}, - &Connection{URL: &url.URL{Scheme: "http", Host: "foo3"}}, - &Connection{URL: &url.URL{Scheme: "http", Host: "foo4"}}, +func TestStatusConnectionPoolOnSuccess(t *testing.T) { + t.Run("Move connection to live list and mark it as healthy", func(t *testing.T) { + pool := &statusConnectionPool{ + dead: []*Connection{ + &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}, Failures: 3, IsDead: true}, }, + selector: &roundRobinSelector{curr: -1}, } - c, err := pool.Next() - if err != nil { + conn := pool.dead[0] + + if err := pool.OnSuccess(conn); err != nil { t.Fatalf("Unexpected error: %s", err) } - // Return first connection - if c.URL.String() != "http://foo1" { - t.Errorf("Expected http://foo1, got: %s", c.URL.String()) + if conn.IsDead { + t.Errorf("Expected the connection to be live; %s", conn) } - // Reset the index; (cp.curr + 1) % len(cp.live) - if pool.curr != 0 { - t.Errorf("Expected curr to be 0, got: %d", pool.curr) + if !conn.DeadSince.IsZero() { + t.Errorf("Unexpected value for DeadSince: %s", conn.DeadSince) + } + + if len(pool.live) != 1 { + t.Errorf("Expected 1 live connection, got: %d", len(pool.live)) + } + + if len(pool.dead) != 0 { + t.Errorf("Expected 0 dead connections, got: %d", len(pool.dead)) } }) } -func TestRoundRobinConnectionPoolRemove(t *testing.T) { +func TestStatusConnectionPoolOnFailure(t *testing.T) { t.Run("Remove connection, mark it, and sort dead connections", func(t *testing.T) { - pool := &roundRobinConnectionPool{ + pool := &statusConnectionPool{ live: []*Connection{ &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}}, &Connection{URL: &url.URL{Scheme: "http", Host: "foo2"}}, @@ -177,18 +198,23 @@ func TestRoundRobinConnectionPoolRemove(t *testing.T) { &Connection{URL: &url.URL{Scheme: "http", Host: "foo3"}, Failures: 0}, &Connection{URL: &url.URL{Scheme: "http", Host: "foo4"}, Failures: 99}, }, + selector: &roundRobinSelector{curr: -1}, } conn := pool.live[0] - if err := pool.Remove(conn); err != nil { + if err := pool.OnFailure(conn); err != nil { t.Fatalf("Unexpected error: %s", err) } - if !conn.Dead { + if !conn.IsDead { t.Errorf("Expected the connection to be dead; %s", conn) } + if conn.DeadSince.IsZero() { + t.Errorf("Unexpected value for DeadSince: %s", conn.DeadSince) + } + if len(pool.live) != 1 { t.Errorf("Expected 1 live connection, got: %d", len(pool.live)) } @@ -211,15 +237,19 @@ func TestRoundRobinConnectionPoolRemove(t *testing.T) { }) t.Run("Short circuit when the connection is already dead", func(t *testing.T) { - pool := newRoundRobinConnectionPool( - &url.URL{Scheme: "http", Host: "foo1"}, - &url.URL{Scheme: "http", Host: "foo2"}, - &url.URL{Scheme: "http", Host: "foo3"}) + pool := &statusConnectionPool{ + live: []*Connection{ + &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}}, + &Connection{URL: &url.URL{Scheme: "http", Host: "foo2"}}, + &Connection{URL: &url.URL{Scheme: "http", Host: "foo3"}}, + }, + selector: &roundRobinSelector{curr: -1}, + } conn := pool.live[0] - conn.Dead = true + conn.IsDead = true - if err := pool.Remove(conn); err != nil { + if err := pool.OnFailure(conn); err != nil { t.Fatalf("Unexpected error: %s", err) } @@ -227,49 +257,23 @@ func TestRoundRobinConnectionPoolRemove(t *testing.T) { t.Errorf("Expected the dead list to be empty, got: %s", pool.dead) } }) - - t.Run("Short circuit when the connection is already removed from live list", func(t *testing.T) { - pool := newRoundRobinConnectionPool( - &url.URL{Scheme: "http", Host: "foo1"}, - &url.URL{Scheme: "http", Host: "foo2"}, - &url.URL{Scheme: "http", Host: "foo3"}) - - conn := pool.live[0] - - // Remove connection manually - index := 0 - copy(pool.live[index:], pool.live[index+1:]) - pool.live = pool.live[:len(pool.live)-1] - - if err := pool.Remove(conn); err != nil { - t.Fatalf("Unexpected error: %s", err) - } - - if len(pool.live) != 2 { - t.Errorf("Expected 2 live connections, got: %s", pool.live) - } - - if len(pool.dead) != 1 { - t.Logf("pool.dead: %s", pool.dead) - t.Errorf("Expected 1 dead connection, got: %s", pool.dead) - } - }) } -func TestRoundRobinConnectionPoolResurrect(t *testing.T) { +func TestStatusConnectionPoolResurrect(t *testing.T) { t.Run("Mark the connection as dead and add/remove it to the lists", func(t *testing.T) { - pool := &roundRobinConnectionPool{ - live: []*Connection{}, - dead: []*Connection{&Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}, Dead: true}}, + pool := &statusConnectionPool{ + live: []*Connection{}, + dead: []*Connection{&Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}, IsDead: true}}, + selector: &roundRobinSelector{curr: -1}, } conn := pool.dead[0] - if err := pool.Resurrect(conn); err != nil { + if err := pool.resurrect(conn, true); err != nil { t.Fatalf("Unexpected error: %s", err) } - if conn.Dead { + if conn.IsDead { t.Errorf("Expected connection to be dead, got: %s", conn) } @@ -282,32 +286,15 @@ func TestRoundRobinConnectionPoolResurrect(t *testing.T) { } }) - t.Run("Short circuit when the connection is already marked as live", func(t *testing.T) { - pool := &roundRobinConnectionPool{} - - conn := &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}, Dead: false} - - if err := pool.Resurrect(conn); err != nil { - t.Fatalf("Unexpected error: %s", err) - } - - if len(pool.live) != 0 { - t.Errorf("Expected no live connections, got: %s", pool.live) - } - - if len(pool.dead) != 0 { - t.Errorf("Expected no dead connections, got: %s", pool.dead) - } - }) - t.Run("Short circuit removal when the connection is not in the dead list", func(t *testing.T) { - pool := &roundRobinConnectionPool{ - dead: []*Connection{&Connection{URL: &url.URL{Scheme: "http", Host: "bar"}, Dead: true}}, + pool := &statusConnectionPool{ + dead: []*Connection{&Connection{URL: &url.URL{Scheme: "http", Host: "bar"}, IsDead: true}}, + selector: &roundRobinSelector{curr: -1}, } - conn := &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}, Dead: true} + conn := &Connection{URL: &url.URL{Scheme: "http", Host: "foo1"}, IsDead: true} - if err := pool.Resurrect(conn); err != nil { + if err := pool.resurrect(conn, true); err != nil { t.Fatalf("Unexpected error: %s", err) } @@ -324,16 +311,17 @@ func TestRoundRobinConnectionPoolResurrect(t *testing.T) { defaultResurrectTimeoutInitial = 0 defer func() { defaultResurrectTimeoutInitial = 60 * time.Second }() - pool := &roundRobinConnectionPool{ + pool := &statusConnectionPool{ live: []*Connection{}, dead: []*Connection{ &Connection{ URL: &url.URL{Scheme: "http", Host: "foo1"}, Failures: 100, - Dead: true, + IsDead: true, DeadSince: time.Now().UTC(), }, }, + selector: &roundRobinSelector{curr: -1}, } conn := pool.dead[0] @@ -351,3 +339,27 @@ func TestRoundRobinConnectionPoolResurrect(t *testing.T) { } }) } + +func TestConnection(t *testing.T) { + t.Run("String", func(t *testing.T) { + conn := &Connection{ + URL: &url.URL{Scheme: "http", Host: "foo1"}, + Failures: 10, + IsDead: true, + DeadSince: time.Now().UTC(), + } + + match, err := regexp.MatchString( + ` dead=true failures=10`, + conn.String(), + ) + + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if !match { + t.Errorf("Unexpected output: %s", conn) + } + }) +} diff --git a/estransport/doc.go b/estransport/doc.go index f3573bc86d..8a4979b2dc 100644 --- a/estransport/doc.go +++ b/estransport/doc.go @@ -5,7 +5,7 @@ It is automatically included in the client provided by the github.com/elastic/go and is not intended for direct use: to configure the client, use the elasticsearch.Config struct. The default HTTP transport of the client is http.Transport; use the Transport option to customize it; -see the _examples/customization.go file in this repository for information. +see the _examples/coniguration.go and _examples/customization.go files in this repository for information. The package will automatically retry requests on network-related errors, and on specific response status codes (by default 502, 503, 504). Use the RetryOnStatus option to customize the list. @@ -20,11 +20,14 @@ implement the RetryBackoff option function; see an example in the package unit t When multiple addresses are passed in configuration, the package will use them in a round-robin fashion, and will keep track of live and dead nodes. The status of dead nodes is checked periodically. -The package defines the "Logger" interface for logging information about request and response. -It comes with several bundled loggers for logging in text and JSON. +To customize the node selection behaviour, provide a Selector implementation in the configuration. +To replace the connection pool entirely, provide a custom ConnectionPool implementation. -Use the EnableMetrics option to enable metric collection and export. +The package defines the Logger interface for logging information about request and response. +It comes with several bundled loggers for logging in text and JSON. Use the EnableDebugLogger option to enable the debugging logger for connection management. + +Use the EnableMetrics option to enable metric collection and export. */ package estransport diff --git a/estransport/estransport.go b/estransport/estransport.go index d95e856406..7783cff711 100644 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -62,6 +62,9 @@ type Config struct { Transport http.RoundTripper Logger Logger + Selector Selector + + ConnectionPoolFunc func([]*Connection, Selector) ConnectionPool } // Client represents the HTTP client. @@ -80,12 +83,11 @@ type Client struct { metrics *metrics - enableDebugLogger bool - debugLogger DebuggingLogger - transport http.RoundTripper - pool ConnectionPool logger Logger + selector Selector + pool ConnectionPool + poolFunc func([]*Connection, Selector) ConnectionPool } // New creates new HTTP client. @@ -105,11 +107,9 @@ func New(cfg Config) *Client { cfg.MaxRetries = defaultMaxRetries } - var pool ConnectionPool - if len(cfg.URLs) == 1 { - pool = newSingleConnectionPool(cfg.URLs[0]) - } else { - pool = newRoundRobinConnectionPool(cfg.URLs...) + var conns []*Connection + for _, u := range cfg.URLs { + conns = append(conns, &Connection{URL: u}) } client := Client{ @@ -124,33 +124,30 @@ func New(cfg Config) *Client { maxRetries: cfg.MaxRetries, retryBackoff: cfg.RetryBackoff, - enableDebugLogger: cfg.EnableDebugLogger, - transport: cfg.Transport, - pool: pool, logger: cfg.Logger, + selector: cfg.Selector, + poolFunc: cfg.ConnectionPoolFunc, } - if cfg.EnableMetrics { - // FIXME(karmi): Type assertion to interface - if pool, ok := client.pool.(*singleConnectionPool); ok { - client.metrics = &metrics{responses: make(map[int]int)} - pool.metrics = client.metrics - } - if pool, ok := client.pool.(*roundRobinConnectionPool); ok { - client.metrics = &metrics{responses: make(map[int]int)} - pool.metrics = client.metrics - } + if client.poolFunc != nil { + client.pool = client.poolFunc(conns, client.selector) + } else { + client.pool, _ = NewConnectionPool(conns, client.selector) } if cfg.EnableDebugLogger { - client.debugLogger = &debugLogger{Output: os.Stdout} + debugLogger = &debuggingLogger{Output: os.Stdout} + } + if cfg.EnableMetrics { + client.metrics = &metrics{responses: make(map[int]int)} + // TODO(karmi): Type assertion to interface if pool, ok := client.pool.(*singleConnectionPool); ok { - pool.debugLogger = client.debugLogger + pool.metrics = client.metrics } - if pool, ok := client.pool.(*roundRobinConnectionPool); ok { - pool.debugLogger = client.debugLogger + if pool, ok := client.pool.(*statusConnectionPool); ok { + pool.metrics = client.metrics } } @@ -166,7 +163,6 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { ) // Record metrics, when enabled - // if c.metrics != nil { c.metrics.Lock() c.metrics.requests++ @@ -174,7 +170,6 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { } // Update request - // c.setReqUserAgent(req) if req.Body != nil && req.Body != http.NoBody && req.GetBody == nil { @@ -192,15 +187,13 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { } for i := 1; i <= c.maxRetries; i++ { - // fmt.Printf("Attempt %d\n", i) var ( conn *Connection shouldRetry bool ) // Get connection from the pool - // - conn, err = c.getConnection() + conn, err = c.pool.Next() if err != nil { if c.logger != nil { c.logRoundTrip(req, nil, err, time.Time{}, time.Duration(0)) @@ -209,7 +202,6 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { } // Update request - // c.setReqURL(conn.URL, req) c.setReqAuth(conn.URL, req) @@ -222,13 +214,11 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { } // Set up time measures and execute the request - // start := time.Now().UTC() res, err = c.transport.RoundTrip(req) dur := time.Since(start) // Log request and response - // if c.logger != nil { if c.logger.RequestBodyEnabled() && req.Body != nil && req.Body != http.NoBody { req.Body, _ = req.GetBody() @@ -238,30 +228,24 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { if err != nil { // Record metrics, when enabled - // if c.metrics != nil { c.metrics.Lock() c.metrics.failures++ c.metrics.Unlock() } - // Remove the connection from pool - // - c.pool.Remove(conn) + // Report the connection as unsuccessful + c.pool.OnFailure(conn) // Retry only on network errors, but don't retry on timeout errors, unless configured - // if err, ok := err.(net.Error); ok { if (!err.Timeout() || c.enableRetryOnTimeout) && !c.disableRetry { shouldRetry = true } } } else { - // Reset the failure counter - // - conn.Lock() - conn.markAsHealthy() - conn.Unlock() + // Report the connection as succesfull + c.pool.OnSuccess(conn) } if res != nil && c.metrics != nil { @@ -271,7 +255,6 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { } // Retry on configured response statuses - // if res != nil && !c.disableRetry { for _, code := range c.retryOnStatus { if res.StatusCode == code { @@ -281,13 +264,11 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { } // Break if retry should not be performed - // if !shouldRetry { break } // Delay the retry if a backoff function is configured - // if c.retryBackoff != nil { time.Sleep(c.retryBackoff(i)) } @@ -299,15 +280,9 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { // URLs returns a list of transport URLs. // -// TODO(karmi): Refactor to take into account live, dead, orig lists. -// // func (c *Client) URLs() []*url.URL { - return c.urls -} - -func (c *Client) getConnection() (*Connection, error) { - return c.pool.Next() + return c.pool.URLs() } func (c *Client) setReqURL(u *url.URL, req *http.Request) *http.Request { diff --git a/estransport/estransport_internal_test.go b/estransport/estransport_internal_test.go index 94eeb402a7..89b40bba87 100644 --- a/estransport/estransport_internal_test.go +++ b/estransport/estransport_internal_test.go @@ -9,6 +9,7 @@ package estransport import ( "fmt" "io/ioutil" + "math/rand" "net/http" "net/url" "reflect" @@ -21,6 +22,10 @@ var ( _ = fmt.Print ) +func init() { + rand.Seed(time.Now().Unix()) +} + type mockTransp struct { RoundTripFunc func(req *http.Request) (*http.Response, error) } @@ -145,8 +150,8 @@ func TestTransportConnectionPool(t *testing.T) { {Scheme: "http", Host: "foo2"}, }}) - if _, ok := tp.pool.(*roundRobinConnectionPool); !ok { - t.Errorf("Expected connection to be roundRobinConnectionPool, got: %T", tp) + if _, ok := tp.pool.(*statusConnectionPool); !ok { + t.Errorf("Expected connection to be statusConnectionPool, got: %T", tp) } conn, err = tp.pool.Next() @@ -175,6 +180,65 @@ func TestTransportConnectionPool(t *testing.T) { }) } +type CustomConnectionPool struct { + urls []*url.URL +} + +// Next returns a random connection. +func (cp *CustomConnectionPool) Next() (*Connection, error) { + u := cp.urls[rand.Intn(len(cp.urls))] + return &Connection{URL: u}, nil +} + +func (cp *CustomConnectionPool) OnFailure(c *Connection) error { + var index = -1 + for i, u := range cp.urls { + if u == c.URL { + index = i + } + } + if index > -1 { + cp.urls = append(cp.urls[:index], cp.urls[index+1:]...) + return nil + } + return fmt.Errorf("connection not found") +} +func (cp *CustomConnectionPool) OnSuccess(c *Connection) error { return nil } +func (cp *CustomConnectionPool) URLs() []*url.URL { return cp.urls } + +func TestTransportCustomConnectionPool(t *testing.T) { + t.Run("Run", func(t *testing.T) { + tp := New(Config{ + ConnectionPoolFunc: func(conns []*Connection, selector Selector) ConnectionPool { + return &CustomConnectionPool{ + urls: []*url.URL{ + {Scheme: "http", Host: "custom1"}, + {Scheme: "http", Host: "custom2"}, + }, + } + }, + }) + + if _, ok := tp.pool.(*CustomConnectionPool); !ok { + t.Fatalf("Unexpected connection pool, want=CustomConnectionPool, got=%T", tp.pool) + } + + conn, err := tp.pool.Next() + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + if conn.URL == nil { + t.Errorf("Empty connection URL: %+v", conn) + } + if err := tp.pool.OnFailure(conn); err != nil { + t.Errorf("Error removing the %q connection: %s", conn.URL, err) + } + if len(tp.pool.URLs()) != 1 { + t.Errorf("Unexpected number of connections in pool: %q", tp.pool) + } + }) +} + func TestTransportPerform(t *testing.T) { t.Run("Executes", func(t *testing.T) { u, _ := url.Parse("https://foo.com/bar") diff --git a/estransport/logger.go b/estransport/logger.go index 02b922dd29..4f0af98a3a 100644 --- a/estransport/logger.go +++ b/estransport/logger.go @@ -18,6 +18,8 @@ import ( "time" ) +var debugLogger DebuggingLogger + // Logger defines an interface for logging request and response. // type Logger interface { @@ -69,9 +71,9 @@ type JSONLogger struct { EnableResponseBody bool } -// debugLogger prints debug messages as plain text. +// debuggingLogger prints debug messages as plain text. // -type debugLogger struct { +type debuggingLogger struct { Output io.Writer } @@ -390,14 +392,14 @@ func (l *JSONLogger) ResponseBodyEnabled() bool { return l.EnableResponseBody } // Log prints the arguments to output in default format. // -func (l *debugLogger) Log(a ...interface{}) error { +func (l *debuggingLogger) Log(a ...interface{}) error { _, err := fmt.Fprint(l.Output, a...) return err } // Logf prints formats the arguments and prints them to output. // -func (l *debugLogger) Logf(format string, a ...interface{}) error { +func (l *debuggingLogger) Logf(format string, a ...interface{}) error { _, err := fmt.Fprintf(l.Output, format, a...) return err } diff --git a/estransport/logger_internal_test.go b/estransport/logger_internal_test.go index 865af1f049..28da622b74 100644 --- a/estransport/logger_internal_test.go +++ b/estransport/logger_internal_test.go @@ -430,6 +430,21 @@ func TestTransportLogger(t *testing.T) { }) } +func TestDebuggingLogger(t *testing.T) { + logger := &debuggingLogger{Output: ioutil.Discard} + + t.Run("Log", func(t *testing.T) { + if err := logger.Log("Foo"); err != nil { + t.Errorf("Unexpected error: %s", err) + } + }) + t.Run("Logf", func(t *testing.T) { + if err := logger.Logf("Foo %d", 1); err != nil { + t.Errorf("Unexpected error: %s", err) + } + }) +} + type CustomLogger struct { Output io.Writer } diff --git a/estransport/metrics.go b/estransport/metrics.go index bc496ae06a..6a828adfc1 100644 --- a/estransport/metrics.go +++ b/estransport/metrics.go @@ -5,7 +5,6 @@ package estransport import ( - "encoding/json" "errors" "fmt" "strconv" @@ -14,19 +13,18 @@ import ( "time" ) -// For expvar, do something like this: -// -// expvar.Publish("go-elasticsearch", expvar.Func(func() interface{} { -// m, _ := es.Metrics() -// return m -// })) - // Measurable defines the interface for transports supporting metrics. // type Measurable interface { Metrics() (Metrics, error) } +// connectionable defines the interface for transports returning a list of connections. +// +type connectionable interface { + connections() []*Connection +} + // Metrics represents the transport metrics. // type Metrics struct { @@ -34,23 +32,18 @@ type Metrics struct { Failures int `json:"failures"` Responses map[int]int `json:"responses"` - Live []connectionMetric `json:"live,omitempty"` - Dead []connectionMetric `json:"dead,omitempty"` + Connections []fmt.Stringer `json:"connections"` } -// connectionMetric represents metric information for a connection. +// ConnectionMetric represents metric information for a connection. // -type connectionMetric struct { - URL string `json:"url"` - Failures int `json:"failures,omitempty"` - DeadSince nullableTime `json:"dead_since,omitempty"` - ResurrectIn time.Duration `json:"resurrect_in,omitempty"` +type ConnectionMetric struct { + URL string `json:"url"` + Failures int `json:"failures,omitempty"` + IsDead bool `json:"dead,omitempty"` + DeadSince *time.Time `json:"dead_since,omitempty"` } -// nullableTime allows to return time zero value as nil. -// -type nullableTime struct{ time.Time } - // metrics represents the inner state of metrics. // type metrics struct { @@ -60,8 +53,7 @@ type metrics struct { failures int responses map[int]int - live []*Connection - dead []*Connection + connections []*Connection } // Metrics returns the transport metrics. @@ -84,23 +76,21 @@ func (c *Client) Metrics() (Metrics, error) { Responses: c.metrics.responses, } - // FIXME(karmi): Type assertion to interface - if pool, ok := c.pool.(*roundRobinConnectionPool); ok { - for _, c := range pool.live { + if pool, ok := c.pool.(connectionable); ok { + for _, c := range pool.connections() { c.Lock() - m.Live = append(m.Live, connectionMetric{URL: c.URL.String()}) - c.Unlock() - } - for _, c := range pool.dead { - c.Lock() - m.Dead = append(m.Dead, connectionMetric{ - URL: c.URL.String(), - Failures: c.Failures, - DeadSince: nullableTime{c.DeadSince}, - // FIXME(karmi): Take factor into account - ResurrectIn: c.DeadSince.Add(defaultResurrectTimeoutInitial).Sub(time.Now().UTC()).Truncate(time.Second), - }) + cm := ConnectionMetric{ + URL: c.URL.String(), + IsDead: c.IsDead, + Failures: c.Failures, + } + + if !c.DeadSince.IsZero() { + cm.DeadSince = &c.DeadSince + } + + m.Connections = append(m.Connections, cm) c.Unlock() } } @@ -139,20 +129,10 @@ func (m Metrics) String() string { b.WriteString("]") } - b.WriteString(" Live: [") - for i, c := range m.Live { + b.WriteString(" Connections: [") + for i, c := range m.Connections { b.WriteString(c.String()) - if i+1 < len(m.Live) { - b.WriteString(", ") - } - i++ - } - b.WriteString("]") - - b.WriteString(" Dead: [") - for i, c := range m.Dead { - b.WriteString(c.String()) - if i+1 < len(m.Dead) { + if i+1 < len(m.Connections) { b.WriteString(", ") } i++ @@ -165,31 +145,19 @@ func (m Metrics) String() string { // String returns the connection information as a string. // -func (cm connectionMetric) String() string { +func (cm ConnectionMetric) String() string { var b strings.Builder b.WriteString("{") b.WriteString(cm.URL) + if cm.IsDead { + fmt.Fprintf(&b, " dead=%v", cm.IsDead) + } if cm.Failures > 0 { fmt.Fprintf(&b, " failures=%d", cm.Failures) } - if !cm.DeadSince.IsZero() { + if cm.DeadSince != nil { fmt.Fprintf(&b, " dead_since=%s", cm.DeadSince.Local().Format(time.Stamp)) } - if cm.ResurrectIn > time.Duration(0) { - fmt.Fprintf(&b, " resurrect_in=%s", cm.ResurrectIn) - } b.WriteString("}") return b.String() } - -// MarshallJSON encodes zero value of time as nil. -// -// NOTE: isEmptyValue() doesn't handle time values. -// https://golang.org/src/encoding/json/encode.go?s=10804:10846#L318 -// -func (t nullableTime) MarshalJSON() ([]byte, error) { - if t.IsZero() { - return []byte(`null`), nil - } - return json.Marshal(t.Time) -} diff --git a/estransport/metrics_internal_test.go b/estransport/metrics_internal_test.go index 0e43d3cfcb..e0e54ba612 100644 --- a/estransport/metrics_internal_test.go +++ b/estransport/metrics_internal_test.go @@ -11,8 +11,6 @@ import ( "net/http" "net/url" "regexp" - "strconv" - "strings" "testing" "time" ) @@ -55,11 +53,8 @@ func TestMetrics(t *testing.T) { if len(m.Responses) != 2 { t.Errorf("Unexpected output: %+v", m.Responses) } - if len(m.Live) != 2 { - t.Errorf("Unexpected output: %+v", m.Live) - } - if len(m.Dead) != 1 { - t.Errorf("Unexpected output: %+v", m.Dead) + if len(m.Connections) != 3 { + t.Errorf("Unexpected output: %+v", m.Connections) } }) @@ -73,29 +68,24 @@ func TestMetrics(t *testing.T) { }) t.Run("String()", func(t *testing.T) { - var m connectionMetric + var m ConnectionMetric - m = connectionMetric{ - URL: "http://foo1", - Failures: 0, - DeadSince: nullableTime{time.Time{}}, - ResurrectIn: time.Duration(0), - } + m = ConnectionMetric{URL: "http://foo1"} if m.String() != "{http://foo1}" { t.Errorf("Unexpected output: %s", m) } tt, _ := time.Parse(time.RFC3339, "2010-11-11T11:00:00Z") - m = connectionMetric{ - URL: "http://foo2", - Failures: 123, - DeadSince: nullableTime{tt}, - ResurrectIn: time.Duration(100), + m = ConnectionMetric{ + URL: "http://foo2", + IsDead: true, + Failures: 123, + DeadSince: &tt, } match, err := regexp.MatchString( - `{http://foo2 failures=123 dead_since=Nov 11 \d+:00:00 resurrect_in=100ns}`, + `{http://foo2 dead=true failures=123 dead_since=Nov 11 \d+:00:00}`, m.String(), ) if err != nil { @@ -106,27 +96,4 @@ func TestMetrics(t *testing.T) { t.Errorf("Unexpected output: %s", m) } }) - - t.Run("nullableTime.MarshalJSON()", func(t *testing.T) { - var ( - j []byte - err error - ) - - j, err = nullableTime{time.Now()}.MarshalJSON() - if err != nil { - t.Fatalf("Unexpected error: %s", err) - } - if !strings.HasPrefix(string(j), `"`+strconv.Itoa(time.Now().Year())) { - t.Errorf("Unexpected value: %s", j) - } - - j, err = nullableTime{}.MarshalJSON() - if err != nil { - t.Fatalf("Unexpected error: %s", err) - } - if string(j) != `null` { - t.Errorf("Unexpected value: %s", j) - } - }) } From c54007af664a677306b3e0935dd89d787e88c9b8 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 16 Nov 2019 10:03:43 +0100 Subject: [PATCH 147/355] Transport: Add support for node discovery This patch adds support for discovering nodes in the cluster automatically ("sniffing") and using their hostnames to replace the connections in the pool. It updates the metrics support to contain node metadata. Closes #101 (cherry picked from commit 413583419151bfec42078b5754120bb4d04bd537) --- elasticsearch.go | 29 +++- estransport/connection.go | 7 +- estransport/discovery.go | 199 +++++++++++++++++++++++++ estransport/discovery_internal_test.go | 165 ++++++++++++++++++++ estransport/doc.go | 3 +- estransport/estransport.go | 41 +++-- estransport/metrics.go | 18 +++ estransport/testdata/cert.pem | 18 +++ estransport/testdata/key.pem | 28 ++++ estransport/testdata/nodes.info.json | 83 +++++++++++ 10 files changed, 577 insertions(+), 14 deletions(-) create mode 100644 estransport/discovery.go create mode 100644 estransport/discovery_internal_test.go create mode 100644 estransport/testdata/cert.pem create mode 100644 estransport/testdata/key.pem create mode 100644 estransport/testdata/nodes.info.json diff --git a/elasticsearch.go b/elasticsearch.go index d131211981..c291c25a3e 100644 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -42,6 +42,9 @@ type Config struct { EnableRetryOnTimeout bool // Default: false. MaxRetries int // Default: 3. + DiscoverNodesOnStart bool // Discover nodes when initializing the client. Default: false. + DiscoverNodesInterval time.Duration // Discover nodes periodically. Default: disabled. + EnableMetrics bool // Enable the metrics collection. EnableDebugLogger bool // Enable the debug logging. @@ -124,6 +127,13 @@ func NewClient(cfg Config) (*Client, error) { urls = append(urls, u) } + // TODO(karmi): Refactor + if urls[0].User != nil { + cfg.Username = urls[0].User.Username() + pw, _ := urls[0].User.Password() + cfg.Password = pw + } + tp := estransport.New(estransport.Config{ URLs: urls, Username: cfg.Username, @@ -139,13 +149,21 @@ func NewClient(cfg Config) (*Client, error) { EnableMetrics: cfg.EnableMetrics, EnableDebugLogger: cfg.EnableDebugLogger, + DiscoverNodesInterval: cfg.DiscoverNodesInterval, + Transport: cfg.Transport, Logger: cfg.Logger, Selector: cfg.Selector, ConnectionPoolFunc: cfg.ConnectionPoolFunc, }) - return &Client{Transport: tp, API: esapi.New(tp)}, nil + client := &Client{Transport: tp, API: esapi.New(tp)} + + if cfg.DiscoverNodesOnStart { + go client.DiscoverNodes() + } + + return client, nil } // Perform delegates to Transport to execute a request and return a response. @@ -163,6 +181,15 @@ func (c *Client) Metrics() (estransport.Metrics, error) { return estransport.Metrics{}, errors.New("transport is missing method Metrics()") } +// DiscoverNodes reloads the client connections by fetching information from the cluster. +// +func (c *Client) DiscoverNodes() error { + if dt, ok := c.Transport.(estransport.Discoverable); ok { + return dt.DiscoverNodes() + } + return errors.New("transport is missing method DiscoverNodes()") +} + // addrsFromEnvironment returns a list of addresses by splitting // the ELASTICSEARCH_URL environment variable with comma, or an empty list. // diff --git a/estransport/connection.go b/estransport/connection.go index 57b90f0d03..7764a503bb 100644 --- a/estransport/connection.go +++ b/estransport/connection.go @@ -43,6 +43,11 @@ type Connection struct { IsDead bool DeadSince time.Time Failures int + + ID string + Name string + Roles []string + Attributes map[string]interface{} } type singleConnectionPool struct { @@ -222,8 +227,8 @@ func (cp *statusConnectionPool) resurrect(c *Connection, removeDead bool) error } c.markAsLive() - cp.live = append(cp.live, c) + if removeDead { index := -1 for i, conn := range cp.dead { diff --git a/estransport/discovery.go b/estransport/discovery.go new file mode 100644 index 0000000000..b82291cda8 --- /dev/null +++ b/estransport/discovery.go @@ -0,0 +1,199 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +package estransport + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "sort" + "strings" + "sync" + "time" +) + +// Discoverable defines the interface for transports supporting node discovery. +// +type Discoverable interface { + DiscoverNodes() error +} + +// nodeInfo represents the information about node in a cluster. +// +// See: https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html +// +type nodeInfo struct { + ID string + Name string + URL *url.URL + Roles []string + Attributes map[string]interface{} + HTTP struct { + PublishAddress string `json:"publish_address"` + } +} + +// DiscoverNodes reloads the client connections by fetching information from the cluster. +// +func (c *Client) DiscoverNodes() error { + var conns []*Connection + + nodes, err := c.getNodesInfo() + if err != nil { + if debugLogger != nil { + debugLogger.Logf("Error getting nodes info: %s\n", err) + } + return fmt.Errorf("discovery: get nodes: %s", err) + } + + for _, node := range nodes { + var ( + isDataNode bool + isIngestNode bool + ) + + roles := append(node.Roles[:0:0], node.Roles...) + sort.Strings(roles) + + if i := sort.SearchStrings(roles, "data"); i < len(roles) && roles[i] == "data" { + isDataNode = true + } + if i := sort.SearchStrings(roles, "ingest"); i < len(roles) && roles[i] == "ingest" { + isIngestNode = true + } + + if debugLogger != nil { + var skip string + if !isDataNode || !isIngestNode { + skip = "; [SKIP]" + } + debugLogger.Logf("Discovered node [%s]; %s; roles=%s%s\n", node.Name, node.URL, node.Roles, skip) + } + + // Skip master only nodes + // TODO(karmi): Move logic to Selector? + if !isDataNode || !isIngestNode { + continue + } + + conns = append(conns, &Connection{ + URL: node.URL, + ID: node.ID, + Name: node.Name, + Roles: node.Roles, + Attributes: node.Attributes, + }) + } + + c.Lock() + defer c.Unlock() + + if lockable, ok := c.pool.(sync.Locker); ok { + lockable.Lock() + defer lockable.Unlock() + } + + if c.poolFunc != nil { + c.pool = c.poolFunc(conns, c.selector) + } else { + // TODO(karmi): Replace only live connections, leave dead scheduled for resurrect? + c.pool, err = NewConnectionPool(conns, c.selector) + if err != nil { + return err + } + } + + return nil +} + +func (c *Client) getNodesInfo() ([]nodeInfo, error) { + var ( + out []nodeInfo + scheme = c.urls[0].Scheme + ) + + req, err := http.NewRequest("GET", "/_nodes/http", nil) + if err != nil { + return out, err + } + + c.Lock() + conn, err := c.pool.Next() + c.Unlock() + // TODO(karmi): If no connection is returned, fallback to original URLs + if err != nil { + return out, err + } + + c.setReqURL(conn.URL, req) + c.setReqAuth(conn.URL, req) + c.setReqUserAgent(req) + + res, err := c.transport.RoundTrip(req) + if err != nil { + return out, err + } + defer res.Body.Close() + + if res.StatusCode > 200 { + body, _ := ioutil.ReadAll(res.Body) + return out, fmt.Errorf("server error: %s: %s", res.Status, body) + } + + var env map[string]json.RawMessage + if err := json.NewDecoder(res.Body).Decode(&env); err != nil { + return out, err + } + + var nodes map[string]nodeInfo + if err := json.Unmarshal(env["nodes"], &nodes); err != nil { + return out, err + } + + for id, node := range nodes { + node.ID = id + u, err := c.getNodeURL(node, scheme) + if err != nil { + return out, err + } + node.URL = u + out = append(out, node) + } + + return out, nil +} + +func (c *Client) getNodeURL(node nodeInfo, scheme string) (*url.URL, error) { + var ( + host string + port string + + addrs = strings.Split(node.HTTP.PublishAddress, "/") + ports = strings.Split(node.HTTP.PublishAddress, ":") + ) + + if len(addrs) > 1 { + host = addrs[0] + } else { + host = strings.Split(addrs[0], ":")[0] + } + port = ports[len(ports)-1] + + u := &url.URL{ + Scheme: scheme, + Host: host + ":" + port, + } + + return u, nil +} + +func (c *Client) scheduleDiscoverNodes(d time.Duration) { + go c.DiscoverNodes() + time.AfterFunc(c.discoverNodesInterval, func() { + c.scheduleDiscoverNodes(c.discoverNodesInterval) + }) +} diff --git a/estransport/discovery_internal_test.go b/estransport/discovery_internal_test.go new file mode 100644 index 0000000000..82929784fd --- /dev/null +++ b/estransport/discovery_internal_test.go @@ -0,0 +1,165 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build !integration + +package estransport + +import ( + "crypto/tls" + "fmt" + "io" + "net/http" + "net/url" + "os" + "testing" + "time" +) + +func TestDiscovery(t *testing.T) { + defaultHandler := func(w http.ResponseWriter, r *http.Request) { + f, err := os.Open("testdata/nodes.info.json") + if err != nil { + http.Error(w, fmt.Sprintf("Fixture error: %s", err), 500) + return + } + io.Copy(w, f) + } + + srv := &http.Server{Addr: "localhost:10100", Handler: http.HandlerFunc(defaultHandler)} + srvTLS := &http.Server{Addr: "localhost:10200", Handler: http.HandlerFunc(defaultHandler)} + + go func() { + if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed { + t.Fatalf("Unable to start server: %s", err) + } + }() + go func() { + if err := srvTLS.ListenAndServeTLS("testdata/cert.pem", "testdata/key.pem"); err != nil && err != http.ErrServerClosed { + t.Fatalf("Unable to start server: %s", err) + } + }() + defer func() { srv.Close() }() + defer func() { srvTLS.Close() }() + + time.Sleep(time.Millisecond) + + t.Run("getNodesInfo()", func(t *testing.T) { + u, _ := url.Parse("http://" + srv.Addr) + tp := New(Config{URLs: []*url.URL{u}}) + + nodes, err := tp.getNodesInfo() + if err != nil { + t.Fatalf("ERROR: %s", err) + } + fmt.Printf("NodesInfo: %+v\n", nodes) + + if len(nodes) != 3 { + t.Errorf("Unexpected number of nodes, want=3, got=%d", len(nodes)) + } + + for _, node := range nodes { + switch node.Name { + case "es1": + if node.URL.String() != "http://127.0.0.1:9200" { + t.Errorf("Unexpected URL: %s", node.URL.String()) + } + case "es2": + if node.URL.String() != "http://localhost:9201" { + t.Errorf("Unexpected URL: %s", node.URL.String()) + } + case "es3": + if node.URL.String() != "http://127.0.0.1:9202" { + t.Errorf("Unexpected URL: %s", node.URL.String()) + } + } + } + }) + + t.Run("DiscoverNodes()", func(t *testing.T) { + u, _ := url.Parse("http://" + srv.Addr) + tp := New(Config{URLs: []*url.URL{u}}) + + tp.DiscoverNodes() + + pool, ok := tp.pool.(*statusConnectionPool) + if !ok { + t.Fatalf("Unexpected pool, want=statusConnectionPool, got=%T", tp.pool) + } + + if len(pool.live) != 2 { + t.Errorf("Unexpected number of nodes, want=2, got=%d", len(pool.live)) + } + + for _, conn := range pool.live { + switch conn.Name { + case "es1": + if conn.URL.String() != "http://127.0.0.1:9200" { + t.Errorf("Unexpected URL: %s", conn.URL.String()) + } + case "es2": + if conn.URL.String() != "http://localhost:9201" { + t.Errorf("Unexpected URL: %s", conn.URL.String()) + } + default: + t.Errorf("Unexpected node: %s", conn.Name) + } + } + }) + + t.Run("DiscoverNodes() with SSL and authorization", func(t *testing.T) { + u, _ := url.Parse("https://" + srvTLS.Addr) + tp := New(Config{ + URLs: []*url.URL{u}, + Username: "foo", + Password: "bar", + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{ + InsecureSkipVerify: true, + }, + }, + }) + + tp.DiscoverNodes() + + pool, ok := tp.pool.(*statusConnectionPool) + if !ok { + t.Fatalf("Unexpected pool, want=statusConnectionPool, got=%T", tp.pool) + } + + if len(pool.live) != 2 { + t.Errorf("Unexpected number of nodes, want=2, got=%d", len(pool.live)) + } + + for _, conn := range pool.live { + switch conn.Name { + case "es1": + if conn.URL.String() != "https://127.0.0.1:9200" { + t.Errorf("Unexpected URL: %s", conn.URL.String()) + } + case "es2": + if conn.URL.String() != "https://localhost:9201" { + t.Errorf("Unexpected URL: %s", conn.URL.String()) + } + default: + t.Errorf("Unexpected node: %s", conn.Name) + } + } + }) + + t.Run("scheduleDiscoverNodes()", func(t *testing.T) { + u, _ := url.Parse("http://" + srv.Addr) + + tp := New(Config{URLs: []*url.URL{u}, DiscoverNodesInterval: time.Millisecond}) + + if len(tp.pool.URLs()) != 1 { + t.Errorf("Unexpected number of nodes, want=1, got=%d", len(tp.pool.URLs())) + } + + time.Sleep(5 * time.Millisecond) + if len(tp.pool.URLs()) != 2 { + t.Errorf("Unexpected number of nodes, want=2, got=%d", len(tp.pool.URLs())) + } + }) +} diff --git a/estransport/doc.go b/estransport/doc.go index 8a4979b2dc..096b730707 100644 --- a/estransport/doc.go +++ b/estransport/doc.go @@ -21,7 +21,8 @@ When multiple addresses are passed in configuration, the package will use them i and will keep track of live and dead nodes. The status of dead nodes is checked periodically. To customize the node selection behaviour, provide a Selector implementation in the configuration. -To replace the connection pool entirely, provide a custom ConnectionPool implementation. +To replace the connection pool entirely, provide a custom ConnectionPool implementation via +the ConnectionPoolFunc option. The package defines the Logger interface for logging information about request and response. It comes with several bundled loggers for logging in text and JSON. diff --git a/estransport/estransport.go b/estransport/estransport.go index 7783cff711..5da0f7ca86 100644 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -16,6 +16,7 @@ import ( "regexp" "runtime" "strings" + "sync" "time" "github.com/elastic/go-elasticsearch/v7/internal/version" @@ -60,6 +61,8 @@ type Config struct { EnableMetrics bool EnableDebugLogger bool + DiscoverNodesInterval time.Duration + Transport http.RoundTripper Logger Logger Selector Selector @@ -70,16 +73,19 @@ type Config struct { // Client represents the HTTP client. // type Client struct { + sync.Mutex + urls []*url.URL username string password string apikey string - retryOnStatus []int - disableRetry bool - enableRetryOnTimeout bool - maxRetries int - retryBackoff func(attempt int) time.Duration + retryOnStatus []int + disableRetry bool + enableRetryOnTimeout bool + maxRetries int + retryBackoff func(attempt int) time.Duration + discoverNodesInterval time.Duration metrics *metrics @@ -90,7 +96,7 @@ type Client struct { poolFunc func([]*Connection, Selector) ConnectionPool } -// New creates new HTTP client. +// New creates new transport client. // // http.DefaultTransport will be used if no transport is passed in the configuration. // @@ -118,11 +124,12 @@ func New(cfg Config) *Client { password: cfg.Password, apikey: cfg.APIKey, - retryOnStatus: cfg.RetryOnStatus, - disableRetry: cfg.DisableRetry, - enableRetryOnTimeout: cfg.EnableRetryOnTimeout, - maxRetries: cfg.MaxRetries, - retryBackoff: cfg.RetryBackoff, + retryOnStatus: cfg.RetryOnStatus, + disableRetry: cfg.DisableRetry, + enableRetryOnTimeout: cfg.EnableRetryOnTimeout, + maxRetries: cfg.MaxRetries, + retryBackoff: cfg.RetryBackoff, + discoverNodesInterval: cfg.DiscoverNodesInterval, transport: cfg.Transport, logger: cfg.Logger, @@ -151,6 +158,12 @@ func New(cfg Config) *Client { } } + if client.discoverNodesInterval > 0 { + time.AfterFunc(client.discoverNodesInterval, func() { + client.scheduleDiscoverNodes(client.discoverNodesInterval) + }) + } + return &client } @@ -193,7 +206,9 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { ) // Get connection from the pool + c.Lock() conn, err = c.pool.Next() + c.Unlock() if err != nil { if c.logger != nil { c.logRoundTrip(req, nil, err, time.Time{}, time.Duration(0)) @@ -235,7 +250,9 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { } // Report the connection as unsuccessful + c.Lock() c.pool.OnFailure(conn) + c.Unlock() // Retry only on network errors, but don't retry on timeout errors, unless configured if err, ok := err.(net.Error); ok { @@ -245,7 +262,9 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { } } else { // Report the connection as succesfull + c.Lock() c.pool.OnSuccess(conn) + c.Unlock() } if res != nil && c.metrics != nil { diff --git a/estransport/metrics.go b/estransport/metrics.go index 6a828adfc1..c01df0a2c3 100644 --- a/estransport/metrics.go +++ b/estransport/metrics.go @@ -42,6 +42,12 @@ type ConnectionMetric struct { Failures int `json:"failures,omitempty"` IsDead bool `json:"dead,omitempty"` DeadSince *time.Time `json:"dead_since,omitempty"` + + Meta struct { + ID string `json:"id"` + Name string `json:"name"` + Roles []string `json:"roles"` + } `json:"meta"` } // metrics represents the inner state of metrics. @@ -90,6 +96,18 @@ func (c *Client) Metrics() (Metrics, error) { cm.DeadSince = &c.DeadSince } + if c.ID != "" { + cm.Meta.ID = c.ID + } + + if c.Name != "" { + cm.Meta.Name = c.Name + } + + if len(c.Roles) > 0 { + cm.Meta.Roles = c.Roles + } + m.Connections = append(m.Connections, cm) c.Unlock() } diff --git a/estransport/testdata/cert.pem b/estransport/testdata/cert.pem new file mode 100644 index 0000000000..75310cf935 --- /dev/null +++ b/estransport/testdata/cert.pem @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE----- +MIIC+jCCAeKgAwIBAgIRAPX2ep98yDY2s0ykr/Mv7DAwDQYJKoZIhvcNAQELBQAw +EjEQMA4GA1UEChMHQWNtZSBDbzAeFw0xOTExMDIwOTIyNDZaFw0yMDExMDEwOTIy +NDZaMBIxEDAOBgNVBAoTB0FjbWUgQ28wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQDB0m5QrKyFALYrB2Dpac8RK1cU3edoiowIS00GRHm3dp7oeqmbXwJ4 +RFDDejM1NkVigkLSzCoDZQIUDiNQ1q7TdWQyWpiTv8d1MlT8kIq3wup4DyFPKEDZ +C1X1fZeitOhj08E5X55voq5QAQLfCeSCWB4aP8+/e3KMgSk4GjKxfkAjoT6fSc38 +atdRZ1TTzwCJupiAZ54zYlL7gGDjw8K8Y7xRUYD+QiD7onghb0+jJbhShTUO3Rli +nMfdeqICGN8LOqBfOuxAm1tl/+LFnqI8B/tJ8uo3YrOH2CXt1v8EauASEnIRXKTX +Nrf+y1+PZlYwIkCDVQW8oYCqXzexY/q5AgMBAAGjSzBJMA4GA1UdDwEB/wQEAwIF +oDATBgNVHSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMBQGA1UdEQQNMAuC +CWxvY2FsaG9zdDANBgkqhkiG9w0BAQsFAAOCAQEADamo8m4XkgvX56TDQJiII8Zl +S5d1GnCKxzqHXbDse7d5fOUl3FjO5ZaMbn0CiExv8tWbHlg7P9NCsBrqAxUTReKE +cWTywC99wvQzEqfSJfW/Q8vTbbOw4uM9RgYDG+mfk66KC+M2MN81i/cHUKxq7N7v +7Y6s16rtxqFzerGgAKLppg52RJNDhCDPumnSHp1rm4RjrLlG+qZpo3/37mXdNd5Z +JvP/Uki4FrZw46TEbMw2f1hnXQtwgE5DoD6vDpNHG5ffVBpO6/OOfnQJtnmN3gsZ +MmdgdEzroVPY6vs9WveNyIkIHip0QgHt7jk2vW3g1lOBw1cHuwZZkUeQ9yz3bQ== +-----END CERTIFICATE----- diff --git a/estransport/testdata/key.pem b/estransport/testdata/key.pem new file mode 100644 index 0000000000..db3f890639 --- /dev/null +++ b/estransport/testdata/key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDB0m5QrKyFALYr +B2Dpac8RK1cU3edoiowIS00GRHm3dp7oeqmbXwJ4RFDDejM1NkVigkLSzCoDZQIU +DiNQ1q7TdWQyWpiTv8d1MlT8kIq3wup4DyFPKEDZC1X1fZeitOhj08E5X55voq5Q +AQLfCeSCWB4aP8+/e3KMgSk4GjKxfkAjoT6fSc38atdRZ1TTzwCJupiAZ54zYlL7 +gGDjw8K8Y7xRUYD+QiD7onghb0+jJbhShTUO3RlinMfdeqICGN8LOqBfOuxAm1tl +/+LFnqI8B/tJ8uo3YrOH2CXt1v8EauASEnIRXKTXNrf+y1+PZlYwIkCDVQW8oYCq +XzexY/q5AgMBAAECggEAJUIEPrHSwAZw/jh+4p+aVFyWcsZtU2U+oeGHvuqu0xuU +VHAv5lQPL3tCYzE8YsA5+kO8ALWKZfimu6A0HbgHB1MLnbpYlh5JgzfXqm1GnSh0 +1ftilcrRHGfXcEdiPL615WqxPAwrcp49D9gB60oFiSDTOIyHrPFYBbZWbBhtIj0i +plEOSNlqch64oRuj/jWsUOSJk3MLm00lim81yfCG8vjQxsQ1MsdJh2E0GH58t4W6 +UUvHp85iZHrPLtWt9iI9hng9b51RBKKqqyjhfEW+jNgUdOlWBNkaCTzyCjRAu9fM +7VFhzCII6APVH4NhIbotx+NoA9sTSOdRFvcpPNJMGQKBgQD0vf8P/pQfOv176Bju +fWno9ZL+bwCe1YW6FaHIMJ5vz6GR+kmDMxnjEJi9eCR9mZ8Ag4NotItTZ1lAeLdO +MkfNXMolI3GTfSZ1qVoYuExOU3BMER2XgHCCo/jPWWL50YVUAUiIJd26KPn+CnrW +EUQbtGMtnl0pg7chooeifgBHGwKBgQDKvNC0TJaQz/P8mTeJdGUfP5px37nYBM0Y +hTWGGnMiU/OhjLLOysgUANj4XG12gzz1CMwND/HldgRWoZXqMEuRr/KoWTIREra1 +vjN+HEsTrujcB3+2peUBVTOFaoFfTH1ohbUp+wYw05y9Iz7DgY/EVmnZzusdxvxL +UFda696+uwKBgGPkTH+9u71HeYCiSdLFk33HBdkde1ZY9jzuaVrpJTGjwGFxk6Ge +MNmxw3XJ3LL7CZ/PDcqlrhw7mX0sCD09XnsefU9NOSUmtpTdq21dg5+QhMw3TCmy +/bkEriALbs9iShXwdCdFtUsvQGIE6wAGihL4vGY5NfMk1JFA4jVbUkezAoGARcIO +Nducextyolm96Efqe4QRClmmwpN0VpmPPyNetlMYo1+cLtdLXMal4V88MukZUl7C +h0QTQZcICx7yTHBtsCVQY2i9d25u+74ETcJCevVWHk9ePGR8labRYXiyJy5UgGBx +Y46CJM7LQbEc6XxtEWuCZHV0JPzQ1sFALYK3U/0CgYEAps8bjTS0BR5yb/NSO+YR +Wd9/9Jh1fUgf/lWQUPBBdThOqWXtNYTHwTUdqmr6td+urlz6F2PpD7FGNBlNc8Ia +352T6k2fGNzce9bWdaxagbC4zDQeBWZtO8nLFQYUqkxf/UQSEjzHglZ0ZtpiRJ2M +TrUFwQLe98VOuKjkOsqXn5A= +-----END PRIVATE KEY----- diff --git a/estransport/testdata/nodes.info.json b/estransport/testdata/nodes.info.json new file mode 100644 index 0000000000..6c8942c963 --- /dev/null +++ b/estransport/testdata/nodes.info.json @@ -0,0 +1,83 @@ +{ + "_nodes": { + "total": 3, + "successful": 3, + "failed": 0 + }, + "cluster_name": "elasticsearch", + "nodes": { + "8g1UNpQNS06tlH1DUMBNhg": { + "name": "es1", + "transport_address": "127.0.0.1:9300", + "host": "127.0.0.1", + "ip": "127.0.0.1", + "version": "7.4.2", + "build_flavor": "default", + "build_type": "tar", + "build_hash": "2f90bbf7b93631e52bafb59b3b049cb44ec25e96", + "roles": ["ingest", "master", "data", "ml"], + "attributes": { + "ml.machine_memory": "8589934592", + "xpack.installed": "true", + "ml.max_open_jobs": "20" + }, + "http": { + "bound_address": [ + "[::1]:9200", + "127.0.0.1:9200" + ], + "publish_address": "127.0.0.1:9200", + "max_content_length_in_bytes": 104857600 + } + }, + "8YR2EBk_QvWI4guQK292RA": { + "name": "es2", + "transport_address": "127.0.0.1:9302", + "host": "127.0.0.1", + "ip": "127.0.0.1", + "version": "7.4.2", + "build_flavor": "default", + "build_type": "tar", + "build_hash": "2f90bbf7b93631e52bafb59b3b049cb44ec25e96", + "roles": ["ingest", "master", "data", "ml"], + "attributes": { + "ml.machine_memory": "8589934592", + "ml.max_open_jobs": "20", + "xpack.installed": "true" + }, + "http": { + "bound_address": [ + "127.0.0.1:9201", + "[::1]:9201", + "[fe80::1]:9201" + ], + "publish_address": "localhost/127.0.0.1:9201", + "max_content_length_in_bytes": 104857600 + } + }, + "oSVIMafYQD-4kD0Lz6H4-g": { + "name": "es3", + "transport_address": "127.0.0.1:9301", + "host": "127.0.0.1", + "ip": "127.0.0.1", + "version": "7.4.2", + "build_flavor": "default", + "build_type": "tar", + "build_hash": "2f90bbf7b93631e52bafb59b3b049cb44ec25e96", + "roles": ["master", "ml"], + "attributes": { + "ml.machine_memory": "8589934592", + "ml.max_open_jobs": "20", + "xpack.installed": "true" + }, + "http": { + "bound_address": [ + "[::1]:9202", + "127.0.0.1:9202" + ], + "publish_address": "127.0.0.1:9202", + "max_content_length_in_bytes": 104857600 + } + } + } +} From b937004db3cf5935e62ff337eaf6755fc97d450a Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 16 Nov 2019 11:02:55 +0100 Subject: [PATCH 148/355] Makefile: Update the default Elasticsearch version to 7.5-SNAPSHOT --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f60a52605e..0e61db02d8 100644 --- a/Makefile +++ b/Makefile @@ -233,7 +233,7 @@ godoc: ## Display documentation for the package GOROOT=/tmp/tmpgoroot/ GOPATH=/tmp/tmpgopath/ godoc -http=localhost:6060 -play cluster: ## Launch an Elasticsearch cluster with Docker - $(eval version ?= "elasticsearch-oss:7.4-SNAPSHOT") + $(eval version ?= "elasticsearch-oss:7.5-SNAPSHOT") ifeq ($(origin nodes), undefined) $(eval nodes = 1) endif @@ -311,7 +311,7 @@ ifdef detached endif cluster-update: ## Update the Docker image - $(eval version ?= "elasticsearch-oss:7.4-SNAPSHOT") + $(eval version ?= "elasticsearch-oss:7.5-SNAPSHOT") @echo "\033[2m→ Updating the Docker image...\033[0m" @docker pull docker.elastic.co/elasticsearch/$(version); From 40592c620e9f81fdbdfca304458c0c7ae400fbbd Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 16 Nov 2019 11:19:38 +0100 Subject: [PATCH 149/355] API: Update the APIs for Elasticsearch 7.5 (23df04b7393) --- esapi/api._.go | 252 +++++++++++------- esapi/api.bulk.go | 2 +- esapi/api.cat.aliases.go | 2 +- esapi/api.cat.allocation.go | 2 +- esapi/api.cat.count.go | 2 +- esapi/api.cat.fielddata.go | 2 +- esapi/api.cat.health.go | 2 +- esapi/api.cat.help.go | 2 +- esapi/api.cat.indices.go | 2 +- esapi/api.cat.master.go | 2 +- esapi/api.cat.nodeattrs.go | 2 +- esapi/api.cat.nodes.go | 2 +- esapi/api.cat.pending_tasks.go | 2 +- esapi/api.cat.plugins.go | 2 +- esapi/api.cat.recovery.go | 2 +- esapi/api.cat.repositories.go | 2 +- esapi/api.cat.segments.go | 2 +- esapi/api.cat.shards.go | 2 +- esapi/api.cat.snapshots.go | 2 +- esapi/api.cat.tasks.go | 2 +- esapi/api.cat.templates.go | 2 +- esapi/api.cat.thread_pool.go | 2 +- esapi/api.clear_scroll.go | 2 +- esapi/api.cluster.allocation_explain.go | 2 +- esapi/api.cluster.get_settings.go | 2 +- esapi/api.cluster.health.go | 2 +- esapi/api.cluster.pending_tasks.go | 2 +- esapi/api.cluster.put_settings.go | 2 +- esapi/api.cluster.remote_info.go | 2 +- esapi/api.cluster.reroute.go | 2 +- esapi/api.cluster.state.go | 2 +- esapi/api.cluster.stats.go | 2 +- esapi/api.count.go | 2 +- esapi/api.create.go | 2 +- esapi/api.delete.go | 2 +- esapi/api.delete_by_query.go | 2 +- esapi/api.delete_by_query_rethrottle.go | 2 +- esapi/api.delete_script.go | 2 +- esapi/api.exists.go | 2 +- esapi/api.exists_source.go | 2 +- esapi/api.explain.go | 2 +- esapi/api.field_caps.go | 2 +- esapi/api.get.go | 2 +- esapi/api.get_script.go | 2 +- esapi/api.get_source.go | 2 +- esapi/api.index.go | 4 +- esapi/api.indices.analyze.go | 2 +- esapi/api.indices.clear_cache.go | 2 +- esapi/api.indices.clone.go | 2 +- esapi/api.indices.close.go | 2 +- esapi/api.indices.create.go | 2 +- esapi/api.indices.delete.go | 2 +- esapi/api.indices.delete_alias.go | 2 +- esapi/api.indices.delete_template.go | 2 +- esapi/api.indices.exists.go | 2 +- esapi/api.indices.exists_alias.go | 2 +- esapi/api.indices.exists_template.go | 2 +- esapi/api.indices.exists_type.go | 2 +- esapi/api.indices.flush.go | 2 +- esapi/api.indices.flush_synced.go | 2 +- esapi/api.indices.forcemerge.go | 2 +- esapi/api.indices.get.go | 2 +- esapi/api.indices.get_alias.go | 2 +- esapi/api.indices.get_field_mapping.go | 2 +- esapi/api.indices.get_mapping.go | 2 +- esapi/api.indices.get_settings.go | 2 +- esapi/api.indices.get_template.go | 2 +- esapi/api.indices.get_upgrade.go | 2 +- esapi/api.indices.open.go | 2 +- esapi/api.indices.put_alias.go | 2 +- esapi/api.indices.put_mapping.go | 2 +- esapi/api.indices.put_settings.go | 2 +- esapi/api.indices.put_template.go | 2 +- esapi/api.indices.recovery.go | 2 +- esapi/api.indices.refresh.go | 2 +- esapi/api.indices.rollover.go | 2 +- esapi/api.indices.segments.go | 2 +- esapi/api.indices.shard_stores.go | 2 +- esapi/api.indices.shrink.go | 2 +- esapi/api.indices.split.go | 2 +- esapi/api.indices.stats.go | 2 +- esapi/api.indices.update_aliases.go | 2 +- esapi/api.indices.upgrade.go | 2 +- esapi/api.indices.validate_query.go | 2 +- esapi/api.info.go | 2 +- esapi/api.ingest.delete_pipeline.go | 2 +- esapi/api.ingest.get_pipeline.go | 2 +- esapi/api.ingest.processor_grok.go | 2 +- esapi/api.ingest.put_pipeline.go | 2 +- esapi/api.ingest.simulate.go | 2 +- esapi/api.mget.go | 2 +- esapi/api.msearch.go | 2 +- esapi/api.msearch_template.go | 2 +- esapi/api.mtermvectors.go | 2 +- esapi/api.nodes.hot_threads.go | 2 +- esapi/api.nodes.info.go | 2 +- esapi/api.nodes.reload_secure_settings.go | 2 +- esapi/api.nodes.stats.go | 2 +- esapi/api.nodes.usage.go | 2 +- esapi/api.ping.go | 2 +- esapi/api.put_script.go | 2 +- esapi/api.rank_eval.go | 2 +- esapi/api.reindex.go | 2 +- esapi/api.reindex_rethrottle.go | 2 +- esapi/api.render_search_template.go | 2 +- esapi/api.scripts_painless_execute.go | 2 +- esapi/api.scroll.go | 2 +- esapi/api.search.go | 2 +- esapi/api.search_shards.go | 2 +- esapi/api.search_template.go | 2 +- esapi/api.snapshot.cleanup_repository.go | 2 +- esapi/api.snapshot.create.go | 2 +- esapi/api.snapshot.create_repository.go | 2 +- esapi/api.snapshot.delete.go | 2 +- esapi/api.snapshot.delete_repository.go | 2 +- esapi/api.snapshot.get.go | 2 +- esapi/api.snapshot.get_repository.go | 2 +- esapi/api.snapshot.restore.go | 2 +- esapi/api.snapshot.status.go | 2 +- esapi/api.snapshot.verify_repository.go | 2 +- esapi/api.tasks.cancel.go | 2 +- esapi/api.tasks.get.go | 2 +- esapi/api.tasks.list.go | 2 +- esapi/api.termvectors.go | 2 +- esapi/api.update.go | 2 +- esapi/api.update_by_query.go | 2 +- esapi/api.update_by_query_rethrottle.go | 2 +- ...pi.xpack.ccr.delete_auto_follow_pattern.go | 2 +- esapi/api.xpack.ccr.follow.go | 2 +- esapi/api.xpack.ccr.follow_info.go | 2 +- esapi/api.xpack.ccr.follow_stats.go | 2 +- esapi/api.xpack.ccr.forget_follower.go | 2 +- .../api.xpack.ccr.get_auto_follow_pattern.go | 2 +- ...api.xpack.ccr.pause_auto_follow_pattern.go | 192 +++++++++++++ esapi/api.xpack.ccr.pause_follow.go | 2 +- .../api.xpack.ccr.put_auto_follow_pattern.go | 2 +- ...pi.xpack.ccr.resume_auto_follow_pattern.go | 192 +++++++++++++ esapi/api.xpack.ccr.resume_follow.go | 2 +- esapi/api.xpack.ccr.stats.go | 2 +- esapi/api.xpack.ccr.unfollow.go | 2 +- ...e_transform_deprecated.delete_transform.go | 205 ++++++++++++++ ...rame_transform_deprecated.get_transform.go | 241 +++++++++++++++++ ...ransform_deprecated.get_transform_stats.go | 233 ++++++++++++++++ ..._transform_deprecated.preview_transform.go | 190 +++++++++++++ ...rame_transform_deprecated.put_transform.go | 212 +++++++++++++++ ...me_transform_deprecated.start_transform.go | 207 ++++++++++++++ ...ame_transform_deprecated.stop_transform.go | 234 ++++++++++++++++ ...e_transform_deprecated.update_transform.go | 214 +++++++++++++++ esapi/api.xpack.enrich.delete_policy.go | 190 +++++++++++++ esapi/api.xpack.enrich.execute_policy.go | 207 ++++++++++++++ esapi/api.xpack.enrich.get_policy.go | 200 ++++++++++++++ esapi/api.xpack.enrich.put_policy.go | 197 ++++++++++++++ esapi/api.xpack.enrich.stats.go | 183 +++++++++++++ esapi/api.xpack.graph.explore.go | 2 +- esapi/api.xpack.ilm.delete_lifecycle.go | 2 +- esapi/api.xpack.ilm.explain_lifecycle.go | 2 +- esapi/api.xpack.ilm.get_lifecycle.go | 2 +- esapi/api.xpack.ilm.get_status.go | 2 +- esapi/api.xpack.ilm.move_to_step.go | 2 +- esapi/api.xpack.ilm.put_lifecycle.go | 2 +- esapi/api.xpack.ilm.remove_policy.go | 2 +- esapi/api.xpack.ilm.retry.go | 2 +- esapi/api.xpack.ilm.start.go | 2 +- esapi/api.xpack.ilm.stop.go | 2 +- esapi/api.xpack.indices.freeze.go | 2 +- ...i.xpack.indices.reload_search_analyzers.go | 2 +- esapi/api.xpack.indices.unfreeze.go | 2 +- esapi/api.xpack.license.delete.go | 2 +- esapi/api.xpack.license.get.go | 2 +- esapi/api.xpack.license.get_basic_status.go | 2 +- esapi/api.xpack.license.get_trial_status.go | 2 +- esapi/api.xpack.license.post.go | 2 +- esapi/api.xpack.license.post_start_basic.go | 2 +- esapi/api.xpack.license.post_start_trial.go | 2 +- esapi/api.xpack.migration.deprecations.go | 2 +- esapi/api.xpack.ml.close_job.go | 2 +- esapi/api.xpack.ml.delete_calendar.go | 2 +- esapi/api.xpack.ml.delete_calendar_event.go | 2 +- esapi/api.xpack.ml.delete_calendar_job.go | 2 +- ...pi.xpack.ml.delete_data_frame_analytics.go | 2 +- esapi/api.xpack.ml.delete_datafeed.go | 2 +- esapi/api.xpack.ml.delete_expired_data.go | 2 +- esapi/api.xpack.ml.delete_filter.go | 2 +- esapi/api.xpack.ml.delete_forecast.go | 2 +- esapi/api.xpack.ml.delete_job.go | 2 +- esapi/api.xpack.ml.delete_model_snapshot.go | 2 +- esapi/api.xpack.ml.estimate_memory_usage.go | 2 +- esapi/api.xpack.ml.evaluate_data_frame.go | 2 +- esapi/api.xpack.ml.find_file_structure.go | 2 +- esapi/api.xpack.ml.flush_job.go | 2 +- esapi/api.xpack.ml.forecast.go | 2 +- esapi/api.xpack.ml.get_buckets.go | 2 +- esapi/api.xpack.ml.get_calendar_events.go | 2 +- esapi/api.xpack.ml.get_calendars.go | 2 +- esapi/api.xpack.ml.get_categories.go | 2 +- .../api.xpack.ml.get_data_frame_analytics.go | 2 +- ...xpack.ml.get_data_frame_analytics_stats.go | 2 +- esapi/api.xpack.ml.get_datafeed_stats.go | 2 +- esapi/api.xpack.ml.get_datafeeds.go | 2 +- esapi/api.xpack.ml.get_filters.go | 2 +- esapi/api.xpack.ml.get_influencers.go | 2 +- esapi/api.xpack.ml.get_job_stats.go | 2 +- esapi/api.xpack.ml.get_jobs.go | 2 +- esapi/api.xpack.ml.get_model_snapshots.go | 2 +- esapi/api.xpack.ml.get_overall_buckets.go | 2 +- esapi/api.xpack.ml.get_records.go | 2 +- esapi/api.xpack.ml.info.go | 2 +- esapi/api.xpack.ml.open_job.go | 2 +- esapi/api.xpack.ml.post_calendar_events.go | 2 +- esapi/api.xpack.ml.post_data.go | 2 +- esapi/api.xpack.ml.preview_datafeed.go | 2 +- esapi/api.xpack.ml.put_calendar.go | 2 +- esapi/api.xpack.ml.put_calendar_job.go | 2 +- .../api.xpack.ml.put_data_frame_analytics.go | 2 +- esapi/api.xpack.ml.put_datafeed.go | 2 +- esapi/api.xpack.ml.put_filter.go | 2 +- esapi/api.xpack.ml.put_job.go | 2 +- esapi/api.xpack.ml.revert_model_snapshot.go | 2 +- esapi/api.xpack.ml.set_upgrade_mode.go | 2 +- ...api.xpack.ml.start_data_frame_analytics.go | 2 +- esapi/api.xpack.ml.start_datafeed.go | 2 +- .../api.xpack.ml.stop_data_frame_analytics.go | 2 +- esapi/api.xpack.ml.stop_datafeed.go | 2 +- esapi/api.xpack.ml.update_datafeed.go | 2 +- esapi/api.xpack.ml.update_filter.go | 2 +- esapi/api.xpack.ml.update_job.go | 2 +- esapi/api.xpack.ml.update_model_snapshot.go | 2 +- esapi/api.xpack.ml.validate.go | 2 +- esapi/api.xpack.ml.validate_detector.go | 2 +- esapi/api.xpack.monitoring.bulk.go | 2 +- esapi/api.xpack.rollup.delete_job.go | 2 +- esapi/api.xpack.rollup.get_jobs.go | 2 +- esapi/api.xpack.rollup.get_rollup_caps.go | 2 +- .../api.xpack.rollup.get_rollup_index_caps.go | 2 +- esapi/api.xpack.rollup.put_job.go | 2 +- esapi/api.xpack.rollup.rollup_search.go | 2 +- esapi/api.xpack.rollup.start_job.go | 2 +- esapi/api.xpack.rollup.stop_job.go | 2 +- esapi/api.xpack.security.authenticate.go | 2 +- esapi/api.xpack.security.change_password.go | 2 +- .../api.xpack.security.clear_cached_realms.go | 2 +- .../api.xpack.security.clear_cached_roles.go | 2 +- esapi/api.xpack.security.create_api_key.go | 2 +- esapi/api.xpack.security.delete_privileges.go | 2 +- esapi/api.xpack.security.delete_role.go | 2 +- .../api.xpack.security.delete_role_mapping.go | 2 +- esapi/api.xpack.security.delete_user.go | 2 +- esapi/api.xpack.security.disable_user.go | 2 +- esapi/api.xpack.security.enable_user.go | 2 +- esapi/api.xpack.security.get_api_key.go | 16 +- ...i.xpack.security.get_builtin_privileges.go | 2 +- esapi/api.xpack.security.get_privileges.go | 2 +- esapi/api.xpack.security.get_role.go | 2 +- esapi/api.xpack.security.get_role_mapping.go | 2 +- esapi/api.xpack.security.get_token.go | 2 +- esapi/api.xpack.security.get_user.go | 2 +- .../api.xpack.security.get_user_privileges.go | 2 +- esapi/api.xpack.security.has_privileges.go | 2 +- .../api.xpack.security.invalidate_api_key.go | 2 +- esapi/api.xpack.security.invalidate_token.go | 2 +- esapi/api.xpack.security.put_privileges.go | 2 +- esapi/api.xpack.security.put_role.go | 2 +- esapi/api.xpack.security.put_role_mapping.go | 2 +- esapi/api.xpack.security.put_user.go | 2 +- esapi/api.xpack.slm.delete_lifecycle.go | 2 +- esapi/api.xpack.slm.execute_lifecycle.go | 2 +- esapi/api.xpack.slm.execute_retention.go | 183 +++++++++++++ esapi/api.xpack.slm.get_lifecycle.go | 2 +- esapi/api.xpack.slm.get_stats.go | 183 +++++++++++++ esapi/api.xpack.slm.put_lifecycle.go | 2 +- esapi/api.xpack.sql.clear_cursor.go | 2 +- esapi/api.xpack.sql.query.go | 2 +- esapi/api.xpack.sql.translate.go | 2 +- esapi/api.xpack.ssl.certificates.go | 2 +- esapi/api.xpack.transform.delete_transform.go | 203 ++++++++++++++ esapi/api.xpack.transform.get_transform.go | 239 +++++++++++++++++ ...api.xpack.transform.get_transform_stats.go | 231 ++++++++++++++++ .../api.xpack.transform.preview_transform.go | 190 +++++++++++++ esapi/api.xpack.transform.put_transform.go | 210 +++++++++++++++ esapi/api.xpack.transform.start_transform.go | 205 ++++++++++++++ esapi/api.xpack.transform.stop_transform.go | 232 ++++++++++++++++ esapi/api.xpack.transform.update_transform.go | 212 +++++++++++++++ esapi/api.xpack.watcher.ack_watch.go | 2 +- esapi/api.xpack.watcher.activate_watch.go | 2 +- esapi/api.xpack.watcher.deactivate_watch.go | 2 +- esapi/api.xpack.watcher.delete_watch.go | 2 +- esapi/api.xpack.watcher.execute_watch.go | 2 +- esapi/api.xpack.watcher.get_watch.go | 2 +- esapi/api.xpack.watcher.put_watch.go | 2 +- esapi/api.xpack.watcher.start.go | 2 +- esapi/api.xpack.watcher.stats.go | 2 +- esapi/api.xpack.watcher.stop.go | 2 +- esapi/api.xpack.xpack.info.go | 2 +- esapi/api.xpack.xpack.usage.go | 2 +- 294 files changed, 5617 insertions(+), 372 deletions(-) create mode 100644 esapi/api.xpack.ccr.pause_auto_follow_pattern.go create mode 100644 esapi/api.xpack.ccr.resume_auto_follow_pattern.go create mode 100644 esapi/api.xpack.data_frame_transform_deprecated.delete_transform.go create mode 100644 esapi/api.xpack.data_frame_transform_deprecated.get_transform.go create mode 100644 esapi/api.xpack.data_frame_transform_deprecated.get_transform_stats.go create mode 100644 esapi/api.xpack.data_frame_transform_deprecated.preview_transform.go create mode 100644 esapi/api.xpack.data_frame_transform_deprecated.put_transform.go create mode 100644 esapi/api.xpack.data_frame_transform_deprecated.start_transform.go create mode 100644 esapi/api.xpack.data_frame_transform_deprecated.stop_transform.go create mode 100644 esapi/api.xpack.data_frame_transform_deprecated.update_transform.go create mode 100644 esapi/api.xpack.enrich.delete_policy.go create mode 100644 esapi/api.xpack.enrich.execute_policy.go create mode 100644 esapi/api.xpack.enrich.get_policy.go create mode 100644 esapi/api.xpack.enrich.put_policy.go create mode 100644 esapi/api.xpack.enrich.stats.go create mode 100644 esapi/api.xpack.slm.execute_retention.go create mode 100644 esapi/api.xpack.slm.get_stats.go create mode 100644 esapi/api.xpack.transform.delete_transform.go create mode 100644 esapi/api.xpack.transform.get_transform.go create mode 100644 esapi/api.xpack.transform.get_transform_stats.go create mode 100644 esapi/api.xpack.transform.preview_transform.go create mode 100644 esapi/api.xpack.transform.put_transform.go create mode 100644 esapi/api.xpack.transform.start_transform.go create mode 100644 esapi/api.xpack.transform.stop_transform.go create mode 100644 esapi/api.xpack.transform.update_transform.go diff --git a/esapi/api._.go b/esapi/api._.go index 1b671bd801..40dced64cb 100644 --- a/esapi/api._.go +++ b/esapi/api._.go @@ -1,8 +1,4 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// Code generated from specification version 7.4.2 (c1c6a413632): DO NOT EDIT +// Code generated from specification version 7.5.0 (23df04b7393): DO NOT EDIT package esapi @@ -30,55 +26,78 @@ type API struct { Watcher *Watcher XPack *XPack - Bulk Bulk - ClearScroll ClearScroll - Count Count - Create Create - DataFrameDeleteDataFrameTransform DataFrameDeleteDataFrameTransform - DataFrameGetDataFrameTransform DataFrameGetDataFrameTransform - DataFrameGetDataFrameTransformStats DataFrameGetDataFrameTransformStats - DataFramePreviewDataFrameTransform DataFramePreviewDataFrameTransform - DataFramePutDataFrameTransform DataFramePutDataFrameTransform - DataFrameStartDataFrameTransform DataFrameStartDataFrameTransform - DataFrameStopDataFrameTransform DataFrameStopDataFrameTransform - DataFrameUpdateDataFrameTransform DataFrameUpdateDataFrameTransform - DeleteByQuery DeleteByQuery - DeleteByQueryRethrottle DeleteByQueryRethrottle - Delete Delete - DeleteScript DeleteScript - Exists Exists - ExistsSource ExistsSource - Explain Explain - FieldCaps FieldCaps - Get Get - GetScript GetScript - GetSource GetSource - GraphExplore GraphExplore - Index Index - Info Info - Mget Mget - Msearch Msearch - MsearchTemplate MsearchTemplate - Mtermvectors Mtermvectors - Ping Ping - PutScript PutScript - RankEval RankEval - Reindex Reindex - ReindexRethrottle ReindexRethrottle - RenderSearchTemplate RenderSearchTemplate - ScriptsPainlessExecute ScriptsPainlessExecute - Scroll Scroll - Search Search - SearchShards SearchShards - SearchTemplate SearchTemplate - SlmDeleteLifecycle SlmDeleteLifecycle - SlmExecuteLifecycle SlmExecuteLifecycle - SlmGetLifecycle SlmGetLifecycle - SlmPutLifecycle SlmPutLifecycle - Termvectors Termvectors - UpdateByQuery UpdateByQuery - UpdateByQueryRethrottle UpdateByQueryRethrottle - Update Update + Bulk Bulk + ClearScroll ClearScroll + Count Count + Create Create + DataFrameDeleteDataFrameTransform DataFrameDeleteDataFrameTransform + DataFrameGetDataFrameTransform DataFrameGetDataFrameTransform + DataFrameGetDataFrameTransformStats DataFrameGetDataFrameTransformStats + DataFramePreviewDataFrameTransform DataFramePreviewDataFrameTransform + DataFramePutDataFrameTransform DataFramePutDataFrameTransform + DataFrameStartDataFrameTransform DataFrameStartDataFrameTransform + DataFrameStopDataFrameTransform DataFrameStopDataFrameTransform + DataFrameTransformDeprecatedDeleteTransform DataFrameTransformDeprecatedDeleteTransform + DataFrameTransformDeprecatedGetTransform DataFrameTransformDeprecatedGetTransform + DataFrameTransformDeprecatedGetTransformStats DataFrameTransformDeprecatedGetTransformStats + DataFrameTransformDeprecatedPreviewTransform DataFrameTransformDeprecatedPreviewTransform + DataFrameTransformDeprecatedPutTransform DataFrameTransformDeprecatedPutTransform + DataFrameTransformDeprecatedStartTransform DataFrameTransformDeprecatedStartTransform + DataFrameTransformDeprecatedStopTransform DataFrameTransformDeprecatedStopTransform + DataFrameTransformDeprecatedUpdateTransform DataFrameTransformDeprecatedUpdateTransform + DataFrameUpdateDataFrameTransform DataFrameUpdateDataFrameTransform + DeleteByQuery DeleteByQuery + DeleteByQueryRethrottle DeleteByQueryRethrottle + Delete Delete + DeleteScript DeleteScript + EnrichDeletePolicy EnrichDeletePolicy + EnrichExecutePolicy EnrichExecutePolicy + EnrichGetPolicy EnrichGetPolicy + EnrichPutPolicy EnrichPutPolicy + EnrichStats EnrichStats + Exists Exists + ExistsSource ExistsSource + Explain Explain + FieldCaps FieldCaps + Get Get + GetScript GetScript + GetSource GetSource + GraphExplore GraphExplore + Index Index + Info Info + Mget Mget + Msearch Msearch + MsearchTemplate MsearchTemplate + Mtermvectors Mtermvectors + Ping Ping + PutScript PutScript + RankEval RankEval + Reindex Reindex + ReindexRethrottle ReindexRethrottle + RenderSearchTemplate RenderSearchTemplate + ScriptsPainlessExecute ScriptsPainlessExecute + Scroll Scroll + Search Search + SearchShards SearchShards + SearchTemplate SearchTemplate + SlmDeleteLifecycle SlmDeleteLifecycle + SlmExecuteLifecycle SlmExecuteLifecycle + SlmExecuteRetention SlmExecuteRetention + SlmGetLifecycle SlmGetLifecycle + SlmGetStats SlmGetStats + SlmPutLifecycle SlmPutLifecycle + Termvectors Termvectors + TransformDeleteTransform TransformDeleteTransform + TransformGetTransform TransformGetTransform + TransformGetTransformStats TransformGetTransformStats + TransformPreviewTransform TransformPreviewTransform + TransformPutTransform TransformPutTransform + TransformStartTransform TransformStartTransform + TransformStopTransform TransformStopTransform + TransformUpdateTransform TransformUpdateTransform + UpdateByQuery UpdateByQuery + UpdateByQueryRethrottle UpdateByQueryRethrottle + Update Update } // Cat contains the Cat APIs @@ -214,8 +233,10 @@ type CCR struct { FollowStats CCRFollowStats ForgetFollower CCRForgetFollower GetAutoFollowPattern CCRGetAutoFollowPattern + PauseAutoFollowPattern CCRPauseAutoFollowPattern PauseFollow CCRPauseFollow PutAutoFollowPattern CCRPutAutoFollowPattern + ResumeAutoFollowPattern CCRResumeAutoFollowPattern ResumeFollow CCRResumeFollow Stats CCRStats Unfollow CCRUnfollow @@ -392,55 +413,78 @@ type XPack struct { // func New(t Transport) *API { return &API{ - Bulk: newBulkFunc(t), - ClearScroll: newClearScrollFunc(t), - Count: newCountFunc(t), - Create: newCreateFunc(t), - DataFrameDeleteDataFrameTransform: newDataFrameDeleteDataFrameTransformFunc(t), - DataFrameGetDataFrameTransform: newDataFrameGetDataFrameTransformFunc(t), - DataFrameGetDataFrameTransformStats: newDataFrameGetDataFrameTransformStatsFunc(t), - DataFramePreviewDataFrameTransform: newDataFramePreviewDataFrameTransformFunc(t), - DataFramePutDataFrameTransform: newDataFramePutDataFrameTransformFunc(t), - DataFrameStartDataFrameTransform: newDataFrameStartDataFrameTransformFunc(t), - DataFrameStopDataFrameTransform: newDataFrameStopDataFrameTransformFunc(t), - DataFrameUpdateDataFrameTransform: newDataFrameUpdateDataFrameTransformFunc(t), - DeleteByQuery: newDeleteByQueryFunc(t), - DeleteByQueryRethrottle: newDeleteByQueryRethrottleFunc(t), - Delete: newDeleteFunc(t), - DeleteScript: newDeleteScriptFunc(t), - Exists: newExistsFunc(t), - ExistsSource: newExistsSourceFunc(t), - Explain: newExplainFunc(t), - FieldCaps: newFieldCapsFunc(t), - Get: newGetFunc(t), - GetScript: newGetScriptFunc(t), - GetSource: newGetSourceFunc(t), - GraphExplore: newGraphExploreFunc(t), - Index: newIndexFunc(t), - Info: newInfoFunc(t), - Mget: newMgetFunc(t), - Msearch: newMsearchFunc(t), - MsearchTemplate: newMsearchTemplateFunc(t), - Mtermvectors: newMtermvectorsFunc(t), - Ping: newPingFunc(t), - PutScript: newPutScriptFunc(t), - RankEval: newRankEvalFunc(t), - Reindex: newReindexFunc(t), - ReindexRethrottle: newReindexRethrottleFunc(t), - RenderSearchTemplate: newRenderSearchTemplateFunc(t), - ScriptsPainlessExecute: newScriptsPainlessExecuteFunc(t), - Scroll: newScrollFunc(t), - Search: newSearchFunc(t), - SearchShards: newSearchShardsFunc(t), - SearchTemplate: newSearchTemplateFunc(t), - SlmDeleteLifecycle: newSlmDeleteLifecycleFunc(t), - SlmExecuteLifecycle: newSlmExecuteLifecycleFunc(t), - SlmGetLifecycle: newSlmGetLifecycleFunc(t), - SlmPutLifecycle: newSlmPutLifecycleFunc(t), - Termvectors: newTermvectorsFunc(t), - UpdateByQuery: newUpdateByQueryFunc(t), - UpdateByQueryRethrottle: newUpdateByQueryRethrottleFunc(t), - Update: newUpdateFunc(t), + Bulk: newBulkFunc(t), + ClearScroll: newClearScrollFunc(t), + Count: newCountFunc(t), + Create: newCreateFunc(t), + DataFrameDeleteDataFrameTransform: newDataFrameDeleteDataFrameTransformFunc(t), + DataFrameGetDataFrameTransform: newDataFrameGetDataFrameTransformFunc(t), + DataFrameGetDataFrameTransformStats: newDataFrameGetDataFrameTransformStatsFunc(t), + DataFramePreviewDataFrameTransform: newDataFramePreviewDataFrameTransformFunc(t), + DataFramePutDataFrameTransform: newDataFramePutDataFrameTransformFunc(t), + DataFrameStartDataFrameTransform: newDataFrameStartDataFrameTransformFunc(t), + DataFrameStopDataFrameTransform: newDataFrameStopDataFrameTransformFunc(t), + DataFrameTransformDeprecatedDeleteTransform: newDataFrameTransformDeprecatedDeleteTransformFunc(t), + DataFrameTransformDeprecatedGetTransform: newDataFrameTransformDeprecatedGetTransformFunc(t), + DataFrameTransformDeprecatedGetTransformStats: newDataFrameTransformDeprecatedGetTransformStatsFunc(t), + DataFrameTransformDeprecatedPreviewTransform: newDataFrameTransformDeprecatedPreviewTransformFunc(t), + DataFrameTransformDeprecatedPutTransform: newDataFrameTransformDeprecatedPutTransformFunc(t), + DataFrameTransformDeprecatedStartTransform: newDataFrameTransformDeprecatedStartTransformFunc(t), + DataFrameTransformDeprecatedStopTransform: newDataFrameTransformDeprecatedStopTransformFunc(t), + DataFrameTransformDeprecatedUpdateTransform: newDataFrameTransformDeprecatedUpdateTransformFunc(t), + DataFrameUpdateDataFrameTransform: newDataFrameUpdateDataFrameTransformFunc(t), + DeleteByQuery: newDeleteByQueryFunc(t), + DeleteByQueryRethrottle: newDeleteByQueryRethrottleFunc(t), + Delete: newDeleteFunc(t), + DeleteScript: newDeleteScriptFunc(t), + EnrichDeletePolicy: newEnrichDeletePolicyFunc(t), + EnrichExecutePolicy: newEnrichExecutePolicyFunc(t), + EnrichGetPolicy: newEnrichGetPolicyFunc(t), + EnrichPutPolicy: newEnrichPutPolicyFunc(t), + EnrichStats: newEnrichStatsFunc(t), + Exists: newExistsFunc(t), + ExistsSource: newExistsSourceFunc(t), + Explain: newExplainFunc(t), + FieldCaps: newFieldCapsFunc(t), + Get: newGetFunc(t), + GetScript: newGetScriptFunc(t), + GetSource: newGetSourceFunc(t), + GraphExplore: newGraphExploreFunc(t), + Index: newIndexFunc(t), + Info: newInfoFunc(t), + Mget: newMgetFunc(t), + Msearch: newMsearchFunc(t), + MsearchTemplate: newMsearchTemplateFunc(t), + Mtermvectors: newMtermvectorsFunc(t), + Ping: newPingFunc(t), + PutScript: newPutScriptFunc(t), + RankEval: newRankEvalFunc(t), + Reindex: newReindexFunc(t), + ReindexRethrottle: newReindexRethrottleFunc(t), + RenderSearchTemplate: newRenderSearchTemplateFunc(t), + ScriptsPainlessExecute: newScriptsPainlessExecuteFunc(t), + Scroll: newScrollFunc(t), + Search: newSearchFunc(t), + SearchShards: newSearchShardsFunc(t), + SearchTemplate: newSearchTemplateFunc(t), + SlmDeleteLifecycle: newSlmDeleteLifecycleFunc(t), + SlmExecuteLifecycle: newSlmExecuteLifecycleFunc(t), + SlmExecuteRetention: newSlmExecuteRetentionFunc(t), + SlmGetLifecycle: newSlmGetLifecycleFunc(t), + SlmGetStats: newSlmGetStatsFunc(t), + SlmPutLifecycle: newSlmPutLifecycleFunc(t), + Termvectors: newTermvectorsFunc(t), + TransformDeleteTransform: newTransformDeleteTransformFunc(t), + TransformGetTransform: newTransformGetTransformFunc(t), + TransformGetTransformStats: newTransformGetTransformStatsFunc(t), + TransformPreviewTransform: newTransformPreviewTransformFunc(t), + TransformPutTransform: newTransformPutTransformFunc(t), + TransformStartTransform: newTransformStartTransformFunc(t), + TransformStopTransform: newTransformStopTransformFunc(t), + TransformUpdateTransform: newTransformUpdateTransformFunc(t), + UpdateByQuery: newUpdateByQueryFunc(t), + UpdateByQueryRethrottle: newUpdateByQueryRethrottleFunc(t), + Update: newUpdateFunc(t), Cat: &Cat{ Aliases: newCatAliasesFunc(t), Allocation: newCatAllocationFunc(t), @@ -556,8 +600,10 @@ func New(t Transport) *API { FollowStats: newCCRFollowStatsFunc(t), ForgetFollower: newCCRForgetFollowerFunc(t), GetAutoFollowPattern: newCCRGetAutoFollowPatternFunc(t), + PauseAutoFollowPattern: newCCRPauseAutoFollowPatternFunc(t), PauseFollow: newCCRPauseFollowFunc(t), PutAutoFollowPattern: newCCRPutAutoFollowPatternFunc(t), + ResumeAutoFollowPattern: newCCRResumeAutoFollowPatternFunc(t), ResumeFollow: newCCRResumeFollowFunc(t), Stats: newCCRStatsFunc(t), Unfollow: newCCRUnfollowFunc(t), diff --git a/esapi/api.bulk.go b/esapi/api.bulk.go index e3d2799a35..651c301dbe 100644 --- a/esapi/api.bulk.go +++ b/esapi/api.bulk.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.aliases.go b/esapi/api.cat.aliases.go index cf6f52cd15..924729a384 100644 --- a/esapi/api.cat.aliases.go +++ b/esapi/api.cat.aliases.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.allocation.go b/esapi/api.cat.allocation.go index 1ee5c872d4..c2cd7dada3 100644 --- a/esapi/api.cat.allocation.go +++ b/esapi/api.cat.allocation.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.count.go b/esapi/api.cat.count.go index cf48e5335b..8f6729d0b1 100644 --- a/esapi/api.cat.count.go +++ b/esapi/api.cat.count.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.fielddata.go b/esapi/api.cat.fielddata.go index 03a146ec42..21592b05b9 100644 --- a/esapi/api.cat.fielddata.go +++ b/esapi/api.cat.fielddata.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.health.go b/esapi/api.cat.health.go index 4b0436f30f..159fd1be3a 100644 --- a/esapi/api.cat.health.go +++ b/esapi/api.cat.health.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.help.go b/esapi/api.cat.help.go index c8c6a099c2..a4bfd1cb2e 100644 --- a/esapi/api.cat.help.go +++ b/esapi/api.cat.help.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.indices.go b/esapi/api.cat.indices.go index 1e86d048de..028d31ae55 100644 --- a/esapi/api.cat.indices.go +++ b/esapi/api.cat.indices.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.master.go b/esapi/api.cat.master.go index 8f8421025c..a893d9d259 100644 --- a/esapi/api.cat.master.go +++ b/esapi/api.cat.master.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.nodeattrs.go b/esapi/api.cat.nodeattrs.go index bb720b5859..83bec67c25 100644 --- a/esapi/api.cat.nodeattrs.go +++ b/esapi/api.cat.nodeattrs.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.nodes.go b/esapi/api.cat.nodes.go index 645477f74f..894da385d8 100644 --- a/esapi/api.cat.nodes.go +++ b/esapi/api.cat.nodes.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.pending_tasks.go b/esapi/api.cat.pending_tasks.go index 2cab935e8a..42e32e95c8 100644 --- a/esapi/api.cat.pending_tasks.go +++ b/esapi/api.cat.pending_tasks.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.plugins.go b/esapi/api.cat.plugins.go index c0b502e497..f006f606b8 100644 --- a/esapi/api.cat.plugins.go +++ b/esapi/api.cat.plugins.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.recovery.go b/esapi/api.cat.recovery.go index 8111a875ee..02943d780b 100644 --- a/esapi/api.cat.recovery.go +++ b/esapi/api.cat.recovery.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.repositories.go b/esapi/api.cat.repositories.go index 917a43d470..0292479ce5 100644 --- a/esapi/api.cat.repositories.go +++ b/esapi/api.cat.repositories.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.segments.go b/esapi/api.cat.segments.go index 2f4150a78b..e27dd0f0af 100644 --- a/esapi/api.cat.segments.go +++ b/esapi/api.cat.segments.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.shards.go b/esapi/api.cat.shards.go index a9ba9843bd..111d72dd08 100644 --- a/esapi/api.cat.shards.go +++ b/esapi/api.cat.shards.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.snapshots.go b/esapi/api.cat.snapshots.go index c8675e241b..1e840cb758 100644 --- a/esapi/api.cat.snapshots.go +++ b/esapi/api.cat.snapshots.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.tasks.go b/esapi/api.cat.tasks.go index 3a395e59f9..e8407a48d6 100644 --- a/esapi/api.cat.tasks.go +++ b/esapi/api.cat.tasks.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.templates.go b/esapi/api.cat.templates.go index 6457d33f10..17f5043e4f 100644 --- a/esapi/api.cat.templates.go +++ b/esapi/api.cat.templates.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cat.thread_pool.go b/esapi/api.cat.thread_pool.go index 39b1eb07e0..28d6f4b0bd 100644 --- a/esapi/api.cat.thread_pool.go +++ b/esapi/api.cat.thread_pool.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.clear_scroll.go b/esapi/api.clear_scroll.go index 93356c10c6..6c97c79fdd 100644 --- a/esapi/api.clear_scroll.go +++ b/esapi/api.clear_scroll.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.allocation_explain.go b/esapi/api.cluster.allocation_explain.go index 8eaf24ad19..58e2629743 100644 --- a/esapi/api.cluster.allocation_explain.go +++ b/esapi/api.cluster.allocation_explain.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.get_settings.go b/esapi/api.cluster.get_settings.go index 2021da301c..d652bd90e7 100644 --- a/esapi/api.cluster.get_settings.go +++ b/esapi/api.cluster.get_settings.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.health.go b/esapi/api.cluster.health.go index 14278c5b70..207fcf617a 100644 --- a/esapi/api.cluster.health.go +++ b/esapi/api.cluster.health.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.pending_tasks.go b/esapi/api.cluster.pending_tasks.go index 065edda3f3..6a6805150b 100644 --- a/esapi/api.cluster.pending_tasks.go +++ b/esapi/api.cluster.pending_tasks.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.put_settings.go b/esapi/api.cluster.put_settings.go index d2e505c73e..f394809c6c 100644 --- a/esapi/api.cluster.put_settings.go +++ b/esapi/api.cluster.put_settings.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.remote_info.go b/esapi/api.cluster.remote_info.go index b7f079e5f3..f1e4f42fc5 100644 --- a/esapi/api.cluster.remote_info.go +++ b/esapi/api.cluster.remote_info.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.reroute.go b/esapi/api.cluster.reroute.go index b0a243fd3f..1f26ada520 100644 --- a/esapi/api.cluster.reroute.go +++ b/esapi/api.cluster.reroute.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.state.go b/esapi/api.cluster.state.go index fea2e01a6f..0d57025dc7 100644 --- a/esapi/api.cluster.state.go +++ b/esapi/api.cluster.state.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.cluster.stats.go b/esapi/api.cluster.stats.go index 0c53027342..3ecada9397 100644 --- a/esapi/api.cluster.stats.go +++ b/esapi/api.cluster.stats.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.count.go b/esapi/api.count.go index 9dcca1f30c..df5f2c9f67 100644 --- a/esapi/api.count.go +++ b/esapi/api.count.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.create.go b/esapi/api.create.go index 733862819f..76468403c0 100644 --- a/esapi/api.create.go +++ b/esapi/api.create.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.delete.go b/esapi/api.delete.go index af98c846c1..3638b75120 100644 --- a/esapi/api.delete.go +++ b/esapi/api.delete.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.delete_by_query.go b/esapi/api.delete_by_query.go index ca83f61391..3707a58436 100644 --- a/esapi/api.delete_by_query.go +++ b/esapi/api.delete_by_query.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.delete_by_query_rethrottle.go b/esapi/api.delete_by_query_rethrottle.go index b6fe1126b2..ae3e014a5d 100644 --- a/esapi/api.delete_by_query_rethrottle.go +++ b/esapi/api.delete_by_query_rethrottle.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.delete_script.go b/esapi/api.delete_script.go index 3de04b59bc..071c766a7f 100644 --- a/esapi/api.delete_script.go +++ b/esapi/api.delete_script.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.exists.go b/esapi/api.exists.go index b259a3394e..0bf1f6bfa3 100644 --- a/esapi/api.exists.go +++ b/esapi/api.exists.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.exists_source.go b/esapi/api.exists_source.go index 9dc3adde71..b56d6d206f 100644 --- a/esapi/api.exists_source.go +++ b/esapi/api.exists_source.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.explain.go b/esapi/api.explain.go index 474fef1af3..3659a00769 100644 --- a/esapi/api.explain.go +++ b/esapi/api.explain.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.field_caps.go b/esapi/api.field_caps.go index 1a0a7b19a3..770fb9731c 100644 --- a/esapi/api.field_caps.go +++ b/esapi/api.field_caps.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.get.go b/esapi/api.get.go index ca66c8c08d..0fd242f926 100644 --- a/esapi/api.get.go +++ b/esapi/api.get.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.get_script.go b/esapi/api.get_script.go index ae7700621e..b09a47b312 100644 --- a/esapi/api.get_script.go +++ b/esapi/api.get_script.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.get_source.go b/esapi/api.get_source.go index 722aed056f..c2e6e6fedf 100644 --- a/esapi/api.get_source.go +++ b/esapi/api.get_source.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.index.go b/esapi/api.index.go index 1f47ec642d..26d3abfcbf 100644 --- a/esapi/api.index.go +++ b/esapi/api.index.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi @@ -239,7 +239,7 @@ func (f Index) WithIfSeqNo(v int) func(*IndexRequest) { } } -// WithOpType - explicit operation type. +// WithOpType - explicit operation type. defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID. // func (f Index) WithOpType(v string) func(*IndexRequest) { return func(r *IndexRequest) { diff --git a/esapi/api.indices.analyze.go b/esapi/api.indices.analyze.go index 70b7c085f8..f67befccfd 100644 --- a/esapi/api.indices.analyze.go +++ b/esapi/api.indices.analyze.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.clear_cache.go b/esapi/api.indices.clear_cache.go index bef018627f..f69b34bd17 100644 --- a/esapi/api.indices.clear_cache.go +++ b/esapi/api.indices.clear_cache.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.clone.go b/esapi/api.indices.clone.go index 18794e23e2..a58210887c 100644 --- a/esapi/api.indices.clone.go +++ b/esapi/api.indices.clone.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.close.go b/esapi/api.indices.close.go index 8341441429..4265da6e50 100644 --- a/esapi/api.indices.close.go +++ b/esapi/api.indices.close.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.create.go b/esapi/api.indices.create.go index b25f2ed9d2..f2dd34f89d 100644 --- a/esapi/api.indices.create.go +++ b/esapi/api.indices.create.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.delete.go b/esapi/api.indices.delete.go index 33f979aa64..153034bf63 100644 --- a/esapi/api.indices.delete.go +++ b/esapi/api.indices.delete.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.delete_alias.go b/esapi/api.indices.delete_alias.go index ef6761540d..b913b1e2e9 100644 --- a/esapi/api.indices.delete_alias.go +++ b/esapi/api.indices.delete_alias.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.delete_template.go b/esapi/api.indices.delete_template.go index 54769ae6cd..ce3cc8f063 100644 --- a/esapi/api.indices.delete_template.go +++ b/esapi/api.indices.delete_template.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.exists.go b/esapi/api.indices.exists.go index 6c960f1f6a..4672ac12c6 100644 --- a/esapi/api.indices.exists.go +++ b/esapi/api.indices.exists.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.exists_alias.go b/esapi/api.indices.exists_alias.go index d46a0c4eb3..a7e02f391f 100644 --- a/esapi/api.indices.exists_alias.go +++ b/esapi/api.indices.exists_alias.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.exists_template.go b/esapi/api.indices.exists_template.go index f07f0822df..b5be8e3294 100644 --- a/esapi/api.indices.exists_template.go +++ b/esapi/api.indices.exists_template.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.exists_type.go b/esapi/api.indices.exists_type.go index 948af83b74..93d0f0ea4f 100644 --- a/esapi/api.indices.exists_type.go +++ b/esapi/api.indices.exists_type.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.flush.go b/esapi/api.indices.flush.go index aa4ba1778e..e641d0e248 100644 --- a/esapi/api.indices.flush.go +++ b/esapi/api.indices.flush.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.flush_synced.go b/esapi/api.indices.flush_synced.go index f2ad6fc8f1..2502e616a3 100644 --- a/esapi/api.indices.flush_synced.go +++ b/esapi/api.indices.flush_synced.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.forcemerge.go b/esapi/api.indices.forcemerge.go index c25559a5d4..95c9fcff53 100644 --- a/esapi/api.indices.forcemerge.go +++ b/esapi/api.indices.forcemerge.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get.go b/esapi/api.indices.get.go index 48360170c6..55af776e4d 100644 --- a/esapi/api.indices.get.go +++ b/esapi/api.indices.get.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_alias.go b/esapi/api.indices.get_alias.go index c2b99ec008..4cae6434dc 100644 --- a/esapi/api.indices.get_alias.go +++ b/esapi/api.indices.get_alias.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_field_mapping.go b/esapi/api.indices.get_field_mapping.go index da068fc52b..810c6002f1 100644 --- a/esapi/api.indices.get_field_mapping.go +++ b/esapi/api.indices.get_field_mapping.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_mapping.go b/esapi/api.indices.get_mapping.go index 7454e050c1..27ee293310 100644 --- a/esapi/api.indices.get_mapping.go +++ b/esapi/api.indices.get_mapping.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_settings.go b/esapi/api.indices.get_settings.go index 5347513e6f..e28e17b589 100644 --- a/esapi/api.indices.get_settings.go +++ b/esapi/api.indices.get_settings.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_template.go b/esapi/api.indices.get_template.go index 9aec941738..64f5defdba 100644 --- a/esapi/api.indices.get_template.go +++ b/esapi/api.indices.get_template.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.get_upgrade.go b/esapi/api.indices.get_upgrade.go index 6470cb4a42..20369d5dd7 100644 --- a/esapi/api.indices.get_upgrade.go +++ b/esapi/api.indices.get_upgrade.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.open.go b/esapi/api.indices.open.go index 3820050e96..1804f11b6e 100644 --- a/esapi/api.indices.open.go +++ b/esapi/api.indices.open.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.put_alias.go b/esapi/api.indices.put_alias.go index b480032a4b..8cd0cc9223 100644 --- a/esapi/api.indices.put_alias.go +++ b/esapi/api.indices.put_alias.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.put_mapping.go b/esapi/api.indices.put_mapping.go index 1f2d242526..7dd2e4b9cb 100644 --- a/esapi/api.indices.put_mapping.go +++ b/esapi/api.indices.put_mapping.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.put_settings.go b/esapi/api.indices.put_settings.go index c3fe9bb406..5f690dea11 100644 --- a/esapi/api.indices.put_settings.go +++ b/esapi/api.indices.put_settings.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.put_template.go b/esapi/api.indices.put_template.go index a0af6b1c61..2a7b57624c 100644 --- a/esapi/api.indices.put_template.go +++ b/esapi/api.indices.put_template.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.recovery.go b/esapi/api.indices.recovery.go index 36025c122e..3fcdacdb0b 100644 --- a/esapi/api.indices.recovery.go +++ b/esapi/api.indices.recovery.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.refresh.go b/esapi/api.indices.refresh.go index cceac0769f..a3bb5499ec 100644 --- a/esapi/api.indices.refresh.go +++ b/esapi/api.indices.refresh.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.rollover.go b/esapi/api.indices.rollover.go index de44011884..c7068aca91 100644 --- a/esapi/api.indices.rollover.go +++ b/esapi/api.indices.rollover.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.segments.go b/esapi/api.indices.segments.go index e221fa3439..1374a936be 100644 --- a/esapi/api.indices.segments.go +++ b/esapi/api.indices.segments.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.shard_stores.go b/esapi/api.indices.shard_stores.go index 0f1388be1a..ff4b222402 100644 --- a/esapi/api.indices.shard_stores.go +++ b/esapi/api.indices.shard_stores.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.shrink.go b/esapi/api.indices.shrink.go index 81a30d7580..36e6e46b31 100644 --- a/esapi/api.indices.shrink.go +++ b/esapi/api.indices.shrink.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.split.go b/esapi/api.indices.split.go index cf623a676e..1cdc4c4393 100644 --- a/esapi/api.indices.split.go +++ b/esapi/api.indices.split.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.stats.go b/esapi/api.indices.stats.go index 347976b8bc..85d1ec4c7b 100644 --- a/esapi/api.indices.stats.go +++ b/esapi/api.indices.stats.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.update_aliases.go b/esapi/api.indices.update_aliases.go index 05ae25734e..3a32511978 100644 --- a/esapi/api.indices.update_aliases.go +++ b/esapi/api.indices.update_aliases.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.upgrade.go b/esapi/api.indices.upgrade.go index 3028fc0433..e6ba54a2fc 100644 --- a/esapi/api.indices.upgrade.go +++ b/esapi/api.indices.upgrade.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.indices.validate_query.go b/esapi/api.indices.validate_query.go index 277a2505cc..7dc9e15d19 100644 --- a/esapi/api.indices.validate_query.go +++ b/esapi/api.indices.validate_query.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.info.go b/esapi/api.info.go index 08e0da39b2..7030dc9b64 100644 --- a/esapi/api.info.go +++ b/esapi/api.info.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.delete_pipeline.go b/esapi/api.ingest.delete_pipeline.go index 262d982c1d..40474397e5 100644 --- a/esapi/api.ingest.delete_pipeline.go +++ b/esapi/api.ingest.delete_pipeline.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.get_pipeline.go b/esapi/api.ingest.get_pipeline.go index dac2655af4..7be0486567 100644 --- a/esapi/api.ingest.get_pipeline.go +++ b/esapi/api.ingest.get_pipeline.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.processor_grok.go b/esapi/api.ingest.processor_grok.go index c812d27063..938f5b9753 100644 --- a/esapi/api.ingest.processor_grok.go +++ b/esapi/api.ingest.processor_grok.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.put_pipeline.go b/esapi/api.ingest.put_pipeline.go index ffcbc3468c..de9bf57d41 100644 --- a/esapi/api.ingest.put_pipeline.go +++ b/esapi/api.ingest.put_pipeline.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.ingest.simulate.go b/esapi/api.ingest.simulate.go index 5c040e203d..ee9c0a2d0c 100644 --- a/esapi/api.ingest.simulate.go +++ b/esapi/api.ingest.simulate.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.mget.go b/esapi/api.mget.go index f776b798be..b8fbc03295 100644 --- a/esapi/api.mget.go +++ b/esapi/api.mget.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.msearch.go b/esapi/api.msearch.go index b26d8c2dd8..ce38e3e064 100644 --- a/esapi/api.msearch.go +++ b/esapi/api.msearch.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.msearch_template.go b/esapi/api.msearch_template.go index 86fa94dd89..28e41faa04 100644 --- a/esapi/api.msearch_template.go +++ b/esapi/api.msearch_template.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.mtermvectors.go b/esapi/api.mtermvectors.go index 7a1ea1244d..06491ab44e 100644 --- a/esapi/api.mtermvectors.go +++ b/esapi/api.mtermvectors.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.hot_threads.go b/esapi/api.nodes.hot_threads.go index c09c543fe1..f02b3969f8 100644 --- a/esapi/api.nodes.hot_threads.go +++ b/esapi/api.nodes.hot_threads.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.info.go b/esapi/api.nodes.info.go index 10ba753dd0..2604efe497 100644 --- a/esapi/api.nodes.info.go +++ b/esapi/api.nodes.info.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.reload_secure_settings.go b/esapi/api.nodes.reload_secure_settings.go index 085446fe6c..6b5c2566c0 100644 --- a/esapi/api.nodes.reload_secure_settings.go +++ b/esapi/api.nodes.reload_secure_settings.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.stats.go b/esapi/api.nodes.stats.go index 254e0e04da..0b2438dc91 100644 --- a/esapi/api.nodes.stats.go +++ b/esapi/api.nodes.stats.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.nodes.usage.go b/esapi/api.nodes.usage.go index 522f589491..b77b85f975 100644 --- a/esapi/api.nodes.usage.go +++ b/esapi/api.nodes.usage.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.ping.go b/esapi/api.ping.go index b90ed55816..2b6b763f5c 100644 --- a/esapi/api.ping.go +++ b/esapi/api.ping.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.put_script.go b/esapi/api.put_script.go index 1d21342415..bae0808219 100644 --- a/esapi/api.put_script.go +++ b/esapi/api.put_script.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.rank_eval.go b/esapi/api.rank_eval.go index 7eb75aa74a..e7332b5b17 100644 --- a/esapi/api.rank_eval.go +++ b/esapi/api.rank_eval.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.reindex.go b/esapi/api.reindex.go index f2cd8dac13..a6f3633898 100644 --- a/esapi/api.reindex.go +++ b/esapi/api.reindex.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.reindex_rethrottle.go b/esapi/api.reindex_rethrottle.go index 80418ba52d..d07774a26e 100644 --- a/esapi/api.reindex_rethrottle.go +++ b/esapi/api.reindex_rethrottle.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.render_search_template.go b/esapi/api.render_search_template.go index 77e9870164..994b5f7233 100644 --- a/esapi/api.render_search_template.go +++ b/esapi/api.render_search_template.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.scripts_painless_execute.go b/esapi/api.scripts_painless_execute.go index 4f58827e71..b51890a835 100644 --- a/esapi/api.scripts_painless_execute.go +++ b/esapi/api.scripts_painless_execute.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.scroll.go b/esapi/api.scroll.go index bfc86ebe1d..f60b4c910e 100644 --- a/esapi/api.scroll.go +++ b/esapi/api.scroll.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.search.go b/esapi/api.search.go index 4d4ccda010..3431e26753 100644 --- a/esapi/api.search.go +++ b/esapi/api.search.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.search_shards.go b/esapi/api.search_shards.go index d4f1d0551c..ee43e2aabf 100644 --- a/esapi/api.search_shards.go +++ b/esapi/api.search_shards.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.search_template.go b/esapi/api.search_template.go index 92d4623c92..e8e4ccd1c7 100644 --- a/esapi/api.search_template.go +++ b/esapi/api.search_template.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.cleanup_repository.go b/esapi/api.snapshot.cleanup_repository.go index a82a6fd779..bbbf8b2d2f 100644 --- a/esapi/api.snapshot.cleanup_repository.go +++ b/esapi/api.snapshot.cleanup_repository.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.create.go b/esapi/api.snapshot.create.go index e42ddb4a28..2777693e13 100644 --- a/esapi/api.snapshot.create.go +++ b/esapi/api.snapshot.create.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.create_repository.go b/esapi/api.snapshot.create_repository.go index 3a883306e4..c414906392 100644 --- a/esapi/api.snapshot.create_repository.go +++ b/esapi/api.snapshot.create_repository.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.delete.go b/esapi/api.snapshot.delete.go index a515795645..35165fcc50 100644 --- a/esapi/api.snapshot.delete.go +++ b/esapi/api.snapshot.delete.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.delete_repository.go b/esapi/api.snapshot.delete_repository.go index 24c931b295..cdbfb2bebc 100644 --- a/esapi/api.snapshot.delete_repository.go +++ b/esapi/api.snapshot.delete_repository.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.get.go b/esapi/api.snapshot.get.go index 310310fdbb..5efd950455 100644 --- a/esapi/api.snapshot.get.go +++ b/esapi/api.snapshot.get.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.get_repository.go b/esapi/api.snapshot.get_repository.go index 806d8beadd..7b2bf1e732 100644 --- a/esapi/api.snapshot.get_repository.go +++ b/esapi/api.snapshot.get_repository.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.restore.go b/esapi/api.snapshot.restore.go index b82a95d5db..eece4beac8 100644 --- a/esapi/api.snapshot.restore.go +++ b/esapi/api.snapshot.restore.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.status.go b/esapi/api.snapshot.status.go index bf8cb900d7..c49035d889 100644 --- a/esapi/api.snapshot.status.go +++ b/esapi/api.snapshot.status.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.snapshot.verify_repository.go b/esapi/api.snapshot.verify_repository.go index 8285b4a0c3..de63b20c0c 100644 --- a/esapi/api.snapshot.verify_repository.go +++ b/esapi/api.snapshot.verify_repository.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.tasks.cancel.go b/esapi/api.tasks.cancel.go index 7304a06854..f0a3a1fa90 100644 --- a/esapi/api.tasks.cancel.go +++ b/esapi/api.tasks.cancel.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.tasks.get.go b/esapi/api.tasks.get.go index 24a88b2570..6f69d4eec0 100644 --- a/esapi/api.tasks.get.go +++ b/esapi/api.tasks.get.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.tasks.list.go b/esapi/api.tasks.list.go index 5c8d6f684c..1b242d8e9e 100644 --- a/esapi/api.tasks.list.go +++ b/esapi/api.tasks.list.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.termvectors.go b/esapi/api.termvectors.go index 083a8f0cea..7c02ac3877 100644 --- a/esapi/api.termvectors.go +++ b/esapi/api.termvectors.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.update.go b/esapi/api.update.go index 10c46ceef9..a694d09fea 100644 --- a/esapi/api.update.go +++ b/esapi/api.update.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.update_by_query.go b/esapi/api.update_by_query.go index c802954231..d588811d0d 100644 --- a/esapi/api.update_by_query.go +++ b/esapi/api.update_by_query.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.update_by_query_rethrottle.go b/esapi/api.update_by_query_rethrottle.go index 478c51c2df..0214c4f385 100644 --- a/esapi/api.update_by_query_rethrottle.go +++ b/esapi/api.update_by_query_rethrottle.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go index dd05d70f68..3a09f21635 100644 --- a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.follow.go b/esapi/api.xpack.ccr.follow.go index 5d6da91961..b0aef5cc58 100644 --- a/esapi/api.xpack.ccr.follow.go +++ b/esapi/api.xpack.ccr.follow.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.follow_info.go b/esapi/api.xpack.ccr.follow_info.go index c346281006..45257da861 100644 --- a/esapi/api.xpack.ccr.follow_info.go +++ b/esapi/api.xpack.ccr.follow_info.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.follow_stats.go b/esapi/api.xpack.ccr.follow_stats.go index ece6ecab74..45ab27586f 100644 --- a/esapi/api.xpack.ccr.follow_stats.go +++ b/esapi/api.xpack.ccr.follow_stats.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.forget_follower.go b/esapi/api.xpack.ccr.forget_follower.go index 2ed2cf63b7..8f951f0890 100644 --- a/esapi/api.xpack.ccr.forget_follower.go +++ b/esapi/api.xpack.ccr.forget_follower.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.get_auto_follow_pattern.go b/esapi/api.xpack.ccr.get_auto_follow_pattern.go index 69f07fad1e..8c45e6c6fb 100644 --- a/esapi/api.xpack.ccr.get_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.get_auto_follow_pattern.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.pause_auto_follow_pattern.go b/esapi/api.xpack.ccr.pause_auto_follow_pattern.go new file mode 100644 index 0000000000..2dba285977 --- /dev/null +++ b/esapi/api.xpack.ccr.pause_auto_follow_pattern.go @@ -0,0 +1,192 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newCCRPauseAutoFollowPatternFunc(t Transport) CCRPauseAutoFollowPattern { + return func(name string, o ...func(*CCRPauseAutoFollowPatternRequest)) (*Response, error) { + var r = CCRPauseAutoFollowPatternRequest{Name: name} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// CCRPauseAutoFollowPattern - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html. +// +type CCRPauseAutoFollowPattern func(name string, o ...func(*CCRPauseAutoFollowPatternRequest)) (*Response, error) + +// CCRPauseAutoFollowPatternRequest configures the CCR Pause Auto Follow Pattern API request. +// +type CCRPauseAutoFollowPatternRequest struct { + Name string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r CCRPauseAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ccr") + 1 + len("auto_follow") + 1 + len(r.Name) + 1 + len("pause")) + path.WriteString("/") + path.WriteString("_ccr") + path.WriteString("/") + path.WriteString("auto_follow") + path.WriteString("/") + path.WriteString(r.Name) + path.WriteString("/") + path.WriteString("pause") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f CCRPauseAutoFollowPattern) WithContext(v context.Context) func(*CCRPauseAutoFollowPatternRequest) { + return func(r *CCRPauseAutoFollowPatternRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f CCRPauseAutoFollowPattern) WithPretty() func(*CCRPauseAutoFollowPatternRequest) { + return func(r *CCRPauseAutoFollowPatternRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f CCRPauseAutoFollowPattern) WithHuman() func(*CCRPauseAutoFollowPatternRequest) { + return func(r *CCRPauseAutoFollowPatternRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f CCRPauseAutoFollowPattern) WithErrorTrace() func(*CCRPauseAutoFollowPatternRequest) { + return func(r *CCRPauseAutoFollowPatternRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f CCRPauseAutoFollowPattern) WithFilterPath(v ...string) func(*CCRPauseAutoFollowPatternRequest) { + return func(r *CCRPauseAutoFollowPatternRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f CCRPauseAutoFollowPattern) WithHeader(h map[string]string) func(*CCRPauseAutoFollowPatternRequest) { + return func(r *CCRPauseAutoFollowPatternRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRPauseAutoFollowPattern) WithOpaqueID(s string) func(*CCRPauseAutoFollowPatternRequest) { + return func(r *CCRPauseAutoFollowPatternRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ccr.pause_follow.go b/esapi/api.xpack.ccr.pause_follow.go index 0b5ea6df4a..29bd00479b 100644 --- a/esapi/api.xpack.ccr.pause_follow.go +++ b/esapi/api.xpack.ccr.pause_follow.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.put_auto_follow_pattern.go b/esapi/api.xpack.ccr.put_auto_follow_pattern.go index 95b0164f4e..1ebf5ddb3c 100644 --- a/esapi/api.xpack.ccr.put_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.put_auto_follow_pattern.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.resume_auto_follow_pattern.go b/esapi/api.xpack.ccr.resume_auto_follow_pattern.go new file mode 100644 index 0000000000..be1052107a --- /dev/null +++ b/esapi/api.xpack.ccr.resume_auto_follow_pattern.go @@ -0,0 +1,192 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newCCRResumeAutoFollowPatternFunc(t Transport) CCRResumeAutoFollowPattern { + return func(name string, o ...func(*CCRResumeAutoFollowPatternRequest)) (*Response, error) { + var r = CCRResumeAutoFollowPatternRequest{Name: name} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// CCRResumeAutoFollowPattern - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html. +// +type CCRResumeAutoFollowPattern func(name string, o ...func(*CCRResumeAutoFollowPatternRequest)) (*Response, error) + +// CCRResumeAutoFollowPatternRequest configures the CCR Resume Auto Follow Pattern API request. +// +type CCRResumeAutoFollowPatternRequest struct { + Name string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r CCRResumeAutoFollowPatternRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_ccr") + 1 + len("auto_follow") + 1 + len(r.Name) + 1 + len("resume")) + path.WriteString("/") + path.WriteString("_ccr") + path.WriteString("/") + path.WriteString("auto_follow") + path.WriteString("/") + path.WriteString(r.Name) + path.WriteString("/") + path.WriteString("resume") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f CCRResumeAutoFollowPattern) WithContext(v context.Context) func(*CCRResumeAutoFollowPatternRequest) { + return func(r *CCRResumeAutoFollowPatternRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f CCRResumeAutoFollowPattern) WithPretty() func(*CCRResumeAutoFollowPatternRequest) { + return func(r *CCRResumeAutoFollowPatternRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f CCRResumeAutoFollowPattern) WithHuman() func(*CCRResumeAutoFollowPatternRequest) { + return func(r *CCRResumeAutoFollowPatternRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f CCRResumeAutoFollowPattern) WithErrorTrace() func(*CCRResumeAutoFollowPatternRequest) { + return func(r *CCRResumeAutoFollowPatternRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f CCRResumeAutoFollowPattern) WithFilterPath(v ...string) func(*CCRResumeAutoFollowPatternRequest) { + return func(r *CCRResumeAutoFollowPatternRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f CCRResumeAutoFollowPattern) WithHeader(h map[string]string) func(*CCRResumeAutoFollowPatternRequest) { + return func(r *CCRResumeAutoFollowPatternRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRResumeAutoFollowPattern) WithOpaqueID(s string) func(*CCRResumeAutoFollowPatternRequest) { + return func(r *CCRResumeAutoFollowPatternRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.ccr.resume_follow.go b/esapi/api.xpack.ccr.resume_follow.go index b40a987641..b0d6d2a893 100644 --- a/esapi/api.xpack.ccr.resume_follow.go +++ b/esapi/api.xpack.ccr.resume_follow.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.stats.go b/esapi/api.xpack.ccr.stats.go index 27e3e379a1..dc93a7e31e 100644 --- a/esapi/api.xpack.ccr.stats.go +++ b/esapi/api.xpack.ccr.stats.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ccr.unfollow.go b/esapi/api.xpack.ccr.unfollow.go index 76773ba418..3b18fb9f42 100644 --- a/esapi/api.xpack.ccr.unfollow.go +++ b/esapi/api.xpack.ccr.unfollow.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.data_frame_transform_deprecated.delete_transform.go b/esapi/api.xpack.data_frame_transform_deprecated.delete_transform.go new file mode 100644 index 0000000000..66315fde0a --- /dev/null +++ b/esapi/api.xpack.data_frame_transform_deprecated.delete_transform.go @@ -0,0 +1,205 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newDataFrameTransformDeprecatedDeleteTransformFunc(t Transport) DataFrameTransformDeprecatedDeleteTransform { + return func(transform_id string, o ...func(*DataFrameTransformDeprecatedDeleteTransformRequest)) (*Response, error) { + var r = DataFrameTransformDeprecatedDeleteTransformRequest{TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFrameTransformDeprecatedDeleteTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html. +// +type DataFrameTransformDeprecatedDeleteTransform func(transform_id string, o ...func(*DataFrameTransformDeprecatedDeleteTransformRequest)) (*Response, error) + +// DataFrameTransformDeprecatedDeleteTransformRequest configures the Data Frame Transform Deprecated Delete Transform API request. +// +type DataFrameTransformDeprecatedDeleteTransformRequest struct { + TransformID string + + Force *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFrameTransformDeprecatedDeleteTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_data_frame") + 1 + len("transforms") + 1 + len(r.TransformID)) + path.WriteString("/") + path.WriteString("_data_frame") + path.WriteString("/") + path.WriteString("transforms") + path.WriteString("/") + path.WriteString(r.TransformID) + + params = make(map[string]string) + + if r.Force != nil { + params["force"] = strconv.FormatBool(*r.Force) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFrameTransformDeprecatedDeleteTransform) WithContext(v context.Context) func(*DataFrameTransformDeprecatedDeleteTransformRequest) { + return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { + r.ctx = v + } +} + +// WithForce - when `true`, the transform is deleted regardless of its current state. the default value is `false`, meaning that the transform must be `stopped` before it can be deleted.. +// +func (f DataFrameTransformDeprecatedDeleteTransform) WithForce(v bool) func(*DataFrameTransformDeprecatedDeleteTransformRequest) { + return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { + r.Force = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFrameTransformDeprecatedDeleteTransform) WithPretty() func(*DataFrameTransformDeprecatedDeleteTransformRequest) { + return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFrameTransformDeprecatedDeleteTransform) WithHuman() func(*DataFrameTransformDeprecatedDeleteTransformRequest) { + return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFrameTransformDeprecatedDeleteTransform) WithErrorTrace() func(*DataFrameTransformDeprecatedDeleteTransformRequest) { + return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFrameTransformDeprecatedDeleteTransform) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedDeleteTransformRequest) { + return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFrameTransformDeprecatedDeleteTransform) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedDeleteTransformRequest) { + return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFrameTransformDeprecatedDeleteTransform) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedDeleteTransformRequest) { + return func(r *DataFrameTransformDeprecatedDeleteTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame_transform_deprecated.get_transform.go b/esapi/api.xpack.data_frame_transform_deprecated.get_transform.go new file mode 100644 index 0000000000..2c692616d9 --- /dev/null +++ b/esapi/api.xpack.data_frame_transform_deprecated.get_transform.go @@ -0,0 +1,241 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newDataFrameTransformDeprecatedGetTransformFunc(t Transport) DataFrameTransformDeprecatedGetTransform { + return func(o ...func(*DataFrameTransformDeprecatedGetTransformRequest)) (*Response, error) { + var r = DataFrameTransformDeprecatedGetTransformRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFrameTransformDeprecatedGetTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html. +// +type DataFrameTransformDeprecatedGetTransform func(o ...func(*DataFrameTransformDeprecatedGetTransformRequest)) (*Response, error) + +// DataFrameTransformDeprecatedGetTransformRequest configures the Data Frame Transform Deprecated Get Transform API request. +// +type DataFrameTransformDeprecatedGetTransformRequest struct { + TransformID string + + AllowNoMatch *bool + From *int + Size *int + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFrameTransformDeprecatedGetTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_data_frame") + 1 + len("transforms") + 1 + len(r.TransformID)) + path.WriteString("/") + path.WriteString("_data_frame") + path.WriteString("/") + path.WriteString("transforms") + if r.TransformID != "" { + path.WriteString("/") + path.WriteString(r.TransformID) + } + + params = make(map[string]string) + + if r.AllowNoMatch != nil { + params["allow_no_match"] = strconv.FormatBool(*r.AllowNoMatch) + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFrameTransformDeprecatedGetTransform) WithContext(v context.Context) func(*DataFrameTransformDeprecatedGetTransformRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformRequest) { + r.ctx = v + } +} + +// WithTransformID - the ID or comma delimited list of ID expressions of the transforms to get, '_all' or '*' implies get all transforms. +// +func (f DataFrameTransformDeprecatedGetTransform) WithTransformID(v string) func(*DataFrameTransformDeprecatedGetTransformRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformRequest) { + r.TransformID = v + } +} + +// WithAllowNoMatch - whether to ignore if a wildcard expression matches no transforms. (this includes `_all` string or when no transforms have been specified). +// +func (f DataFrameTransformDeprecatedGetTransform) WithAllowNoMatch(v bool) func(*DataFrameTransformDeprecatedGetTransformRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformRequest) { + r.AllowNoMatch = &v + } +} + +// WithFrom - skips a number of transform configs, defaults to 0. +// +func (f DataFrameTransformDeprecatedGetTransform) WithFrom(v int) func(*DataFrameTransformDeprecatedGetTransformRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformRequest) { + r.From = &v + } +} + +// WithSize - specifies a max number of transforms to get, defaults to 100. +// +func (f DataFrameTransformDeprecatedGetTransform) WithSize(v int) func(*DataFrameTransformDeprecatedGetTransformRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformRequest) { + r.Size = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFrameTransformDeprecatedGetTransform) WithPretty() func(*DataFrameTransformDeprecatedGetTransformRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFrameTransformDeprecatedGetTransform) WithHuman() func(*DataFrameTransformDeprecatedGetTransformRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFrameTransformDeprecatedGetTransform) WithErrorTrace() func(*DataFrameTransformDeprecatedGetTransformRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFrameTransformDeprecatedGetTransform) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedGetTransformRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFrameTransformDeprecatedGetTransform) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedGetTransformRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFrameTransformDeprecatedGetTransform) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedGetTransformRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame_transform_deprecated.get_transform_stats.go b/esapi/api.xpack.data_frame_transform_deprecated.get_transform_stats.go new file mode 100644 index 0000000000..c677ff09f9 --- /dev/null +++ b/esapi/api.xpack.data_frame_transform_deprecated.get_transform_stats.go @@ -0,0 +1,233 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newDataFrameTransformDeprecatedGetTransformStatsFunc(t Transport) DataFrameTransformDeprecatedGetTransformStats { + return func(transform_id string, o ...func(*DataFrameTransformDeprecatedGetTransformStatsRequest)) (*Response, error) { + var r = DataFrameTransformDeprecatedGetTransformStatsRequest{TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFrameTransformDeprecatedGetTransformStats - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html. +// +type DataFrameTransformDeprecatedGetTransformStats func(transform_id string, o ...func(*DataFrameTransformDeprecatedGetTransformStatsRequest)) (*Response, error) + +// DataFrameTransformDeprecatedGetTransformStatsRequest configures the Data Frame Transform Deprecated Get Transform Stats API request. +// +type DataFrameTransformDeprecatedGetTransformStatsRequest struct { + TransformID string + + AllowNoMatch *bool + From *int + Size *int + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFrameTransformDeprecatedGetTransformStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_data_frame") + 1 + len("transforms") + 1 + len(r.TransformID) + 1 + len("_stats")) + path.WriteString("/") + path.WriteString("_data_frame") + path.WriteString("/") + path.WriteString("transforms") + path.WriteString("/") + path.WriteString(r.TransformID) + path.WriteString("/") + path.WriteString("_stats") + + params = make(map[string]string) + + if r.AllowNoMatch != nil { + params["allow_no_match"] = strconv.FormatBool(*r.AllowNoMatch) + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFrameTransformDeprecatedGetTransformStats) WithContext(v context.Context) func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { + r.ctx = v + } +} + +// WithAllowNoMatch - whether to ignore if a wildcard expression matches no transforms. (this includes `_all` string or when no transforms have been specified). +// +func (f DataFrameTransformDeprecatedGetTransformStats) WithAllowNoMatch(v bool) func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { + r.AllowNoMatch = &v + } +} + +// WithFrom - skips a number of transform stats, defaults to 0. +// +func (f DataFrameTransformDeprecatedGetTransformStats) WithFrom(v int) func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { + r.From = &v + } +} + +// WithSize - specifies a max number of transform stats to get, defaults to 100. +// +func (f DataFrameTransformDeprecatedGetTransformStats) WithSize(v int) func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { + r.Size = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFrameTransformDeprecatedGetTransformStats) WithPretty() func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFrameTransformDeprecatedGetTransformStats) WithHuman() func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFrameTransformDeprecatedGetTransformStats) WithErrorTrace() func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFrameTransformDeprecatedGetTransformStats) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFrameTransformDeprecatedGetTransformStats) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFrameTransformDeprecatedGetTransformStats) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedGetTransformStatsRequest) { + return func(r *DataFrameTransformDeprecatedGetTransformStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame_transform_deprecated.preview_transform.go b/esapi/api.xpack.data_frame_transform_deprecated.preview_transform.go new file mode 100644 index 0000000000..6a3a7869dc --- /dev/null +++ b/esapi/api.xpack.data_frame_transform_deprecated.preview_transform.go @@ -0,0 +1,190 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newDataFrameTransformDeprecatedPreviewTransformFunc(t Transport) DataFrameTransformDeprecatedPreviewTransform { + return func(body io.Reader, o ...func(*DataFrameTransformDeprecatedPreviewTransformRequest)) (*Response, error) { + var r = DataFrameTransformDeprecatedPreviewTransformRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFrameTransformDeprecatedPreviewTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html. +// +type DataFrameTransformDeprecatedPreviewTransform func(body io.Reader, o ...func(*DataFrameTransformDeprecatedPreviewTransformRequest)) (*Response, error) + +// DataFrameTransformDeprecatedPreviewTransformRequest configures the Data Frame Transform Deprecated Preview Transform API request. +// +type DataFrameTransformDeprecatedPreviewTransformRequest struct { + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFrameTransformDeprecatedPreviewTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_data_frame/transforms/_preview")) + path.WriteString("/_data_frame/transforms/_preview") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFrameTransformDeprecatedPreviewTransform) WithContext(v context.Context) func(*DataFrameTransformDeprecatedPreviewTransformRequest) { + return func(r *DataFrameTransformDeprecatedPreviewTransformRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFrameTransformDeprecatedPreviewTransform) WithPretty() func(*DataFrameTransformDeprecatedPreviewTransformRequest) { + return func(r *DataFrameTransformDeprecatedPreviewTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFrameTransformDeprecatedPreviewTransform) WithHuman() func(*DataFrameTransformDeprecatedPreviewTransformRequest) { + return func(r *DataFrameTransformDeprecatedPreviewTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFrameTransformDeprecatedPreviewTransform) WithErrorTrace() func(*DataFrameTransformDeprecatedPreviewTransformRequest) { + return func(r *DataFrameTransformDeprecatedPreviewTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFrameTransformDeprecatedPreviewTransform) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedPreviewTransformRequest) { + return func(r *DataFrameTransformDeprecatedPreviewTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFrameTransformDeprecatedPreviewTransform) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedPreviewTransformRequest) { + return func(r *DataFrameTransformDeprecatedPreviewTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFrameTransformDeprecatedPreviewTransform) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedPreviewTransformRequest) { + return func(r *DataFrameTransformDeprecatedPreviewTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame_transform_deprecated.put_transform.go b/esapi/api.xpack.data_frame_transform_deprecated.put_transform.go new file mode 100644 index 0000000000..937ad71fd2 --- /dev/null +++ b/esapi/api.xpack.data_frame_transform_deprecated.put_transform.go @@ -0,0 +1,212 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" +) + +func newDataFrameTransformDeprecatedPutTransformFunc(t Transport) DataFrameTransformDeprecatedPutTransform { + return func(body io.Reader, transform_id string, o ...func(*DataFrameTransformDeprecatedPutTransformRequest)) (*Response, error) { + var r = DataFrameTransformDeprecatedPutTransformRequest{Body: body, TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFrameTransformDeprecatedPutTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html. +// +type DataFrameTransformDeprecatedPutTransform func(body io.Reader, transform_id string, o ...func(*DataFrameTransformDeprecatedPutTransformRequest)) (*Response, error) + +// DataFrameTransformDeprecatedPutTransformRequest configures the Data Frame Transform Deprecated Put Transform API request. +// +type DataFrameTransformDeprecatedPutTransformRequest struct { + Body io.Reader + + TransformID string + + DeferValidation *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFrameTransformDeprecatedPutTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_data_frame") + 1 + len("transforms") + 1 + len(r.TransformID)) + path.WriteString("/") + path.WriteString("_data_frame") + path.WriteString("/") + path.WriteString("transforms") + path.WriteString("/") + path.WriteString(r.TransformID) + + params = make(map[string]string) + + if r.DeferValidation != nil { + params["defer_validation"] = strconv.FormatBool(*r.DeferValidation) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFrameTransformDeprecatedPutTransform) WithContext(v context.Context) func(*DataFrameTransformDeprecatedPutTransformRequest) { + return func(r *DataFrameTransformDeprecatedPutTransformRequest) { + r.ctx = v + } +} + +// WithDeferValidation - if validations should be deferred until transform starts, defaults to false.. +// +func (f DataFrameTransformDeprecatedPutTransform) WithDeferValidation(v bool) func(*DataFrameTransformDeprecatedPutTransformRequest) { + return func(r *DataFrameTransformDeprecatedPutTransformRequest) { + r.DeferValidation = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFrameTransformDeprecatedPutTransform) WithPretty() func(*DataFrameTransformDeprecatedPutTransformRequest) { + return func(r *DataFrameTransformDeprecatedPutTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFrameTransformDeprecatedPutTransform) WithHuman() func(*DataFrameTransformDeprecatedPutTransformRequest) { + return func(r *DataFrameTransformDeprecatedPutTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFrameTransformDeprecatedPutTransform) WithErrorTrace() func(*DataFrameTransformDeprecatedPutTransformRequest) { + return func(r *DataFrameTransformDeprecatedPutTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFrameTransformDeprecatedPutTransform) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedPutTransformRequest) { + return func(r *DataFrameTransformDeprecatedPutTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFrameTransformDeprecatedPutTransform) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedPutTransformRequest) { + return func(r *DataFrameTransformDeprecatedPutTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFrameTransformDeprecatedPutTransform) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedPutTransformRequest) { + return func(r *DataFrameTransformDeprecatedPutTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame_transform_deprecated.start_transform.go b/esapi/api.xpack.data_frame_transform_deprecated.start_transform.go new file mode 100644 index 0000000000..1b6b0d5bb0 --- /dev/null +++ b/esapi/api.xpack.data_frame_transform_deprecated.start_transform.go @@ -0,0 +1,207 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" + "time" +) + +func newDataFrameTransformDeprecatedStartTransformFunc(t Transport) DataFrameTransformDeprecatedStartTransform { + return func(transform_id string, o ...func(*DataFrameTransformDeprecatedStartTransformRequest)) (*Response, error) { + var r = DataFrameTransformDeprecatedStartTransformRequest{TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFrameTransformDeprecatedStartTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html. +// +type DataFrameTransformDeprecatedStartTransform func(transform_id string, o ...func(*DataFrameTransformDeprecatedStartTransformRequest)) (*Response, error) + +// DataFrameTransformDeprecatedStartTransformRequest configures the Data Frame Transform Deprecated Start Transform API request. +// +type DataFrameTransformDeprecatedStartTransformRequest struct { + TransformID string + + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFrameTransformDeprecatedStartTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_data_frame") + 1 + len("transforms") + 1 + len(r.TransformID) + 1 + len("_start")) + path.WriteString("/") + path.WriteString("_data_frame") + path.WriteString("/") + path.WriteString("transforms") + path.WriteString("/") + path.WriteString(r.TransformID) + path.WriteString("/") + path.WriteString("_start") + + params = make(map[string]string) + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFrameTransformDeprecatedStartTransform) WithContext(v context.Context) func(*DataFrameTransformDeprecatedStartTransformRequest) { + return func(r *DataFrameTransformDeprecatedStartTransformRequest) { + r.ctx = v + } +} + +// WithTimeout - controls the time to wait for the transform to start. +// +func (f DataFrameTransformDeprecatedStartTransform) WithTimeout(v time.Duration) func(*DataFrameTransformDeprecatedStartTransformRequest) { + return func(r *DataFrameTransformDeprecatedStartTransformRequest) { + r.Timeout = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFrameTransformDeprecatedStartTransform) WithPretty() func(*DataFrameTransformDeprecatedStartTransformRequest) { + return func(r *DataFrameTransformDeprecatedStartTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFrameTransformDeprecatedStartTransform) WithHuman() func(*DataFrameTransformDeprecatedStartTransformRequest) { + return func(r *DataFrameTransformDeprecatedStartTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFrameTransformDeprecatedStartTransform) WithErrorTrace() func(*DataFrameTransformDeprecatedStartTransformRequest) { + return func(r *DataFrameTransformDeprecatedStartTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFrameTransformDeprecatedStartTransform) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedStartTransformRequest) { + return func(r *DataFrameTransformDeprecatedStartTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFrameTransformDeprecatedStartTransform) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedStartTransformRequest) { + return func(r *DataFrameTransformDeprecatedStartTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFrameTransformDeprecatedStartTransform) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedStartTransformRequest) { + return func(r *DataFrameTransformDeprecatedStartTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame_transform_deprecated.stop_transform.go b/esapi/api.xpack.data_frame_transform_deprecated.stop_transform.go new file mode 100644 index 0000000000..10ee4261df --- /dev/null +++ b/esapi/api.xpack.data_frame_transform_deprecated.stop_transform.go @@ -0,0 +1,234 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" + "time" +) + +func newDataFrameTransformDeprecatedStopTransformFunc(t Transport) DataFrameTransformDeprecatedStopTransform { + return func(transform_id string, o ...func(*DataFrameTransformDeprecatedStopTransformRequest)) (*Response, error) { + var r = DataFrameTransformDeprecatedStopTransformRequest{TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFrameTransformDeprecatedStopTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html. +// +type DataFrameTransformDeprecatedStopTransform func(transform_id string, o ...func(*DataFrameTransformDeprecatedStopTransformRequest)) (*Response, error) + +// DataFrameTransformDeprecatedStopTransformRequest configures the Data Frame Transform Deprecated Stop Transform API request. +// +type DataFrameTransformDeprecatedStopTransformRequest struct { + TransformID string + + AllowNoMatch *bool + Timeout time.Duration + WaitForCompletion *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFrameTransformDeprecatedStopTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_data_frame") + 1 + len("transforms") + 1 + len(r.TransformID) + 1 + len("_stop")) + path.WriteString("/") + path.WriteString("_data_frame") + path.WriteString("/") + path.WriteString("transforms") + path.WriteString("/") + path.WriteString(r.TransformID) + path.WriteString("/") + path.WriteString("_stop") + + params = make(map[string]string) + + if r.AllowNoMatch != nil { + params["allow_no_match"] = strconv.FormatBool(*r.AllowNoMatch) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForCompletion != nil { + params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFrameTransformDeprecatedStopTransform) WithContext(v context.Context) func(*DataFrameTransformDeprecatedStopTransformRequest) { + return func(r *DataFrameTransformDeprecatedStopTransformRequest) { + r.ctx = v + } +} + +// WithAllowNoMatch - whether to ignore if a wildcard expression matches no transforms. (this includes `_all` string or when no transforms have been specified). +// +func (f DataFrameTransformDeprecatedStopTransform) WithAllowNoMatch(v bool) func(*DataFrameTransformDeprecatedStopTransformRequest) { + return func(r *DataFrameTransformDeprecatedStopTransformRequest) { + r.AllowNoMatch = &v + } +} + +// WithTimeout - controls the time to wait until the transform has stopped. default to 30 seconds. +// +func (f DataFrameTransformDeprecatedStopTransform) WithTimeout(v time.Duration) func(*DataFrameTransformDeprecatedStopTransformRequest) { + return func(r *DataFrameTransformDeprecatedStopTransformRequest) { + r.Timeout = v + } +} + +// WithWaitForCompletion - whether to wait for the transform to fully stop before returning or not. default to false. +// +func (f DataFrameTransformDeprecatedStopTransform) WithWaitForCompletion(v bool) func(*DataFrameTransformDeprecatedStopTransformRequest) { + return func(r *DataFrameTransformDeprecatedStopTransformRequest) { + r.WaitForCompletion = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFrameTransformDeprecatedStopTransform) WithPretty() func(*DataFrameTransformDeprecatedStopTransformRequest) { + return func(r *DataFrameTransformDeprecatedStopTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFrameTransformDeprecatedStopTransform) WithHuman() func(*DataFrameTransformDeprecatedStopTransformRequest) { + return func(r *DataFrameTransformDeprecatedStopTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFrameTransformDeprecatedStopTransform) WithErrorTrace() func(*DataFrameTransformDeprecatedStopTransformRequest) { + return func(r *DataFrameTransformDeprecatedStopTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFrameTransformDeprecatedStopTransform) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedStopTransformRequest) { + return func(r *DataFrameTransformDeprecatedStopTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFrameTransformDeprecatedStopTransform) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedStopTransformRequest) { + return func(r *DataFrameTransformDeprecatedStopTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFrameTransformDeprecatedStopTransform) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedStopTransformRequest) { + return func(r *DataFrameTransformDeprecatedStopTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.data_frame_transform_deprecated.update_transform.go b/esapi/api.xpack.data_frame_transform_deprecated.update_transform.go new file mode 100644 index 0000000000..7af44dac60 --- /dev/null +++ b/esapi/api.xpack.data_frame_transform_deprecated.update_transform.go @@ -0,0 +1,214 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" +) + +func newDataFrameTransformDeprecatedUpdateTransformFunc(t Transport) DataFrameTransformDeprecatedUpdateTransform { + return func(body io.Reader, transform_id string, o ...func(*DataFrameTransformDeprecatedUpdateTransformRequest)) (*Response, error) { + var r = DataFrameTransformDeprecatedUpdateTransformRequest{Body: body, TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// DataFrameTransformDeprecatedUpdateTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html. +// +type DataFrameTransformDeprecatedUpdateTransform func(body io.Reader, transform_id string, o ...func(*DataFrameTransformDeprecatedUpdateTransformRequest)) (*Response, error) + +// DataFrameTransformDeprecatedUpdateTransformRequest configures the Data Frame Transform Deprecated Update Transform API request. +// +type DataFrameTransformDeprecatedUpdateTransformRequest struct { + Body io.Reader + + TransformID string + + DeferValidation *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r DataFrameTransformDeprecatedUpdateTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_data_frame") + 1 + len("transforms") + 1 + len(r.TransformID) + 1 + len("_update")) + path.WriteString("/") + path.WriteString("_data_frame") + path.WriteString("/") + path.WriteString("transforms") + path.WriteString("/") + path.WriteString(r.TransformID) + path.WriteString("/") + path.WriteString("_update") + + params = make(map[string]string) + + if r.DeferValidation != nil { + params["defer_validation"] = strconv.FormatBool(*r.DeferValidation) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f DataFrameTransformDeprecatedUpdateTransform) WithContext(v context.Context) func(*DataFrameTransformDeprecatedUpdateTransformRequest) { + return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { + r.ctx = v + } +} + +// WithDeferValidation - if validations should be deferred until transform starts, defaults to false.. +// +func (f DataFrameTransformDeprecatedUpdateTransform) WithDeferValidation(v bool) func(*DataFrameTransformDeprecatedUpdateTransformRequest) { + return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { + r.DeferValidation = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f DataFrameTransformDeprecatedUpdateTransform) WithPretty() func(*DataFrameTransformDeprecatedUpdateTransformRequest) { + return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f DataFrameTransformDeprecatedUpdateTransform) WithHuman() func(*DataFrameTransformDeprecatedUpdateTransformRequest) { + return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f DataFrameTransformDeprecatedUpdateTransform) WithErrorTrace() func(*DataFrameTransformDeprecatedUpdateTransformRequest) { + return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f DataFrameTransformDeprecatedUpdateTransform) WithFilterPath(v ...string) func(*DataFrameTransformDeprecatedUpdateTransformRequest) { + return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f DataFrameTransformDeprecatedUpdateTransform) WithHeader(h map[string]string) func(*DataFrameTransformDeprecatedUpdateTransformRequest) { + return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DataFrameTransformDeprecatedUpdateTransform) WithOpaqueID(s string) func(*DataFrameTransformDeprecatedUpdateTransformRequest) { + return func(r *DataFrameTransformDeprecatedUpdateTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.enrich.delete_policy.go b/esapi/api.xpack.enrich.delete_policy.go new file mode 100644 index 0000000000..08fd892646 --- /dev/null +++ b/esapi/api.xpack.enrich.delete_policy.go @@ -0,0 +1,190 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newEnrichDeletePolicyFunc(t Transport) EnrichDeletePolicy { + return func(name string, o ...func(*EnrichDeletePolicyRequest)) (*Response, error) { + var r = EnrichDeletePolicyRequest{Name: name} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// EnrichDeletePolicy - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-delete-policy.html. +// +type EnrichDeletePolicy func(name string, o ...func(*EnrichDeletePolicyRequest)) (*Response, error) + +// EnrichDeletePolicyRequest configures the Enrich Delete Policy API request. +// +type EnrichDeletePolicyRequest struct { + Name string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r EnrichDeletePolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_enrich") + 1 + len("policy") + 1 + len(r.Name)) + path.WriteString("/") + path.WriteString("_enrich") + path.WriteString("/") + path.WriteString("policy") + path.WriteString("/") + path.WriteString(r.Name) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f EnrichDeletePolicy) WithContext(v context.Context) func(*EnrichDeletePolicyRequest) { + return func(r *EnrichDeletePolicyRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f EnrichDeletePolicy) WithPretty() func(*EnrichDeletePolicyRequest) { + return func(r *EnrichDeletePolicyRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f EnrichDeletePolicy) WithHuman() func(*EnrichDeletePolicyRequest) { + return func(r *EnrichDeletePolicyRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f EnrichDeletePolicy) WithErrorTrace() func(*EnrichDeletePolicyRequest) { + return func(r *EnrichDeletePolicyRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f EnrichDeletePolicy) WithFilterPath(v ...string) func(*EnrichDeletePolicyRequest) { + return func(r *EnrichDeletePolicyRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f EnrichDeletePolicy) WithHeader(h map[string]string) func(*EnrichDeletePolicyRequest) { + return func(r *EnrichDeletePolicyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f EnrichDeletePolicy) WithOpaqueID(s string) func(*EnrichDeletePolicyRequest) { + return func(r *EnrichDeletePolicyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.enrich.execute_policy.go b/esapi/api.xpack.enrich.execute_policy.go new file mode 100644 index 0000000000..235f75f184 --- /dev/null +++ b/esapi/api.xpack.enrich.execute_policy.go @@ -0,0 +1,207 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newEnrichExecutePolicyFunc(t Transport) EnrichExecutePolicy { + return func(name string, o ...func(*EnrichExecutePolicyRequest)) (*Response, error) { + var r = EnrichExecutePolicyRequest{Name: name} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// EnrichExecutePolicy - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-execute-policy.html. +// +type EnrichExecutePolicy func(name string, o ...func(*EnrichExecutePolicyRequest)) (*Response, error) + +// EnrichExecutePolicyRequest configures the Enrich Execute Policy API request. +// +type EnrichExecutePolicyRequest struct { + Name string + + WaitForCompletion *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r EnrichExecutePolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_enrich") + 1 + len("policy") + 1 + len(r.Name) + 1 + len("_execute")) + path.WriteString("/") + path.WriteString("_enrich") + path.WriteString("/") + path.WriteString("policy") + path.WriteString("/") + path.WriteString(r.Name) + path.WriteString("/") + path.WriteString("_execute") + + params = make(map[string]string) + + if r.WaitForCompletion != nil { + params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f EnrichExecutePolicy) WithContext(v context.Context) func(*EnrichExecutePolicyRequest) { + return func(r *EnrichExecutePolicyRequest) { + r.ctx = v + } +} + +// WithWaitForCompletion - should the request should block until the execution is complete.. +// +func (f EnrichExecutePolicy) WithWaitForCompletion(v bool) func(*EnrichExecutePolicyRequest) { + return func(r *EnrichExecutePolicyRequest) { + r.WaitForCompletion = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f EnrichExecutePolicy) WithPretty() func(*EnrichExecutePolicyRequest) { + return func(r *EnrichExecutePolicyRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f EnrichExecutePolicy) WithHuman() func(*EnrichExecutePolicyRequest) { + return func(r *EnrichExecutePolicyRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f EnrichExecutePolicy) WithErrorTrace() func(*EnrichExecutePolicyRequest) { + return func(r *EnrichExecutePolicyRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f EnrichExecutePolicy) WithFilterPath(v ...string) func(*EnrichExecutePolicyRequest) { + return func(r *EnrichExecutePolicyRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f EnrichExecutePolicy) WithHeader(h map[string]string) func(*EnrichExecutePolicyRequest) { + return func(r *EnrichExecutePolicyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f EnrichExecutePolicy) WithOpaqueID(s string) func(*EnrichExecutePolicyRequest) { + return func(r *EnrichExecutePolicyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.enrich.get_policy.go b/esapi/api.xpack.enrich.get_policy.go new file mode 100644 index 0000000000..e394d8b865 --- /dev/null +++ b/esapi/api.xpack.enrich.get_policy.go @@ -0,0 +1,200 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newEnrichGetPolicyFunc(t Transport) EnrichGetPolicy { + return func(o ...func(*EnrichGetPolicyRequest)) (*Response, error) { + var r = EnrichGetPolicyRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// EnrichGetPolicy - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-get-policy.html. +// +type EnrichGetPolicy func(o ...func(*EnrichGetPolicyRequest)) (*Response, error) + +// EnrichGetPolicyRequest configures the Enrich Get Policy API request. +// +type EnrichGetPolicyRequest struct { + Name string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r EnrichGetPolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_enrich") + 1 + len("policy") + 1 + len(r.Name)) + path.WriteString("/") + path.WriteString("_enrich") + path.WriteString("/") + path.WriteString("policy") + if r.Name != "" { + path.WriteString("/") + path.WriteString(r.Name) + } + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f EnrichGetPolicy) WithContext(v context.Context) func(*EnrichGetPolicyRequest) { + return func(r *EnrichGetPolicyRequest) { + r.ctx = v + } +} + +// WithName - the name of the enrich policy. +// +func (f EnrichGetPolicy) WithName(v string) func(*EnrichGetPolicyRequest) { + return func(r *EnrichGetPolicyRequest) { + r.Name = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f EnrichGetPolicy) WithPretty() func(*EnrichGetPolicyRequest) { + return func(r *EnrichGetPolicyRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f EnrichGetPolicy) WithHuman() func(*EnrichGetPolicyRequest) { + return func(r *EnrichGetPolicyRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f EnrichGetPolicy) WithErrorTrace() func(*EnrichGetPolicyRequest) { + return func(r *EnrichGetPolicyRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f EnrichGetPolicy) WithFilterPath(v ...string) func(*EnrichGetPolicyRequest) { + return func(r *EnrichGetPolicyRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f EnrichGetPolicy) WithHeader(h map[string]string) func(*EnrichGetPolicyRequest) { + return func(r *EnrichGetPolicyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f EnrichGetPolicy) WithOpaqueID(s string) func(*EnrichGetPolicyRequest) { + return func(r *EnrichGetPolicyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.enrich.put_policy.go b/esapi/api.xpack.enrich.put_policy.go new file mode 100644 index 0000000000..c44bdf1cf8 --- /dev/null +++ b/esapi/api.xpack.enrich.put_policy.go @@ -0,0 +1,197 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newEnrichPutPolicyFunc(t Transport) EnrichPutPolicy { + return func(name string, body io.Reader, o ...func(*EnrichPutPolicyRequest)) (*Response, error) { + var r = EnrichPutPolicyRequest{Name: name, Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// EnrichPutPolicy - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-put-policy.html. +// +type EnrichPutPolicy func(name string, body io.Reader, o ...func(*EnrichPutPolicyRequest)) (*Response, error) + +// EnrichPutPolicyRequest configures the Enrich Put Policy API request. +// +type EnrichPutPolicyRequest struct { + Body io.Reader + + Name string + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r EnrichPutPolicyRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_enrich") + 1 + len("policy") + 1 + len(r.Name)) + path.WriteString("/") + path.WriteString("_enrich") + path.WriteString("/") + path.WriteString("policy") + path.WriteString("/") + path.WriteString(r.Name) + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f EnrichPutPolicy) WithContext(v context.Context) func(*EnrichPutPolicyRequest) { + return func(r *EnrichPutPolicyRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f EnrichPutPolicy) WithPretty() func(*EnrichPutPolicyRequest) { + return func(r *EnrichPutPolicyRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f EnrichPutPolicy) WithHuman() func(*EnrichPutPolicyRequest) { + return func(r *EnrichPutPolicyRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f EnrichPutPolicy) WithErrorTrace() func(*EnrichPutPolicyRequest) { + return func(r *EnrichPutPolicyRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f EnrichPutPolicy) WithFilterPath(v ...string) func(*EnrichPutPolicyRequest) { + return func(r *EnrichPutPolicyRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f EnrichPutPolicy) WithHeader(h map[string]string) func(*EnrichPutPolicyRequest) { + return func(r *EnrichPutPolicyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f EnrichPutPolicy) WithOpaqueID(s string) func(*EnrichPutPolicyRequest) { + return func(r *EnrichPutPolicyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.enrich.stats.go b/esapi/api.xpack.enrich.stats.go new file mode 100644 index 0000000000..a586b4f262 --- /dev/null +++ b/esapi/api.xpack.enrich.stats.go @@ -0,0 +1,183 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newEnrichStatsFunc(t Transport) EnrichStats { + return func(o ...func(*EnrichStatsRequest)) (*Response, error) { + var r = EnrichStatsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// EnrichStats - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats.html. +// +type EnrichStats func(o ...func(*EnrichStatsRequest)) (*Response, error) + +// EnrichStatsRequest configures the Enrich Stats API request. +// +type EnrichStatsRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r EnrichStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_enrich/_stats")) + path.WriteString("/_enrich/_stats") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f EnrichStats) WithContext(v context.Context) func(*EnrichStatsRequest) { + return func(r *EnrichStatsRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f EnrichStats) WithPretty() func(*EnrichStatsRequest) { + return func(r *EnrichStatsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f EnrichStats) WithHuman() func(*EnrichStatsRequest) { + return func(r *EnrichStatsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f EnrichStats) WithErrorTrace() func(*EnrichStatsRequest) { + return func(r *EnrichStatsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f EnrichStats) WithFilterPath(v ...string) func(*EnrichStatsRequest) { + return func(r *EnrichStatsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f EnrichStats) WithHeader(h map[string]string) func(*EnrichStatsRequest) { + return func(r *EnrichStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f EnrichStats) WithOpaqueID(s string) func(*EnrichStatsRequest) { + return func(r *EnrichStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.graph.explore.go b/esapi/api.xpack.graph.explore.go index 363550d9d8..11d81f5366 100644 --- a/esapi/api.xpack.graph.explore.go +++ b/esapi/api.xpack.graph.explore.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.delete_lifecycle.go b/esapi/api.xpack.ilm.delete_lifecycle.go index 526e575d9c..bb97cccf06 100644 --- a/esapi/api.xpack.ilm.delete_lifecycle.go +++ b/esapi/api.xpack.ilm.delete_lifecycle.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.explain_lifecycle.go b/esapi/api.xpack.ilm.explain_lifecycle.go index e63a519151..e8e54a765d 100644 --- a/esapi/api.xpack.ilm.explain_lifecycle.go +++ b/esapi/api.xpack.ilm.explain_lifecycle.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.get_lifecycle.go b/esapi/api.xpack.ilm.get_lifecycle.go index 799e7f4eb1..853f50afba 100644 --- a/esapi/api.xpack.ilm.get_lifecycle.go +++ b/esapi/api.xpack.ilm.get_lifecycle.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.get_status.go b/esapi/api.xpack.ilm.get_status.go index 19ae52aff5..2df45227cc 100644 --- a/esapi/api.xpack.ilm.get_status.go +++ b/esapi/api.xpack.ilm.get_status.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.move_to_step.go b/esapi/api.xpack.ilm.move_to_step.go index 007736528c..a9ddc20198 100644 --- a/esapi/api.xpack.ilm.move_to_step.go +++ b/esapi/api.xpack.ilm.move_to_step.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.put_lifecycle.go b/esapi/api.xpack.ilm.put_lifecycle.go index c9cc63e5e5..dadf554659 100644 --- a/esapi/api.xpack.ilm.put_lifecycle.go +++ b/esapi/api.xpack.ilm.put_lifecycle.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.remove_policy.go b/esapi/api.xpack.ilm.remove_policy.go index a54730c99d..66976e7cc1 100644 --- a/esapi/api.xpack.ilm.remove_policy.go +++ b/esapi/api.xpack.ilm.remove_policy.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.retry.go b/esapi/api.xpack.ilm.retry.go index 13eeb767f7..60ae6357e5 100644 --- a/esapi/api.xpack.ilm.retry.go +++ b/esapi/api.xpack.ilm.retry.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.start.go b/esapi/api.xpack.ilm.start.go index 704d1c22a6..5a79efa9eb 100644 --- a/esapi/api.xpack.ilm.start.go +++ b/esapi/api.xpack.ilm.start.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ilm.stop.go b/esapi/api.xpack.ilm.stop.go index 100f988b9d..85ba156850 100644 --- a/esapi/api.xpack.ilm.stop.go +++ b/esapi/api.xpack.ilm.stop.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.indices.freeze.go b/esapi/api.xpack.indices.freeze.go index 2d3dbde26e..fab53586e8 100644 --- a/esapi/api.xpack.indices.freeze.go +++ b/esapi/api.xpack.indices.freeze.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.indices.reload_search_analyzers.go b/esapi/api.xpack.indices.reload_search_analyzers.go index 9085257d2c..fce436e8ac 100644 --- a/esapi/api.xpack.indices.reload_search_analyzers.go +++ b/esapi/api.xpack.indices.reload_search_analyzers.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.indices.unfreeze.go b/esapi/api.xpack.indices.unfreeze.go index 974ebc1d85..a15c9742a6 100644 --- a/esapi/api.xpack.indices.unfreeze.go +++ b/esapi/api.xpack.indices.unfreeze.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.delete.go b/esapi/api.xpack.license.delete.go index f100563ede..a521735e59 100644 --- a/esapi/api.xpack.license.delete.go +++ b/esapi/api.xpack.license.delete.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.get.go b/esapi/api.xpack.license.get.go index a689b41b84..b9ed99f59d 100644 --- a/esapi/api.xpack.license.get.go +++ b/esapi/api.xpack.license.get.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.get_basic_status.go b/esapi/api.xpack.license.get_basic_status.go index 3e7e0d7df9..8015f5b423 100644 --- a/esapi/api.xpack.license.get_basic_status.go +++ b/esapi/api.xpack.license.get_basic_status.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.get_trial_status.go b/esapi/api.xpack.license.get_trial_status.go index e2330bd85d..2cbc657996 100644 --- a/esapi/api.xpack.license.get_trial_status.go +++ b/esapi/api.xpack.license.get_trial_status.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.post.go b/esapi/api.xpack.license.post.go index e7492f431b..52662bf1f6 100644 --- a/esapi/api.xpack.license.post.go +++ b/esapi/api.xpack.license.post.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.post_start_basic.go b/esapi/api.xpack.license.post_start_basic.go index 09ae9763f4..6a131e70e3 100644 --- a/esapi/api.xpack.license.post_start_basic.go +++ b/esapi/api.xpack.license.post_start_basic.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.license.post_start_trial.go b/esapi/api.xpack.license.post_start_trial.go index 069ddff3ff..c68af23bd1 100644 --- a/esapi/api.xpack.license.post_start_trial.go +++ b/esapi/api.xpack.license.post_start_trial.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.migration.deprecations.go b/esapi/api.xpack.migration.deprecations.go index 57973fa702..e34fee81da 100644 --- a/esapi/api.xpack.migration.deprecations.go +++ b/esapi/api.xpack.migration.deprecations.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.close_job.go b/esapi/api.xpack.ml.close_job.go index 2434205546..e84e1abf51 100644 --- a/esapi/api.xpack.ml.close_job.go +++ b/esapi/api.xpack.ml.close_job.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_calendar.go b/esapi/api.xpack.ml.delete_calendar.go index 1f4a4c7cf9..c2d212f498 100644 --- a/esapi/api.xpack.ml.delete_calendar.go +++ b/esapi/api.xpack.ml.delete_calendar.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_calendar_event.go b/esapi/api.xpack.ml.delete_calendar_event.go index 466aab4b0a..71c3a6c035 100644 --- a/esapi/api.xpack.ml.delete_calendar_event.go +++ b/esapi/api.xpack.ml.delete_calendar_event.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_calendar_job.go b/esapi/api.xpack.ml.delete_calendar_job.go index 74b2c88965..21b34ba744 100644 --- a/esapi/api.xpack.ml.delete_calendar_job.go +++ b/esapi/api.xpack.ml.delete_calendar_job.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_data_frame_analytics.go b/esapi/api.xpack.ml.delete_data_frame_analytics.go index 271eefa9a4..88b48dfb2f 100644 --- a/esapi/api.xpack.ml.delete_data_frame_analytics.go +++ b/esapi/api.xpack.ml.delete_data_frame_analytics.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_datafeed.go b/esapi/api.xpack.ml.delete_datafeed.go index b52c392a34..0be47134a2 100644 --- a/esapi/api.xpack.ml.delete_datafeed.go +++ b/esapi/api.xpack.ml.delete_datafeed.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_expired_data.go b/esapi/api.xpack.ml.delete_expired_data.go index f14fcf69b0..fd1c5228d1 100644 --- a/esapi/api.xpack.ml.delete_expired_data.go +++ b/esapi/api.xpack.ml.delete_expired_data.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_filter.go b/esapi/api.xpack.ml.delete_filter.go index 77d4a8936a..92d0b18698 100644 --- a/esapi/api.xpack.ml.delete_filter.go +++ b/esapi/api.xpack.ml.delete_filter.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_forecast.go b/esapi/api.xpack.ml.delete_forecast.go index 6e62690ed5..8c70a1949e 100644 --- a/esapi/api.xpack.ml.delete_forecast.go +++ b/esapi/api.xpack.ml.delete_forecast.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_job.go b/esapi/api.xpack.ml.delete_job.go index 3f2efa7fca..2587c0d68c 100644 --- a/esapi/api.xpack.ml.delete_job.go +++ b/esapi/api.xpack.ml.delete_job.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.delete_model_snapshot.go b/esapi/api.xpack.ml.delete_model_snapshot.go index 5a255b6351..0eb74d8332 100644 --- a/esapi/api.xpack.ml.delete_model_snapshot.go +++ b/esapi/api.xpack.ml.delete_model_snapshot.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.estimate_memory_usage.go b/esapi/api.xpack.ml.estimate_memory_usage.go index 736c8f59c8..ed6c487ff3 100644 --- a/esapi/api.xpack.ml.estimate_memory_usage.go +++ b/esapi/api.xpack.ml.estimate_memory_usage.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.evaluate_data_frame.go b/esapi/api.xpack.ml.evaluate_data_frame.go index 873389c4c9..8e0295e834 100644 --- a/esapi/api.xpack.ml.evaluate_data_frame.go +++ b/esapi/api.xpack.ml.evaluate_data_frame.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.find_file_structure.go b/esapi/api.xpack.ml.find_file_structure.go index 3a971404ba..0e0f2eda60 100644 --- a/esapi/api.xpack.ml.find_file_structure.go +++ b/esapi/api.xpack.ml.find_file_structure.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.flush_job.go b/esapi/api.xpack.ml.flush_job.go index 3248d428e8..4e91a9986a 100644 --- a/esapi/api.xpack.ml.flush_job.go +++ b/esapi/api.xpack.ml.flush_job.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.forecast.go b/esapi/api.xpack.ml.forecast.go index 3ac8308aed..d109373472 100644 --- a/esapi/api.xpack.ml.forecast.go +++ b/esapi/api.xpack.ml.forecast.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_buckets.go b/esapi/api.xpack.ml.get_buckets.go index 7a97bbd50d..2622153c1f 100644 --- a/esapi/api.xpack.ml.get_buckets.go +++ b/esapi/api.xpack.ml.get_buckets.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_calendar_events.go b/esapi/api.xpack.ml.get_calendar_events.go index 5d9270a8bb..c4edfc1d7f 100644 --- a/esapi/api.xpack.ml.get_calendar_events.go +++ b/esapi/api.xpack.ml.get_calendar_events.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_calendars.go b/esapi/api.xpack.ml.get_calendars.go index fc3d0c45b1..2888391693 100644 --- a/esapi/api.xpack.ml.get_calendars.go +++ b/esapi/api.xpack.ml.get_calendars.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_categories.go b/esapi/api.xpack.ml.get_categories.go index dde18805ff..dc7caab3fd 100644 --- a/esapi/api.xpack.ml.get_categories.go +++ b/esapi/api.xpack.ml.get_categories.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_data_frame_analytics.go b/esapi/api.xpack.ml.get_data_frame_analytics.go index 106a3dee17..04b1e1eb45 100644 --- a/esapi/api.xpack.ml.get_data_frame_analytics.go +++ b/esapi/api.xpack.ml.get_data_frame_analytics.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go index 5feae82aba..0a1e748b01 100644 --- a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go +++ b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_datafeed_stats.go b/esapi/api.xpack.ml.get_datafeed_stats.go index 31e2ec82b4..acc5fab3f4 100644 --- a/esapi/api.xpack.ml.get_datafeed_stats.go +++ b/esapi/api.xpack.ml.get_datafeed_stats.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_datafeeds.go b/esapi/api.xpack.ml.get_datafeeds.go index e4ed5f2a43..5da216d0d6 100644 --- a/esapi/api.xpack.ml.get_datafeeds.go +++ b/esapi/api.xpack.ml.get_datafeeds.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_filters.go b/esapi/api.xpack.ml.get_filters.go index 05ef5f4a08..bca0489912 100644 --- a/esapi/api.xpack.ml.get_filters.go +++ b/esapi/api.xpack.ml.get_filters.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_influencers.go b/esapi/api.xpack.ml.get_influencers.go index 87811fe51e..d7b608666e 100644 --- a/esapi/api.xpack.ml.get_influencers.go +++ b/esapi/api.xpack.ml.get_influencers.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_job_stats.go b/esapi/api.xpack.ml.get_job_stats.go index 562d749a4a..10f6b6148a 100644 --- a/esapi/api.xpack.ml.get_job_stats.go +++ b/esapi/api.xpack.ml.get_job_stats.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_jobs.go b/esapi/api.xpack.ml.get_jobs.go index 8ba393e496..0ae165e714 100644 --- a/esapi/api.xpack.ml.get_jobs.go +++ b/esapi/api.xpack.ml.get_jobs.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_model_snapshots.go b/esapi/api.xpack.ml.get_model_snapshots.go index afe4041998..ee851332a6 100644 --- a/esapi/api.xpack.ml.get_model_snapshots.go +++ b/esapi/api.xpack.ml.get_model_snapshots.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_overall_buckets.go b/esapi/api.xpack.ml.get_overall_buckets.go index 3e481138f9..e987d230eb 100644 --- a/esapi/api.xpack.ml.get_overall_buckets.go +++ b/esapi/api.xpack.ml.get_overall_buckets.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.get_records.go b/esapi/api.xpack.ml.get_records.go index b513c1e8e3..4068de3dbb 100644 --- a/esapi/api.xpack.ml.get_records.go +++ b/esapi/api.xpack.ml.get_records.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.info.go b/esapi/api.xpack.ml.info.go index 1df931ab65..a85fe67cab 100644 --- a/esapi/api.xpack.ml.info.go +++ b/esapi/api.xpack.ml.info.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.open_job.go b/esapi/api.xpack.ml.open_job.go index 1eca338006..6146487a1c 100644 --- a/esapi/api.xpack.ml.open_job.go +++ b/esapi/api.xpack.ml.open_job.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.post_calendar_events.go b/esapi/api.xpack.ml.post_calendar_events.go index 54c64a47b5..19b19e5fe5 100644 --- a/esapi/api.xpack.ml.post_calendar_events.go +++ b/esapi/api.xpack.ml.post_calendar_events.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.post_data.go b/esapi/api.xpack.ml.post_data.go index 39c9dcc670..36a8a37368 100644 --- a/esapi/api.xpack.ml.post_data.go +++ b/esapi/api.xpack.ml.post_data.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.preview_datafeed.go b/esapi/api.xpack.ml.preview_datafeed.go index 2b3b0ca694..29808c749e 100644 --- a/esapi/api.xpack.ml.preview_datafeed.go +++ b/esapi/api.xpack.ml.preview_datafeed.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_calendar.go b/esapi/api.xpack.ml.put_calendar.go index 85510a7e2a..59ae340c2c 100644 --- a/esapi/api.xpack.ml.put_calendar.go +++ b/esapi/api.xpack.ml.put_calendar.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_calendar_job.go b/esapi/api.xpack.ml.put_calendar_job.go index 17438ff724..d30ec9fe52 100644 --- a/esapi/api.xpack.ml.put_calendar_job.go +++ b/esapi/api.xpack.ml.put_calendar_job.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_data_frame_analytics.go b/esapi/api.xpack.ml.put_data_frame_analytics.go index 0ca69a4e2b..3cad85559a 100644 --- a/esapi/api.xpack.ml.put_data_frame_analytics.go +++ b/esapi/api.xpack.ml.put_data_frame_analytics.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_datafeed.go b/esapi/api.xpack.ml.put_datafeed.go index 1928479982..5e67725b11 100644 --- a/esapi/api.xpack.ml.put_datafeed.go +++ b/esapi/api.xpack.ml.put_datafeed.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_filter.go b/esapi/api.xpack.ml.put_filter.go index 27b279244c..f7c4073a00 100644 --- a/esapi/api.xpack.ml.put_filter.go +++ b/esapi/api.xpack.ml.put_filter.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.put_job.go b/esapi/api.xpack.ml.put_job.go index d62ce4a367..ef1fe96625 100644 --- a/esapi/api.xpack.ml.put_job.go +++ b/esapi/api.xpack.ml.put_job.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.revert_model_snapshot.go b/esapi/api.xpack.ml.revert_model_snapshot.go index d68299dd83..96f11f60ef 100644 --- a/esapi/api.xpack.ml.revert_model_snapshot.go +++ b/esapi/api.xpack.ml.revert_model_snapshot.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.set_upgrade_mode.go b/esapi/api.xpack.ml.set_upgrade_mode.go index c2727fc53a..c1471a216e 100644 --- a/esapi/api.xpack.ml.set_upgrade_mode.go +++ b/esapi/api.xpack.ml.set_upgrade_mode.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.start_data_frame_analytics.go b/esapi/api.xpack.ml.start_data_frame_analytics.go index 89619ee384..880ebf769d 100644 --- a/esapi/api.xpack.ml.start_data_frame_analytics.go +++ b/esapi/api.xpack.ml.start_data_frame_analytics.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.start_datafeed.go b/esapi/api.xpack.ml.start_datafeed.go index c8544705f5..450e979f23 100644 --- a/esapi/api.xpack.ml.start_datafeed.go +++ b/esapi/api.xpack.ml.start_datafeed.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.stop_data_frame_analytics.go b/esapi/api.xpack.ml.stop_data_frame_analytics.go index f71e074da1..0524ea53ea 100644 --- a/esapi/api.xpack.ml.stop_data_frame_analytics.go +++ b/esapi/api.xpack.ml.stop_data_frame_analytics.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.stop_datafeed.go b/esapi/api.xpack.ml.stop_datafeed.go index ea45c1fe8c..5a1f54f1ab 100644 --- a/esapi/api.xpack.ml.stop_datafeed.go +++ b/esapi/api.xpack.ml.stop_datafeed.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.update_datafeed.go b/esapi/api.xpack.ml.update_datafeed.go index 1c30417513..583071ef1c 100644 --- a/esapi/api.xpack.ml.update_datafeed.go +++ b/esapi/api.xpack.ml.update_datafeed.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.update_filter.go b/esapi/api.xpack.ml.update_filter.go index 275f32d83b..f13c2d020b 100644 --- a/esapi/api.xpack.ml.update_filter.go +++ b/esapi/api.xpack.ml.update_filter.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.update_job.go b/esapi/api.xpack.ml.update_job.go index d685313555..baa181dbf8 100644 --- a/esapi/api.xpack.ml.update_job.go +++ b/esapi/api.xpack.ml.update_job.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.update_model_snapshot.go b/esapi/api.xpack.ml.update_model_snapshot.go index 9b72a752fa..1aac169e99 100644 --- a/esapi/api.xpack.ml.update_model_snapshot.go +++ b/esapi/api.xpack.ml.update_model_snapshot.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.validate.go b/esapi/api.xpack.ml.validate.go index 3befaf2d10..6ecf5e94fb 100644 --- a/esapi/api.xpack.ml.validate.go +++ b/esapi/api.xpack.ml.validate.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ml.validate_detector.go b/esapi/api.xpack.ml.validate_detector.go index 0fe2cb5bff..1d32a49eac 100644 --- a/esapi/api.xpack.ml.validate_detector.go +++ b/esapi/api.xpack.ml.validate_detector.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.monitoring.bulk.go b/esapi/api.xpack.monitoring.bulk.go index 559f94e2ba..7f22b7263e 100644 --- a/esapi/api.xpack.monitoring.bulk.go +++ b/esapi/api.xpack.monitoring.bulk.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.delete_job.go b/esapi/api.xpack.rollup.delete_job.go index 61cb6dd977..d8a3dfd929 100644 --- a/esapi/api.xpack.rollup.delete_job.go +++ b/esapi/api.xpack.rollup.delete_job.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.get_jobs.go b/esapi/api.xpack.rollup.get_jobs.go index d69f9406cc..adff116b75 100644 --- a/esapi/api.xpack.rollup.get_jobs.go +++ b/esapi/api.xpack.rollup.get_jobs.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.get_rollup_caps.go b/esapi/api.xpack.rollup.get_rollup_caps.go index e0ba8636c7..1b227b033f 100644 --- a/esapi/api.xpack.rollup.get_rollup_caps.go +++ b/esapi/api.xpack.rollup.get_rollup_caps.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.get_rollup_index_caps.go b/esapi/api.xpack.rollup.get_rollup_index_caps.go index e9d82f3a81..8d2fe25367 100644 --- a/esapi/api.xpack.rollup.get_rollup_index_caps.go +++ b/esapi/api.xpack.rollup.get_rollup_index_caps.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.put_job.go b/esapi/api.xpack.rollup.put_job.go index 3c84cb2c7f..1c09051375 100644 --- a/esapi/api.xpack.rollup.put_job.go +++ b/esapi/api.xpack.rollup.put_job.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.rollup_search.go b/esapi/api.xpack.rollup.rollup_search.go index 418d0a17b3..9e33327c2d 100644 --- a/esapi/api.xpack.rollup.rollup_search.go +++ b/esapi/api.xpack.rollup.rollup_search.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.start_job.go b/esapi/api.xpack.rollup.start_job.go index c93e069822..51fa78d2ee 100644 --- a/esapi/api.xpack.rollup.start_job.go +++ b/esapi/api.xpack.rollup.start_job.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.rollup.stop_job.go b/esapi/api.xpack.rollup.stop_job.go index 9d08c3675a..3dbe8b8efe 100644 --- a/esapi/api.xpack.rollup.stop_job.go +++ b/esapi/api.xpack.rollup.stop_job.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.authenticate.go b/esapi/api.xpack.security.authenticate.go index 1dc5008178..978c55b868 100644 --- a/esapi/api.xpack.security.authenticate.go +++ b/esapi/api.xpack.security.authenticate.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.change_password.go b/esapi/api.xpack.security.change_password.go index 3527b317a8..c637740b0f 100644 --- a/esapi/api.xpack.security.change_password.go +++ b/esapi/api.xpack.security.change_password.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.clear_cached_realms.go b/esapi/api.xpack.security.clear_cached_realms.go index b95804cfb4..0d300e3077 100644 --- a/esapi/api.xpack.security.clear_cached_realms.go +++ b/esapi/api.xpack.security.clear_cached_realms.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.clear_cached_roles.go b/esapi/api.xpack.security.clear_cached_roles.go index 98f05b722e..4537ed0ada 100644 --- a/esapi/api.xpack.security.clear_cached_roles.go +++ b/esapi/api.xpack.security.clear_cached_roles.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.create_api_key.go b/esapi/api.xpack.security.create_api_key.go index 8592ee5484..c19b61c361 100644 --- a/esapi/api.xpack.security.create_api_key.go +++ b/esapi/api.xpack.security.create_api_key.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.delete_privileges.go b/esapi/api.xpack.security.delete_privileges.go index b353b18f86..8f856e11b7 100644 --- a/esapi/api.xpack.security.delete_privileges.go +++ b/esapi/api.xpack.security.delete_privileges.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.delete_role.go b/esapi/api.xpack.security.delete_role.go index 055659eb14..eddd65cdce 100644 --- a/esapi/api.xpack.security.delete_role.go +++ b/esapi/api.xpack.security.delete_role.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.delete_role_mapping.go b/esapi/api.xpack.security.delete_role_mapping.go index 8f4360c39c..eaad2b3fd5 100644 --- a/esapi/api.xpack.security.delete_role_mapping.go +++ b/esapi/api.xpack.security.delete_role_mapping.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.delete_user.go b/esapi/api.xpack.security.delete_user.go index 9e457b0fc8..3a795e9158 100644 --- a/esapi/api.xpack.security.delete_user.go +++ b/esapi/api.xpack.security.delete_user.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.disable_user.go b/esapi/api.xpack.security.disable_user.go index 04f74c5885..dd1dadb060 100644 --- a/esapi/api.xpack.security.disable_user.go +++ b/esapi/api.xpack.security.disable_user.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.enable_user.go b/esapi/api.xpack.security.enable_user.go index a81ec177ec..a57e5388c3 100644 --- a/esapi/api.xpack.security.enable_user.go +++ b/esapi/api.xpack.security.enable_user.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_api_key.go b/esapi/api.xpack.security.get_api_key.go index 2b56a65c92..738549ae88 100644 --- a/esapi/api.xpack.security.get_api_key.go +++ b/esapi/api.xpack.security.get_api_key.go @@ -2,13 +2,14 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi import ( "context" "net/http" + "strconv" "strings" ) @@ -35,6 +36,7 @@ type SecurityGetAPIKey func(o ...func(*SecurityGetAPIKeyRequest)) (*Response, er type SecurityGetAPIKeyRequest struct { ID string Name string + Owner *bool RealmName string Username string @@ -72,6 +74,10 @@ func (r SecurityGetAPIKeyRequest) Do(ctx context.Context, transport Transport) ( params["name"] = r.Name } + if r.Owner != nil { + params["owner"] = strconv.FormatBool(*r.Owner) + } + if r.RealmName != "" { params["realm_name"] = r.RealmName } @@ -163,6 +169,14 @@ func (f SecurityGetAPIKey) WithName(v string) func(*SecurityGetAPIKeyRequest) { } } +// WithOwner - flag to query api keys owned by the currently authenticated user. +// +func (f SecurityGetAPIKey) WithOwner(v bool) func(*SecurityGetAPIKeyRequest) { + return func(r *SecurityGetAPIKeyRequest) { + r.Owner = &v + } +} + // WithRealmName - realm name of the user who created this api key to be retrieved. // func (f SecurityGetAPIKey) WithRealmName(v string) func(*SecurityGetAPIKeyRequest) { diff --git a/esapi/api.xpack.security.get_builtin_privileges.go b/esapi/api.xpack.security.get_builtin_privileges.go index 8d1ead3f67..dfbecf26b3 100644 --- a/esapi/api.xpack.security.get_builtin_privileges.go +++ b/esapi/api.xpack.security.get_builtin_privileges.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_privileges.go b/esapi/api.xpack.security.get_privileges.go index a88b36152b..0a90399163 100644 --- a/esapi/api.xpack.security.get_privileges.go +++ b/esapi/api.xpack.security.get_privileges.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_role.go b/esapi/api.xpack.security.get_role.go index 01fa74e07d..217852521a 100644 --- a/esapi/api.xpack.security.get_role.go +++ b/esapi/api.xpack.security.get_role.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_role_mapping.go b/esapi/api.xpack.security.get_role_mapping.go index e95d2036f5..39e388c9ce 100644 --- a/esapi/api.xpack.security.get_role_mapping.go +++ b/esapi/api.xpack.security.get_role_mapping.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_token.go b/esapi/api.xpack.security.get_token.go index e9389663e9..b710b06797 100644 --- a/esapi/api.xpack.security.get_token.go +++ b/esapi/api.xpack.security.get_token.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_user.go b/esapi/api.xpack.security.get_user.go index f9b8878a00..39de2595f0 100644 --- a/esapi/api.xpack.security.get_user.go +++ b/esapi/api.xpack.security.get_user.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.get_user_privileges.go b/esapi/api.xpack.security.get_user_privileges.go index 7e2a6811ff..360c00f40b 100644 --- a/esapi/api.xpack.security.get_user_privileges.go +++ b/esapi/api.xpack.security.get_user_privileges.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.has_privileges.go b/esapi/api.xpack.security.has_privileges.go index 8de167f9b2..ac15d11021 100644 --- a/esapi/api.xpack.security.has_privileges.go +++ b/esapi/api.xpack.security.has_privileges.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.invalidate_api_key.go b/esapi/api.xpack.security.invalidate_api_key.go index f885723cbd..72bb0f05c3 100644 --- a/esapi/api.xpack.security.invalidate_api_key.go +++ b/esapi/api.xpack.security.invalidate_api_key.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.invalidate_token.go b/esapi/api.xpack.security.invalidate_token.go index 2bc4fe3b58..78b4a5056c 100644 --- a/esapi/api.xpack.security.invalidate_token.go +++ b/esapi/api.xpack.security.invalidate_token.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.put_privileges.go b/esapi/api.xpack.security.put_privileges.go index 7cd92efe43..29efadab8d 100644 --- a/esapi/api.xpack.security.put_privileges.go +++ b/esapi/api.xpack.security.put_privileges.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.put_role.go b/esapi/api.xpack.security.put_role.go index 0babd4f29e..f93a7ad8ab 100644 --- a/esapi/api.xpack.security.put_role.go +++ b/esapi/api.xpack.security.put_role.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.put_role_mapping.go b/esapi/api.xpack.security.put_role_mapping.go index 00dfae13eb..f998570779 100644 --- a/esapi/api.xpack.security.put_role_mapping.go +++ b/esapi/api.xpack.security.put_role_mapping.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.security.put_user.go b/esapi/api.xpack.security.put_user.go index b4aca3ced5..1130be83fc 100644 --- a/esapi/api.xpack.security.put_user.go +++ b/esapi/api.xpack.security.put_user.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.slm.delete_lifecycle.go b/esapi/api.xpack.slm.delete_lifecycle.go index 56a131f2b0..c8eca708d4 100644 --- a/esapi/api.xpack.slm.delete_lifecycle.go +++ b/esapi/api.xpack.slm.delete_lifecycle.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.slm.execute_lifecycle.go b/esapi/api.xpack.slm.execute_lifecycle.go index 4ace01b581..9080e17fe9 100644 --- a/esapi/api.xpack.slm.execute_lifecycle.go +++ b/esapi/api.xpack.slm.execute_lifecycle.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.slm.execute_retention.go b/esapi/api.xpack.slm.execute_retention.go new file mode 100644 index 0000000000..b376af9428 --- /dev/null +++ b/esapi/api.xpack.slm.execute_retention.go @@ -0,0 +1,183 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSlmExecuteRetentionFunc(t Transport) SlmExecuteRetention { + return func(o ...func(*SlmExecuteRetentionRequest)) (*Response, error) { + var r = SlmExecuteRetentionRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SlmExecuteRetention - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html. +// +type SlmExecuteRetention func(o ...func(*SlmExecuteRetentionRequest)) (*Response, error) + +// SlmExecuteRetentionRequest configures the Slm Execute Retention API request. +// +type SlmExecuteRetentionRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SlmExecuteRetentionRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_slm/_execute_retention")) + path.WriteString("/_slm/_execute_retention") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SlmExecuteRetention) WithContext(v context.Context) func(*SlmExecuteRetentionRequest) { + return func(r *SlmExecuteRetentionRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SlmExecuteRetention) WithPretty() func(*SlmExecuteRetentionRequest) { + return func(r *SlmExecuteRetentionRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SlmExecuteRetention) WithHuman() func(*SlmExecuteRetentionRequest) { + return func(r *SlmExecuteRetentionRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SlmExecuteRetention) WithErrorTrace() func(*SlmExecuteRetentionRequest) { + return func(r *SlmExecuteRetentionRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SlmExecuteRetention) WithFilterPath(v ...string) func(*SlmExecuteRetentionRequest) { + return func(r *SlmExecuteRetentionRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SlmExecuteRetention) WithHeader(h map[string]string) func(*SlmExecuteRetentionRequest) { + return func(r *SlmExecuteRetentionRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SlmExecuteRetention) WithOpaqueID(s string) func(*SlmExecuteRetentionRequest) { + return func(r *SlmExecuteRetentionRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.slm.get_lifecycle.go b/esapi/api.xpack.slm.get_lifecycle.go index 0a4af1c97d..e8cbaaf7d4 100644 --- a/esapi/api.xpack.slm.get_lifecycle.go +++ b/esapi/api.xpack.slm.get_lifecycle.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.slm.get_stats.go b/esapi/api.xpack.slm.get_stats.go new file mode 100644 index 0000000000..d9093d0362 --- /dev/null +++ b/esapi/api.xpack.slm.get_stats.go @@ -0,0 +1,183 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" +) + +func newSlmGetStatsFunc(t Transport) SlmGetStats { + return func(o ...func(*SlmGetStatsRequest)) (*Response, error) { + var r = SlmGetStatsRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// SlmGetStats - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-get-stats.html. +// +type SlmGetStats func(o ...func(*SlmGetStatsRequest)) (*Response, error) + +// SlmGetStatsRequest configures the Slm Get Stats API request. +// +type SlmGetStatsRequest struct { + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r SlmGetStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_slm/stats")) + path.WriteString("/_slm/stats") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f SlmGetStats) WithContext(v context.Context) func(*SlmGetStatsRequest) { + return func(r *SlmGetStatsRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f SlmGetStats) WithPretty() func(*SlmGetStatsRequest) { + return func(r *SlmGetStatsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f SlmGetStats) WithHuman() func(*SlmGetStatsRequest) { + return func(r *SlmGetStatsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f SlmGetStats) WithErrorTrace() func(*SlmGetStatsRequest) { + return func(r *SlmGetStatsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f SlmGetStats) WithFilterPath(v ...string) func(*SlmGetStatsRequest) { + return func(r *SlmGetStatsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f SlmGetStats) WithHeader(h map[string]string) func(*SlmGetStatsRequest) { + return func(r *SlmGetStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SlmGetStats) WithOpaqueID(s string) func(*SlmGetStatsRequest) { + return func(r *SlmGetStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.slm.put_lifecycle.go b/esapi/api.xpack.slm.put_lifecycle.go index cd50103526..54e8b52fc9 100644 --- a/esapi/api.xpack.slm.put_lifecycle.go +++ b/esapi/api.xpack.slm.put_lifecycle.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.sql.clear_cursor.go b/esapi/api.xpack.sql.clear_cursor.go index 08a6180757..bfb061b0f7 100644 --- a/esapi/api.xpack.sql.clear_cursor.go +++ b/esapi/api.xpack.sql.clear_cursor.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.sql.query.go b/esapi/api.xpack.sql.query.go index 39730dd7d6..26f0c1af91 100644 --- a/esapi/api.xpack.sql.query.go +++ b/esapi/api.xpack.sql.query.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.sql.translate.go b/esapi/api.xpack.sql.translate.go index 73113c912c..27c173efc2 100644 --- a/esapi/api.xpack.sql.translate.go +++ b/esapi/api.xpack.sql.translate.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.ssl.certificates.go b/esapi/api.xpack.ssl.certificates.go index 904a06c2e3..cf6a4ce27d 100644 --- a/esapi/api.xpack.ssl.certificates.go +++ b/esapi/api.xpack.ssl.certificates.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.transform.delete_transform.go b/esapi/api.xpack.transform.delete_transform.go new file mode 100644 index 0000000000..e11d7abcfd --- /dev/null +++ b/esapi/api.xpack.transform.delete_transform.go @@ -0,0 +1,203 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newTransformDeleteTransformFunc(t Transport) TransformDeleteTransform { + return func(transform_id string, o ...func(*TransformDeleteTransformRequest)) (*Response, error) { + var r = TransformDeleteTransformRequest{TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// TransformDeleteTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html. +// +type TransformDeleteTransform func(transform_id string, o ...func(*TransformDeleteTransformRequest)) (*Response, error) + +// TransformDeleteTransformRequest configures the Transform Delete Transform API request. +// +type TransformDeleteTransformRequest struct { + TransformID string + + Force *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r TransformDeleteTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "DELETE" + + path.Grow(1 + len("_transform") + 1 + len(r.TransformID)) + path.WriteString("/") + path.WriteString("_transform") + path.WriteString("/") + path.WriteString(r.TransformID) + + params = make(map[string]string) + + if r.Force != nil { + params["force"] = strconv.FormatBool(*r.Force) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f TransformDeleteTransform) WithContext(v context.Context) func(*TransformDeleteTransformRequest) { + return func(r *TransformDeleteTransformRequest) { + r.ctx = v + } +} + +// WithForce - when `true`, the transform is deleted regardless of its current state. the default value is `false`, meaning that the transform must be `stopped` before it can be deleted.. +// +func (f TransformDeleteTransform) WithForce(v bool) func(*TransformDeleteTransformRequest) { + return func(r *TransformDeleteTransformRequest) { + r.Force = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f TransformDeleteTransform) WithPretty() func(*TransformDeleteTransformRequest) { + return func(r *TransformDeleteTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f TransformDeleteTransform) WithHuman() func(*TransformDeleteTransformRequest) { + return func(r *TransformDeleteTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f TransformDeleteTransform) WithErrorTrace() func(*TransformDeleteTransformRequest) { + return func(r *TransformDeleteTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f TransformDeleteTransform) WithFilterPath(v ...string) func(*TransformDeleteTransformRequest) { + return func(r *TransformDeleteTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f TransformDeleteTransform) WithHeader(h map[string]string) func(*TransformDeleteTransformRequest) { + return func(r *TransformDeleteTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f TransformDeleteTransform) WithOpaqueID(s string) func(*TransformDeleteTransformRequest) { + return func(r *TransformDeleteTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.transform.get_transform.go b/esapi/api.xpack.transform.get_transform.go new file mode 100644 index 0000000000..f2584cd5b0 --- /dev/null +++ b/esapi/api.xpack.transform.get_transform.go @@ -0,0 +1,239 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newTransformGetTransformFunc(t Transport) TransformGetTransform { + return func(o ...func(*TransformGetTransformRequest)) (*Response, error) { + var r = TransformGetTransformRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// TransformGetTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html. +// +type TransformGetTransform func(o ...func(*TransformGetTransformRequest)) (*Response, error) + +// TransformGetTransformRequest configures the Transform Get Transform API request. +// +type TransformGetTransformRequest struct { + TransformID string + + AllowNoMatch *bool + From *int + Size *int + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r TransformGetTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_transform") + 1 + len(r.TransformID)) + path.WriteString("/") + path.WriteString("_transform") + if r.TransformID != "" { + path.WriteString("/") + path.WriteString(r.TransformID) + } + + params = make(map[string]string) + + if r.AllowNoMatch != nil { + params["allow_no_match"] = strconv.FormatBool(*r.AllowNoMatch) + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f TransformGetTransform) WithContext(v context.Context) func(*TransformGetTransformRequest) { + return func(r *TransformGetTransformRequest) { + r.ctx = v + } +} + +// WithTransformID - the ID or comma delimited list of ID expressions of the transforms to get, '_all' or '*' implies get all transforms. +// +func (f TransformGetTransform) WithTransformID(v string) func(*TransformGetTransformRequest) { + return func(r *TransformGetTransformRequest) { + r.TransformID = v + } +} + +// WithAllowNoMatch - whether to ignore if a wildcard expression matches no transforms. (this includes `_all` string or when no transforms have been specified). +// +func (f TransformGetTransform) WithAllowNoMatch(v bool) func(*TransformGetTransformRequest) { + return func(r *TransformGetTransformRequest) { + r.AllowNoMatch = &v + } +} + +// WithFrom - skips a number of transform configs, defaults to 0. +// +func (f TransformGetTransform) WithFrom(v int) func(*TransformGetTransformRequest) { + return func(r *TransformGetTransformRequest) { + r.From = &v + } +} + +// WithSize - specifies a max number of transforms to get, defaults to 100. +// +func (f TransformGetTransform) WithSize(v int) func(*TransformGetTransformRequest) { + return func(r *TransformGetTransformRequest) { + r.Size = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f TransformGetTransform) WithPretty() func(*TransformGetTransformRequest) { + return func(r *TransformGetTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f TransformGetTransform) WithHuman() func(*TransformGetTransformRequest) { + return func(r *TransformGetTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f TransformGetTransform) WithErrorTrace() func(*TransformGetTransformRequest) { + return func(r *TransformGetTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f TransformGetTransform) WithFilterPath(v ...string) func(*TransformGetTransformRequest) { + return func(r *TransformGetTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f TransformGetTransform) WithHeader(h map[string]string) func(*TransformGetTransformRequest) { + return func(r *TransformGetTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f TransformGetTransform) WithOpaqueID(s string) func(*TransformGetTransformRequest) { + return func(r *TransformGetTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.transform.get_transform_stats.go b/esapi/api.xpack.transform.get_transform_stats.go new file mode 100644 index 0000000000..c19d68ac05 --- /dev/null +++ b/esapi/api.xpack.transform.get_transform_stats.go @@ -0,0 +1,231 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" +) + +func newTransformGetTransformStatsFunc(t Transport) TransformGetTransformStats { + return func(transform_id string, o ...func(*TransformGetTransformStatsRequest)) (*Response, error) { + var r = TransformGetTransformStatsRequest{TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// TransformGetTransformStats - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html. +// +type TransformGetTransformStats func(transform_id string, o ...func(*TransformGetTransformStatsRequest)) (*Response, error) + +// TransformGetTransformStatsRequest configures the Transform Get Transform Stats API request. +// +type TransformGetTransformStatsRequest struct { + TransformID string + + AllowNoMatch *bool + From *int + Size *int + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r TransformGetTransformStatsRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(1 + len("_transform") + 1 + len(r.TransformID) + 1 + len("_stats")) + path.WriteString("/") + path.WriteString("_transform") + path.WriteString("/") + path.WriteString(r.TransformID) + path.WriteString("/") + path.WriteString("_stats") + + params = make(map[string]string) + + if r.AllowNoMatch != nil { + params["allow_no_match"] = strconv.FormatBool(*r.AllowNoMatch) + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f TransformGetTransformStats) WithContext(v context.Context) func(*TransformGetTransformStatsRequest) { + return func(r *TransformGetTransformStatsRequest) { + r.ctx = v + } +} + +// WithAllowNoMatch - whether to ignore if a wildcard expression matches no transforms. (this includes `_all` string or when no transforms have been specified). +// +func (f TransformGetTransformStats) WithAllowNoMatch(v bool) func(*TransformGetTransformStatsRequest) { + return func(r *TransformGetTransformStatsRequest) { + r.AllowNoMatch = &v + } +} + +// WithFrom - skips a number of transform stats, defaults to 0. +// +func (f TransformGetTransformStats) WithFrom(v int) func(*TransformGetTransformStatsRequest) { + return func(r *TransformGetTransformStatsRequest) { + r.From = &v + } +} + +// WithSize - specifies a max number of transform stats to get, defaults to 100. +// +func (f TransformGetTransformStats) WithSize(v int) func(*TransformGetTransformStatsRequest) { + return func(r *TransformGetTransformStatsRequest) { + r.Size = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f TransformGetTransformStats) WithPretty() func(*TransformGetTransformStatsRequest) { + return func(r *TransformGetTransformStatsRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f TransformGetTransformStats) WithHuman() func(*TransformGetTransformStatsRequest) { + return func(r *TransformGetTransformStatsRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f TransformGetTransformStats) WithErrorTrace() func(*TransformGetTransformStatsRequest) { + return func(r *TransformGetTransformStatsRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f TransformGetTransformStats) WithFilterPath(v ...string) func(*TransformGetTransformStatsRequest) { + return func(r *TransformGetTransformStatsRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f TransformGetTransformStats) WithHeader(h map[string]string) func(*TransformGetTransformStatsRequest) { + return func(r *TransformGetTransformStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f TransformGetTransformStats) WithOpaqueID(s string) func(*TransformGetTransformStatsRequest) { + return func(r *TransformGetTransformStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.transform.preview_transform.go b/esapi/api.xpack.transform.preview_transform.go new file mode 100644 index 0000000000..d42ccabb55 --- /dev/null +++ b/esapi/api.xpack.transform.preview_transform.go @@ -0,0 +1,190 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strings" +) + +func newTransformPreviewTransformFunc(t Transport) TransformPreviewTransform { + return func(body io.Reader, o ...func(*TransformPreviewTransformRequest)) (*Response, error) { + var r = TransformPreviewTransformRequest{Body: body} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// TransformPreviewTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html. +// +type TransformPreviewTransform func(body io.Reader, o ...func(*TransformPreviewTransformRequest)) (*Response, error) + +// TransformPreviewTransformRequest configures the Transform Preview Transform API request. +// +type TransformPreviewTransformRequest struct { + Body io.Reader + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r TransformPreviewTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(len("/_transform/_preview")) + path.WriteString("/_transform/_preview") + + params = make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f TransformPreviewTransform) WithContext(v context.Context) func(*TransformPreviewTransformRequest) { + return func(r *TransformPreviewTransformRequest) { + r.ctx = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f TransformPreviewTransform) WithPretty() func(*TransformPreviewTransformRequest) { + return func(r *TransformPreviewTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f TransformPreviewTransform) WithHuman() func(*TransformPreviewTransformRequest) { + return func(r *TransformPreviewTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f TransformPreviewTransform) WithErrorTrace() func(*TransformPreviewTransformRequest) { + return func(r *TransformPreviewTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f TransformPreviewTransform) WithFilterPath(v ...string) func(*TransformPreviewTransformRequest) { + return func(r *TransformPreviewTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f TransformPreviewTransform) WithHeader(h map[string]string) func(*TransformPreviewTransformRequest) { + return func(r *TransformPreviewTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f TransformPreviewTransform) WithOpaqueID(s string) func(*TransformPreviewTransformRequest) { + return func(r *TransformPreviewTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.transform.put_transform.go b/esapi/api.xpack.transform.put_transform.go new file mode 100644 index 0000000000..b45df2886f --- /dev/null +++ b/esapi/api.xpack.transform.put_transform.go @@ -0,0 +1,210 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" +) + +func newTransformPutTransformFunc(t Transport) TransformPutTransform { + return func(body io.Reader, transform_id string, o ...func(*TransformPutTransformRequest)) (*Response, error) { + var r = TransformPutTransformRequest{Body: body, TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// TransformPutTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html. +// +type TransformPutTransform func(body io.Reader, transform_id string, o ...func(*TransformPutTransformRequest)) (*Response, error) + +// TransformPutTransformRequest configures the Transform Put Transform API request. +// +type TransformPutTransformRequest struct { + Body io.Reader + + TransformID string + + DeferValidation *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r TransformPutTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "PUT" + + path.Grow(1 + len("_transform") + 1 + len(r.TransformID)) + path.WriteString("/") + path.WriteString("_transform") + path.WriteString("/") + path.WriteString(r.TransformID) + + params = make(map[string]string) + + if r.DeferValidation != nil { + params["defer_validation"] = strconv.FormatBool(*r.DeferValidation) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f TransformPutTransform) WithContext(v context.Context) func(*TransformPutTransformRequest) { + return func(r *TransformPutTransformRequest) { + r.ctx = v + } +} + +// WithDeferValidation - if validations should be deferred until transform starts, defaults to false.. +// +func (f TransformPutTransform) WithDeferValidation(v bool) func(*TransformPutTransformRequest) { + return func(r *TransformPutTransformRequest) { + r.DeferValidation = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f TransformPutTransform) WithPretty() func(*TransformPutTransformRequest) { + return func(r *TransformPutTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f TransformPutTransform) WithHuman() func(*TransformPutTransformRequest) { + return func(r *TransformPutTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f TransformPutTransform) WithErrorTrace() func(*TransformPutTransformRequest) { + return func(r *TransformPutTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f TransformPutTransform) WithFilterPath(v ...string) func(*TransformPutTransformRequest) { + return func(r *TransformPutTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f TransformPutTransform) WithHeader(h map[string]string) func(*TransformPutTransformRequest) { + return func(r *TransformPutTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f TransformPutTransform) WithOpaqueID(s string) func(*TransformPutTransformRequest) { + return func(r *TransformPutTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.transform.start_transform.go b/esapi/api.xpack.transform.start_transform.go new file mode 100644 index 0000000000..6c5784d0d6 --- /dev/null +++ b/esapi/api.xpack.transform.start_transform.go @@ -0,0 +1,205 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strings" + "time" +) + +func newTransformStartTransformFunc(t Transport) TransformStartTransform { + return func(transform_id string, o ...func(*TransformStartTransformRequest)) (*Response, error) { + var r = TransformStartTransformRequest{TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// TransformStartTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html. +// +type TransformStartTransform func(transform_id string, o ...func(*TransformStartTransformRequest)) (*Response, error) + +// TransformStartTransformRequest configures the Transform Start Transform API request. +// +type TransformStartTransformRequest struct { + TransformID string + + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r TransformStartTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_transform") + 1 + len(r.TransformID) + 1 + len("_start")) + path.WriteString("/") + path.WriteString("_transform") + path.WriteString("/") + path.WriteString(r.TransformID) + path.WriteString("/") + path.WriteString("_start") + + params = make(map[string]string) + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f TransformStartTransform) WithContext(v context.Context) func(*TransformStartTransformRequest) { + return func(r *TransformStartTransformRequest) { + r.ctx = v + } +} + +// WithTimeout - controls the time to wait for the transform to start. +// +func (f TransformStartTransform) WithTimeout(v time.Duration) func(*TransformStartTransformRequest) { + return func(r *TransformStartTransformRequest) { + r.Timeout = v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f TransformStartTransform) WithPretty() func(*TransformStartTransformRequest) { + return func(r *TransformStartTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f TransformStartTransform) WithHuman() func(*TransformStartTransformRequest) { + return func(r *TransformStartTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f TransformStartTransform) WithErrorTrace() func(*TransformStartTransformRequest) { + return func(r *TransformStartTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f TransformStartTransform) WithFilterPath(v ...string) func(*TransformStartTransformRequest) { + return func(r *TransformStartTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f TransformStartTransform) WithHeader(h map[string]string) func(*TransformStartTransformRequest) { + return func(r *TransformStartTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f TransformStartTransform) WithOpaqueID(s string) func(*TransformStartTransformRequest) { + return func(r *TransformStartTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.transform.stop_transform.go b/esapi/api.xpack.transform.stop_transform.go new file mode 100644 index 0000000000..d57df83757 --- /dev/null +++ b/esapi/api.xpack.transform.stop_transform.go @@ -0,0 +1,232 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" + "time" +) + +func newTransformStopTransformFunc(t Transport) TransformStopTransform { + return func(transform_id string, o ...func(*TransformStopTransformRequest)) (*Response, error) { + var r = TransformStopTransformRequest{TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// TransformStopTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html. +// +type TransformStopTransform func(transform_id string, o ...func(*TransformStopTransformRequest)) (*Response, error) + +// TransformStopTransformRequest configures the Transform Stop Transform API request. +// +type TransformStopTransformRequest struct { + TransformID string + + AllowNoMatch *bool + Timeout time.Duration + WaitForCompletion *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r TransformStopTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_transform") + 1 + len(r.TransformID) + 1 + len("_stop")) + path.WriteString("/") + path.WriteString("_transform") + path.WriteString("/") + path.WriteString(r.TransformID) + path.WriteString("/") + path.WriteString("_stop") + + params = make(map[string]string) + + if r.AllowNoMatch != nil { + params["allow_no_match"] = strconv.FormatBool(*r.AllowNoMatch) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForCompletion != nil { + params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f TransformStopTransform) WithContext(v context.Context) func(*TransformStopTransformRequest) { + return func(r *TransformStopTransformRequest) { + r.ctx = v + } +} + +// WithAllowNoMatch - whether to ignore if a wildcard expression matches no transforms. (this includes `_all` string or when no transforms have been specified). +// +func (f TransformStopTransform) WithAllowNoMatch(v bool) func(*TransformStopTransformRequest) { + return func(r *TransformStopTransformRequest) { + r.AllowNoMatch = &v + } +} + +// WithTimeout - controls the time to wait until the transform has stopped. default to 30 seconds. +// +func (f TransformStopTransform) WithTimeout(v time.Duration) func(*TransformStopTransformRequest) { + return func(r *TransformStopTransformRequest) { + r.Timeout = v + } +} + +// WithWaitForCompletion - whether to wait for the transform to fully stop before returning or not. default to false. +// +func (f TransformStopTransform) WithWaitForCompletion(v bool) func(*TransformStopTransformRequest) { + return func(r *TransformStopTransformRequest) { + r.WaitForCompletion = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f TransformStopTransform) WithPretty() func(*TransformStopTransformRequest) { + return func(r *TransformStopTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f TransformStopTransform) WithHuman() func(*TransformStopTransformRequest) { + return func(r *TransformStopTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f TransformStopTransform) WithErrorTrace() func(*TransformStopTransformRequest) { + return func(r *TransformStopTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f TransformStopTransform) WithFilterPath(v ...string) func(*TransformStopTransformRequest) { + return func(r *TransformStopTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f TransformStopTransform) WithHeader(h map[string]string) func(*TransformStopTransformRequest) { + return func(r *TransformStopTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f TransformStopTransform) WithOpaqueID(s string) func(*TransformStopTransformRequest) { + return func(r *TransformStopTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.transform.update_transform.go b/esapi/api.xpack.transform.update_transform.go new file mode 100644 index 0000000000..9be6f9c30c --- /dev/null +++ b/esapi/api.xpack.transform.update_transform.go @@ -0,0 +1,212 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 7.5.0: DO NOT EDIT + +package esapi + +import ( + "context" + "io" + "net/http" + "strconv" + "strings" +) + +func newTransformUpdateTransformFunc(t Transport) TransformUpdateTransform { + return func(body io.Reader, transform_id string, o ...func(*TransformUpdateTransformRequest)) (*Response, error) { + var r = TransformUpdateTransformRequest{Body: body, TransformID: transform_id} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// TransformUpdateTransform - +// +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html. +// +type TransformUpdateTransform func(body io.Reader, transform_id string, o ...func(*TransformUpdateTransformRequest)) (*Response, error) + +// TransformUpdateTransformRequest configures the Transform Update Transform API request. +// +type TransformUpdateTransformRequest struct { + Body io.Reader + + TransformID string + + DeferValidation *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +// +func (r TransformUpdateTransformRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "POST" + + path.Grow(1 + len("_transform") + 1 + len(r.TransformID) + 1 + len("_update")) + path.WriteString("/") + path.WriteString("_transform") + path.WriteString("/") + path.WriteString(r.TransformID) + path.WriteString("/") + path.WriteString("_update") + + params = make(map[string]string) + + if r.DeferValidation != nil { + params["defer_validation"] = strconv.FormatBool(*r.DeferValidation) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if r.Body != nil { + req.Header[headerContentType] = headerContentTypeJSON + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +// +func (f TransformUpdateTransform) WithContext(v context.Context) func(*TransformUpdateTransformRequest) { + return func(r *TransformUpdateTransformRequest) { + r.ctx = v + } +} + +// WithDeferValidation - if validations should be deferred until transform starts, defaults to false.. +// +func (f TransformUpdateTransform) WithDeferValidation(v bool) func(*TransformUpdateTransformRequest) { + return func(r *TransformUpdateTransformRequest) { + r.DeferValidation = &v + } +} + +// WithPretty makes the response body pretty-printed. +// +func (f TransformUpdateTransform) WithPretty() func(*TransformUpdateTransformRequest) { + return func(r *TransformUpdateTransformRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +// +func (f TransformUpdateTransform) WithHuman() func(*TransformUpdateTransformRequest) { + return func(r *TransformUpdateTransformRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +// +func (f TransformUpdateTransform) WithErrorTrace() func(*TransformUpdateTransformRequest) { + return func(r *TransformUpdateTransformRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +// +func (f TransformUpdateTransform) WithFilterPath(v ...string) func(*TransformUpdateTransformRequest) { + return func(r *TransformUpdateTransformRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +// +func (f TransformUpdateTransform) WithHeader(h map[string]string) func(*TransformUpdateTransformRequest) { + return func(r *TransformUpdateTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + for k, v := range h { + r.Header.Add(k, v) + } + } +} + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f TransformUpdateTransform) WithOpaqueID(s string) func(*TransformUpdateTransformRequest) { + return func(r *TransformUpdateTransformRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/esapi/api.xpack.watcher.ack_watch.go b/esapi/api.xpack.watcher.ack_watch.go index 32b1f1cd01..e07c4175d2 100644 --- a/esapi/api.xpack.watcher.ack_watch.go +++ b/esapi/api.xpack.watcher.ack_watch.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.activate_watch.go b/esapi/api.xpack.watcher.activate_watch.go index cd2146d7fc..468a6330e0 100644 --- a/esapi/api.xpack.watcher.activate_watch.go +++ b/esapi/api.xpack.watcher.activate_watch.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.deactivate_watch.go b/esapi/api.xpack.watcher.deactivate_watch.go index a5124e3985..1afbb7bbec 100644 --- a/esapi/api.xpack.watcher.deactivate_watch.go +++ b/esapi/api.xpack.watcher.deactivate_watch.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.delete_watch.go b/esapi/api.xpack.watcher.delete_watch.go index 1274e041e1..83fbadeb27 100644 --- a/esapi/api.xpack.watcher.delete_watch.go +++ b/esapi/api.xpack.watcher.delete_watch.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.execute_watch.go b/esapi/api.xpack.watcher.execute_watch.go index 9fbdbf92d7..2e847b5651 100644 --- a/esapi/api.xpack.watcher.execute_watch.go +++ b/esapi/api.xpack.watcher.execute_watch.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.get_watch.go b/esapi/api.xpack.watcher.get_watch.go index 3f089353fa..1ee0d603d6 100644 --- a/esapi/api.xpack.watcher.get_watch.go +++ b/esapi/api.xpack.watcher.get_watch.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.put_watch.go b/esapi/api.xpack.watcher.put_watch.go index 9361d07d21..9b23fc97ed 100644 --- a/esapi/api.xpack.watcher.put_watch.go +++ b/esapi/api.xpack.watcher.put_watch.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.start.go b/esapi/api.xpack.watcher.start.go index b0f096242d..f37227c154 100644 --- a/esapi/api.xpack.watcher.start.go +++ b/esapi/api.xpack.watcher.start.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.stats.go b/esapi/api.xpack.watcher.stats.go index b2f8b19e34..aa6c8cf483 100644 --- a/esapi/api.xpack.watcher.stats.go +++ b/esapi/api.xpack.watcher.stats.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.watcher.stop.go b/esapi/api.xpack.watcher.stop.go index d02a1fcc45..76191dab64 100644 --- a/esapi/api.xpack.watcher.stop.go +++ b/esapi/api.xpack.watcher.stop.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.xpack.info.go b/esapi/api.xpack.xpack.info.go index c02762e67a..51c68b2232 100644 --- a/esapi/api.xpack.xpack.info.go +++ b/esapi/api.xpack.xpack.info.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi diff --git a/esapi/api.xpack.xpack.usage.go b/esapi/api.xpack.xpack.usage.go index 15d1c6c30e..ed80f550d9 100644 --- a/esapi/api.xpack.xpack.usage.go +++ b/esapi/api.xpack.xpack.usage.go @@ -2,7 +2,7 @@ // Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // -// Code generated from specification version 7.4.2: DO NOT EDIT +// Code generated from specification version 7.5.0: DO NOT EDIT package esapi From c3151acaeef9a3f297aa411e3126789cee14b267 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 16 Nov 2019 11:20:24 +0100 Subject: [PATCH 150/355] Update version to 7.5-SNAPSHOT --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index 1f10ae8d3e..ef189d7072 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -6,4 +6,4 @@ package version // Client returns the client version as a string. // -const Client = "7.4-SNAPSHOT" +const Client = "7.5-SNAPSHOT" From 43b5b8a3f03d49eab890528d7af9091dc374f054 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 3 Dec 2019 09:55:13 +0100 Subject: [PATCH 151/355] API: Update the APIs for Elasticsearch 7.5 (e9ccaed468e) --- esapi/api._.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esapi/api._.go b/esapi/api._.go index 40dced64cb..4b7d6fca82 100644 --- a/esapi/api._.go +++ b/esapi/api._.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.5.0 (23df04b7393): DO NOT EDIT +// Code generated from specification version 7.5.0 (e9ccaed468e|v7.5.0): DO NOT EDIT package esapi From 258e051329bef4450833e6babcc276cb455467cb Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 3 Dec 2019 12:34:06 +0100 Subject: [PATCH 152/355] Makefile: Improve the release target Update the "release" target so it updates the version in internal/version/version.go back to the previous value, which is usually something like "X.Y-SNAPSHOT", and commit the change. (cherry picked from commit 52bd6956da63b47001b05357145c1a922b56411e) --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0e61db02d8..419355a426 100644 --- a/Makefile +++ b/Makefile @@ -202,7 +202,6 @@ endif set -e -o pipefail; \ cp internal/version/version.go internal/version/version.go.OLD && \ cat internal/version/version.go.OLD | sed -e 's/Client = ".*"/Client = "$(version)"/' > internal/version/version.go && \ - rm internal/version/version.go.OLD && \ go vet internal/version/version.go && \ go fmt internal/version/version.go && \ git diff --color-words internal/version/version.go | tail -n 1; \ @@ -217,8 +216,14 @@ endif git tag --annotate v$(version) --message 'Release $(version)'; \ echo "\033[2m→ Push `git show --pretty='%h (%s)' --no-patch HEAD` to Github:\033[0m\n"; \ echo "\033[1m git push origin HEAD && git push origin v$(version)\033[0m\n"; \ + mv internal/version/version.go.OLD internal/version/version.go && \ + git add internal/version/version.go && \ + original_version=`cat internal/version/version.go | sed -ne 's;^const Client = "\(.*\)"$$;\1;p'` && \ + git commit --no-status --quiet --message "Update version to $$original_version"; \ + echo "\033[2m→ Version updated to [$$original_version].\033[0m\n"; \ else \ echo "Aborting..."; \ + rm internal/version/version.go.OLD; \ exit 1; \ fi; \ } From e16172e03bf5084592917e9a93916d3eb1cf49ce Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 3 Dec 2019 17:25:31 +0100 Subject: [PATCH 153/355] Release 7.5.0 --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index ef189d7072..79f72acab0 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -6,4 +6,4 @@ package version // Client returns the client version as a string. // -const Client = "7.5-SNAPSHOT" +const Client = "7.5.0" From 679688b2c39a6f0cbf9bd9909ce8e1578ae75439 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 3 Dec 2019 17:25:31 +0100 Subject: [PATCH 154/355] Update version to 7.5-SNAPSHOT --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version/version.go b/internal/version/version.go index 79f72acab0..ef189d7072 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -6,4 +6,4 @@ package version // Client returns the client version as a string. // -const Client = "7.5.0" +const Client = "7.5-SNAPSHOT" From 3e593003678a3a5378eaa88f09f4b9e70cc02816 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 4 Dec 2019 10:44:45 +0100 Subject: [PATCH 155/355] Examples: Update the "valyala/fasthttp" example to send HTTP body as POST Related: #112 (cherry picked from commit ca6559d64393a14f9a5af6b5394806554822ad8e) --- _examples/fasthttp/cmd/main.go | 27 +++++++++++++++++++++++++++ _examples/fasthttp/fasthttp.go | 4 ++++ _examples/fasthttp/go.mod | 2 +- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/_examples/fasthttp/cmd/main.go b/_examples/fasthttp/cmd/main.go index f332d97b70..e90897a189 100644 --- a/_examples/fasthttp/cmd/main.go +++ b/_examples/fasthttp/cmd/main.go @@ -5,10 +5,12 @@ package main import ( + "context" "log" "os" "sort" "strconv" + "strings" "time" "github.com/elastic/go-elasticsearch/v7" @@ -42,6 +44,31 @@ func main() { log.Fatalf("Error creating the client: %s", err) } + // Test sending the body as POST + // + ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond) + defer cancel() + + go func() { + es.Info() + if _, err := es.Search( + es.Search.WithBody(strings.NewReader(`{"query":{"match":{"title":"foo"}}}`)), + es.Search.WithPretty(), + ); err != nil { + log.Fatalf("Error getting response: %s", err) + } + cancel() + }() + + select { + case <-ctx.Done(): + if ctx.Err() != context.Canceled { + log.Fatalf("Timeout: %s", ctx.Err()) + } + } + + // Run benchmark + // t := time.Now() for i := 0; i < count; i++ { t0 := time.Now() diff --git a/_examples/fasthttp/fasthttp.go b/_examples/fasthttp/fasthttp.go index 6301b314f0..3d2b5d445a 100644 --- a/_examples/fasthttp/fasthttp.go +++ b/_examples/fasthttp/fasthttp.go @@ -42,6 +42,10 @@ func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { // copyRequest converts a http.Request to fasthttp.Request // func (t *Transport) copyRequest(dst *fasthttp.Request, src *http.Request) *fasthttp.Request { + if src.Method == "GET" && src.Body != nil { + src.Method = "POST" + } + dst.SetHost(src.Host) dst.SetRequestURI(src.URL.String()) diff --git a/_examples/fasthttp/go.mod b/_examples/fasthttp/go.mod index 95d04d3c75..c0637560ea 100644 --- a/_examples/fasthttp/go.mod +++ b/_examples/fasthttp/go.mod @@ -5,6 +5,6 @@ go 1.11 replace github.com/elastic/go-elasticsearch/v7 => ../.. require ( - github.com/elastic/go-elasticsearch/v7 v7.0.0-20190407092644-3fb2a278216b + github.com/elastic/go-elasticsearch/v7 7.x github.com/valyala/fasthttp v1.5.0 ) From ddae56a684ae0495bcdab28d2c2a200fd5a13cb2 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 4 Dec 2019 15:35:03 +0100 Subject: [PATCH 156/355] Retry on EOF errors The retry mechanism should be active when the server closes the connection unexpectedly, eg. when an Elasticsearch node is restarting, or the underlying connection gets stale. Fixes #111 (cherry picked from commit cb4ea94ef05b5d9a9c737619e2c1e99f7430aa8b) --- estransport/estransport.go | 7 ++++- estransport/estransport_internal_test.go | 40 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/estransport/estransport.go b/estransport/estransport.go index 5da0f7ca86..28d27d9a7b 100644 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -254,7 +254,12 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { c.pool.OnFailure(conn) c.Unlock() - // Retry only on network errors, but don't retry on timeout errors, unless configured + // Retry on EOF errors + if err == io.EOF { + shouldRetry = true + } + + // Retry on network errors, but not on timeout errors, unless configured if err, ok := err.(net.Error); ok { if (!err.Timeout() || c.enableRetryOnTimeout) && !c.disableRetry { shouldRetry = true diff --git a/estransport/estransport_internal_test.go b/estransport/estransport_internal_test.go index 89b40bba87..f1a37a4d76 100644 --- a/estransport/estransport_internal_test.go +++ b/estransport/estransport_internal_test.go @@ -8,6 +8,7 @@ package estransport import ( "fmt" + "io" "io/ioutil" "math/rand" "net/http" @@ -393,6 +394,45 @@ func TestTransportPerformRetries(t *testing.T) { } }) + t.Run("Retry request on EOF error and return the response", func(t *testing.T) { + var ( + i int + numReqs = 2 + ) + + u, _ := url.Parse("http://foo.bar") + tp := New(Config{ + URLs: []*url.URL{u, u, u}, + Transport: &mockTransp{ + RoundTripFunc: func(req *http.Request) (*http.Response, error) { + i++ + fmt.Printf("Request #%d", i) + if i == numReqs { + fmt.Print(": OK\n") + return &http.Response{Status: "OK"}, nil + } + fmt.Print(": ERR\n") + return nil, io.EOF + }, + }}) + + req, _ := http.NewRequest("GET", "/abc", nil) + + res, err := tp.Perform(req) + + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if res.Status != "OK" { + t.Errorf("Unexpected response: %+v", res) + } + + if i != numReqs { + t.Errorf("Unexpected number of requests, want=%d, got=%d", numReqs, i) + } + }) + t.Run("Retry request on 5xx response and return new response", func(t *testing.T) { var ( i int From ed288cdc5128a5729c32b4f6aa5e30b09ebba294 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 8 Dec 2019 15:07:01 +0100 Subject: [PATCH 157/355] Ignore the ELASTICSEARCH_URL variable when address is passed in configuration Fixes #113 Closes #115 (cherry picked from commit 86a626c2a3459a406cce4aab02f802b87d5660a8) --- doc.go | 1 + elasticsearch.go | 47 +++++++++++++-------------- elasticsearch_internal_test.go | 59 +++++++++++++++++++++++++--------- 3 files changed, 68 insertions(+), 39 deletions(-) diff --git a/doc.go b/doc.go index 853036c026..a60225533b 100644 --- a/doc.go +++ b/doc.go @@ -30,6 +30,7 @@ To configure the client, pass a Config object to the NewClient function: elasticsearch.NewClient(cfg) When using the Elastic Service (https://elastic.co/cloud), you can use CloudID instead of Addresses. +When either Addresses or CloudID is set, the ELASTICSEARCH_URL environment variable is ignored. See the elasticsearch_integration_test.go file and the _examples folder for more information. diff --git a/elasticsearch.go b/elasticsearch.go index c291c25a3e..8fae4f647a 100644 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -83,36 +83,30 @@ func NewDefaultClient() (*Client, error) { // It will use the ELASTICSEARCH_URL environment variable, if set, // to configure the addresses; use a comma to separate multiple URLs. // -// It's an error to set both cfg.Addresses and the ELASTICSEARCH_URL -// environment variable. +// If either cfg.Addresses or cfg.CloudID is set, the ELASTICSEARCH_URL +// environment variable is ignored. +// +// It's an error to set both cfg.Addresses and cfg.CloudID. // func NewClient(cfg Config) (*Client, error) { var addrs []string - envAddrs := addrsFromEnvironment() - - if len(envAddrs) > 0 && len(cfg.Addresses) > 0 { - return nil, errors.New("cannot create client: both ELASTICSEARCH_URL and Addresses are set") - } - - if len(envAddrs) > 0 && cfg.CloudID != "" { - return nil, errors.New("cannot create client: both ELASTICSEARCH_URL and CloudID are set") - } - - if len(cfg.Addresses) > 0 && cfg.CloudID != "" { - return nil, errors.New("cannot create client: both Addresses and CloudID are set") - } + if len(cfg.Addresses) == 0 && cfg.CloudID == "" { + addrs = addrsFromEnvironment() + } else { + if len(cfg.Addresses) > 0 && cfg.CloudID != "" { + return nil, errors.New("cannot create client: both Addresses and CloudID are set") + } - if cfg.CloudID != "" { - cloudAddrs, err := addrFromCloudID(cfg.CloudID) - if err != nil { - return nil, fmt.Errorf("cannot create client: cannot parse CloudID: %s", err) + if cfg.CloudID != "" { + cloudAddr, err := addrFromCloudID(cfg.CloudID) + if err != nil { + return nil, fmt.Errorf("cannot create client: cannot parse CloudID: %s", err) + } + addrs = append(addrs, cloudAddr) } - addrs = append(addrs, cloudAddrs) - } else { - if len(envAddrs) > 0 { - addrs = append(addrs, envAddrs...) - } else if len(cfg.Addresses) > 0 { + + if len(cfg.Addresses) > 0 { addrs = append(addrs, cfg.Addresses...) } } @@ -236,5 +230,10 @@ func addrFromCloudID(input string) (string, error) { return "", err } parts := strings.Split(string(data), "$") + + if len(parts) < 2 { + return "", fmt.Errorf("invalid encoded value: %s", parts) + } + return fmt.Sprintf("%s%s.%s", scheme, parts[1], parts[0]), nil } diff --git a/elasticsearch_internal_test.go b/elasticsearch_internal_test.go index 6f847a0ff8..103bc291bb 100644 --- a/elasticsearch_internal_test.go +++ b/elasticsearch_internal_test.go @@ -22,14 +22,20 @@ func TestClientConfiguration(t *testing.T) { t.Parallel() t.Run("With empty", func(t *testing.T) { - _, err := NewDefaultClient() + c, err := NewDefaultClient() if err != nil { t.Errorf("Unexpected error: %s", err) } + + u := c.Transport.(*estransport.Client).URLs()[0].String() + + if u != defaultURL { + t.Errorf("Unexpected URL, want=%s, got=%s", defaultURL, u) + } }) - t.Run("With address", func(t *testing.T) { + t.Run("With URL from Addresses", func(t *testing.T) { c, err := NewClient(Config{Addresses: []string{"http://localhost:8080//"}}) if err != nil { t.Fatalf("Unexpected error: %s", err) @@ -62,13 +68,15 @@ func TestClientConfiguration(t *testing.T) { os.Setenv("ELASTICSEARCH_URL", "http://example.com") defer func() { os.Setenv("ELASTICSEARCH_URL", "") }() - _, err := NewClient(Config{Addresses: []string{"http://localhost:8080//"}}) - if err == nil { - t.Fatalf("Expected error, got: %v", err) + c, err := NewClient(Config{Addresses: []string{"http://localhost:8080//"}}) + if err != nil { + t.Fatalf("Unexpected error: %s", err) } - match, _ := regexp.MatchString("both .* are set", err.Error()) - if !match { - t.Errorf("Expected error when addresses from environment and configuration are used together, got: %v", err) + + u := c.Transport.(*estransport.Client).URLs()[0].String() + + if u != "http://localhost:8080" { + t.Errorf("Unexpected URL, want=http://localhost:8080, got=%s", u) } }) @@ -76,18 +84,20 @@ func TestClientConfiguration(t *testing.T) { os.Setenv("ELASTICSEARCH_URL", "http://example.com") defer func() { os.Setenv("ELASTICSEARCH_URL", "") }() - _, err := NewClient(Config{CloudID: "foobar="}) - if err == nil { - t.Fatalf("Expected error, got: %v", err) + c, err := NewClient(Config{CloudID: "foo:YmFyLmNsb3VkLmVzLmlvJGFiYzEyMyRkZWY0NTY="}) + if err != nil { + t.Fatalf("Unexpected error: %s", err) } - match, _ := regexp.MatchString("both .* are set", err.Error()) - if !match { - t.Errorf("Expected error when addresses from environment and configuration are used together, got: %v", err) + + u := c.Transport.(*estransport.Client).URLs()[0].String() + + if u != "https://abc123.bar.cloud.es.io" { + t.Errorf("Unexpected URL, want=https://abc123.bar.cloud.es.io, got=%s", u) } }) t.Run("With cfg.Addresses and cfg.CloudID", func(t *testing.T) { - _, err := NewClient(Config{Addresses: []string{"http://localhost:8080//"}, CloudID: "foobar="}) + _, err := NewClient(Config{Addresses: []string{"http://localhost:8080//"}, CloudID: "foo:ABC="}) if err == nil { t.Fatalf("Expected error, got: %v", err) } @@ -111,6 +121,25 @@ func TestClientConfiguration(t *testing.T) { } }) + t.Run("With invalid CloudID", func(t *testing.T) { + var err error + + _, err = NewClient(Config{CloudID: "foo:ZZZ==="}) + if err == nil { + t.Errorf("Expected error for CloudID, got: %v", err) + } + + _, err = NewClient(Config{CloudID: "foo:Zm9v"}) + if err == nil { + t.Errorf("Expected error for CloudID, got: %v", err) + } + + _, err = NewClient(Config{CloudID: "foo:"}) + if err == nil { + t.Errorf("Expected error for CloudID, got: %v", err) + } + }) + t.Run("With invalid URL", func(t *testing.T) { u := ":foo" _, err := NewClient(Config{Addresses: []string{u}}) From 3dc5ce76b869ed5089f3c2096530d6083f4c10b2 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 26 Jan 2020 10:58:30 +0100 Subject: [PATCH 158/355] Util: Fix brittle JSONReader integration test (cherry picked from commit 68e298bfa3171de704e9662e3cb12d4a16c41e45) --- esutil/json_reader_integration_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esutil/json_reader_integration_test.go b/esutil/json_reader_integration_test.go index 7dcf97b6dd..21044114f7 100644 --- a/esutil/json_reader_integration_test.go +++ b/esutil/json_reader_integration_test.go @@ -27,7 +27,7 @@ func TestJSONReaderIntegration(t *testing.T) { t.Fatalf("Error creating the client: %s\n", err) } - es.Indices.Delete([]string{"test"}) + es.Indices.Delete([]string{"test"}, es.Indices.Delete.WithIgnoreUnavailable(true)) doc := struct { Title string `json:"title"` From 13aac274ae1deb723fe5b4ea537ac49920422504 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 24 Jan 2020 18:38:44 +0100 Subject: [PATCH 159/355] Examples: Add foundation for the security example * Add the configuration for generating the certificates with elasticsearch-certutil * Add the Docker Compose configuration for launching the cluster with TLS/authentication * Add an example for manually setting the TLS configuration in the transport (cherry picked from commit 3bacc0ad1a38f74383de883ed6d1ca084df40c80) --- _examples/security/.env | 4 ++ _examples/security/.gitignore | 4 ++ _examples/security/Makefile | 34 +++++++++ _examples/security/certificates-config.yml | 4 ++ _examples/security/certificates-create.yml | 35 +++++++++ _examples/security/elasticsearch-cluster.yml | 44 ++++++++++++ _examples/security/go.mod | 9 +++ _examples/security/tls_configure_ca.go | 74 ++++++++++++++++++++ 8 files changed, 208 insertions(+) create mode 100644 _examples/security/.env create mode 100644 _examples/security/.gitignore create mode 100644 _examples/security/Makefile create mode 100644 _examples/security/certificates-config.yml create mode 100644 _examples/security/certificates-create.yml create mode 100644 _examples/security/elasticsearch-cluster.yml create mode 100644 _examples/security/go.mod create mode 100644 _examples/security/tls_configure_ca.go diff --git a/_examples/security/.env b/_examples/security/.env new file mode 100644 index 0000000000..2bcf395dd6 --- /dev/null +++ b/_examples/security/.env @@ -0,0 +1,4 @@ +COMPOSE_PROJECT_NAME='example' + +ELASTIC_VERSION=7.x-SNAPSHOT +ELASTIC_PASSWORD=elastic diff --git a/_examples/security/.gitignore b/_examples/security/.gitignore new file mode 100644 index 0000000000..eaea94840e --- /dev/null +++ b/_examples/security/.gitignore @@ -0,0 +1,4 @@ +go.sum + +certificates/ +tmp/ diff --git a/_examples/security/Makefile b/_examples/security/Makefile new file mode 100644 index 0000000000..a4d0504391 --- /dev/null +++ b/_examples/security/Makefile @@ -0,0 +1,34 @@ +test: + @for file in ./*.go; do \ + echo "go build -o /dev/null $$file"; \ + go build -o /dev/null $$file; \ + done; + +test-integ: + @for file in ./*.go; do \ + echo "go run $$file"; \ + go run $$file; \ + done; + +certificates: certificates-clean + docker-compose --file certificates-create.yml run --rm create_certificates + +cluster: + docker-compose --file elasticsearch-cluster.yml up --remove-orphans --detach; echo; + @docker-compose --file elasticsearch-cluster.yml ps; + @{ \ + set -e; \ + until \ + docker inspect example_elasticsearch_1 > /dev/null 2>&1 && \ + [[ `docker inspect -f "{{ .State.Health.Status }}" example_elasticsearch_1` == "healthy" ]]; \ + do printf '-'; sleep 1; \ + done; echo "> [OK]"; \ + } + +certificates-clean: + rm -rf ./certificates + +cluster-clean: + docker-compose --file elasticsearch-cluster.yml down --volumes + +.PHONY: test test-integ certificates cluster certificates-clean cluster-clean diff --git a/_examples/security/certificates-config.yml b/_examples/security/certificates-config.yml new file mode 100644 index 0000000000..76e6e8dd46 --- /dev/null +++ b/_examples/security/certificates-config.yml @@ -0,0 +1,4 @@ +instances: + - name: elasticsearch + ip: [0.0.0.0, 127.0.0.1] + dns: ["localhost", "example_elasticsearch_1", "example_elasticsearch_2", "example_elasticsearch_3"] diff --git a/_examples/security/certificates-create.yml b/_examples/security/certificates-create.yml new file mode 100644 index 0000000000..363ae92ed8 --- /dev/null +++ b/_examples/security/certificates-create.yml @@ -0,0 +1,35 @@ +# Create the certificates for the stack: +# +# docker-compose --file certificates-create.yml run --rm create_certificates +# +# See: https://www.elastic.co/guide/en/elasticsearch/reference/current/configuring-tls-docker.html + +version: "3.7" + +services: + create_certificates: + image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION} + container_name: certificates_generator + user: root + working_dir: /usr/share/elasticsearch + command: > + bash -c ' + OUTPUT="/certificates/bundle.zip" + if [[ -f $$OUTPUT ]]; then + echo "Certificates already present in [.$$OUTPUT]"; exit 1; + else + yum install -y -q -e 0 unzip tree; + bin/elasticsearch-certutil cert \ + --pem \ + --days 365 \ + --keep-ca-key \ + --in config/certificates/certificates-config.yml \ + --out $$OUTPUT; + unzip -q $$OUTPUT -d /certificates; + chown -R 1000:0 /certificates; echo; + tree /certificates; + fi; + ' + volumes: + - ./certificates:/certificates + - ./certificates-config.yml:/usr/share/elasticsearch/config/certificates/certificates-config.yml diff --git a/_examples/security/elasticsearch-cluster.yml b/_examples/security/elasticsearch-cluster.yml new file mode 100644 index 0000000000..5118d99889 --- /dev/null +++ b/_examples/security/elasticsearch-cluster.yml @@ -0,0 +1,44 @@ +# This configuration file will launch Elasticsearch Stack with full TLS configuration and authentication. + +version: "3.7" + +services: + elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION} + volumes: + - es-data:/usr/share/elasticsearch/data + - ./certificates:/usr/share/elasticsearch/config/certificates/ + networks: + - elasticstack + ports: + - 9200:9200 + environment: + - node.name=example_elasticsearch_1 + - cluster.name=golang-example-security + - cluster.initial_master_nodes=example_elasticsearch_1 + - discovery.seed_hosts=example_elasticsearch_1 + - bootstrap.memory_lock=true + - network.host=example_elasticsearch_1,_local_ + - network.publish_host=example_elasticsearch_1 + - ES_JAVA_OPTS=-Xms1G -Xmx1G -Des.transport.cname_in_publish_address=true + # Security & TLS + - ELASTIC_PASSWORD=${ELASTIC_PASSWORD} + - xpack.security.enabled=true + - xpack.security.http.ssl.enabled=true + - xpack.security.http.ssl.key=/usr/share/elasticsearch/config/certificates/elasticsearch/elasticsearch.key + - xpack.security.http.ssl.certificate=/usr/share/elasticsearch/config/certificates/elasticsearch/elasticsearch.crt + - xpack.security.http.ssl.certificate_authorities=/usr/share/elasticsearch/config/certificates/ca/ca.crt + - xpack.security.transport.ssl.enabled=true + - xpack.security.transport.ssl.verification_mode=certificate + - xpack.security.transport.ssl.key=/usr/share/elasticsearch/config/certificates/elasticsearch/elasticsearch.key + - xpack.security.transport.ssl.certificate=/usr/share/elasticsearch/config/certificates/elasticsearch/elasticsearch.crt + - xpack.security.transport.ssl.certificate_authorities=/usr/share/elasticsearch/config/certificates/ca/ca.crt + ulimits: { nofile: { soft: 65535, hard: 65535 }, memlock: -1 } + healthcheck: + test: curl --cacert /usr/share/elasticsearch/config/certificates/ca/ca.crt --max-time 120 --retry 120 --retry-delay 1 --show-error --silent https://elastic:${ELASTIC_PASSWORD}@localhost:9200 + +networks: + elasticstack: { labels: { elasticstack.description: "Network for the Elastic Stack" }} + +volumes: + es-data: { labels: { elasticstack.description: "Elasticsearch data" }} diff --git a/_examples/security/go.mod b/_examples/security/go.mod new file mode 100644 index 0000000000..cb54168ce4 --- /dev/null +++ b/_examples/security/go.mod @@ -0,0 +1,9 @@ +module github.com/elastic/go-elasticsearch/v7/_examples/security + +go 1.11 + +replace github.com/elastic/go-elasticsearch/v7 => ../.. + +require ( + github.com/elastic/go-elasticsearch/v7 7.x +) diff --git a/_examples/security/tls_configure_ca.go b/_examples/security/tls_configure_ca.go new file mode 100644 index 0000000000..b3d559c0a0 --- /dev/null +++ b/_examples/security/tls_configure_ca.go @@ -0,0 +1,74 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build ignore + +package main + +import ( + "crypto/x509" + "flag" + "io/ioutil" + "log" + "net/http" + + "github.com/elastic/go-elasticsearch/v7" +) + +func main() { + log.SetFlags(0) + + var ( + err error + + // --> Configure the path to the certificate authority and the password + // + cacert = flag.String("cacert", "certificates/ca/ca.crt", "Path to the file with certificate authority") + password = flag.String("password", "elastic", "Elasticsearch password") + ) + flag.Parse() + + ca, err := ioutil.ReadFile(*cacert) + if err != nil { + log.Fatalf("ERROR: Unable to read CA from %q: %s", *cacert, err) + } + + // --> Clone the default HTTP transport + // + tp := http.DefaultTransport.(*http.Transport).Clone() + + // --> Initialize the set of root certificate authorities + // + if tp.TLSClientConfig.RootCAs, err = x509.SystemCertPool(); err != nil { + log.Fatalf("ERROR: Problem adding system CA: %s", err) + } + + // --> Add the custom certificate authority + // + if ok := tp.TLSClientConfig.RootCAs.AppendCertsFromPEM(ca); !ok { + log.Fatalf("ERROR: Problem adding CA from file %q", *cacert) + } + + es, err := elasticsearch.NewClient( + elasticsearch.Config{ + Addresses: []string{"https://localhost:9200"}, + Username: "elastic", + Password: *password, + + // --> Pass the transport to the client + // + Transport: tp, + }, + ) + if err != nil { + log.Fatalf("ERROR: Unable to create client: %s", err) + } + + res, err := es.Info() + if err != nil { + log.Fatalf("ERROR: Unable to get response: %s", err) + } + + log.Println(res) +} From 2501b4ac0aee9a7f3d01f744393a4ec8e81bfe58 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 25 Jan 2020 17:28:45 +0100 Subject: [PATCH 160/355] Transport: Update the estransport.New() method to allow returning an error This patch changes the estransport.New() method, so it returns a tuple of [transport, error], allowing to return an error, when the passed in configuration is invalid. (cherry picked from commit e66ab8dbc17acd48a74dd5c8c9c7a305c07420a4) --- elasticsearch.go | 2 +- elasticsearch_integration_test.go | 4 +- estransport/connection_integration_test.go | 2 +- estransport/discovery_internal_test.go | 8 +-- estransport/estransport.go | 4 +- estransport/estransport_benchmark_test.go | 2 +- .../estransport_integration_multinode_test.go | 2 +- estransport/estransport_integration_test.go | 2 +- estransport/estransport_internal_test.go | 51 ++++++++++--------- estransport/logger_benchmark_test.go | 8 +-- estransport/logger_internal_test.go | 20 ++++---- estransport/metrics_internal_test.go | 4 +- 12 files changed, 55 insertions(+), 54 deletions(-) diff --git a/elasticsearch.go b/elasticsearch.go index 8fae4f647a..4fd62f42d5 100644 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -128,7 +128,7 @@ func NewClient(cfg Config) (*Client, error) { cfg.Password = pw } - tp := estransport.New(estransport.Config{ + tp, err := estransport.New(estransport.Config{ URLs: urls, Username: cfg.Username, Password: cfg.Password, diff --git a/elasticsearch_integration_test.go b/elasticsearch_integration_test.go index 5848244d7a..73d058597d 100644 --- a/elasticsearch_integration_test.go +++ b/elasticsearch_integration_test.go @@ -184,7 +184,7 @@ func TestClientCustomTransport(t *testing.T) { }) t.Run("Manual", func(t *testing.T) { - tr := estransport.New(estransport.Config{ + tp, _ := estransport.New(estransport.Config{ URLs: []*url.URL{ {Scheme: "http", Host: "localhost:9200"}, }, @@ -192,7 +192,7 @@ func TestClientCustomTransport(t *testing.T) { }) es := elasticsearch.Client{ - Transport: tr, API: esapi.New(tr), + Transport: tp, API: esapi.New(tp), } for i := 0; i < 10; i++ { diff --git a/estransport/connection_integration_test.go b/estransport/connection_integration_test.go index e848522732..bcdcae2eae 100644 --- a/estransport/connection_integration_test.go +++ b/estransport/connection_integration_test.go @@ -56,7 +56,7 @@ func TestStatusConnectionPool(t *testing.T) { fmt.Printf("==> Started %d servers on %s\n", numServers, serverHosts) - transport := New( + transport, _ := New( Config{ URLs: serverURLs, Logger: &TextLogger{Output: os.Stdout}, diff --git a/estransport/discovery_internal_test.go b/estransport/discovery_internal_test.go index 82929784fd..6d035fc328 100644 --- a/estransport/discovery_internal_test.go +++ b/estransport/discovery_internal_test.go @@ -47,7 +47,7 @@ func TestDiscovery(t *testing.T) { t.Run("getNodesInfo()", func(t *testing.T) { u, _ := url.Parse("http://" + srv.Addr) - tp := New(Config{URLs: []*url.URL{u}}) + tp, _ := New(Config{URLs: []*url.URL{u}}) nodes, err := tp.getNodesInfo() if err != nil { @@ -79,7 +79,7 @@ func TestDiscovery(t *testing.T) { t.Run("DiscoverNodes()", func(t *testing.T) { u, _ := url.Parse("http://" + srv.Addr) - tp := New(Config{URLs: []*url.URL{u}}) + tp, _ := New(Config{URLs: []*url.URL{u}}) tp.DiscoverNodes() @@ -110,7 +110,7 @@ func TestDiscovery(t *testing.T) { t.Run("DiscoverNodes() with SSL and authorization", func(t *testing.T) { u, _ := url.Parse("https://" + srvTLS.Addr) - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{u}, Username: "foo", Password: "bar", @@ -151,7 +151,7 @@ func TestDiscovery(t *testing.T) { t.Run("scheduleDiscoverNodes()", func(t *testing.T) { u, _ := url.Parse("http://" + srv.Addr) - tp := New(Config{URLs: []*url.URL{u}, DiscoverNodesInterval: time.Millisecond}) + tp, _ := New(Config{URLs: []*url.URL{u}, DiscoverNodesInterval: time.Millisecond}) if len(tp.pool.URLs()) != 1 { t.Errorf("Unexpected number of nodes, want=1, got=%d", len(tp.pool.URLs())) diff --git a/estransport/estransport.go b/estransport/estransport.go index 28d27d9a7b..62d18b4e38 100644 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -100,7 +100,7 @@ type Client struct { // // http.DefaultTransport will be used if no transport is passed in the configuration. // -func New(cfg Config) *Client { +func New(cfg Config) (*Client, error) { if cfg.Transport == nil { cfg.Transport = http.DefaultTransport } @@ -164,7 +164,7 @@ func New(cfg Config) *Client { }) } - return &client + return &client, nil } // Perform executes the request and returns a response or error. diff --git a/estransport/estransport_benchmark_test.go b/estransport/estransport_benchmark_test.go index d986687f90..1080ff643a 100644 --- a/estransport/estransport_benchmark_test.go +++ b/estransport/estransport_benchmark_test.go @@ -41,7 +41,7 @@ func BenchmarkTransport(b *testing.B) { b.Run("Defaults", func(b *testing.B) { for i := 0; i < b.N; i++ { - tp := estransport.New(estransport.Config{ + tp, _ := estransport.New(estransport.Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newFakeTransport(b), }) diff --git a/estransport/estransport_integration_multinode_test.go b/estransport/estransport_integration_multinode_test.go index b91a0c421d..64c7707515 100644 --- a/estransport/estransport_integration_multinode_test.go +++ b/estransport/estransport_integration_multinode_test.go @@ -49,7 +49,7 @@ func TestTransportSelector(t *testing.T) { var ( node string ) - transport := estransport.New(estransport.Config{URLs: []*url.URL{ + transport, _ := estransport.New(estransport.Config{URLs: []*url.URL{ {Scheme: "http", Host: "localhost:9200"}, {Scheme: "http", Host: "localhost:9201"}, }}) diff --git a/estransport/estransport_integration_test.go b/estransport/estransport_integration_test.go index cbecc632dd..8afb26c57e 100644 --- a/estransport/estransport_integration_test.go +++ b/estransport/estransport_integration_test.go @@ -38,7 +38,7 @@ func TestTransportRetries(t *testing.T) { })) serverURL, _ := url.Parse(server.URL) - transport := estransport.New(estransport.Config{URLs: []*url.URL{serverURL}}) + transport, _ := estransport.New(estransport.Config{URLs: []*url.URL{serverURL}}) bodies := []io.Reader{ strings.NewReader(`FAKE`), diff --git a/estransport/estransport_internal_test.go b/estransport/estransport_internal_test.go index f1a37a4d76..5481788dbe 100644 --- a/estransport/estransport_internal_test.go +++ b/estransport/estransport_internal_test.go @@ -42,12 +42,13 @@ func (e *mockNetError) Temporary() bool { return false } func TestTransport(t *testing.T) { t.Run("Interface", func(t *testing.T) { - var _ Interface = New(Config{}) - var _ http.RoundTripper = New(Config{}).transport + tp, _ := New(Config{}) + var _ Interface = tp + var _ http.RoundTripper = tp.transport }) t.Run("Default", func(t *testing.T) { - tp := New(Config{}) + tp, _ := New(Config{}) if tp.transport == nil { t.Error("Expected the transport to not be nil") } @@ -57,7 +58,7 @@ func TestTransport(t *testing.T) { }) t.Run("Custom", func(t *testing.T) { - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{{}}, Transport: &mockTransp{ RoundTripFunc: func(req *http.Request) (*http.Response, error) { return &http.Response{Status: "MOCK"}, nil }, @@ -77,7 +78,7 @@ func TestTransport(t *testing.T) { func TestTransportConfig(t *testing.T) { t.Run("Defaults", func(t *testing.T) { - tp := New(Config{}) + tp, _ := New(Config{}) if !reflect.DeepEqual(tp.retryOnStatus, []int{502, 503, 504}) { t.Errorf("Unexpected retryOnStatus: %v", tp.retryOnStatus) @@ -97,7 +98,7 @@ func TestTransportConfig(t *testing.T) { }) t.Run("Custom", func(t *testing.T) { - tp := New(Config{ + tp, _ := New(Config{ RetryOnStatus: []int{404, 408}, DisableRetry: true, EnableRetryOnTimeout: true, @@ -124,7 +125,7 @@ func TestTransportConfig(t *testing.T) { func TestTransportConnectionPool(t *testing.T) { t.Run("Single URL", func(t *testing.T) { - tp := New(Config{URLs: []*url.URL{{Scheme: "http", Host: "foo1"}}}) + tp, _ := New(Config{URLs: []*url.URL{{Scheme: "http", Host: "foo1"}}}) if _, ok := tp.pool.(*singleConnectionPool); !ok { t.Errorf("Expected connection to be singleConnectionPool, got: %T", tp) @@ -146,7 +147,7 @@ func TestTransportConnectionPool(t *testing.T) { err error ) - tp := New(Config{URLs: []*url.URL{ + tp, _ := New(Config{URLs: []*url.URL{ {Scheme: "http", Host: "foo1"}, {Scheme: "http", Host: "foo2"}, }}) @@ -209,7 +210,7 @@ func (cp *CustomConnectionPool) URLs() []*url.URL { return cp.urls func TestTransportCustomConnectionPool(t *testing.T) { t.Run("Run", func(t *testing.T) { - tp := New(Config{ + tp, _ := New(Config{ ConnectionPoolFunc: func(conns []*Connection, selector Selector) ConnectionPool { return &CustomConnectionPool{ urls: []*url.URL{ @@ -243,7 +244,7 @@ func TestTransportCustomConnectionPool(t *testing.T) { func TestTransportPerform(t *testing.T) { t.Run("Executes", func(t *testing.T) { u, _ := url.Parse("https://foo.com/bar") - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{u}, Transport: &mockTransp{ RoundTripFunc: func(req *http.Request) (*http.Response, error) { return &http.Response{Status: "MOCK"}, nil }, @@ -263,7 +264,7 @@ func TestTransportPerform(t *testing.T) { t.Run("Sets URL", func(t *testing.T) { u, _ := url.Parse("https://foo.com/bar") - tp := New(Config{URLs: []*url.URL{u}}) + tp, _ := New(Config{URLs: []*url.URL{u}}) req, _ := http.NewRequest("GET", "/abc", nil) tp.setReqURL(u, req) @@ -277,7 +278,7 @@ func TestTransportPerform(t *testing.T) { t.Run("Sets HTTP Basic Auth from URL", func(t *testing.T) { u, _ := url.Parse("https://foo:bar@example.com") - tp := New(Config{URLs: []*url.URL{u}}) + tp, _ := New(Config{URLs: []*url.URL{u}}) req, _ := http.NewRequest("GET", "/", nil) tp.setReqAuth(u, req) @@ -294,7 +295,7 @@ func TestTransportPerform(t *testing.T) { t.Run("Sets HTTP Basic Auth from configuration", func(t *testing.T) { u, _ := url.Parse("http://example.com") - tp := New(Config{URLs: []*url.URL{u}, Username: "foo", Password: "bar"}) + tp, _ := New(Config{URLs: []*url.URL{u}, Username: "foo", Password: "bar"}) req, _ := http.NewRequest("GET", "/", nil) tp.setReqAuth(u, req) @@ -311,7 +312,7 @@ func TestTransportPerform(t *testing.T) { t.Run("Sets APIKey Authentication from configuration", func(t *testing.T) { u, _ := url.Parse("http://example.com") - tp := New(Config{URLs: []*url.URL{u}, APIKey: "Zm9vYmFy"}) // foobar + tp, _ := New(Config{URLs: []*url.URL{u}, APIKey: "Zm9vYmFy"}) // foobar req, _ := http.NewRequest("GET", "/", nil) tp.setReqAuth(u, req) @@ -328,7 +329,7 @@ func TestTransportPerform(t *testing.T) { t.Run("Sets UserAgent", func(t *testing.T) { u, _ := url.Parse("http://example.com") - tp := New(Config{URLs: []*url.URL{u}}) + tp, _ := New(Config{URLs: []*url.URL{u}}) req, _ := http.NewRequest("GET", "/abc", nil) tp.setReqUserAgent(req) @@ -339,7 +340,7 @@ func TestTransportPerform(t *testing.T) { }) t.Run("Error No URL", func(t *testing.T) { - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{}, Transport: &mockTransp{ RoundTripFunc: func(req *http.Request) (*http.Response, error) { return &http.Response{Status: "MOCK"}, nil }, @@ -362,7 +363,7 @@ func TestTransportPerformRetries(t *testing.T) { ) u, _ := url.Parse("http://foo.bar") - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{u, u, u}, Transport: &mockTransp{ RoundTripFunc: func(req *http.Request) (*http.Response, error) { @@ -401,7 +402,7 @@ func TestTransportPerformRetries(t *testing.T) { ) u, _ := url.Parse("http://foo.bar") - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{u, u, u}, Transport: &mockTransp{ RoundTripFunc: func(req *http.Request) (*http.Response, error) { @@ -440,7 +441,7 @@ func TestTransportPerformRetries(t *testing.T) { ) u, _ := url.Parse("http://foo.bar") - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{u, u, u}, Transport: &mockTransp{ RoundTripFunc: func(req *http.Request) (*http.Response, error) { @@ -479,7 +480,7 @@ func TestTransportPerformRetries(t *testing.T) { ) u, _ := url.Parse("http://foo.bar") - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{u, u, u}, Transport: &mockTransp{ RoundTripFunc: func(req *http.Request) (*http.Response, error) { @@ -510,7 +511,7 @@ func TestTransportPerformRetries(t *testing.T) { t.Run("Reset request body during retry", func(t *testing.T) { var bodies []string u, _ := url.Parse("https://foo.com/bar") - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{u}, Transport: &mockTransp{ RoundTripFunc: func(req *http.Request) (*http.Response, error) { @@ -545,7 +546,7 @@ func TestTransportPerformRetries(t *testing.T) { var i int u, _ := url.Parse("http://foo.bar") - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{u, u, u}, Transport: &mockTransp{ RoundTripFunc: func(req *http.Request) (*http.Response, error) { @@ -577,7 +578,7 @@ func TestTransportPerformRetries(t *testing.T) { var i int u, _ := url.Parse("http://foo.bar") - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{u, u, u}, Transport: &mockTransp{ RoundTripFunc: func(req *http.Request) (*http.Response, error) { @@ -607,7 +608,7 @@ func TestTransportPerformRetries(t *testing.T) { ) u, _ := url.Parse("http://foo.bar") - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{u, u, u}, Transport: &mockTransp{ RoundTripFunc: func(req *http.Request) (*http.Response, error) { @@ -656,7 +657,7 @@ func TestTransportPerformRetries(t *testing.T) { func TestURLs(t *testing.T) { t.Run("Returns URLs", func(t *testing.T) { - tp := New(Config{URLs: []*url.URL{ + tp, _ := New(Config{URLs: []*url.URL{ {Scheme: "http", Host: "localhost:9200"}, {Scheme: "http", Host: "localhost:9201"}, }}) diff --git a/estransport/logger_benchmark_test.go b/estransport/logger_benchmark_test.go index bb63a2ebdb..f2cd7c2d91 100644 --- a/estransport/logger_benchmark_test.go +++ b/estransport/logger_benchmark_test.go @@ -21,7 +21,7 @@ func BenchmarkTransportLogger(b *testing.B) { b.Run("Text", func(b *testing.B) { for i := 0; i < b.N; i++ { - tp := estransport.New(estransport.Config{ + tp, _ := estransport.New(estransport.Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newFakeTransport(b), Logger: &estransport.TextLogger{Output: ioutil.Discard}, @@ -37,7 +37,7 @@ func BenchmarkTransportLogger(b *testing.B) { b.Run("Text-Body", func(b *testing.B) { for i := 0; i < b.N; i++ { - tp := estransport.New(estransport.Config{ + tp, _ := estransport.New(estransport.Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newFakeTransport(b), Logger: &estransport.TextLogger{Output: ioutil.Discard, EnableRequestBody: true, EnableResponseBody: true}, @@ -62,7 +62,7 @@ func BenchmarkTransportLogger(b *testing.B) { b.Run("JSON", func(b *testing.B) { for i := 0; i < b.N; i++ { - tp := estransport.New(estransport.Config{ + tp, _ := estransport.New(estransport.Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newFakeTransport(b), Logger: &estransport.JSONLogger{Output: ioutil.Discard}, @@ -78,7 +78,7 @@ func BenchmarkTransportLogger(b *testing.B) { b.Run("JSON-Body", func(b *testing.B) { for i := 0; i < b.N; i++ { - tp := estransport.New(estransport.Config{ + tp, _ := estransport.New(estransport.Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newFakeTransport(b), Logger: &estransport.JSONLogger{Output: ioutil.Discard, EnableRequestBody: true, EnableResponseBody: true}, diff --git a/estransport/logger_internal_test.go b/estransport/logger_internal_test.go index 28da622b74..cd60cfa7e0 100644 --- a/estransport/logger_internal_test.go +++ b/estransport/logger_internal_test.go @@ -45,7 +45,7 @@ func TestTransportLogger(t *testing.T) { t.Run("Defaults", func(t *testing.T) { var wg sync.WaitGroup - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), // Logger: ioutil.Discard, @@ -67,7 +67,7 @@ func TestTransportLogger(t *testing.T) { }) t.Run("Nil", func(t *testing.T) { - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: nil, @@ -81,7 +81,7 @@ func TestTransportLogger(t *testing.T) { }) t.Run("No HTTP response", func(t *testing.T) { - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: &mockTransp{ RoundTripFunc: func(req *http.Request) (*http.Response, error) { @@ -104,7 +104,7 @@ func TestTransportLogger(t *testing.T) { t.Run("Keep response body", func(t *testing.T) { var dst strings.Builder - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: &TextLogger{Output: &dst, EnableRequestBody: true, EnableResponseBody: true}, @@ -135,7 +135,7 @@ func TestTransportLogger(t *testing.T) { t.Run("Text with body", func(t *testing.T) { var dst strings.Builder - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: &TextLogger{Output: &dst, EnableRequestBody: true, EnableResponseBody: true}, @@ -180,7 +180,7 @@ func TestTransportLogger(t *testing.T) { t.Run("Color with body", func(t *testing.T) { var dst strings.Builder - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: &ColorLogger{Output: &dst, EnableRequestBody: true, EnableResponseBody: true}, @@ -234,7 +234,7 @@ func TestTransportLogger(t *testing.T) { t.Run("Curl", func(t *testing.T) { var dst strings.Builder - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: &CurlLogger{Output: &dst, EnableRequestBody: true, EnableResponseBody: true}, @@ -271,7 +271,7 @@ func TestTransportLogger(t *testing.T) { t.Run("JSON", func(t *testing.T) { var dst strings.Builder - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: &JSONLogger{Output: &dst}, @@ -308,7 +308,7 @@ func TestTransportLogger(t *testing.T) { t.Run("JSON with request body", func(t *testing.T) { var dst strings.Builder - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: &JSONLogger{Output: &dst, EnableRequestBody: true}, @@ -351,7 +351,7 @@ func TestTransportLogger(t *testing.T) { t.Run("Custom", func(t *testing.T) { var dst strings.Builder - tp := New(Config{ + tp, _ := New(Config{ URLs: []*url.URL{{Scheme: "http", Host: "foo"}}, Transport: newRoundTripper(), Logger: &CustomLogger{Output: &dst}, diff --git a/estransport/metrics_internal_test.go b/estransport/metrics_internal_test.go index e0e54ba612..736731706d 100644 --- a/estransport/metrics_internal_test.go +++ b/estransport/metrics_internal_test.go @@ -17,7 +17,7 @@ import ( func TestMetrics(t *testing.T) { t.Run("Metrics()", func(t *testing.T) { - tp := New( + tp, _ := New( Config{ URLs: []*url.URL{ {Scheme: "http", Host: "foo1"}, @@ -59,7 +59,7 @@ func TestMetrics(t *testing.T) { }) t.Run("Metrics() when not enabled", func(t *testing.T) { - tp := New(Config{}) + tp, _ := New(Config{}) _, err := tp.Metrics() if err == nil { From f28198b20ca6759f4c2e66bcc3aba0058805d5c1 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sat, 25 Jan 2020 17:29:31 +0100 Subject: [PATCH 161/355] Transport: Add the CACert configuration option to the client and transport When the option is set, the transport will perform the neccessary ceremony for adding the custom certificate authority to the TLSClientConfig. It returns an error for transports other than http.Transport. An executable example has been added to _examples/security/tls_with_ca.go. Closes #106 (cherry picked from commit 4c9d9032b459f96993380254820d77aa483bda38) --- README.md | 39 ++++++++++++---- _examples/security/README.md | 76 +++++++++++++++++++++++++++++++ _examples/security/tls_with_ca.go | 57 +++++++++++++++++++++++ elasticsearch.go | 10 ++++ estransport/estransport.go | 20 ++++++++ 5 files changed, 193 insertions(+), 9 deletions(-) create mode 100644 _examples/security/README.md create mode 100644 _examples/security/tls_with_ca.go diff --git a/README.md b/README.md index 0625ff52f1..5956bab998 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ log.Println(res) When you export the `ELASTICSEARCH_URL` environment variable, it will be used to set the cluster endpoint(s). Separate multiple adresses by a comma. -To set the cluster endpoint(s) programatically, pass them in the configuration object +To set the cluster endpoint(s) programatically, pass a configuration object to the `elasticsearch.NewClient()` function. ```golang @@ -115,34 +115,55 @@ cfg := elasticsearch.Config{ "http://localhost:9200", "http://localhost:9201", }, + // ... } es, err := elasticsearch.NewClient(cfg) -// ... ``` -To configure the HTTP settings, pass a [`http.Transport`](https://golang.org/pkg/net/http/#Transport) -object in the configuration object (the values are for illustrative purposes only). +To set the username and password, include them in the endpoint URL, +or use the corresponding configuration options. + +```golang +cfg := elasticsearch.Config{ + // ... + Username: "foo", + Password: "bar", +} +``` + +To set a custom certificate authority used to sign the certificates of cluster nodes, +use the `CACert` configuration option. + +```golang +cert, _ := ioutil.ReadFile(*cacert) + +cfg := elasticsearch.Config{ + // ... + CACert: cert, +} +``` + +To configure other HTTP settings, pass an [`http.Transport`](https://golang.org/pkg/net/http/#Transport) +object in the configuration object. ```golang cfg := elasticsearch.Config{ Transport: &http.Transport{ MaxIdleConnsPerHost: 10, ResponseHeaderTimeout: time.Second, - DialContext: (&net.Dialer{Timeout: time.Second}).DialContext, TLSClientConfig: &tls.Config{ MinVersion: tls.VersionTLS11, // ... }, + // ... }, } - -es, err := elasticsearch.NewClient(cfg) -// ... ``` See the [`_examples/configuration.go`](_examples/configuration.go) and [`_examples/customization.go`](_examples/customization.go) files for more examples of configuration and customization of the client. +See the [`_examples/security`](_examples/security) for an example of a security configuration. The following example demonstrates a more complex usage. It fetches the Elasticsearch version from the cluster, indexes a couple of documents concurrently, and prints the search results, using a lightweight wrapper around the response body. @@ -335,7 +356,7 @@ The `esutil` package provides convenience helpers for working with the client. A ## Examples -The **[`_examples`](./_examples)** folder contains a number of recipes and comprehensive examples to get you started with the client, including configuration and customization of the client, mocking the transport for unit tests, embedding the client in a custom type, building queries, performing requests, and parsing the responses. +The **[`_examples`](./_examples)** folder contains a number of recipes and comprehensive examples to get you started with the client, including configuration and customization of the client, using a custom certificate authority (CA) for security (TLS), mocking the transport for unit tests, embedding the client in a custom type, building queries, performing requests individually and in bulk, and parsing the responses. diff --git a/_examples/security/README.md b/_examples/security/README.md new file mode 100644 index 0000000000..8a1b5c382e --- /dev/null +++ b/_examples/security/README.md @@ -0,0 +1,76 @@ +# Example: Security + +This example demonstrates how to use Transport Layer Security (TLS) for +encrypting and verifying the communication with an Elasticsearch cluster +by passing a custom certificate authority to the client. + +## Creating the certificates for the cluster nodes + +Generate the certificates using the +[`elasticsearch-certutil`](https://www.elastic.co/guide/en/elasticsearch/reference/current/certutil.html) +tool: + +```bash +make certificates +``` + +> See the [_Encrypting communications in an Elasticsearch Docker Container_](https://www.elastic.co/guide/en/elasticsearch/reference/current/configuring-tls-docker.html) tutorial for a complete overview. + +Start the cluster with full security configuration: + +```bash +make cluster +``` + +See the [`elasticsearch-cluster.yml`](elasticsearch-cluster.yml) file for details. + +Use `curl` to verify access to the cluster: + +``` +curl --cacert certificates/ca/ca.crt https://elastic:elastic@localhost:9200 +``` + +> NOTE: On Mac OS X, you may need to add the certificate to the Keychain with `security add-trusted-cert -p ssl certificates/ca/ca.crt`. To remove it, run `security remove-trusted-cert certificates/ca/ca.crt`. + + +## Using the client configuration option + +To pass the certificate authority (CA) to the client, so it can verify the server certificate, +use the `elasticsearch.Config.CACert` configuration option: + +```go +// --> Read the certificate from file +cert, _ := ioutil.ReadFile(*cacert) + +es, _ := elasticsearch.NewClient( + elasticsearch.Config{ + // ... + + // --> Pass the certificate to the client + CACert: cert, + }) +``` + +Run the full example: + +```bash +go run tls_with_ca.go + +# [200 OK] { +# ... +``` + + +## Manual transport configuration + +To configure the transport manually, use the +`(*http.Transport).TLSClientConfig.RootCAs.AppendCertsFromPEM()` method. + +Run the full example: + +```bash +go run tls_configure_ca.go + +# [200 OK] { +# ... +``` diff --git a/_examples/security/tls_with_ca.go b/_examples/security/tls_with_ca.go new file mode 100644 index 0000000000..b42e338a6b --- /dev/null +++ b/_examples/security/tls_with_ca.go @@ -0,0 +1,57 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build ignore + +package main + +import ( + "flag" + "io/ioutil" + "log" + + "github.com/elastic/go-elasticsearch/v7" +) + +func main() { + log.SetFlags(0) + + var ( + err error + + // --> Configure the path to the certificate authority and the password + // + cacert = flag.String("cacert", "certificates/ca/ca.crt", "Path to the file with certificate authority") + password = flag.String("password", "elastic", "Elasticsearch password") + ) + flag.Parse() + + // --> Read the certificate from file + // + cert, err := ioutil.ReadFile(*cacert) + if err != nil { + log.Fatalf("ERROR: Unable to read CA from %q: %s", *cacert, err) + } + + es, err := elasticsearch.NewClient( + elasticsearch.Config{ + Addresses: []string{"https://localhost:9200"}, + Username: "elastic", + Password: *password, + + // --> Pass the certificate to the client + // + CACert: cert, + }) + if err != nil { + log.Fatalf("ERROR: Unable to create client: %s", err) + } + + res, err := es.Info() + if err != nil { + log.Fatalf("ERROR: Unable to get response: %s", err) + } + + log.Println(res) +} diff --git a/elasticsearch.go b/elasticsearch.go index 4fd62f42d5..e0ff32ca96 100644 --- a/elasticsearch.go +++ b/elasticsearch.go @@ -37,6 +37,11 @@ type Config struct { CloudID string // Endpoint for the Elastic Service (https://elastic.co/cloud). APIKey string // Base64-encoded token for authorization; if set, overrides username and password. + // PEM-encoded certificate authorities. + // When set, an empty certificate pool will be created, and the certificates will be appended to it. + // The option is only valid when the transport is not specified, or when it's http.Transport. + CACert []byte + RetryOnStatus []int // List of status codes for retry. Default: 502, 503, 504. DisableRetry bool // Default: false. EnableRetryOnTimeout bool // Default: false. @@ -134,6 +139,8 @@ func NewClient(cfg Config) (*Client, error) { Password: cfg.Password, APIKey: cfg.APIKey, + CACert: cfg.CACert, + RetryOnStatus: cfg.RetryOnStatus, DisableRetry: cfg.DisableRetry, EnableRetryOnTimeout: cfg.EnableRetryOnTimeout, @@ -150,6 +157,9 @@ func NewClient(cfg Config) (*Client, error) { Selector: cfg.Selector, ConnectionPoolFunc: cfg.ConnectionPoolFunc, }) + if err != nil { + return nil, fmt.Errorf("error creating transport: %s", err) + } client := &Client{Transport: tp, API: esapi.New(tp)} diff --git a/estransport/estransport.go b/estransport/estransport.go index 62d18b4e38..9aac82f508 100644 --- a/estransport/estransport.go +++ b/estransport/estransport.go @@ -6,6 +6,8 @@ package estransport import ( "bytes" + "crypto/x509" + "errors" "fmt" "io" "io/ioutil" @@ -52,6 +54,8 @@ type Config struct { Password string APIKey string + CACert []byte + RetryOnStatus []int DisableRetry bool EnableRetryOnTimeout bool @@ -105,6 +109,22 @@ func New(cfg Config) (*Client, error) { cfg.Transport = http.DefaultTransport } + if cfg.CACert != nil { + httpTransport, ok := cfg.Transport.(*http.Transport) + if !ok { + return nil, fmt.Errorf("unable to set CA certificate for transport of type %T", cfg.Transport) + } + + httpTransport = httpTransport.Clone() + httpTransport.TLSClientConfig.RootCAs = x509.NewCertPool() + + if ok := httpTransport.TLSClientConfig.RootCAs.AppendCertsFromPEM(cfg.CACert); !ok { + return nil, errors.New("unable to add CA certificate") + } + + cfg.Transport = httpTransport + } + if len(cfg.RetryOnStatus) == 0 { cfg.RetryOnStatus = defaultRetryOnStatus[:] } From 26b6710291f6aa6824d43d83ffc3c55845d674c2 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 4 Feb 2020 10:55:33 +0100 Subject: [PATCH 162/355] CI: Update the Elasticsearch version in matrix to 7.x-SNAPSHOT --- .jenkins/test-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jenkins/test-matrix.yml b/.jenkins/test-matrix.yml index 7f62207640..a71e2334a2 100644 --- a/.jenkins/test-matrix.yml +++ b/.jenkins/test-matrix.yml @@ -1,7 +1,7 @@ --- ELASTICSEARCH_VERSION: -- 7.3-SNAPSHOT + - 7.x-SNAPSHOT GO_VERSION: - 1-alpine From fe1e7ab9b577279323d985782360c24a6e9a80b2 Mon Sep 17 00:00:00 2001 From: Denis Voytyuk Date: Tue, 4 Feb 2020 11:01:34 +0100 Subject: [PATCH 163/355] Add missing res.Body.Close() to the README Closes #127 (cherry picked from commit ca32bbd4b9860afbb832ebbaa9149a50740e9f9a) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5956bab998..0569b642de 100644 --- a/README.md +++ b/README.md @@ -208,6 +208,7 @@ func main() { if err != nil { log.Fatalf("Error getting response: %s", err) } + defer res.Body.Close() // Check response status if res.IsError() { log.Fatalf("Error: %s", res.String()) From 7c2098ad5498658338d93029c36c434c7632737c Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 6 Feb 2020 15:39:34 +0100 Subject: [PATCH 164/355] Makefile: Improve the "lint" target (cherry picked from commit 10c620a3285ed652fe71b02ecdd93158fce08166) --- Makefile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 419355a426..112900bd51 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ endif ifeq ($(flavor), xpack) @{ \ set -e ; \ - trap "git checkout $(PWD)/esapi/test/go.mod" SIGINT SIGTERM EXIT; \ + trap "git checkout $(PWD)/esapi/test/go.mod" INT TERM EXIT; \ export ELASTICSEARCH_URL='https://elastic:elastic@localhost:9200' && \ if which gotestsum > /dev/null 2>&1 ; then \ cd esapi/test && \ @@ -68,7 +68,7 @@ else $(eval testapiargs += $(PWD)/esapi/test/*_test.go) @{ \ set -e ; \ - trap "git checkout $(PWD)/esapi/test/go.mod" SIGINT SIGTERM EXIT; \ + trap "git checkout $(PWD)/esapi/test/go.mod" INT TERM EXIT; \ if which gotestsum > /dev/null 2>&1 ; then \ cd esapi/test && gotestsum --format=short-verbose --junitfile=$(PWD)/tmp/integration-api-report.xml -- $(testapiargs); \ else \ @@ -86,7 +86,7 @@ test-examples: ## Execute the _examples @echo "\033[2m→ Testing the examples...\033[0m" @{ \ set -e ; \ - trap "git checkout _examples/**/go.mod" SIGINT SIGTERM EXIT; \ + trap "git checkout _examples/**/go.mod" INT TERM EXIT; \ for f in _examples/*.go; do \ echo "\033[2m────────────────────────────────────────────────────────────────────────────────"; \ echo "\033[1m$$f\033[0m"; \ @@ -126,6 +126,13 @@ lint: ## Run lint on the package @echo "\033[2m→ Running lint...\033[0m" go vet github.com/elastic/go-elasticsearch/... go list github.com/elastic/go-elasticsearch/... | 'grep' -v internal | xargs golint -set_exit_status + @{ \ + set -e ; \ + trap "git checkout --quiet $(PWD)/internal/cmd/generate/go.mod" INT TERM EXIT; \ + echo "cd internal/cmd/generate/ && go vet ./..."; \ + cd "$(PWD)/internal/cmd/generate/" && go vet ./...; \ + } + apidiff: ## Display API incompabilities @if ! command -v apidiff > /dev/null; then \ @@ -349,7 +356,7 @@ endif @echo "\033[2m→ Generating API package from specification ($(version):$(build_hash))...\033[0m" @{ \ set -e; \ - trap "git checkout $(PWD)/internal/cmd/generate/go.mod" SIGINT SIGTERM EXIT; \ + trap "git checkout --quiet $(PWD)/internal/cmd/generate/go.mod" INT TERM EXIT; \ export ELASTICSEARCH_VERSION=$(version) && \ export ELASTICSEARCH_BUILD_HASH=$(build_hash) && \ cd internal/cmd/generate && \ @@ -377,7 +384,7 @@ endif @echo "\033[2m→ Generating API tests from specification ($(version):$(build_hash))...\033[0m" @{ \ set -e; \ - trap "git checkout $(PWD)/internal/cmd/generate/go.mod" SIGINT SIGTERM EXIT; \ + trap "git checkout --quiet $(PWD)/internal/cmd/generate/go.mod" INT TERM EXIT; \ export ELASTICSEARCH_VERSION=$(version) && \ export ELASTICSEARCH_BUILD_HASH=$(build_hash) && \ rm -rf $(output)/*_test.go && \ From 602154ea143c259a83fad35d7d6b1fe20e1b44ca Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 7 Feb 2020 09:40:27 +0100 Subject: [PATCH 165/355] Makefile: Fixes and improvements * Fix the "make lint" target on Docker * Add checking for the presence of .git directory to the `trap git checkout ...` declarations * Use `printf` instead of `echo` when printing colorized output (cherry picked from commit 434a44636621bf9070c1504154b215444cf90e6b) --- Makefile | 104 +++++++++++++++++++++++++++---------------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/Makefile b/Makefile index 112900bd51..648693a91f 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ##@ Test test-unit: ## Run unit tests - @echo "\033[2m→ Running unit tests...\033[0m" + @printf "\033[2m→ Running unit tests...\033[0m\n" ifdef race $(eval testunitargs += "-race") endif @@ -16,7 +16,7 @@ endif test: test-unit test-integ: ## Run integration tests - @echo "\033[2m→ Running integration tests...\033[0m" + @printf "\033[2m→ Running integration tests...\033[0m\n" $(eval testintegtags += "integration") ifdef multinode $(eval testintegtags += "multinode") @@ -45,11 +45,11 @@ ifdef flavor else $(eval flavor='core') endif - @echo "\033[2m→ Running API integration tests for [$(flavor)]...\033[0m" + @printf "\033[2m→ Running API integration tests for [$(flavor)]...\033[0m\n" ifeq ($(flavor), xpack) @{ \ set -e ; \ - trap "git checkout $(PWD)/esapi/test/go.mod" INT TERM EXIT; \ + trap "test -d .git && git checkout --quiet $(PWD)/esapi/test/go.mod" INT TERM EXIT; \ export ELASTICSEARCH_URL='https://elastic:elastic@localhost:9200' && \ if which gotestsum > /dev/null 2>&1 ; then \ cd esapi/test && \ @@ -68,7 +68,7 @@ else $(eval testapiargs += $(PWD)/esapi/test/*_test.go) @{ \ set -e ; \ - trap "git checkout $(PWD)/esapi/test/go.mod" INT TERM EXIT; \ + trap "test -d .git && git checkout --quiet $(PWD)/esapi/test/go.mod" INT TERM EXIT; \ if which gotestsum > /dev/null 2>&1 ; then \ cd esapi/test && gotestsum --format=short-verbose --junitfile=$(PWD)/tmp/integration-api-report.xml -- $(testapiargs); \ else \ @@ -79,83 +79,83 @@ else endif test-bench: ## Run benchmarks - @echo "\033[2m→ Running benchmarks...\033[0m" + @printf "\033[2m→ Running benchmarks...\033[0m\n" go test -run=none -bench=. -benchmem ./... test-examples: ## Execute the _examples - @echo "\033[2m→ Testing the examples...\033[0m" + @printf "\033[2m→ Testing the examples...\033[0m\n" @{ \ set -e ; \ - trap "git checkout _examples/**/go.mod" INT TERM EXIT; \ + trap "test -d .git && git checkout --quiet _examples/**/go.mod" INT TERM EXIT; \ for f in _examples/*.go; do \ - echo "\033[2m────────────────────────────────────────────────────────────────────────────────"; \ - echo "\033[1m$$f\033[0m"; \ - echo "\033[2m────────────────────────────────────────────────────────────────────────────────\033[0m"; \ + printf "\033[2m────────────────────────────────────────────────────────────────────────────────\n"; \ + printf "\033[1m$$f\033[0m\n"; \ + printf "\033[2m────────────────────────────────────────────────────────────────────────────────\033[0m\n"; \ (go run $$f && true) || \ ( \ - echo "\033[31m────────────────────────────────────────────────────────────────────────────────\033[0m"; \ - echo "\033[31;1m⨯ ERROR\033[0m"; \ + printf "\033[31m────────────────────────────────────────────────────────────────────────────────\033[0m\n"; \ + printf "\033[31;1m⨯ ERROR\033[0m\n"; \ false; \ ); \ done; \ \ for f in _examples/*/; do \ - echo "\033[2m────────────────────────────────────────────────────────────────────────────────\033[0m"; \ - echo "\033[1m$$f\033[0m"; \ - echo "\033[2m────────────────────────────────────────────────────────────────────────────────\033[0m"; \ + printf "\033[2m────────────────────────────────────────────────────────────────────────────────\033[0m\n"; \ + printf "\033[1m$$f\033[0m\n"; \ + printf "\033[2m────────────────────────────────────────────────────────────────────────────────\033[0m\n"; \ (cd $$f && make test && true) || \ ( \ - echo "\033[31m────────────────────────────────────────────────────────────────────────────────\033[0m"; \ - echo "\033[31;1m⨯ ERROR\033[0m"; \ + printf "\033[31m────────────────────────────────────────────────────────────────────────────────\033[0m\n"; \ + printf "\033[31;1m⨯ ERROR\033[0m\n"; \ false; \ ); \ done; \ - echo "\033[32m────────────────────────────────────────────────────────────────────────────────\033[0m"; \ + printf "\033[32m────────────────────────────────────────────────────────────────────────────────\033[0m\n"; \ \ - echo "\033[32;1mSUCCESS\033[0m"; \ + printf "\033[32;1mSUCCESS\033[0m\n"; \ } test-coverage: ## Generate test coverage report - @echo "\033[2m→ Generating test coverage report...\033[0m" + @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 'esapi/api\.' | sed 's/github.com\/elastic\/go-elasticsearch\///g' - @echo "--------------------------------------------------------------------------------\nopen tmp/coverage.html\n" + @printf "--------------------------------------------------------------------------------\nopen tmp/coverage.html\n\n" ##@ Development lint: ## Run lint on the package - @echo "\033[2m→ Running lint...\033[0m" + @printf "\033[2m→ Running lint...\033[0m\n" go vet github.com/elastic/go-elasticsearch/... go list github.com/elastic/go-elasticsearch/... | 'grep' -v internal | xargs golint -set_exit_status @{ \ set -e ; \ - trap "git checkout --quiet $(PWD)/internal/cmd/generate/go.mod" INT TERM EXIT; \ + trap "test -d ../../../.git && git checkout --quiet go.mod" INT TERM EXIT; \ echo "cd internal/cmd/generate/ && go vet ./..."; \ - cd "$(PWD)/internal/cmd/generate/" && go vet ./...; \ + cd "internal/cmd/generate/" && go vet ./...; \ } apidiff: ## Display API incompabilities @if ! command -v apidiff > /dev/null; then \ - echo "\033[31;1mERROR: apidiff not installed\033[0m"; \ - echo "go get -u github.com/go-modules-by-example/apidiff"; \ - echo "\033[2m→ https://github.com/go-modules-by-example/index/blob/master/019_apidiff/README.md\033[0m\n"; \ + printf "\033[31;1mERROR: apidiff not installed\033[0m\n"; \ + printf "go get -u github.com/go-modules-by-example/apidiff\n"; \ + printf "\033[2m→ https://github.com/go-modules-by-example/index/blob/master/019_apidiff/README.md\033[0m\n\n"; \ false; \ fi; @rm -rf tmp/apidiff-OLD tmp/apidiff-NEW @git clone --quiet --local .git/ tmp/apidiff-OLD @mkdir -p tmp/apidiff-NEW @tar -c --exclude .git --exclude tmp --exclude cmd . | tar -x -C tmp/apidiff-NEW - @echo "\033[2m→ Running apidiff...\033[0m" - @echo "tmp/apidiff-OLD/esapi tmp/apidiff-NEW/esapi" + @printf "\033[2m→ Running apidiff...\033[0m\n" + @pritnf "tmp/apidiff-OLD/esapi tmp/apidiff-NEW/esapi\n" @{ \ set -e ; \ output=$$(apidiff tmp/apidiff-OLD/esapi tmp/apidiff-NEW/esapi); \ - echo "\n$$output\n"; \ + printf "\n$$output\n\n"; \ if echo $$output | grep -i -e 'incompatible' - > /dev/null 2>&1; then \ - echo "\n\033[31;1mFAILURE\033[0m\n"; \ + printf "\n\033[31;1mFAILURE\033[0m\n\n"; \ false; \ else \ - echo "\033[32;1mSUCCESS\033[0m"; \ + printf "\033[32;1mSUCCESS\033[0m\n"; \ fi; \ } @@ -170,7 +170,7 @@ else $(eval branches_list = $(shell echo $(branches) | tr ',' ' ') ) endif $(eval commits_list = $(shell echo $(commits) | tr ',' ' ')) - @echo "\033[2m→ Backporting commits [$(commits)]\033[0m" + @printf "\033[2m→ Backporting commits [$(commits)]\033[0m\n" @{ \ set -e -o pipefail; \ for commit in $(commits_list); do \ @@ -178,7 +178,7 @@ endif done; \ echo ""; \ for branch in $(branches_list); do \ - echo "\033[2m→ $$branch\033[0m"; \ + printf "\033[2m→ $$branch\033[0m\n"; \ git checkout $$branch; \ for commit in $(commits_list); do \ git cherry-pick -x $$commit; \ @@ -186,7 +186,7 @@ endif git status --short --branch; \ echo ""; \ done; \ - echo "\033[2m→ Push updates to Github:\033[0m"; \ + printf "\033[2m→ Push updates to Github:\033[0m\n"; \ for branch in $(branches_list); do \ echo "git push --verbose origin $$branch"; \ done; \ @@ -195,16 +195,16 @@ endif release: ## Release a new version to Github $(eval branch = $(shell git rev-parse --abbrev-ref HEAD)) $(eval current_version = $(shell cat internal/version/version.go | sed -Ee 's/const Client = "(.*)"/\1/' | tail -1)) - @echo "\033[2m→ [$(branch)] Current version: $(current_version)...\033[0m" + @printf "\033[2m→ [$(branch)] Current version: $(current_version)...\033[0m\n" ifndef version - @echo "\033[31m[!] Missing version argument, exiting...\033[0m" + @printf "\033[31m[!] Missing version argument, exiting...\033[0m\n" @exit 2 endif ifeq ($(version), "") - @echo "\033[31m[!] Empty version argument, exiting...\033[0m" + @printf "\033[31m[!] Empty version argument, exiting...\033[0m\n" @exit 2 endif - @echo "\033[2m→ [$(branch)] Creating version $(version)...\033[0m" + @printf "\033[2m→ [$(branch)] Creating version $(version)...\033[0m\n" @{ \ set -e -o pipefail; \ cp internal/version/version.go internal/version/version.go.OLD && \ @@ -215,19 +215,19 @@ endif } @{ \ set -e -o pipefail; \ - echo "\033[2m→ Commit and create Git tag? (y/n): \033[0m\c"; \ + printf "\033[2m→ Commit and create Git tag? (y/n): \033[0m\c"; \ read continue; \ if [[ $$continue == "y" ]]; then \ git add internal/version/version.go && \ git commit --no-status --quiet --message "Release $(version)" && \ git tag --annotate v$(version) --message 'Release $(version)'; \ - echo "\033[2m→ Push `git show --pretty='%h (%s)' --no-patch HEAD` to Github:\033[0m\n"; \ - echo "\033[1m git push origin HEAD && git push origin v$(version)\033[0m\n"; \ + printf "\033[2m→ Push `git show --pretty='%h (%s)' --no-patch HEAD` to Github:\033[0m\n\n"; \ + printf "\033[1m git push origin HEAD && git push origin v$(version)\033[0m\n\n"; \ mv internal/version/version.go.OLD internal/version/version.go && \ git add internal/version/version.go && \ original_version=`cat internal/version/version.go | sed -ne 's;^const Client = "\(.*\)"$$;\1;p'` && \ git commit --no-status --quiet --message "Update version to $$original_version"; \ - echo "\033[2m→ Version updated to [$$original_version].\033[0m\n"; \ + printf "\033[2m→ Version updated to [$$original_version].\033[0m\n\n"; \ else \ echo "Aborting..."; \ rm internal/version/version.go.OLD; \ @@ -236,7 +236,7 @@ endif } godoc: ## Display documentation for the package - @echo "\033[2m→ Generating documentation...\033[0m" + @printf "\033[2m→ Generating documentation...\033[0m\n" @echo "open http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/\n" mkdir -p /tmp/tmpgoroot/doc rm -rf /tmp/tmpgopath/src/github.com/elastic/go-elasticsearch @@ -249,7 +249,7 @@ cluster: ## Launch an Elasticsearch cluster with Docker ifeq ($(origin nodes), undefined) $(eval nodes = 1) endif - @echo "\033[2m→ Launching" $(nodes) "node(s) of" $(version) "...\033[0m" + @printf "\033[2m→ Launching" $(nodes) "node(s) of" $(version) "...\033[0m\n" ifeq ($(shell test $(nodes) && test $(nodes) -gt 1; echo $$?),0) $(eval detached ?= "true") else @@ -324,11 +324,11 @@ endif cluster-update: ## Update the Docker image $(eval version ?= "elasticsearch-oss:7.5-SNAPSHOT") - @echo "\033[2m→ Updating the Docker image...\033[0m" + @printf "\033[2m→ Updating the Docker image...\033[0m\n" @docker pull docker.elastic.co/elasticsearch/$(version); cluster-clean: ## Remove unused Docker volumes and networks - @echo "\033[2m→ Cleaning up Docker assets...\033[0m" + @printf "\033[2m→ Cleaning up Docker assets...\033[0m\n" docker volume prune --force docker network prune --force @@ -353,10 +353,10 @@ ifdef ELASTICSEARCH_BUILD_HASH else $(eval build_hash = $(shell git --git-dir='$(input)/.git' rev-parse --short HEAD)) endif - @echo "\033[2m→ Generating API package from specification ($(version):$(build_hash))...\033[0m" + @printf "\033[2m→ Generating API package from specification ($(version):$(build_hash))...\033[0m\n" @{ \ set -e; \ - trap "git checkout --quiet $(PWD)/internal/cmd/generate/go.mod" INT TERM EXIT; \ + trap "test -d .git && git checkout --quiet $(PWD)/internal/cmd/generate/go.mod" INT TERM EXIT; \ export ELASTICSEARCH_VERSION=$(version) && \ export ELASTICSEARCH_BUILD_HASH=$(build_hash) && \ cd internal/cmd/generate && \ @@ -381,10 +381,10 @@ ifdef ELASTICSEARCH_BUILD_HASH else $(eval build_hash = $(shell git --git-dir='$(input)/.git' rev-parse --short HEAD)) endif - @echo "\033[2m→ Generating API tests from specification ($(version):$(build_hash))...\033[0m" + @printf "\033[2m→ Generating API tests from specification ($(version):$(build_hash))...\033[0m\n" @{ \ set -e; \ - trap "git checkout --quiet $(PWD)/internal/cmd/generate/go.mod" INT TERM EXIT; \ + trap "test -d .git && git checkout --quiet $(PWD)/internal/cmd/generate/go.mod" INT TERM EXIT; \ export ELASTICSEARCH_VERSION=$(version) && \ export ELASTICSEARCH_BUILD_HASH=$(build_hash) && \ rm -rf $(output)/*_test.go && \ From 5ae93543d45b35ee1a34e96d7cbe40708dbcd562 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 10 Feb 2020 11:11:22 +0100 Subject: [PATCH 166/355] Transport: Increase the wait time for server in discovery tests (cherry picked from commit 1463ac9f2f0e4effd098bb9473b0e54e444d2dc0) --- estransport/discovery_internal_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/estransport/discovery_internal_test.go b/estransport/discovery_internal_test.go index 6d035fc328..5bb4317a24 100644 --- a/estransport/discovery_internal_test.go +++ b/estransport/discovery_internal_test.go @@ -43,7 +43,7 @@ func TestDiscovery(t *testing.T) { defer func() { srv.Close() }() defer func() { srvTLS.Close() }() - time.Sleep(time.Millisecond) + time.Sleep(10 * time.Millisecond) t.Run("getNodesInfo()", func(t *testing.T) { u, _ := url.Parse("http://" + srv.Addr) From 33004104143c2820344bef3a180df20bb3c34081 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 10 Feb 2020 11:36:00 +0100 Subject: [PATCH 167/355] Makefile: Fix formatted command output (cherry picked from commit aff00e5adfde9994ddeb2619ecb7b2131071c338) --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 648693a91f..d4a09e7dfc 100644 --- a/Makefile +++ b/Makefile @@ -249,7 +249,7 @@ cluster: ## Launch an Elasticsearch cluster with Docker ifeq ($(origin nodes), undefined) $(eval nodes = 1) endif - @printf "\033[2m→ Launching" $(nodes) "node(s) of" $(version) "...\033[0m\n" + @printf "\033[2m→ Launching %d node(s) of %s...\033[0m\n" $(nodes) $(version) ifeq ($(shell test $(nodes) && test $(nodes) -gt 1; echo $$?),0) $(eval detached ?= "true") else @@ -311,14 +311,14 @@ endif } ifdef detached @{ \ - echo "\033[2m→ Waiting for the cluster...\033[0m"; \ + printf "\033[2m→ Waiting for the cluster...\033[0m\n"; \ docker run --network elasticsearch --rm appropriate/curl --max-time 120 --retry 120 --retry-delay 1 --retry-connrefused --show-error --silent http://es1:9200; \ output="\033[2m→ Cluster ready; to remove containers:"; \ output="$$output docker rm -f"; \ for n in `seq 1 $(nodes)`; do \ output="$$output es$$n"; \ done; \ - echo "$$output\033[0m"; \ + printf "$$output\033[0m\n"; \ } endif From 7fa3d2eae09d2bb028dba612336dd334c42ac319 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 20 Feb 2020 09:26:42 +0100 Subject: [PATCH 168/355] Makefile: Add SHELL to prevent failures with /bin/sh (cherry picked from commit d7c6fc0b480735ae87ea2e4e0d27fd5649663d6c) --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index d4a09e7dfc..546a70803c 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +SHELL := /bin/bash + ##@ Test test-unit: ## Run unit tests @printf "\033[2m→ Running unit tests...\033[0m\n" From 63dc1929e65e9ba8d86c884fcce873e19ac6a85d Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 26 Feb 2020 11:43:44 +0100 Subject: [PATCH 169/355] Dockerfile: Update "gotestsum" to 0.4.1 (cherry picked from commit a0177b43e62cbe7b9fd720c007419b5ca2e103e6) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index acf4a79e34..3b1f51be83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ FROM golang:${VERSION} RUN apk add --no-cache --quiet make curl git jq unzip tree && \ go get -u golang.org/x/lint/golint && \ - curl -sSL --retry 3 --retry-connrefused https://github.com/gotestyourself/gotestsum/releases/download/v0.3.5/gotestsum_0.3.5_linux_amd64.tar.gz | tar -xz -C /usr/local/bin gotestsum + curl -sSL --retry 3 --retry-connrefused https://github.com/gotestyourself/gotestsum/releases/download/v0.4.1/gotestsum_0.4.1_linux_amd64.tar.gz | tar -xz -C /usr/local/bin gotestsum VOLUME ["/tmp"] From 8a95458704ed7de5ca4b0dcbe7702340b1d891a4 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 26 Feb 2020 11:44:17 +0100 Subject: [PATCH 170/355] CI: Fix internal errors when generating the API registry On Jenkins, the `go generate ./...` command in "internal/cmd/generate" started failing with: Generating API registry into api_registry.gen.go ================================================================================ internal error: nil Pkg importing "context" from "github.com/elastic/go-elasticsearch/v8/esapi" The assumption is that it's related to Go 1.14, released today. An investigation didn't reveal much, but during the debugging, it was discovered that installing `goimports` makes the issue to go away for some reason. (cherry picked from commit f721d5e04e582336edabf166e24eb91e5de1d6e2) --- .jenkins/tests-core.sh | 1 + .jenkins/tests-xpack.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/.jenkins/tests-core.sh b/.jenkins/tests-core.sh index 34d4300d47..5b875dbc5d 100644 --- a/.jenkins/tests-core.sh +++ b/.jenkins/tests-core.sh @@ -11,6 +11,7 @@ docker exec go-elasticsearch /bin/sh -c 'rm -rf esapi/test/xpack' echo -e "\033[1m>>>>> Generating the API registry\033[0m" +docker exec --workdir=/go-elasticsearch/internal/cmd/generate go-elasticsearch go get -u golang.org/x/tools/cmd/goimports docker exec --workdir=/go-elasticsearch/internal/cmd/generate --env PACKAGE_PATH=/go-elasticsearch/esapi go-elasticsearch go generate ./... echo -e "\033[1m>>>>> Generating the test files\033[0m" diff --git a/.jenkins/tests-xpack.sh b/.jenkins/tests-xpack.sh index 87e69934a2..acce903214 100644 --- a/.jenkins/tests-xpack.sh +++ b/.jenkins/tests-xpack.sh @@ -11,6 +11,7 @@ docker exec go-elasticsearch /bin/sh -c 'rm -rf rm -rf esapi/test/ml*' echo -e "\033[1m>>>>> Generating the API registry\033[0m" +docker exec --workdir=/go-elasticsearch/internal/cmd/generate go-elasticsearch go get -u golang.org/x/tools/cmd/goimports docker exec --workdir=/go-elasticsearch/internal/cmd/generate --env PACKAGE_PATH=/go-elasticsearch/esapi go-elasticsearch go generate ./... echo -e "\033[1m>>>>> Generating the test files\033[0m" From 3925e838d1cfcd3f9b2567474a51b1c19e617410 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Thu, 27 Feb 2020 10:23:16 +0100 Subject: [PATCH 171/355] Makefile: Fix incorrect shell command in "test-coverage" (cherry picked from commit 472eb1288b723b54a5c0889c7637ee5e2f7c8310) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 546a70803c..57fef38424 100644 --- a/Makefile +++ b/Makefile @@ -121,7 +121,7 @@ test-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 'esapi/api\.' | sed 's/github.com\/elastic\/go-elasticsearch\///g' - @printf "--------------------------------------------------------------------------------\nopen tmp/coverage.html\n\n" + @printf "\033[0m--------------------------------------------------------------------------------\nopen tmp/coverage.html\n\n\033[0m" ##@ Development lint: ## Run lint on the package From 37d070bd6524c841d217cf11d0175dd6a20c6415 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 11 Mar 2020 07:45:09 +0100 Subject: [PATCH 172/355] Util: Add the BulkIndexer helper This patch adds a bulk indexing helper compoment into the "esutil" package. See code annotations and the bulk_indexer_example_test.go file for information on usage. Closes #137 (cherry picked from commit 56b38163d20761ff1c492c627b6b28fc16e214a4) --- esutil/bulk_indexer.go | 544 +++++++++++++++++++++++ esutil/bulk_indexer_benchmark_test.go | 76 ++++ esutil/bulk_indexer_example_test.go | 115 +++++ esutil/bulk_indexer_integration_test.go | 93 ++++ esutil/bulk_indexer_internal_test.go | 552 ++++++++++++++++++++++++ esutil/testdata/bulk_response_1a.json | 36 ++ esutil/testdata/bulk_response_1b.json | 38 ++ esutil/testdata/bulk_response_1c.json | 38 ++ esutil/testdata/bulk_response_2.json | 56 +++ 9 files changed, 1548 insertions(+) create mode 100644 esutil/bulk_indexer.go create mode 100644 esutil/bulk_indexer_benchmark_test.go create mode 100644 esutil/bulk_indexer_example_test.go create mode 100644 esutil/bulk_indexer_integration_test.go create mode 100644 esutil/bulk_indexer_internal_test.go create mode 100644 esutil/testdata/bulk_response_1a.json create mode 100644 esutil/testdata/bulk_response_1b.json create mode 100644 esutil/testdata/bulk_response_1c.json create mode 100644 esutil/testdata/bulk_response_2.json diff --git a/esutil/bulk_indexer.go b/esutil/bulk_indexer.go new file mode 100644 index 0000000000..e2f57798e0 --- /dev/null +++ b/esutil/bulk_indexer.go @@ -0,0 +1,544 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +package esutil + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "runtime" + "strconv" + "sync" + "sync/atomic" + "time" + + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" +) + +// BulkIndexer represents a parallel, asynchronous, efficient indexer for Elasticsearch. +// +type BulkIndexer interface { + // Add adds an item to the indexer. It returns an error when the item cannot be added. + // Use the OnSuccess and OnFailure callbacks to get the operation result for the item. + // + // You must call the Close() method after you're done adding items. + // + // It is safe for concurrent use. When it's called from goroutines, + // they must finish before the call to Close, eg. using sync.WaitGroup. + Add(context.Context, BulkIndexerItem) error + + // Close waits until all added items are flushed and closes the indexer. + Close(context.Context) error + + // Stats returns indexer statistics. + Stats() BulkIndexerStats +} + +// BulkIndexerConfig represents configuration of the indexer. +// +type BulkIndexerConfig struct { + NumWorkers int // The number of workers. Defaults to runtime.NumCPU(). + FlushBytes int // The flush threshold in bytes. Defaults to 5MB. + FlushInterval time.Duration // The flush threshold as duration. Defaults to 30sec. + + Client *elasticsearch.Client // The Elasticsearch client. + Decoder BulkResponseJSONDecoder // A custom JSON decoder. + DebugLogger BulkIndexerDebugLogger // An optional logger for debugging. + + OnError func(context.Context, error) // Called for indexer errors. + OnFlushStart func(context.Context) context.Context // Called when the flush starts. + OnFlushEnd func(context.Context) // Called when the flush ends. + + // Parameters of the Bulk API. + Index string + ErrorTrace bool + FilterPath []string + Header http.Header + Human bool + Pipeline string + Pretty bool + Refresh string + Routing string + Source []string + SourceExcludes []string + SourceIncludes []string + Timeout time.Duration + WaitForActiveShards string +} + +// BulkIndexerStats represents the indexer statistics. +// +type BulkIndexerStats struct { + NumAdded uint64 + NumFlushed uint64 + NumFailed uint64 + NumIndexed uint64 + NumCreated uint64 + NumUpdated uint64 + NumDeleted uint64 + NumRequests uint64 +} + +// BulkIndexerItem represents an indexer item. +// +type BulkIndexerItem struct { + Index string + Action string + DocumentID string + Body io.Reader + RetryOnConflict *int + + OnSuccess func(context.Context, BulkIndexerItem, BulkIndexerResponseItem) // Per item + OnFailure func(context.Context, BulkIndexerItem, BulkIndexerResponseItem, error) // Per item +} + +// BulkIndexerResponse represents the Elasticsearch response. +// +type BulkIndexerResponse struct { + Took int `json:"took"` + HasErrors bool `json:"errors"` + Items []map[string]BulkIndexerResponseItem `json:"items,omitempty"` +} + +// BulkIndexerResponseItem represents the Elasticsearch response item. +// +type BulkIndexerResponseItem struct { + Index string `json:"_index"` + DocumentID string `json:"_id"` + Version int64 `json:"_version"` + Result string `json:"result"` + Status int `json:"status"` + SeqNo int64 `json:"_seq_no"` + PrimTerm int64 `json:"_primary_term"` + + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_shards"` + + Error struct { + Type string `json:"type"` + Reason string `json:"reason"` + Cause struct { + Type string `json:"type"` + Reason string `json:"reason"` + } `json:"caused_by"` + } `json:"error,omitempty"` +} + +// BulkResponseJSONDecoder defines the interface for custom JSON decoders. +// +type BulkResponseJSONDecoder interface { + UnmarshalFromReader(io.Reader, *BulkIndexerResponse) error +} + +// BulkIndexerDebugLogger defines the interface for a debugging logger. +// +type BulkIndexerDebugLogger interface { + Printf(string, ...interface{}) +} + +type bulkIndexer struct { + wg sync.WaitGroup + queue chan BulkIndexerItem + workers []*worker + ticker *time.Ticker + done chan bool + stats *bulkIndexerStats + + config BulkIndexerConfig +} + +type bulkIndexerStats struct { + numAdded uint64 + numFlushed uint64 + numFailed uint64 + numIndexed uint64 + numCreated uint64 + numUpdated uint64 + numDeleted uint64 + numRequests uint64 +} + +// NewBulkIndexer creates a new bulk indexer. +// +func NewBulkIndexer(cfg BulkIndexerConfig) (BulkIndexer, error) { + if cfg.Client == nil { + cfg.Client, _ = elasticsearch.NewDefaultClient() + } + + if cfg.Decoder == nil { + cfg.Decoder = defaultJSONDecoder{} + } + + if cfg.NumWorkers == 0 { + cfg.NumWorkers = runtime.NumCPU() + } + + if cfg.FlushBytes == 0 { + cfg.FlushBytes = 5e+6 + } + + if cfg.FlushInterval == 0 { + cfg.FlushInterval = 30 * time.Second + } + + bi := bulkIndexer{ + config: cfg, + done: make(chan bool), + stats: &bulkIndexerStats{}, + } + + bi.init() + + return &bi, nil +} + +// Add adds an item to the indexer. +// +// Adding an item after a call to Close() will panic. +// +func (bi *bulkIndexer) Add(ctx context.Context, item BulkIndexerItem) error { + atomic.AddUint64(&bi.stats.numAdded, 1) + + select { + case <-ctx.Done(): + if bi.config.OnError != nil { + bi.config.OnError(ctx, ctx.Err()) + } + return ctx.Err() + case bi.queue <- item: + } + + return nil +} + +// Close stops the periodic flush, closes the indexer queue channel, +// notifies the done channel and calls flush on all writers. +// +func (bi *bulkIndexer) Close(ctx context.Context) error { + bi.ticker.Stop() + close(bi.queue) + bi.done <- true + + select { + case <-ctx.Done(): + if bi.config.OnError != nil { + bi.config.OnError(ctx, ctx.Err()) + } + return ctx.Err() + default: + bi.wg.Wait() + } + + for _, w := range bi.workers { + w.mu.Lock() + if w.buf.Len() > 0 { + if err := w.flush(ctx); err != nil { + w.mu.Unlock() + if bi.config.OnError != nil { + bi.config.OnError(ctx, err) + } + continue + } + } + w.mu.Unlock() + } + return nil +} + +// Stats returns indexer statistics. +// +func (bi *bulkIndexer) Stats() BulkIndexerStats { + return BulkIndexerStats{ + NumAdded: atomic.LoadUint64(&bi.stats.numAdded), + NumFlushed: atomic.LoadUint64(&bi.stats.numFlushed), + NumFailed: atomic.LoadUint64(&bi.stats.numFailed), + NumIndexed: atomic.LoadUint64(&bi.stats.numIndexed), + NumCreated: atomic.LoadUint64(&bi.stats.numCreated), + NumUpdated: atomic.LoadUint64(&bi.stats.numUpdated), + NumDeleted: atomic.LoadUint64(&bi.stats.numDeleted), + NumRequests: atomic.LoadUint64(&bi.stats.numRequests), + } +} + +// init initializes the bulk indexer. +// +func (bi *bulkIndexer) init() { + bi.queue = make(chan BulkIndexerItem, bi.config.NumWorkers) + + for i := 1; i <= bi.config.NumWorkers; i++ { + w := worker{ + id: i, + ch: bi.queue, + bi: bi, + buf: bytes.NewBuffer(make([]byte, 0, bi.config.FlushBytes)), + aux: make([]byte, 0, 512)} + w.run() + bi.workers = append(bi.workers, &w) + } + bi.wg.Add(bi.config.NumWorkers) + + bi.ticker = time.NewTicker(bi.config.FlushInterval) + go func() { + ctx := context.Background() + for { + select { + case <-bi.done: + return + case <-bi.ticker.C: + if bi.config.DebugLogger != nil { + bi.config.DebugLogger.Printf("[indexer] Auto-flushing workers after %s\n", bi.config.FlushInterval) + } + for _, w := range bi.workers { + w.mu.Lock() + if w.buf.Len() > 0 { + if err := w.flush(ctx); err != nil { + w.mu.Unlock() + if bi.config.OnError != nil { + bi.config.OnError(ctx, err) + } + continue + } + } + w.mu.Unlock() + } + } + } + }() +} + +// worker represents an indexer worker. +// +type worker struct { + id int + ch <-chan BulkIndexerItem + mu sync.Mutex + bi *bulkIndexer + buf *bytes.Buffer + aux []byte + items []BulkIndexerItem +} + +// run launches the worker in a goroutine. +// +func (w *worker) run() { + go func() { + ctx := context.Background() + + if w.bi.config.DebugLogger != nil { + w.bi.config.DebugLogger.Printf("[worker-%03d] Started\n", w.id) + } + defer w.bi.wg.Done() + + for item := range w.ch { + w.mu.Lock() + + if w.bi.config.DebugLogger != nil { + w.bi.config.DebugLogger.Printf("[worker-%03d] Received item [%s:%s]\n", w.id, item.Action, item.DocumentID) + } + + if err := w.writeMeta(item); err != nil { + if item.OnFailure != nil { + item.OnFailure(ctx, item, BulkIndexerResponseItem{}, err) + } + atomic.AddUint64(&w.bi.stats.numFailed, 1) + w.mu.Unlock() + continue + } + + if err := w.writeBody(item); err != nil { + if item.OnFailure != nil { + item.OnFailure(ctx, item, BulkIndexerResponseItem{}, err) + } + atomic.AddUint64(&w.bi.stats.numFailed, 1) + w.mu.Unlock() + continue + } + + w.items = append(w.items, item) + if w.buf.Len() >= w.bi.config.FlushBytes { + if err := w.flush(ctx); err != nil { + w.mu.Unlock() + if w.bi.config.OnError != nil { + w.bi.config.OnError(ctx, err) + } + continue + } + } + w.mu.Unlock() + } + }() +} + +// writeMeta formats and writes the item metadata to the buffer; it must be called under a lock. +// +func (w *worker) writeMeta(item BulkIndexerItem) error { + w.buf.WriteRune('{') + w.aux = strconv.AppendQuote(w.aux, item.Action) + w.buf.Write(w.aux) + w.aux = w.aux[:0] + w.buf.WriteRune(':') + w.buf.WriteRune('{') + if item.DocumentID != "" { + w.buf.WriteString(`"_id":`) + w.aux = strconv.AppendQuote(w.aux, item.DocumentID) + w.buf.Write(w.aux) + w.aux = w.aux[:0] + } + w.buf.WriteRune('}') + w.buf.WriteRune('}') + w.buf.WriteRune('\n') + return nil +} + +// writeBody writes the item body to the buffer; it must be called under a lock. +// +func (w *worker) writeBody(item BulkIndexerItem) error { + if item.Body != nil { + if _, err := w.buf.ReadFrom(item.Body); err != nil { + if w.bi.config.OnError != nil { + w.bi.config.OnError(context.Background(), err) + } + return err + } + w.buf.WriteRune('\n') + } + return nil +} + +// flush writes out the worker buffer; it must be called under a lock. +// +func (w *worker) flush(ctx context.Context) error { + if w.bi.config.OnFlushStart != nil { + ctx = w.bi.config.OnFlushStart(ctx) + } + + if w.bi.config.OnFlushEnd != nil { + defer func() { w.bi.config.OnFlushEnd(ctx) }() + } + + if w.buf.Len() < 1 { + if w.bi.config.DebugLogger != nil { + w.bi.config.DebugLogger.Printf("[worker-%03d] Flush: Buffer empty\n", w.id) + } + return nil + } + + var ( + err error + blk BulkIndexerResponse + ) + + defer func() { + w.items = w.items[:0] + w.buf.Reset() + }() + + if w.bi.config.DebugLogger != nil { + w.bi.config.DebugLogger.Printf("[worker-%03d] Flush: %s\n", w.id, w.buf.String()) + } + + atomic.AddUint64(&w.bi.stats.numRequests, 1) + req := esapi.BulkRequest{ + Index: w.bi.config.Index, + Body: w.buf, + + Pipeline: w.bi.config.Pipeline, + Refresh: w.bi.config.Refresh, + Routing: w.bi.config.Routing, + Source: w.bi.config.Source, + SourceExcludes: w.bi.config.SourceExcludes, + SourceIncludes: w.bi.config.SourceIncludes, + Timeout: w.bi.config.Timeout, + WaitForActiveShards: w.bi.config.WaitForActiveShards, + + Pretty: w.bi.config.Pretty, + Human: w.bi.config.Human, + ErrorTrace: w.bi.config.ErrorTrace, + FilterPath: w.bi.config.FilterPath, + Header: w.bi.config.Header, + } + res, err := req.Do(ctx, w.bi.config.Client) + if err != nil { + atomic.AddUint64(&w.bi.stats.numFailed, uint64(len(w.items))) + if w.bi.config.OnError != nil { + w.bi.config.OnError(ctx, fmt.Errorf("flush: %s", err)) + } + return fmt.Errorf("flush: %s", err) + } + if res.Body != nil { + defer res.Body.Close() + } + if res.IsError() { + atomic.AddUint64(&w.bi.stats.numFailed, uint64(len(w.items))) + // TODO(karmi): Wrap error (include response struct) + if w.bi.config.OnError != nil { + w.bi.config.OnError(ctx, fmt.Errorf("flush: %s", err)) + } + return fmt.Errorf("flush: %s", res.String()) + } + + if err := w.bi.config.Decoder.UnmarshalFromReader(res.Body, &blk); err != nil { + // TODO(karmi): Wrap error (include response struct) + if w.bi.config.OnError != nil { + w.bi.config.OnError(ctx, fmt.Errorf("flush: %s", err)) + } + return fmt.Errorf("flush: error parsing response body: %s", err) + } + + for i, blkItem := range blk.Items { + var ( + item BulkIndexerItem + info BulkIndexerResponseItem + op string + ) + + item = w.items[i] + // The Elasticsearch bulk response contains an array of maps like this: + // [ { "index": { ... } }, { "create": { ... } }, ... ] + // We range over the map, to set the first key and value as "op" and "info". + for k, v := range blkItem { + op = k + info = v + } + if info.Error.Type != "" || info.Status > 201 { + atomic.AddUint64(&w.bi.stats.numFailed, 1) + if item.OnFailure != nil { + item.OnFailure(ctx, item, info, nil) + } + } else { + atomic.AddUint64(&w.bi.stats.numFlushed, 1) + + switch op { + case "index": + atomic.AddUint64(&w.bi.stats.numIndexed, 1) + case "create": + atomic.AddUint64(&w.bi.stats.numCreated, 1) + case "delete": + atomic.AddUint64(&w.bi.stats.numDeleted, 1) + case "update": + atomic.AddUint64(&w.bi.stats.numUpdated, 1) + } + + if item.OnSuccess != nil { + item.OnSuccess(ctx, item, info) + } + } + } + + return err +} + +type defaultJSONDecoder struct{} + +func (d defaultJSONDecoder) UnmarshalFromReader(r io.Reader, blk *BulkIndexerResponse) error { + return json.NewDecoder(r).Decode(blk) +} diff --git a/esutil/bulk_indexer_benchmark_test.go b/esutil/bulk_indexer_benchmark_test.go new file mode 100644 index 0000000000..86608d4a6c --- /dev/null +++ b/esutil/bulk_indexer_benchmark_test.go @@ -0,0 +1,76 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build !integration + +package esutil_test + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "strconv" + "strings" + "testing" + + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esutil" +) + +var mockResponseBody = `{ + "took": 30, + "errors": false, + "items": [ + { + "index": { + "_index": "test", + "_id": "1", + "_version": 1, + "result": "created", + "_shards": { "total": 2, "successful": 1, "failed": 0 }, + "status": 201, + "_seq_no": 0, + "_primary_term": 1 + } + } + ] +}` + +type mockTransp struct{} + +func (t *mockTransp) RoundTrip(req *http.Request) (*http.Response, error) { + return &http.Response{Body: ioutil.NopCloser(strings.NewReader(mockResponseBody))}, nil // 1x alloc +} + +func BenchmarkBulkIndexer(b *testing.B) { + b.ReportAllocs() + + b.Run("Basic", func(b *testing.B) { + b.ResetTimer() + + es, _ := elasticsearch.NewClient(elasticsearch.Config{Transport: &mockTransp{}}) + bi, _ := esutil.NewBulkIndexer(esutil.BulkIndexerConfig{ + Client: es, + FlushBytes: 1024, + }) + defer bi.Close(context.Background()) + + docID := make([]byte, 0, 16) + var docIDBuf bytes.Buffer + docIDBuf.Grow(cap(docID)) + + for i := 0; i < b.N; i++ { + docID = strconv.AppendInt(docID, int64(i), 10) + docIDBuf.Write(docID) + bi.Add(context.Background(), esutil.BulkIndexerItem{ + Action: "index", + DocumentID: docIDBuf.String(), // 1x alloc + Body: strings.NewReader(`{"foo":"bar"}`), // 1x alloc + }) + docID = docID[:0] + docIDBuf.Reset() + } + }) +} diff --git a/esutil/bulk_indexer_example_test.go b/esutil/bulk_indexer_example_test.go new file mode 100644 index 0000000000..2b1b9723a1 --- /dev/null +++ b/esutil/bulk_indexer_example_test.go @@ -0,0 +1,115 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build !integration + +package esutil_test + +import ( + "context" + "fmt" + "log" + "strings" + "time" + + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esutil" +) + +func ExampleNewBulkIndexer() { + log.SetFlags(0) + + // Create the Elasticsearch client + // + es, err := elasticsearch.NewClient(elasticsearch.Config{ + // Retry on 429 TooManyRequests statuses + // + RetryOnStatus: []int{502, 503, 504, 429}, + + // A simple incremental backoff function + // + RetryBackoff: func(i int) time.Duration { return time.Duration(i) * 100 * time.Millisecond }, + + // Retry up to 5 attempts + // + MaxRetries: 5, + }) + if err != nil { + log.Fatalf("Error creating the client: %s", err) + } + + // Create the indexer + // + indexer, err := esutil.NewBulkIndexer(esutil.BulkIndexerConfig{ + Client: es, // The Elasticsearch client + Index: "test", // The default index name + NumWorkers: 4, // The number of worker goroutines (default: number of CPUs) + FlushBytes: 5e+6, // The flush threshold in bytes (default: 5M) + }) + if err != nil { + log.Fatalf("Error creating the indexer: %s", err) + } + + // Add an item to the indexer + // + err = indexer.Add( + context.Background(), + esutil.BulkIndexerItem{ + // Action field configures the operation to perform (index, create, delete, update) + Action: "index", + + // DocumentID is the optional document ID + DocumentID: "1", + + // Body is an `io.Reader` with the payload + Body: strings.NewReader(`{"title":"Test"}`), + + // OnSuccess is the optional callback for each successful operation + OnSuccess: func( + ctx context.Context, + item esutil.BulkIndexerItem, + res esutil.BulkIndexerResponseItem, + ) { + fmt.Printf("[%d] %s test/%s", res.Status, res.Result, item.DocumentID) + }, + + // OnFailure is the optional callback for each failed operation + OnFailure: func( + ctx context.Context, + item esutil.BulkIndexerItem, + res esutil.BulkIndexerResponseItem, err error, + ) { + if err != nil { + log.Printf("ERROR: %s", err) + } else { + log.Printf("ERROR: %s: %s", res.Error.Type, res.Error.Reason) + } + }, + }, + ) + if err != nil { + log.Fatalf("Unexpected error: %s", err) + } + + // Close the indexer channel and flush remaining items + // + if err := indexer.Close(context.Background()); err != nil { + log.Fatalf("Unexpected error: %s", err) + } + + // Report the indexer statistics + // + stats := indexer.Stats() + if stats.NumFailed > 0 { + log.Fatalf("Indexed [%d] documents with [%d] errors", stats.NumFlushed, stats.NumFailed) + } else { + log.Printf("Successfully indexed [%d] documents", stats.NumFlushed) + } + + // For optimal performance, consider using a third-party package for JSON decoding and HTTP transport. + // + // For more information, examples and benchmarks, see: + // + // --> https://github.com/elastic/go-elasticsearch/tree/master/_examples/bulk +} diff --git a/esutil/bulk_indexer_integration_test.go b/esutil/bulk_indexer_integration_test.go new file mode 100644 index 0000000000..47d995c892 --- /dev/null +++ b/esutil/bulk_indexer_integration_test.go @@ -0,0 +1,93 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build integration + +package esutil_test + +import ( + "context" + "fmt" + "os" + "strconv" + "strings" + "sync/atomic" + "testing" + "time" + + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/estransport" + "github.com/elastic/go-elasticsearch/v7/esutil" +) + +func TestBulkIndexerIntegration(t *testing.T) { + t.Run("Default", func(t *testing.T) { + var countSuccessful uint64 + indexName := "test-bulk-integration" + + es, _ := elasticsearch.NewClient(elasticsearch.Config{ + Logger: &estransport.ColorLogger{Output: os.Stdout}, + }) + + es.Indices.Delete([]string{indexName}, es.Indices.Delete.WithIgnoreUnavailable(true)) + es.Indices.Create( + indexName, + es.Indices.Create.WithBody(strings.NewReader(`{"settings": {"number_of_shards": 1, "number_of_replicas": 0, "refresh_interval":"5s"}}`)), + es.Indices.Create.WithWaitForActiveShards("1")) + + bi, _ := esutil.NewBulkIndexer(esutil.BulkIndexerConfig{ + Index: indexName, + Client: es, + // FlushBytes: 3e+6, + }) + + numItems := 100000 + body := `{"body":"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."}` + start := time.Now().UTC() + + for i := 1; i <= numItems; i++ { + err := bi.Add(context.Background(), esutil.BulkIndexerItem{ + Action: "index", + DocumentID: strconv.Itoa(i), + Body: strings.NewReader(body), + OnSuccess: func(ctx context.Context, item esutil.BulkIndexerItem, res esutil.BulkIndexerResponseItem) { + atomic.AddUint64(&countSuccessful, 1) + }, + }) + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + } + + if err := bi.Close(context.Background()); err != nil { + t.Errorf("Unexpected error: %s", err) + } + + stats := bi.Stats() + + if stats.NumAdded != uint64(numItems) { + t.Errorf("Unexpected NumAdded: want=%d, got=%d", numItems, stats.NumAdded) + } + + if stats.NumIndexed != uint64(numItems) { + t.Errorf("Unexpected NumIndexed: want=%d, got=%d", numItems, stats.NumIndexed) + } + + if stats.NumFailed != 0 { + t.Errorf("Unexpected NumFailed: want=0, got=%d", stats.NumFailed) + } + + if countSuccessful != uint64(numItems) { + t.Errorf("Unexpected countSuccessful: want=%d, got=%d", numItems, countSuccessful) + } + + fmt.Printf(" Added %d documents to indexer. Succeeded: %d. Failed: %d. Requests: %d. Duration: %s (%.0f docs/sec)\n", + stats.NumAdded, + stats.NumFlushed, + stats.NumFailed, + stats.NumRequests, + time.Since(start).Truncate(time.Millisecond), + 1000.0/float64(time.Since(start)/time.Millisecond)*float64(stats.NumFlushed)) + }) +} diff --git a/esutil/bulk_indexer_internal_test.go b/esutil/bulk_indexer_internal_test.go new file mode 100644 index 0000000000..b45eb6e735 --- /dev/null +++ b/esutil/bulk_indexer_internal_test.go @@ -0,0 +1,552 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build !integration + +package esutil + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "log" + "net/http" + "os" + "reflect" + "strconv" + "strings" + "sync" + "sync/atomic" + "testing" + "time" + + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/estransport" +) + +var defaultRoundTripFunc = func(*http.Request) (*http.Response, error) { + return &http.Response{Body: ioutil.NopCloser(strings.NewReader(`{}`))}, nil +} + +type mockTransport struct { + RoundTripFunc func(*http.Request) (*http.Response, error) +} + +func (t *mockTransport) RoundTrip(req *http.Request) (*http.Response, error) { + if t.RoundTripFunc == nil { + return defaultRoundTripFunc(req) + } + return t.RoundTripFunc(req) +} + +func TestBulkIndexer(t *testing.T) { + t.Run("Basic", func(t *testing.T) { + var ( + wg sync.WaitGroup + + countReqs int + testfile string + numItems = 6 + ) + + es, _ := elasticsearch.NewClient(elasticsearch.Config{Transport: &mockTransport{ + RoundTripFunc: func(*http.Request) (*http.Response, error) { + countReqs++ + switch countReqs { + case 1: + testfile = "testdata/bulk_response_1a.json" + case 2: + testfile = "testdata/bulk_response_1b.json" + case 3: + testfile = "testdata/bulk_response_1c.json" + } + bodyContent, _ := ioutil.ReadFile(testfile) + return &http.Response{Body: ioutil.NopCloser(bytes.NewBuffer(bodyContent))}, nil + }, + }}) + + cfg := BulkIndexerConfig{ + NumWorkers: 1, + FlushBytes: 50, + FlushInterval: time.Hour, // Disable auto-flushing, because response doesn't match number of items + Client: es} + if os.Getenv("DEBUG") != "" { + cfg.DebugLogger = log.New(os.Stdout, "", 0) + } + + bi, _ := NewBulkIndexer(cfg) + + for i := 1; i <= numItems; i++ { + wg.Add(1) + go func(i int) { + defer wg.Done() + err := bi.Add(context.Background(), BulkIndexerItem{ + Action: "foo", + DocumentID: strconv.Itoa(i), + Body: strings.NewReader(fmt.Sprintf(`{"title":"foo-%d"}`, i)), + }) + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + }(i) + } + wg.Wait() + + if err := bi.Close(context.Background()); err != nil { + t.Errorf("Unexpected error: %s", err) + } + + stats := bi.Stats() + + // added = numitems + if stats.NumAdded != uint64(numItems) { + t.Errorf("Unexpected NumAdded: want=%d, got=%d", numItems, stats.NumAdded) + } + + // flushed = numitems - 1x conflict + 1x not_found + if stats.NumFlushed != uint64(numItems-2) { + t.Errorf("Unexpected NumFlushed: want=%d, got=%d", numItems-2, stats.NumFlushed) + } + + // failed = 1x conflict + 1x not_found + if stats.NumFailed != 2 { + t.Errorf("Unexpected NumFailed: want=%d, got=%d", 2, stats.NumFailed) + } + + // indexed = 1x + if stats.NumIndexed != 1 { + t.Errorf("Unexpected NumIndexed: want=%d, got=%d", 1, stats.NumIndexed) + } + + // created = 1x + if stats.NumCreated != 1 { + t.Errorf("Unexpected NumCreated: want=%d, got=%d", 1, stats.NumCreated) + } + + // deleted = 1x + if stats.NumDeleted != 1 { + t.Errorf("Unexpected NumDeleted: want=%d, got=%d", 1, stats.NumDeleted) + } + + if stats.NumUpdated != 1 { + t.Errorf("Unexpected NumUpdated: want=%d, got=%d", 1, stats.NumUpdated) + } + + // 3 items * 40 bytes, 2 workers, 1 request per worker + if stats.NumRequests != 3 { + t.Errorf("Unexpected NumRequests: want=%d, got=%d", 3, stats.NumRequests) + } + }) + + t.Run("Add() Timeout", func(t *testing.T) { + es, _ := elasticsearch.NewClient(elasticsearch.Config{Transport: &mockTransport{}}) + bi, _ := NewBulkIndexer(BulkIndexerConfig{NumWorkers: 1, Client: es}) + ctx, cancel := context.WithTimeout(context.Background(), time.Nanosecond) + defer cancel() + + var errs []error + for i := 0; i < 10; i++ { + errs = append(errs, bi.Add(ctx, BulkIndexerItem{Action: "delete", DocumentID: "timeout"})) + } + if err := bi.Close(context.Background()); err != nil { + t.Errorf("Unexpected error: %s", err) + } + + var gotError bool + for _, err := range errs { + if err != nil && err.Error() == "context deadline exceeded" { + gotError = true + } + } + if !gotError { + t.Errorf("Expected timeout error, but none in: %s", errs) + } + }) + + t.Run("Close() Cancel", func(t *testing.T) { + es, _ := elasticsearch.NewClient(elasticsearch.Config{Transport: &mockTransport{}}) + bi, _ := NewBulkIndexer(BulkIndexerConfig{ + NumWorkers: 1, + FlushBytes: 1, + Client: es, + }) + + for i := 0; i < 10; i++ { + bi.Add(context.Background(), BulkIndexerItem{Action: "foo"}) + } + + ctx, cancel := context.WithCancel(context.Background()) + cancel() + if err := bi.Close(ctx); err == nil { + t.Errorf("Expected context cancelled error, but got: %v", err) + } + }) + + t.Run("Indexer Callback", func(t *testing.T) { + esCfg := elasticsearch.Config{ + Transport: &mockTransport{ + RoundTripFunc: func(*http.Request) (*http.Response, error) { + return nil, fmt.Errorf("Mock transport error") + }, + }, + } + if os.Getenv("DEBUG") != "" { + esCfg.Logger = &estransport.ColorLogger{ + Output: os.Stdout, + EnableRequestBody: true, + EnableResponseBody: true, + } + } + + es, _ := elasticsearch.NewClient(esCfg) + + var indexerError error + biCfg := BulkIndexerConfig{ + NumWorkers: 1, + Client: es, + OnError: func(ctx context.Context, err error) { indexerError = err }, + } + if os.Getenv("DEBUG") != "" { + biCfg.DebugLogger = log.New(os.Stdout, "", 0) + } + + bi, _ := NewBulkIndexer(biCfg) + + if err := bi.Add(context.Background(), BulkIndexerItem{ + Action: "foo", + }); err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + bi.Close(context.Background()) + + if indexerError == nil { + t.Errorf("Expected indexerError to not be nil") + } + }) + + t.Run("Item Callbacks", func(t *testing.T) { + var ( + countSuccessful uint64 + countFailed uint64 + failedIDs []string + + numItems = 4 + numFailed = 2 + bodyContent, _ = ioutil.ReadFile("testdata/bulk_response_2.json") + ) + + es, _ := elasticsearch.NewClient(elasticsearch.Config{Transport: &mockTransport{ + RoundTripFunc: func(*http.Request) (*http.Response, error) { + return &http.Response{Body: ioutil.NopCloser(bytes.NewBuffer(bodyContent))}, nil + }, + }}) + + cfg := BulkIndexerConfig{NumWorkers: 1, Client: es} + if os.Getenv("DEBUG") != "" { + cfg.DebugLogger = log.New(os.Stdout, "", 0) + } + + bi, _ := NewBulkIndexer(cfg) + + successFunc := func(ctx context.Context, item BulkIndexerItem, res BulkIndexerResponseItem) { + atomic.AddUint64(&countSuccessful, 1) + } + failureFunc := func(ctx context.Context, item BulkIndexerItem, res BulkIndexerResponseItem, err error) { + atomic.AddUint64(&countFailed, 1) + failedIDs = append(failedIDs, item.DocumentID) + } + + if err := bi.Add(context.Background(), BulkIndexerItem{ + Action: "index", + DocumentID: "1", + Body: strings.NewReader(`{"title":"foo"}`), + OnSuccess: successFunc, + OnFailure: failureFunc, + }); err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if err := bi.Add(context.Background(), BulkIndexerItem{ + Action: "create", + DocumentID: "1", + Body: strings.NewReader(`{"title":"bar"}`), + OnSuccess: successFunc, + OnFailure: failureFunc, + }); err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if err := bi.Add(context.Background(), BulkIndexerItem{ + Action: "delete", + DocumentID: "2", + OnSuccess: successFunc, + OnFailure: failureFunc, + }); err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if err := bi.Add(context.Background(), BulkIndexerItem{ + Action: "update", + DocumentID: "3", + Body: strings.NewReader(`{"doc":{"title":"qux"}}`), + OnSuccess: successFunc, + OnFailure: failureFunc, + }); err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if err := bi.Close(context.Background()); err != nil { + t.Errorf("Unexpected error: %s", err) + } + + stats := bi.Stats() + + if stats.NumAdded != uint64(numItems) { + t.Errorf("Unexpected NumAdded: %d", stats.NumAdded) + } + + // Two failures are expected: + // + // * Operation #2: document can't be created, because a document with the same ID already exists. + // * Operation #3: document can't be deleted, because it doesn't exist. + + if stats.NumFailed != uint64(numFailed) { + t.Errorf("Unexpected NumFailed: %d", stats.NumFailed) + } + + if stats.NumFlushed != 2 { + t.Errorf("Unexpected NumFailed: %d", stats.NumFailed) + } + + if stats.NumIndexed != 1 { + t.Errorf("Unexpected NumIndexed: %d", stats.NumIndexed) + } + + if stats.NumUpdated != 1 { + t.Errorf("Unexpected NumUpdated: %d", stats.NumUpdated) + } + + if countSuccessful != uint64(numItems-numFailed) { + t.Errorf("Unexpected countSuccessful: %d", countSuccessful) + } + + if countFailed != uint64(numFailed) { + t.Errorf("Unexpected countFailed: %d", countFailed) + } + + if !reflect.DeepEqual(failedIDs, []string{"1", "2"}) { + t.Errorf("Unexpected failedIDs: %#v", failedIDs) + } + }) + + t.Run("OnFlush callbacks", func(t *testing.T) { + type contextKey string + es, _ := elasticsearch.NewClient(elasticsearch.Config{Transport: &mockTransport{}}) + bi, _ := NewBulkIndexer(BulkIndexerConfig{ + Client: es, + Index: "foo", + OnFlushStart: func(ctx context.Context) context.Context { + fmt.Println(">>> Flush started") + return context.WithValue(ctx, contextKey("start"), time.Now().UTC()) + }, + OnFlushEnd: func(ctx context.Context) { + var duration time.Duration + if v := ctx.Value("start"); v != nil { + duration = time.Since(v.(time.Time)) + } + fmt.Printf(">>> Flush finished (duration: %s)\n", duration) + }, + }) + + err := bi.Add(context.Background(), BulkIndexerItem{ + Action: "index", + Body: strings.NewReader(`{"title":"foo"}`), + }) + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if err := bi.Close(context.Background()); err != nil { + t.Errorf("Unexpected error: %s", err) + } + + stats := bi.Stats() + + if stats.NumAdded != uint64(1) { + t.Errorf("Unexpected NumAdded: %d", stats.NumAdded) + } + }) + + t.Run("Automatic flush", func(t *testing.T) { + es, _ := elasticsearch.NewClient(elasticsearch.Config{Transport: &mockTransport{ + RoundTripFunc: func(*http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: http.StatusOK, + Status: "200 OK", + Body: ioutil.NopCloser(strings.NewReader(`{"items":[{"index": {}}]}`))}, nil + }, + }}) + + cfg := BulkIndexerConfig{ + NumWorkers: 1, + Client: es, + FlushInterval: 100 * time.Millisecond, // Decrease the flush timeout + } + if os.Getenv("DEBUG") != "" { + cfg.DebugLogger = log.New(os.Stdout, "", 0) + } + + bi, _ := NewBulkIndexer(cfg) + + bi.Add(context.Background(), + BulkIndexerItem{Action: "index", Body: strings.NewReader(`{"title":"foo"}`)}) + + // Allow some time for auto-flush to kick in + time.Sleep(150 * time.Millisecond) + + stats := bi.Stats() + expected := uint64(1) + + if stats.NumAdded != expected { + t.Errorf("Unexpected NumAdded: want=%d, got=%d", expected, stats.NumAdded) + } + + if stats.NumFailed != 0 { + t.Errorf("Unexpected NumFailed: want=%d, got=%d", 0, stats.NumFlushed) + } + + if stats.NumFlushed != expected { + t.Errorf("Unexpected NumFlushed: want=%d, got=%d", expected, stats.NumFlushed) + } + + if stats.NumIndexed != expected { + t.Errorf("Unexpected NumIndexed: want=%d, got=%d", expected, stats.NumIndexed) + } + + // Wait some time before closing the indexer to clear the timer + time.Sleep(200 * time.Millisecond) + bi.Close(context.Background()) + }) + + t.Run("TooManyRequests", func(t *testing.T) { + var ( + wg sync.WaitGroup + + countReqs int + numItems = 2 + ) + + esCfg := elasticsearch.Config{ + Transport: &mockTransport{ + RoundTripFunc: func(*http.Request) (*http.Response, error) { + countReqs++ + if countReqs <= 4 { + return &http.Response{ + StatusCode: http.StatusTooManyRequests, + Status: "429 TooManyRequests", + Body: ioutil.NopCloser(strings.NewReader(`{"took":1}`))}, nil + } + bodyContent, _ := ioutil.ReadFile("testdata/bulk_response_1c.json") + return &http.Response{ + StatusCode: http.StatusOK, + Status: "200 OK", + Body: ioutil.NopCloser(bytes.NewBuffer(bodyContent)), + }, nil + }, + }, + + MaxRetries: 5, + RetryOnStatus: []int{502, 503, 504, 429}, + RetryBackoff: func(i int) time.Duration { + if os.Getenv("DEBUG") != "" { + fmt.Printf("*** Retry #%d\n", i) + } + return time.Duration(i) * 100 * time.Millisecond + }, + } + if os.Getenv("DEBUG") != "" { + esCfg.Logger = &estransport.ColorLogger{Output: os.Stdout} + } + es, _ := elasticsearch.NewClient(esCfg) + + biCfg := BulkIndexerConfig{NumWorkers: 1, FlushBytes: 50, Client: es} + if os.Getenv("DEBUG") != "" { + biCfg.DebugLogger = log.New(os.Stdout, "", 0) + } + + bi, _ := NewBulkIndexer(biCfg) + + for i := 1; i <= numItems; i++ { + wg.Add(1) + go func(i int) { + defer wg.Done() + err := bi.Add(context.Background(), BulkIndexerItem{ + Action: "foo", + Body: strings.NewReader(`{"title":"foo"}`), + }) + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + }(i) + } + wg.Wait() + + if err := bi.Close(context.Background()); err != nil { + t.Errorf("Unexpected error: %s", err) + } + + stats := bi.Stats() + + if stats.NumAdded != uint64(numItems) { + t.Errorf("Unexpected NumAdded: want=%d, got=%d", numItems, stats.NumAdded) + } + + if stats.NumFlushed != uint64(numItems) { + t.Errorf("Unexpected NumFlushed: want=%d, got=%d", numItems, stats.NumFlushed) + } + + if stats.NumFailed != 0 { + t.Errorf("Unexpected NumFailed: want=%d, got=%d", 0, stats.NumFailed) + } + + // Stats don't include the retries in client + if stats.NumRequests != 1 { + t.Errorf("Unexpected NumRequests: want=%d, got=%d", 3, stats.NumRequests) + } + }) + + t.Run("Custom JSON Decoder", func(t *testing.T) { + es, _ := elasticsearch.NewClient(elasticsearch.Config{Transport: &mockTransport{}}) + bi, _ := NewBulkIndexer(BulkIndexerConfig{Client: es, Decoder: customJSONDecoder{}}) + + err := bi.Add(context.Background(), BulkIndexerItem{ + Action: "index", + DocumentID: "1", + Body: strings.NewReader(`{"title":"foo"}`), + }) + if err != nil { + t.Fatalf("Unexpected error: %s", err) + } + + if err := bi.Close(context.Background()); err != nil { + t.Errorf("Unexpected error: %s", err) + } + + stats := bi.Stats() + + if stats.NumAdded != uint64(1) { + t.Errorf("Unexpected NumAdded: %d", stats.NumAdded) + } + }) +} + +type customJSONDecoder struct{} + +func (d customJSONDecoder) UnmarshalFromReader(r io.Reader, blk *BulkIndexerResponse) error { + return json.NewDecoder(r).Decode(blk) +} diff --git a/esutil/testdata/bulk_response_1a.json b/esutil/testdata/bulk_response_1a.json new file mode 100644 index 0000000000..972a23add7 --- /dev/null +++ b/esutil/testdata/bulk_response_1a.json @@ -0,0 +1,36 @@ +{ + "took": 30, + "errors": true, + "items": [ + { + "index": { + "_index": "test", + "_id": "1", + "_version": 1, + "result": "created", + "_shards": { + "total": 1, + "successful": 1, + "failed": 0 + }, + "_seq_no": 0, + "_primary_term": 1, + "status": 201 + } + }, + { + "create": { + "_index": "test", + "_id": "2", + "status": 409, + "error": { + "type": "version_conflict_engine_exception", + "reason": "[1]: version conflict, document already exists (current version [1])", + "index_uuid": "eZMQ7DUzT56RLaQcAjOlxg", + "index": "test-bulk-integration", + "shard": "0" + } + } + } + ] +} diff --git a/esutil/testdata/bulk_response_1b.json b/esutil/testdata/bulk_response_1b.json new file mode 100644 index 0000000000..3ffdffdcff --- /dev/null +++ b/esutil/testdata/bulk_response_1b.json @@ -0,0 +1,38 @@ +{ + "took": 30, + "errors": false, + "items": [ + { + "create": { + "_index": "test", + "_id": "3", + "_version": 1, + "result": "created", + "status": 201, + "_shards": { + "total": 1, + "successful": 1, + "failed": 0 + }, + "_seq_no": 1, + "_primary_term": 2 + } + }, + { + "delete": { + "_index": "test", + "_id": "4", + "_version": 1, + "result": "not_found", + "_shards": { + "total": 1, + "successful": 1, + "failed": 0 + }, + "_seq_no": 0, + "_primary_term": 1, + "status": 404 + } + } + ] +} diff --git a/esutil/testdata/bulk_response_1c.json b/esutil/testdata/bulk_response_1c.json new file mode 100644 index 0000000000..39090d9e5e --- /dev/null +++ b/esutil/testdata/bulk_response_1c.json @@ -0,0 +1,38 @@ +{ + "took": 30, + "errors": false, + "items": [ + { + "delete": { + "_index": "test", + "_id": "5", + "_version": 2, + "result": "deleted", + "status": 200, + "_shards": { + "total": 1, + "successful": 1, + "failed": 0 + }, + "_seq_no": 0, + "_primary_term": 1 + } + }, + { + "update": { + "_index": "test", + "_id": "6", + "_version": 2, + "result": "updated", + "_shards": { + "total": 1, + "successful": 1, + "failed": 0 + }, + "_seq_no": 0, + "_primary_term": 1, + "status": 200 + } + } + ] +} diff --git a/esutil/testdata/bulk_response_2.json b/esutil/testdata/bulk_response_2.json new file mode 100644 index 0000000000..608375813b --- /dev/null +++ b/esutil/testdata/bulk_response_2.json @@ -0,0 +1,56 @@ +{ + "took": 30, + "errors": true, + "items": [ + { + "index": { + "_index": "test", + "_id": "1", + "_version": 1, + "result": "created", + "_shards": { "total": 1, "successful": 1, "failed": 0 }, + "_seq_no": 0, + "_primary_term": 1, + "status": 201 + } + }, + { + "create": { + "_index": "test", + "_id": "1", + "status": 409, + "error": { + "type": "version_conflict_engine_exception", + "reason": "[1]: version conflict, document already exists (current version [1])", + "index_uuid": "eZMQ7DUzT56RLaQcAjOlxg", + "index": "test-bulk-integration", + "shard": "0" + } + } + }, + { + "delete": { + "_index": "test", + "_id": "2", + "_version": 1, + "result": "not_found", + "_shards": { "total": 1, "successful": 1, "failed": 0 }, + "_seq_no": 3, + "_primary_term": 1, + "status": 404 + } + }, + { + "update": { + "_index": "test", + "_id": "3", + "_version": 2, + "result": "updated", + "_shards": { "total": 1, "successful": 1, "failed": 0 }, + "_seq_no": 4, + "_primary_term": 1, + "status": 200 + } + } + ] +} From 073c94e53e8fba991aa6286c1a6e1f5e049e1790 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 11 Mar 2020 07:48:23 +0100 Subject: [PATCH 173/355] Examples: Add example and benchmarks for the BulkIndexer helper This patch adds an example for using the BulkIndexer helper into _examples/bulk/default.go, as well as end-to-end benchmarks into _examples/bulk/benchmarks. Related #137 (cherry picked from commit aae4e81ff15a0cb0da6d36b81b3cb51783a26c7b) --- _examples/bulk/.gitignore | 2 + _examples/bulk/Makefile | 21 +- _examples/bulk/README.md | 50 +- _examples/bulk/benchmarks/README.md | 124 ++ _examples/bulk/benchmarks/benchmarks.go | 239 +++ .../benchmarks/data/httplog/document.json | 115 ++ .../bulk/benchmarks/data/httplog/mapping.json | 1275 +++++++++++++++++ .../bulk/benchmarks/data/small/document.json | 10 + .../bulk/benchmarks/data/small/mapping.json | 15 + _examples/bulk/benchmarks/etc/nginx.conf | 42 + _examples/bulk/benchmarks/go.mod | 13 + _examples/bulk/benchmarks/model/model.go | 21 + _examples/bulk/benchmarks/runner/runner.go | 252 ++++ _examples/bulk/{bulk.go => default.go} | 31 +- _examples/bulk/go.mod | 11 + _examples/bulk/indexer.go | 251 ++++ 16 files changed, 2447 insertions(+), 25 deletions(-) create mode 100644 _examples/bulk/.gitignore create mode 100644 _examples/bulk/benchmarks/README.md create mode 100644 _examples/bulk/benchmarks/benchmarks.go create mode 100644 _examples/bulk/benchmarks/data/httplog/document.json create mode 100644 _examples/bulk/benchmarks/data/httplog/mapping.json create mode 100644 _examples/bulk/benchmarks/data/small/document.json create mode 100644 _examples/bulk/benchmarks/data/small/mapping.json create mode 100644 _examples/bulk/benchmarks/etc/nginx.conf create mode 100644 _examples/bulk/benchmarks/go.mod create mode 100644 _examples/bulk/benchmarks/model/model.go create mode 100644 _examples/bulk/benchmarks/runner/runner.go rename _examples/bulk/{bulk.go => default.go} (88%) create mode 100644 _examples/bulk/go.mod create mode 100644 _examples/bulk/indexer.go diff --git a/_examples/bulk/.gitignore b/_examples/bulk/.gitignore new file mode 100644 index 0000000000..1d9ba24cdd --- /dev/null +++ b/_examples/bulk/.gitignore @@ -0,0 +1,2 @@ +go.sum +*_easyjson.go diff --git a/_examples/bulk/Makefile b/_examples/bulk/Makefile index e30aeade76..87ab9847e8 100644 --- a/_examples/bulk/Makefile +++ b/_examples/bulk/Makefile @@ -1,6 +1,21 @@ GO_TEST_CMD = $(if $(shell which richgo),richgo test,go test) -test: ## Run tests - go run bulk.go +test: test-default test-indexer -.PHONY: test +test-default: + go run default.go + +test-indexer: + go run indexer.go + +test-benchmarks: clean setup + cd benchmarks && go run benchmarks.go + +setup: + @go get -u github.com/mailru/easyjson/... + cd benchmarks && go generate ./model + +clean: + @rm -f benchmarks/model/*_easyjson.go + +.PHONY: test test-default test-indexer test-benchmarks setup clean diff --git a/_examples/bulk/README.md b/_examples/bulk/README.md index 59d4e299a2..1b6305b3a6 100644 --- a/_examples/bulk/README.md +++ b/_examples/bulk/README.md @@ -1,8 +1,8 @@ # Example: Bulk Indexing -## `bulk.go` +## `default.go` -The [`bulk.go`](bulk.go) example demonstrates how to properly operate the Elasticsearch's +The [`default.go`](default.go) example demonstrates how to properly operate the Elasticsearch's [Bulk API]([https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html]). The example intentionally doesn't use any abstractions or helper functions, to @@ -17,13 +17,41 @@ demonstrate the low-level mechanics of working with the Bulk API: * printing a report. ```bash -go run bulk.go -count=100000 -batch=25000 - -# > Generated 100000 articles -# > Batch 1 of 4 -# > Batch 2 of 4 -# > Batch 3 of 4 -# > Batch 4 of 4 -# ================================================================================ -# Sucessfuly indexed [100000] documents in 8.02s (12469 docs/sec) +go run default.go -count=100000 -batch=25000 + +# Bulk: documents [100,000] batch size [25,000] +# ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ +# → Generated 100,000 articles +# → Sending batch [1/4] [2/4] [3/4] [4/4] +# ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +# Sucessfuly indexed [100,000] documents in 3.423s (29,214 docs/sec) ``` + +## `indexer.go` + +The [`indexer.go`](indexer.go) example demonstrates how to use the [`esutil.BulkIndexer`](../esutil/bulk_indexer.go) helper for efficient indexing in parallel. + +```bash +go run indexer.go -count=100000 -flush=1000000 + +# BulkIndexer: documents [100,000] workers [8] flush [1.0 MB] +# ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ +# → Generated 100,000 articles +# ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +# Sucessfuly indexed [100,000] documents in 1.909s (52,383 docs/sec) +``` + +The helper allows you to `Add()` bulk indexer items, and flushes each batch based on the configured threshold. + +```golang +indexer, _ := esutil.NewBulkIndexer(esutil.BulkIndexerConfig{}) +indexer.Add( + context.Background(), + esutil.BulkIndexerItem{ + Action: "index", + Body: strings.NewReader(`{"title":"Test"}`), + }) +indexer.Close(context.Background()) +``` + +Please refer to the [`benchmarks`](benchmarks) folder for performance tests with different types of payload. diff --git a/_examples/bulk/benchmarks/README.md b/_examples/bulk/benchmarks/README.md new file mode 100644 index 0000000000..7b3c67824b --- /dev/null +++ b/_examples/bulk/benchmarks/README.md @@ -0,0 +1,124 @@ +# Bulk Indexer Benchmarks + +The [`benchmarks.go`](benchmarks.go) file executes end-to-end benchmarks for `esutil.NewBulkIndexer`. It allows to configure indexer parameters, index settings, number of runs. See `go run benchmarks.go --help` for an overview of configuration options: + +``` +go run benchmarks.go --help + -count int + Number of documents to generate (default 100000) + -dataset string + Dataset to use for indexing (default "small") + -debug + Enable logging output + -easyjson + Use mailru/easyjson for JSON decoding + -fasthttp + Use valyala/fasthttp for HTTP transport + -flush value + Flush threshold in bytes (default 3MB) + -index string + Index name (default "test-bulk-benchmarks") + -mockserver + Measure added, not flushed items + -replicas int + Number of index replicas (default 0) + -runs int + Number of runs (default 10) + -shards int + Number of index shards (default 3) + -wait duration + Wait duration between runs (default 1s) + -warmup int + Number of warmup runs (default 3) + -workers int + Number of indexer workers (default 4) +``` + +Before running the benchmarks, install `easyjson` and generate the auxiliary files: + +``` +go mod download +go get -u github.com/mailru/easyjson/... +grep '~/go/bin' ~/.profile || echo 'export PATH=$PATH:~/go/bin' >> ~/.profile && source ~/.profile +go generate -v ./model +``` + +## Small Document + +The [`small`](data/small/document.json) dataset uses a small document (126B). + +``` +ELASTICSEARCH_URL=http://server:9200 go run benchmarks.go --dataset=small --count=1_000_000 --flush=2MB --shards=5 --replicas=0 --fasthttp=true --easyjson=true +small: run [10x] warmup [3x] shards [5] replicas [0] workers [8] flush [2.0 MB] wait [1s] fasthttp easyjson +▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + 1) add=1M flush=1M fail=0 reqs=52 dur=3.58s 279,173 docs/sec + 2) add=1M flush=1M fail=0 reqs=52 dur=3.52s 284,090 docs/sec + 3) add=1M flush=1M fail=0 reqs=52 dur=3.45s 289,351 docs/sec + 4) add=1M flush=1M fail=0 reqs=52 dur=3.49s 286,123 docs/sec + 5) add=1M flush=1M fail=0 reqs=52 dur=3.47s 287,852 docs/sec + 6) add=1M flush=1M fail=0 reqs=52 dur=3.47s 288,184 docs/sec + 7) add=1M flush=1M fail=0 reqs=52 dur=3.54s 282,246 docs/sec + 8) add=1M flush=1M fail=0 reqs=52 dur=3.47s 288,101 docs/sec + 9) add=1M flush=1M fail=0 reqs=52 dur=3.54s 282,485 docs/sec + 10) add=1M flush=1M fail=0 reqs=52 dur=3.46s 288,350 docs/sec +▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +docs/sec: min [279,173] max [289,351] mean [286,987] +``` + +## HTTP Log Event + +The [`httplog`](data/httplog/document.json) dataset uses a bigger document (2.5K), corresponding to a log event gathered by [Filebeat](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-nginx.html) from Nginx. + +``` +ELASTICSEARCH_URL=http://server:9200 go run benchmarks.go --dataset=httplog --count=1_000_000 --flush=3MB --shards=5 --replicas=0 --fasthttp=true --easyjson=true +httplog: run [10x] warmup [3x] shards [5] replicas [0] workers [8] flush [3.0 MB] wait [1s] fasthttp easyjson +▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + 1) add=1M flush=1M fail=0 reqs=649 dur=19.93s 50,165 docs/sec + 2) add=1M flush=1M fail=0 reqs=649 dur=18.84s 53,072 docs/sec + 3) add=1M flush=1M fail=0 reqs=649 dur=19.13s 52,249 docs/sec + 4) add=1M flush=1M fail=0 reqs=649 dur=19.26s 51,912 docs/sec + 5) add=1M flush=1M fail=0 reqs=649 dur=18.98s 52,662 docs/sec + 6) add=1M flush=1M fail=0 reqs=649 dur=19.21s 52,056 docs/sec + 7) add=1M flush=1M fail=0 reqs=649 dur=18.91s 52,865 docs/sec + 8) add=1M flush=1M fail=0 reqs=649 dur=19.25s 51,934 docs/sec + 9) add=1M flush=1M fail=0 reqs=649 dur=19.44s 51,440 docs/sec + 10) add=1M flush=1M fail=0 reqs=649 dur=19.24s 51,966 docs/sec +▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +docs/sec: min [50,165] max [53,072] mean [52,011] +``` + +## Mock Server + +The `--mockserver` flag allows to run the benchmark against a "mock server", in this case Nginx, to understand a theoretical performance of the client, without the overhead of a real Elasticsearch cluster. + +``` +ELASTICSEARCH_URL=http://server:8000 go run benchmarks.go --dataset=small --count=1_000_000 --flush=2MB --warmup=0 --mockserver +small: run [10x] warmup [0x] shards [3] replicas [0] workers [8] flush [2.0 MB] wait [1s] +▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + 1) add=1M flush=0 fail=0 reqs=56 dur=810ms 1,222,493 docs/sec + 2) add=1M flush=0 fail=0 reqs=56 dur=810ms 1,230,012 docs/sec + 3) add=1M flush=0 fail=0 reqs=56 dur=790ms 1,251,564 docs/sec + 4) add=1M flush=0 fail=0 reqs=56 dur=840ms 1,187,648 docs/sec + 5) add=1M flush=0 fail=0 reqs=56 dur=800ms 1,237,623 docs/sec + 6) add=1M flush=0 fail=0 reqs=56 dur=800ms 1,237,623 docs/sec + 7) add=1M flush=0 fail=0 reqs=56 dur=800ms 1,240,694 docs/sec + 8) add=1M flush=0 fail=0 reqs=56 dur=820ms 1,216,545 docs/sec + 9) add=1M flush=0 fail=0 reqs=56 dur=790ms 1,253,132 docs/sec + 10) add=1M flush=0 fail=0 reqs=56 dur=810ms 1,223,990 docs/sec +▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +docs/sec: min [1,187,648] max [1,253,132] mean [1,233,818] +``` + +## Environment + +Please note that these results are only illustrative, and the real performance depends on many factors: +the size and structure of your data, the index settings and mappings, the cluster setup or the hardware specification. + +The benchmarks have been run in the following environment: + +* OS: Ubuntu 18.04.4 LTS (5.0.0-1031-gcp) +* Client: A `n2-standard-8` [GCP instance](https://cloud.google.com/compute/docs/machine-types#n2_machine_types) (8 vCPUs/32GB RAM) +* Server: A `n2-standard-16` [GCP instance](https://cloud.google.com/compute/docs/machine-types#n2_machine_types) (16 vCPUs/64GB RAM) +* Disk: A [local SSD](https://cloud.google.com/compute/docs/disks#localssds) formatted as `ext4` on NVMe interface for Elasticsearch data +* A single-node Elasticsearch cluster, `7.6.0`, [default distribution](https://www.elastic.co/downloads/elasticsearch), installed from a TAR, with 4GB locked for heap +* Nginx 1.17.8 with [`nginx.conf`](etc/nginx.conf) diff --git a/_examples/bulk/benchmarks/benchmarks.go b/_examples/bulk/benchmarks/benchmarks.go new file mode 100644 index 0000000000..14f0352179 --- /dev/null +++ b/_examples/bulk/benchmarks/benchmarks.go @@ -0,0 +1,239 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build ignore + +// This example demonstrates indexing documents using the esutil.BulkIndexer helper. +// +// You can configure the settings with command line flags: +// +// go run benchmark.go --dataset=httplog --runs=15 --count=1_000_000 --shards=5 --replicas=1 --flush=1MB + +package main + +import ( + "flag" + "io" + "io/ioutil" + "log" + "net/http" + "os" + "os/signal" + "runtime" + "strings" + "time" + + "github.com/dustin/go-humanize" + "github.com/mailru/easyjson" + "github.com/valyala/fasthttp" + + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/estransport" + "github.com/elastic/go-elasticsearch/v7/esutil" + + "github.com/elastic/go-elasticsearch/v7/_examples/bulk/benchmarks/model" + "github.com/elastic/go-elasticsearch/v7/_examples/bulk/benchmarks/runner" +) + +type humanBytes uint64 + +func (b *humanBytes) String() string { return humanize.Bytes(uint64(*b)) } +func (b *humanBytes) Set(v string) error { + n, err := humanize.ParseBytes(v) + *b = humanBytes(n) + return err +} + +var ( + indexName string + datasetName string + numWorkers int + flushBytes humanBytes + numRuns int + numWarmupRuns int + numItems int + numShards int + numReplicas int + wait time.Duration + useFasthttp bool + useEasyjson bool + mockserver bool + debug bool +) + +func init() { + flag.StringVar(&indexName, "index", "test-bulk-benchmarks", "Index name") + flag.StringVar(&datasetName, "dataset", "small", "Dataset to use for indexing") + flag.IntVar(&numWorkers, "workers", runtime.NumCPU(), "Number of indexer workers") + flag.Var(&flushBytes, "flush", "Flush threshold in bytes (default 3MB)") + flag.IntVar(&numRuns, "runs", 10, "Number of runs") + flag.IntVar(&numWarmupRuns, "warmup", 3, "Number of warmup runs") + flag.IntVar(&numItems, "count", 100000, "Number of documents to generate") + flag.IntVar(&numShards, "shards", 3, "Number of index shards") + flag.IntVar(&numReplicas, "replicas", 0, "Number of index replicas (default 0)") + flag.DurationVar(&wait, "wait", time.Second, "Wait duration between runs") + flag.BoolVar(&useFasthttp, "fasthttp", false, "Use valyala/fasthttp for HTTP transport") + flag.BoolVar(&useEasyjson, "easyjson", false, "Use mailru/easyjson for JSON decoding") + flag.BoolVar(&mockserver, "mockserver", false, "Measure added, not flushed items") + flag.BoolVar(&debug, "debug", false, "Enable logging output") + flag.Parse() +} + +func main() { + log.SetFlags(0) + + indexName = indexName + "-" + datasetName + if flushBytes < 1 { + flushBytes = humanBytes(3e+6) + } + + clientCfg := elasticsearch.Config{} + + if useFasthttp { + clientCfg.Transport = &fasthttpTransport{} + } + + if debug { + clientCfg.Logger = &estransport.ColorLogger{Output: os.Stdout, EnableRequestBody: true, EnableResponseBody: true} + } + + es, _ := elasticsearch.NewClient(clientCfg) + + runnerCfg := runner.Config{ + Client: es, + + IndexName: indexName, + DatasetName: datasetName, + NumShards: numShards, + NumReplicas: numReplicas, + NumItems: numItems, + NumRuns: numRuns, + NumWarmupRuns: numWarmupRuns, + NumWorkers: numWorkers, + FlushBytes: int(flushBytes), + Wait: wait, + Mockserver: mockserver, + } + + if useEasyjson { + runnerCfg.Decoder = easyjsonDecoder{} + } + + runner, err := runner.NewRunner(runnerCfg) + if err != nil { + log.Fatalf("Error creating runner: %s", err) + } + + done := make(chan os.Signal) + signal.Notify(done, os.Interrupt) + + go func() { <-done; log.Println("\r" + strings.Repeat("▁", 110)); runner.Report(); os.Exit(0) }() + defer func() { log.Println(strings.Repeat("▁", 110)); runner.Report() }() + + log.Printf( + "%s: run [%sx] warmup [%dx] shards [%d] replicas [%d] workers [%d] flush [%s] wait [%s]%s%s", + datasetName, + humanize.Comma(int64(numRuns)), + numWarmupRuns, + numShards, + numReplicas, + numWorkers, + humanize.Bytes(uint64(flushBytes)), + wait, + func() string { + if useFasthttp { + return " fasthttp" + } + return "" + }(), + func() string { + if useEasyjson { + return " easyjson" + } + return "" + }()) + log.Println(strings.Repeat("▔", 110)) + + runner.Run() +} + +// easyjsonDecoder implements a JSON decoder for the indexer +// via the "github.com/mailru/easyjson" package. +// See _examples/encoding for a demo. + +type easyjsonDecoder struct{} + +func (d easyjsonDecoder) UnmarshalFromReader(r io.Reader, blk *esutil.BulkIndexerResponse) error { + var v model.BulkIndexerResponse + if err := easyjson.UnmarshalFromReader(r, &v); err != nil { + return err + } + blk.Took = v.Took + blk.HasErrors = v.HasErrors + blk.Items = v.Items + + return nil +} + +// fasthttpTransport implements HTTP transport for the Elasticsearch client +// via the "github.com/valyala/fasthttp" package. +// See _examples/fasthttp for a demo. + +type fasthttpTransport struct{} + +func (t *fasthttpTransport) RoundTrip(req *http.Request) (*http.Response, error) { + freq := fasthttp.AcquireRequest() + defer fasthttp.ReleaseRequest(freq) + + fres := fasthttp.AcquireResponse() + defer fasthttp.ReleaseResponse(fres) + + t.copyRequest(freq, req) + + err := fasthttp.Do(freq, fres) + if err != nil { + return nil, err + } + + res := &http.Response{Header: make(http.Header)} + t.copyResponse(res, fres) + + return res, nil +} + +func (t *fasthttpTransport) copyRequest(dst *fasthttp.Request, src *http.Request) *fasthttp.Request { + if src.Method == "GET" && src.Body != nil { + src.Method = "POST" + } + + dst.SetHost(src.Host) + dst.SetRequestURI(src.URL.String()) + + dst.Header.SetRequestURI(src.URL.String()) + dst.Header.SetMethod(src.Method) + + for k, vv := range src.Header { + for _, v := range vv { + dst.Header.Set(k, v) + } + } + + if src.Body != nil { + dst.SetBodyStream(src.Body, -1) + } + + return dst +} + +func (t *fasthttpTransport) copyResponse(dst *http.Response, src *fasthttp.Response) *http.Response { + dst.StatusCode = src.StatusCode() + + src.Header.VisitAll(func(k, v []byte) { + dst.Header.Set(string(k), string(v)) + }) + + dst.Body = ioutil.NopCloser(strings.NewReader(string(src.Body()))) + + return dst +} diff --git a/_examples/bulk/benchmarks/data/httplog/document.json b/_examples/bulk/benchmarks/data/httplog/document.json new file mode 100644 index 0000000000..3032bbc681 --- /dev/null +++ b/_examples/bulk/benchmarks/data/httplog/document.json @@ -0,0 +1,115 @@ +{ + "container": { + "image": { + "name": "nginx:alpine" + }, + "name": "demo_nginx_1", + "id": "containers" + }, + "agent": { + "hostname": "ac2f80ca6f2c", + "id": "e7db09cf-efab-4669-b7d1-bc61af5e2dc9", + "type": "filebeat", + "ephemeral_id": "3bcf621a-b3be-4c33-bf05-e8e5fb9b07af", + "version": "7.5.1" + }, + "log": { + "file": { + "path": "/hostfs/var/lib/docker/containers/dfadbc398fd75cd055a3d9e2ca9b30463c996e56751c962fb17c55c6ceec754c/dfadbc398fd75cd055a3d9e2ca9b30463c996e56751c962fb17c55c6ceec754c-json.log" + }, + "offset": 8095 + }, + "source": { + "address": "172.23.0.1", + "ip": "172.23.0.1" + }, + "docker": { + "container": { + "labels": { + "com_docker_compose_config-hash": "725e1f526ff27e977aec78f5451b9914a91ea1d6764d9387030e270ad9ac5866", + "com_docker_compose_oneoff": "False", + "com_docker_compose_project": "demo", + "com_docker_compose_project_config_files": "docker-compose.yml", + "com_docker_compose_service": "nginx", + "com_docker_compose_container-number": "1", + "com_docker_compose_version": "1.25.4", + "com_docker_compose_project_working_dir": "/.../elastic-stack-demo", + "maintainer": "NGINX Docker Maintainers " + } + } + }, + "ecs": { + "version": "1.1.0" + }, + "stream": "stdout", + "host": { + "hostname": "ac2f80ca6f2c", + "os": { + "kernel": "4.19.76-linuxkit", + "codename": "Core", + "name": "CentOS Linux", + "family": "redhat", + "version": "7 (Core)", + "platform": "centos" + }, + "containerized": true, + "name": "ac2f80ca6f2c", + "architecture": "x86_64" + }, + "event": { + "timezone": "+00:00", + "created": "2020-02-20T08:59:42.312Z", + "module": "nginx", + "dataset": "nginx.access" + }, + "user_agent": { + "original": "curl/7.64.0", + "name": "curl", + "device": { + "name": "Other" + }, + "version": "7.64.0" + }, + "nginx": { + "access": { + "remote_ip_list": [ + "172.23.0.1" + ] + } + }, + "fileset": { + "name": "access" + }, + "url": { + "original": "/" + }, + "tags": [ + "service-A" + ], + "input": { + "type": "container" + }, + "@timestamp": "2020-02-20T08:59:42.000Z", + "service": { + "type": "nginx" + }, + "http": { + "request": { + "referrer": "-", + "method": "GET" + }, + "response": { + "status_code": 200, + "body": { + "bytes": 43 + } + }, + "version": "1.1" + }, + "fields": { + "environment": "staging" + }, + "user": { + "name": "-" + } +} diff --git a/_examples/bulk/benchmarks/data/httplog/mapping.json b/_examples/bulk/benchmarks/data/httplog/mapping.json new file mode 100644 index 0000000000..f85118fbe4 --- /dev/null +++ b/_examples/bulk/benchmarks/data/httplog/mapping.json @@ -0,0 +1,1275 @@ +{ + "mappings": { + "_meta": { + "version": "8-SNAPSHOT" + }, + + "dynamic_templates": [ + { + "labels": { + "path_match": "labels.*", + "match_mapping_type": "string", + "mapping": { + "type": "keyword" + } + } + }, + { + "container.labels": { + "path_match": "container.labels.*", + "match_mapping_type": "string", + "mapping": { + "type": "keyword" + } + } + }, + { + "fields": { + "path_match": "fields.*", + "match_mapping_type": "string", + "mapping": { + "type": "keyword" + } + } + }, + { + "docker.container.labels": { + "path_match": "docker.container.labels.*", + "match_mapping_type": "string", + "mapping": { + "type": "keyword" + } + } + }, + { + "docker.attrs": { + "path_match": "docker.attrs.*", + "match_mapping_type": "string", + "mapping": { + "type": "keyword" + } + } + }, + { + "strings_as_keyword": { + "match_mapping_type": "string", + "mapping": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + ], + + "date_detection": false, + + "properties": { + "@timestamp": { + "type": "date" + }, + "agent": { + "properties": { + "ephemeral_id": { + "type": "keyword", + "ignore_above": 1024 + }, + "hostname": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + }, + "type": { + "type": "keyword", + "ignore_above": 1024 + }, + "version": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "container": { + "properties": { + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "image": { + "properties": { + "name": { + "type": "keyword", + "ignore_above": 1024 + }, + "tag": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "labels": { + "type": "object" + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + }, + "runtime": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "docker": { + "properties": { + "attrs": { + "type": "object" + }, + "container": { + "properties": { + "labels": { + "properties": { + "com_docker_compose_config-hash": { + "type": "keyword" + }, + "com_docker_compose_container-number": { + "type": "keyword" + }, + "com_docker_compose_oneoff": { + "type": "keyword" + }, + "com_docker_compose_project": { + "type": "keyword" + }, + "com_docker_compose_project_config_files": { + "type": "keyword" + }, + "com_docker_compose_project_working_dir": { + "type": "keyword" + }, + "com_docker_compose_service": { + "type": "keyword" + }, + "com_docker_compose_version": { + "type": "keyword" + }, + "org_label-schema_build-date": { + "type": "keyword" + }, + "org_label-schema_license": { + "type": "keyword" + }, + "org_label-schema_name": { + "type": "keyword" + }, + "org_label-schema_schema-version": { + "type": "keyword" + }, + "org_label-schema_url": { + "type": "keyword" + }, + "org_label-schema_usage": { + "type": "keyword" + }, + "org_label-schema_vcs-ref": { + "type": "keyword" + }, + "org_label-schema_vcs-url": { + "type": "keyword" + }, + "org_label-schema_vendor": { + "type": "keyword" + }, + "org_label-schema_version": { + "type": "keyword" + }, + "org_opencontainers_image_created": { + "type": "keyword" + }, + "org_opencontainers_image_documentation": { + "type": "keyword" + }, + "org_opencontainers_image_licenses": { + "type": "keyword" + }, + "org_opencontainers_image_revision": { + "type": "keyword" + }, + "org_opencontainers_image_source": { + "type": "keyword" + }, + "org_opencontainers_image_title": { + "type": "keyword" + }, + "org_opencontainers_image_url": { + "type": "keyword" + }, + "org_opencontainers_image_vendor": { + "type": "keyword" + }, + "org_opencontainers_image_version": { + "type": "keyword" + } + } + } + } + } + } + }, + "ecs": { + "properties": { + "version": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "error": { + "properties": { + "code": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "message": { + "type": "text", + "norms": false + }, + "stack_trace": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "type": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "event": { + "properties": { + "action": { + "type": "keyword", + "ignore_above": 1024 + }, + "category": { + "type": "keyword", + "ignore_above": 1024 + }, + "code": { + "type": "keyword", + "ignore_above": 1024 + }, + "created": { + "type": "date" + }, + "dataset": { + "type": "keyword", + "ignore_above": 1024 + }, + "duration": { + "type": "long" + }, + "end": { + "type": "date" + }, + "hash": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "ingested": { + "type": "date" + }, + "kind": { + "type": "keyword", + "ignore_above": 1024 + }, + "module": { + "type": "keyword", + "ignore_above": 1024 + }, + "original": { + "type": "keyword", + "ignore_above": 1024 + }, + "outcome": { + "type": "keyword", + "ignore_above": 1024 + }, + "provider": { + "type": "keyword", + "ignore_above": 1024 + }, + "risk_score": { + "type": "float" + }, + "risk_score_norm": { + "type": "float" + }, + "sequence": { + "type": "long" + }, + "severity": { + "type": "long" + }, + "start": { + "type": "date" + }, + "timezone": { + "type": "keyword", + "ignore_above": 1024 + }, + "type": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "fields": { + "properties": { + "environment": { + "type": "keyword" + } + } + }, + "fileset": { + "properties": { + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "geo": { + "properties": { + "city_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "continent_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "country_iso_code": { + "type": "keyword", + "ignore_above": 1024 + }, + "country_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "location": { + "type": "geo_point" + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + }, + "region_iso_code": { + "type": "keyword", + "ignore_above": 1024 + }, + "region_name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "host": { + "properties": { + "architecture": { + "type": "keyword", + "ignore_above": 1024 + }, + "containerized": { + "type": "boolean" + }, + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "geo": { + "properties": { + "city_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "continent_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "country_iso_code": { + "type": "keyword", + "ignore_above": 1024 + }, + "country_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "location": { + "type": "geo_point" + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + }, + "region_iso_code": { + "type": "keyword", + "ignore_above": 1024 + }, + "region_name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "hostname": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "ip": { + "type": "ip" + }, + "mac": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + }, + "os": { + "properties": { + "build": { + "type": "keyword", + "ignore_above": 1024 + }, + "codename": { + "type": "keyword", + "ignore_above": 1024 + }, + "family": { + "type": "keyword", + "ignore_above": 1024 + }, + "full": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "kernel": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "platform": { + "type": "keyword", + "ignore_above": 1024 + }, + "version": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "type": { + "type": "keyword", + "ignore_above": 1024 + }, + "uptime": { + "type": "long" + }, + "user": { + "properties": { + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "email": { + "type": "keyword", + "ignore_above": 1024 + }, + "full_name": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "group": { + "properties": { + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "hash": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + } + } + } + } + }, + "http": { + "properties": { + "request": { + "properties": { + "body": { + "properties": { + "bytes": { + "type": "long" + }, + "content": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + } + } + }, + "bytes": { + "type": "long" + }, + "method": { + "type": "keyword", + "ignore_above": 1024 + }, + "referrer": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "response": { + "properties": { + "body": { + "properties": { + "bytes": { + "type": "long" + }, + "content": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + } + } + }, + "bytes": { + "type": "long" + }, + "status_code": { + "type": "long" + } + } + }, + "version": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "input": { + "properties": { + "type": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "labels": { + "type": "object" + }, + "log": { + "properties": { + "file": { + "properties": { + "path": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "flags": { + "type": "keyword", + "ignore_above": 1024 + }, + "level": { + "type": "keyword", + "ignore_above": 1024 + }, + "logger": { + "type": "keyword", + "ignore_above": 1024 + }, + "offset": { + "type": "long" + }, + "origin": { + "properties": { + "file": { + "properties": { + "line": { + "type": "long" + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "function": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "original": { + "type": "keyword", + "ignore_above": 1024 + }, + "source": { + "properties": { + "address": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "syslog": { + "properties": { + "facility": { + "properties": { + "code": { + "type": "long" + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "priority": { + "type": "long" + }, + "severity": { + "properties": { + "code": { + "type": "long" + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + } + } + } + } + }, + "message": { + "type": "text", + "norms": false + }, + "nginx": { + "properties": { + "access": { + "properties": { + "geoip": { + "type": "object" + }, + "user_agent": { + "type": "object" + } + } + }, + "error": { + "properties": { + "connection_id": { + "type": "long" + } + } + } + } + }, + "object_key": { + "type": "keyword", + "ignore_above": 1024 + }, + "source": { + "properties": { + "address": { + "type": "keyword", + "ignore_above": 1024 + }, + "as": { + "properties": { + "number": { + "type": "long" + }, + "organization": { + "properties": { + "name": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + } + } + } + } + }, + "bytes": { + "type": "long" + }, + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "geo": { + "properties": { + "city_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "continent_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "country_iso_code": { + "type": "keyword", + "ignore_above": 1024 + }, + "country_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "location": { + "type": "geo_point" + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + }, + "region_iso_code": { + "type": "keyword", + "ignore_above": 1024 + }, + "region_name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "ip": { + "type": "ip" + }, + "mac": { + "type": "keyword", + "ignore_above": 1024 + }, + "nat": { + "properties": { + "ip": { + "type": "ip" + }, + "port": { + "type": "long" + } + } + }, + "packets": { + "type": "long" + }, + "port": { + "type": "long" + }, + "registered_domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "service": { + "properties": { + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "top_level_domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "user": { + "properties": { + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "email": { + "type": "keyword", + "ignore_above": 1024 + }, + "full_name": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "group": { + "properties": { + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "hash": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + } + } + } + } + }, + "stream": { + "type": "keyword", + "ignore_above": 1024 + }, + "tags": { + "type": "keyword", + "ignore_above": 1024 + }, + "timeseries": { + "properties": { + "instance": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "url": { + "properties": { + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "extension": { + "type": "keyword", + "ignore_above": 1024 + }, + "fragment": { + "type": "keyword", + "ignore_above": 1024 + }, + "full": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "original": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "password": { + "type": "keyword", + "ignore_above": 1024 + }, + "path": { + "type": "keyword", + "ignore_above": 1024 + }, + "port": { + "type": "long" + }, + "query": { + "type": "keyword", + "ignore_above": 1024 + }, + "registered_domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "scheme": { + "type": "keyword", + "ignore_above": 1024 + }, + "top_level_domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "username": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "user": { + "properties": { + "audit": { + "properties": { + "group": { + "properties": { + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "effective": { + "properties": { + "group": { + "properties": { + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "email": { + "type": "keyword", + "ignore_above": 1024 + }, + "filesystem": { + "properties": { + "group": { + "properties": { + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "full_name": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "group": { + "properties": { + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "hash": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "owner": { + "properties": { + "group": { + "properties": { + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "saved": { + "properties": { + "group": { + "properties": { + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "terminal": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "user_agent": { + "properties": { + "device": { + "properties": { + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + }, + "original": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "os": { + "properties": { + "family": { + "type": "keyword", + "ignore_above": 1024 + }, + "full": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "full_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "kernel": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "platform": { + "type": "keyword", + "ignore_above": 1024 + }, + "version": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "version": { + "type": "keyword", + "ignore_above": 1024 + } + } + } + } + } +} diff --git a/_examples/bulk/benchmarks/data/small/document.json b/_examples/bulk/benchmarks/data/small/document.json new file mode 100644 index 0000000000..933b2785ca --- /dev/null +++ b/_examples/bulk/benchmarks/data/small/document.json @@ -0,0 +1,10 @@ +{ + "title": "Test", + "tags": [ + "one", + "two", + "three" + ], + "count": 42, + "time": "2020-02-20T08:59:42.000Z" +} diff --git a/_examples/bulk/benchmarks/data/small/mapping.json b/_examples/bulk/benchmarks/data/small/mapping.json new file mode 100644 index 0000000000..344b227458 --- /dev/null +++ b/_examples/bulk/benchmarks/data/small/mapping.json @@ -0,0 +1,15 @@ +{ + "mappings": { + "_meta": { + "version": "8-SNAPSHOT" + }, + + "properties": { + "count": { "type": "long" }, + "tags": { "type": "keyword" }, + "time": { "type": "date" }, + "title": { "type": "text" } + } + } + } +} diff --git a/_examples/bulk/benchmarks/etc/nginx.conf b/_examples/bulk/benchmarks/etc/nginx.conf new file mode 100644 index 0000000000..92bbe19258 --- /dev/null +++ b/_examples/bulk/benchmarks/etc/nginx.conf @@ -0,0 +1,42 @@ +user nginx; + +worker_processes auto; +worker_rlimit_nofile 10240; +pid /tmp/nginx.pid; + +error_log off; + +events { + worker_connections 10240; + accept_mutex off; + multi_accept off; +} + +http { + access_log off; + error_log off; + + keepalive_timeout 300s; + keepalive_requests 1000000; + + default_type application/json; + + gzip on; + gzip_comp_level 5; + gzip_min_length 256; + + client_max_body_size 100m; + + server { + listen 8000 default_server; + + location / { + return 200 '{"took": 0, "errors": false, "items": []}\n'; + } + + location = /favicon.ico { + access_log off; + return 204; + } + } +} diff --git a/_examples/bulk/benchmarks/go.mod b/_examples/bulk/benchmarks/go.mod new file mode 100644 index 0000000000..bef16542e8 --- /dev/null +++ b/_examples/bulk/benchmarks/go.mod @@ -0,0 +1,13 @@ +module github.com/elastic/go-elasticsearch/v7/_examples/bulk/benchmarks + +go 1.11 + +replace github.com/elastic/go-elasticsearch/v7 => ../../.. + +require ( + github.com/dustin/go-humanize v1.0.0 + github.com/elastic/go-elasticsearch/v7 7.x + github.com/mailru/easyjson v0.7.1 + github.com/montanaflynn/stats v0.6.3 + github.com/valyala/fasthttp v1.9.0 +) diff --git a/_examples/bulk/benchmarks/model/model.go b/_examples/bulk/benchmarks/model/model.go new file mode 100644 index 0000000000..b0d893c432 --- /dev/null +++ b/_examples/bulk/benchmarks/model/model.go @@ -0,0 +1,21 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +//go:generate easyjson $GOFILE + +package model + +import ( + "github.com/elastic/go-elasticsearch/v7/esutil" +) + +// BulkIndexerResponse wraps the esutil.BulkIndexerResponse, +// and implements the esutil.UnmarshalFromReader() method, +// in order to demonstrate usage of a third-party JSON decoder, +// such as "mailru/easyjson". +// +// easyjson:json +type BulkIndexerResponse struct { + esutil.BulkIndexerResponse +} diff --git a/_examples/bulk/benchmarks/runner/runner.go b/_examples/bulk/benchmarks/runner/runner.go new file mode 100644 index 0000000000..a8a0066c87 --- /dev/null +++ b/_examples/bulk/benchmarks/runner/runner.go @@ -0,0 +1,252 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +package runner + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "log" + "math" + "os" + "path/filepath" + "strings" + "time" + + "github.com/dustin/go-humanize" + "github.com/montanaflynn/stats" + + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esutil" +) + +// NewRunner returns new BulkIndexer benchmarking runner. +// +func NewRunner(cfg Config) (*Runner, error) { + return &Runner{config: cfg}, nil +} + +// Runner represents the BulkIndexer benchmarking runner. +// +type Runner struct { + config Config + + doc []byte + indexSettings strings.Builder + + samples []float64 + throughput map[string]float64 +} + +// Config represents configuration for Runner. +// +type Config struct { + IndexName string + DatasetName string + Client *elasticsearch.Client + Decoder esutil.BulkResponseJSONDecoder + + NumShards int + NumReplicas int + NumItems int + NumRuns int + NumWarmupRuns int + NumWorkers int + FlushBytes int + Wait time.Duration + Mockserver bool +} + +// Report prints statistics from the benchmark runs. +// +func (r *Runner) Report() error { + r.throughput = map[string]float64{ + "min": func() float64 { v, _ := stats.Min(r.samples); return v }(), + "max": func() float64 { v, _ := stats.Max(r.samples); return v }(), + "mdn": func() float64 { v, _ := stats.Median(r.samples); return v }(), + "p25": func() float64 { v, _ := stats.Percentile(r.samples, 25); return v }(), + "p50": func() float64 { v, _ := stats.Percentile(r.samples, 50); return v }(), + "p75": func() float64 { v, _ := stats.Percentile(r.samples, 75); return v }(), + "p95": func() float64 { v, _ := stats.Percentile(r.samples, 95); return v }(), + } + + log.Printf( + "docs/sec: min [%s] max [%s] mean [%s]", + humanize.Comma(int64(r.throughput["min"])), + humanize.Comma(int64(r.throughput["max"])), + humanize.Comma(int64(r.throughput["mdn"])), + ) + + ratio := 50.0 / r.throughput["max"] + + if !math.IsNaN(r.throughput["p25"]) { + fmt.Println("25%", + strings.Repeat("▆", int(r.throughput["p25"]*ratio)), + humanize.Comma(int64(r.throughput["p25"])), "docs/sec") + } + if !math.IsNaN(r.throughput["p50"]) { + fmt.Println("50%", + strings.Repeat("▆", int(r.throughput["p50"]*ratio)), + humanize.Comma(int64(r.throughput["p50"])), "docs/sec") + } + if !math.IsNaN(r.throughput["p75"]) { + fmt.Println("75%", + strings.Repeat("▆", int(r.throughput["p75"]*ratio)), + humanize.Comma(int64(r.throughput["p75"])), "docs/sec") + } + if !math.IsNaN(r.throughput["p95"]) { + fmt.Println("95%", + strings.Repeat("▆", int(r.throughput["p95"]*ratio)), + humanize.Comma(int64(r.throughput["p95"])), "docs/sec") + } + + return nil +} + +// Run executes the benchmark runs. +// +func (r *Runner) Run() error { + for n := 1; n <= r.config.NumWarmupRuns; n++ { + if err := r.run(n, false); err != nil { + log.Fatalf("Runner error: %s", err) + } + } + + for n := 1; n <= r.config.NumRuns; n++ { + if err := r.run(n, true); err != nil { + log.Fatalf("Runner error: %s", err) + } + } + + return nil +} + +// setup re-creates the index for a benchmark run. +// +func (r *Runner) setup() error { + fm, err := os.Open(filepath.Join("data", r.config.DatasetName, "mapping.json")) + if err != nil { + return fmt.Errorf("setup: reading mapping: %s", err) + } + + var mappingEnvelope map[string]interface{} + json.NewDecoder(fm).Decode(&mappingEnvelope) + mapping, err := json.Marshal(mappingEnvelope["mappings"]) + if err != nil { + return fmt.Errorf("setup: encoding mapping: %s", err) + } + + r.indexSettings.WriteString(`{ "settings": `) + fmt.Fprintf(&r.indexSettings, `{"number_of_shards": %d, "number_of_replicas": %d, "refresh_interval":"5s"}`, r.config.NumShards, r.config.NumReplicas) + r.indexSettings.WriteString(`, "mappings":`) + r.indexSettings.Write(mapping) + r.indexSettings.WriteString(`}`) + + f, err := os.Open(filepath.Join("data", r.config.DatasetName, "document.json")) + if err != nil { + return fmt.Errorf("setup: reading document: %s", err) + } + var m map[string]interface{} + json.NewDecoder(f).Decode(&m) + doc, err := json.Marshal(m) + if err != nil { + return fmt.Errorf("setup: encoding document: %s", err) + } + r.doc = doc + + r.config.Client.Indices.Delete( + []string{r.config.IndexName}, + r.config.Client.Indices.Delete.WithIgnoreUnavailable(true)) + res, err := r.config.Client.Indices.Create( + r.config.IndexName, + r.config.Client.Indices.Create.WithBody(strings.NewReader(r.indexSettings.String())), + r.config.Client.Indices.Create.WithWaitForActiveShards("1")) + if err != nil { + return fmt.Errorf("setup: encoding document: %s", err) + } + res.Body.Close() + if res.IsError() { + return fmt.Errorf("setup: encoding document: %s", res.String()) + } + + return nil +} + +// run executes a single benchmark run n, recording stats when measure is true. +// +func (r *Runner) run(n int, measure bool) error { + if err := r.setup(); err != nil { + return fmt.Errorf("run: %s", err) + } + + bi, err := esutil.NewBulkIndexer(esutil.BulkIndexerConfig{ + Index: r.config.IndexName, + Client: r.config.Client, + Decoder: r.config.Decoder, + NumWorkers: r.config.NumWorkers, + FlushBytes: r.config.FlushBytes, + FlushInterval: time.Hour, // Disable automatic flushing + }) + if err != nil { + return fmt.Errorf("run: %s", err) + } + + start := time.Now().UTC() + for i := 1; i <= r.config.NumItems; i++ { + err := bi.Add(context.Background(), esutil.BulkIndexerItem{ + Action: "index", + Body: bytes.NewReader(r.doc), + OnFailure: func(ctx context.Context, item esutil.BulkIndexerItem, res esutil.BulkIndexerResponseItem, err error) { + if err != nil { + log.Printf("ERROR: %s", err) + } else { + log.Printf("ERROR: %s: %s", res.Error.Type, res.Error.Reason) + } + }, + }) + if err != nil { + return fmt.Errorf("run: %s", err) + } + } + + if err := bi.Close(context.Background()); err != nil { + return fmt.Errorf("run: %s", err) + } + + duration := time.Since(start) + + if measure { + biStats := bi.Stats() + + var numThroughput uint64 + if r.config.Mockserver { + numThroughput = biStats.NumAdded + } else { + numThroughput = biStats.NumFlushed + } + sample := 1000.0 / float64(duration/time.Millisecond) * float64(numThroughput) + r.samples = append(r.samples, sample) + + log.Printf("%4d) add=%s\tflush=%s\tfail=%s\treqs=%s\tdur=%-6s\t%6s docs/sec\n", + n, + formatInt(int(biStats.NumAdded)), + formatInt(int(biStats.NumFlushed)), + formatInt(int(biStats.NumFailed)), + formatInt(int(biStats.NumRequests)), + duration.Truncate(10*time.Millisecond), + humanize.Comma(int64(sample))) + + time.Sleep(r.config.Wait) + } + + return nil +} + +// formatInt returns a number like 123456 as a string like 123.45K +// +func formatInt(i int) string { + return strings.ReplaceAll(strings.ToUpper(humanize.SIWithDigits(float64(i), 2, "")), " ", "") +} diff --git a/_examples/bulk/bulk.go b/_examples/bulk/default.go similarity index 88% rename from _examples/bulk/bulk.go rename to _examples/bulk/default.go index b0bbc26a86..288f7ccdd8 100644 --- a/_examples/bulk/bulk.go +++ b/_examples/bulk/default.go @@ -9,7 +9,7 @@ // // You can configure the number of documents and the batch size with command line flags: // -// go run bulk.go -count=10000 -batch=2500 +// go run default.go -count=10000 -batch=2500 // // The example intentionally doesn't use any abstractions or helper functions, to // demonstrate the low-level mechanics of working with the Bulk API: preparing @@ -30,6 +30,8 @@ import ( "strings" "time" + "github.com/dustin/go-humanize" + "github.com/elastic/go-elasticsearch/v7" "github.com/elastic/go-elasticsearch/v7/esapi" ) @@ -100,6 +102,11 @@ func main() { currBatch int ) + log.Printf( + "\x1b[1mBulk\x1b[0m: documents [%s] batch size [%s]", + humanize.Comma(int64(count)), humanize.Comma(int64(batch))) + log.Println(strings.Repeat("▁", 65)) + // Create the Elasticsearch client // es, err := elasticsearch.NewDefaultClient() @@ -122,7 +129,8 @@ func main() { }, }) } - log.Printf("> Generated %d articles", len(articles)) + log.Printf("→ Generated %s articles", humanize.Comma(int64(len(articles)))) + fmt.Print("→ Sending batch ") // Re-create the index // @@ -187,7 +195,7 @@ func main() { // When a threshold is reached, execute the Bulk() request with body from buffer // if i > 0 && i%batch == 0 || i == count-1 { - log.Printf("> Batch %-2d of %d", currBatch, numBatches) + fmt.Printf("[%d/%d] ", currBatch, numBatches) res, err = es.Bulk(bytes.NewReader(buf.Bytes()), es.Bulk.WithIndex(indexName)) if err != nil { @@ -250,24 +258,25 @@ func main() { // Report the results: number of indexed docs, number of errors, duration, indexing rate // - log.Println(strings.Repeat("=", 80)) + fmt.Print("\n") + log.Println(strings.Repeat("▔", 65)) dur := time.Since(start) if numErrors > 0 { log.Fatalf( - "Indexed [%d] documents with [%d] errors in %s (%.0f docs/sec)", - numIndexed, - numErrors, + "Indexed [%s] documents with [%s] errors in %s (%s docs/sec)", + humanize.Comma(int64(numIndexed)), + humanize.Comma(int64(numErrors)), dur.Truncate(time.Millisecond), - 1000.0/float64(dur/time.Millisecond)*float64(numIndexed), + humanize.Comma(int64(1000.0/float64(dur/time.Millisecond)*float64(numIndexed))), ) } else { log.Printf( - "Sucessfuly indexed [%d] documents in %s (%.0f docs/sec)", - numIndexed, + "Sucessfuly indexed [%s] documents in %s (%s docs/sec)", + humanize.Comma(int64(numIndexed)), dur.Truncate(time.Millisecond), - 1000.0/float64(dur/time.Millisecond)*float64(numIndexed), + humanize.Comma(int64(1000.0/float64(dur/time.Millisecond)*float64(numIndexed))), ) } } diff --git a/_examples/bulk/go.mod b/_examples/bulk/go.mod new file mode 100644 index 0000000000..36dd5fdfc8 --- /dev/null +++ b/_examples/bulk/go.mod @@ -0,0 +1,11 @@ +module github.com/elastic/go-elasticsearch/v7/_examples/bulk + +go 1.11 + +replace github.com/elastic/go-elasticsearch/v7 => ../.. + +require ( + github.com/cenkalti/backoff/v4 v4.0.0 + github.com/dustin/go-humanize v1.0.0 + github.com/elastic/go-elasticsearch/v7 7.x +) diff --git a/_examples/bulk/indexer.go b/_examples/bulk/indexer.go new file mode 100644 index 0000000000..a6063d2583 --- /dev/null +++ b/_examples/bulk/indexer.go @@ -0,0 +1,251 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build ignore + +// This example demonstrates indexing documents using the esutil.BulkIndexer helper. +// +// You can configure the settings with command line flags: +// +// go run indexer.go --workers=8 --count=100000 --flush=1000000 +// +package main + +import ( + "bytes" + "context" + "encoding/json" + "flag" + "log" + "math/rand" + "runtime" + "strconv" + "strings" + "sync/atomic" + "time" + + "github.com/cenkalti/backoff/v4" + "github.com/dustin/go-humanize" + + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esapi" + "github.com/elastic/go-elasticsearch/v7/esutil" +) + +type Article struct { + ID int `json:"id"` + Title string `json:"title"` + Body string `json:"body"` + Published time.Time `json:"published"` + Author Author `json:"author"` +} + +type Author struct { + FirstName string `json:"first_name"` + LastName string `json:"last_name"` +} + +var ( + indexName string + numWorkers int + flushBytes int + numItems int +) + +func init() { + flag.StringVar(&indexName, "index", "test-bulk-example", "Index name") + flag.IntVar(&numWorkers, "workers", runtime.NumCPU(), "Number of indexer workers") + flag.IntVar(&flushBytes, "flush", 5e+6, "Flush threshold in bytes") + flag.IntVar(&numItems, "count", 10000, "Number of documents to generate") + flag.Parse() + + rand.Seed(time.Now().UnixNano()) +} + +func main() { + log.SetFlags(0) + + var ( + articles []*Article + countSuccessful uint64 + + res *esapi.Response + err error + ) + + log.Printf( + "\x1b[1mBulkIndexer\x1b[0m: documents [%s] workers [%d] flush [%s]", + humanize.Comma(int64(numItems)), numWorkers, humanize.Bytes(uint64(flushBytes))) + log.Println(strings.Repeat("▁", 65)) + + // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // + // Use a third-party package for implementing the backoff function + // + retryBackoff := backoff.NewExponentialBackOff() + // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // + // Create the Elasticsearch client + // + // NOTE: For optimal performance, consider using a third-party HTTP transport package. + // See an example in the "benchmarks" folder. + // + es, err := elasticsearch.NewClient(elasticsearch.Config{ + // Retry on 429 TooManyRequests statuses + // + RetryOnStatus: []int{502, 503, 504, 429}, + + // Configure the backoff function + // + RetryBackoff: func(i int) time.Duration { + if i == 1 { + retryBackoff.Reset() + } + return retryBackoff.NextBackOff() + }, + + // Retry up to 5 attempts + // + MaxRetries: 5, + }) + if err != nil { + log.Fatalf("Error creating the client: %s", err) + } + // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // + // Create the BulkIndexer + // + // NOTE: For optimal performance, consider using a third-party JSON decoding package. + // See an example in the "benchmarks" folder. + // + bi, err := esutil.NewBulkIndexer(esutil.BulkIndexerConfig{ + Index: indexName, // The default index name + Client: es, // The Elasticsearch client + NumWorkers: numWorkers, // The number of worker goroutines + FlushBytes: int(flushBytes), // The flush threshold in bytes + FlushInterval: 30 * time.Second, // The periodic flush interval + }) + if err != nil { + log.Fatalf("Error creating the indexer: %s", err) + } + // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + // Generate the articles collection + // + names := []string{"Alice", "John", "Mary"} + for i := 1; i <= numItems; i++ { + articles = append(articles, &Article{ + ID: i, + Title: strings.Join([]string{"Title", strconv.Itoa(i)}, " "), + Body: "Lorem ipsum dolor sit amet...", + Published: time.Now().Round(time.Second).UTC().AddDate(0, 0, i), + Author: Author{ + FirstName: names[rand.Intn(len(names))], + LastName: "Smith", + }, + }) + } + log.Printf("→ Generated %s articles", humanize.Comma(int64(len(articles)))) + + // Re-create the index + // + if res, err = es.Indices.Delete([]string{indexName}, es.Indices.Delete.WithIgnoreUnavailable(true)); err != nil || res.IsError() { + log.Fatalf("Cannot delete index: %s", err) + } + res.Body.Close() + res, err = es.Indices.Create(indexName) + if err != nil { + log.Fatalf("Cannot create index: %s", err) + } + if res.IsError() { + log.Fatalf("Cannot create index: %s", res) + } + res.Body.Close() + + start := time.Now().UTC() + + // Loop over the collection + // + for _, a := range articles { + // Prepare the data payload: encode article to JSON + // + data, err := json.Marshal(a) + if err != nil { + log.Fatalf("Cannot encode article %d: %s", a.ID, err) + } + + // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // + // Add an item to the BulkIndexer + // + err = bi.Add( + context.Background(), + esutil.BulkIndexerItem{ + // Action field configures the operation to perform (index, create, delete, update) + Action: "index", + + // DocumentID is the (optional) document ID + DocumentID: strconv.Itoa(a.ID), + + // Body is an `io.Reader` with the payload + Body: bytes.NewReader(data), + + // OnSuccess is called for each successful operation + OnSuccess: func(ctx context.Context, item esutil.BulkIndexerItem, res esutil.BulkIndexerResponseItem) { + atomic.AddUint64(&countSuccessful, 1) + }, + + // OnFailure is called for each failed operation + OnFailure: func(ctx context.Context, item esutil.BulkIndexerItem, res esutil.BulkIndexerResponseItem, err error) { + if err != nil { + log.Printf("ERROR: %s", err) + } else { + log.Printf("ERROR: %s: %s", res.Error.Type, res.Error.Reason) + } + }, + }, + ) + if err != nil { + log.Fatalf("Unexpected error: %s", err) + } + // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + } + + // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // Close the indexer + // + if err := bi.Close(context.Background()); err != nil { + log.Fatalf("Unexpected error: %s", err) + } + // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + biStats := bi.Stats() + + // Report the results: number of indexed docs, number of errors, duration, indexing rate + // + log.Println(strings.Repeat("▔", 65)) + + dur := time.Since(start) + + if biStats.NumFailed > 0 { + log.Fatalf( + "Indexed [%s] documents with [%s] errors in %s (%s docs/sec)", + humanize.Comma(int64(biStats.NumFlushed)), + humanize.Comma(int64(biStats.NumFailed)), + dur.Truncate(time.Millisecond), + humanize.Comma(int64(1000.0/float64(dur/time.Millisecond)*float64(biStats.NumFlushed))), + ) + } else { + log.Printf( + "Sucessfuly indexed [%s] documents in %s (%s docs/sec)", + humanize.Comma(int64(biStats.NumFlushed)), + dur.Truncate(time.Millisecond), + humanize.Comma(int64(1000.0/float64(dur/time.Millisecond)*float64(biStats.NumFlushed))), + ) + } +} From bef465571170b8c9a814840c4a3ae35710b2168a Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 11 Mar 2020 08:13:36 +0100 Subject: [PATCH 174/355] Examples: Add the Kafka example for the BulkIndexer helper Related: #137 (cherry picked from commit 118832073e2623ae205a6aa2953f71164c927ab8) --- _examples/bulk/README.md | 2 + _examples/bulk/kafka/.env | 7 + _examples/bulk/kafka/Makefile | 49 +++ _examples/bulk/kafka/README.md | 19 + _examples/bulk/kafka/consumer/consumer.go | 119 ++++++ _examples/bulk/kafka/docker-compose.yml | 129 ++++++ .../bulk/kafka/etc/kibana-objects.ndjson | 8 + _examples/bulk/kafka/go.mod | 13 + _examples/bulk/kafka/kafka.go | 368 ++++++++++++++++++ _examples/bulk/kafka/producer/producer.go | 187 +++++++++ _examples/bulk/kafka/screenshot.png | Bin 0 -> 568571 bytes 11 files changed, 901 insertions(+) create mode 100644 _examples/bulk/kafka/.env create mode 100644 _examples/bulk/kafka/Makefile create mode 100644 _examples/bulk/kafka/README.md create mode 100644 _examples/bulk/kafka/consumer/consumer.go create mode 100644 _examples/bulk/kafka/docker-compose.yml create mode 100644 _examples/bulk/kafka/etc/kibana-objects.ndjson create mode 100644 _examples/bulk/kafka/go.mod create mode 100644 _examples/bulk/kafka/kafka.go create mode 100644 _examples/bulk/kafka/producer/producer.go create mode 100644 _examples/bulk/kafka/screenshot.png diff --git a/_examples/bulk/README.md b/_examples/bulk/README.md index 1b6305b3a6..bb915239d3 100644 --- a/_examples/bulk/README.md +++ b/_examples/bulk/README.md @@ -55,3 +55,5 @@ indexer.Close(context.Background()) ``` Please refer to the [`benchmarks`](benchmarks) folder for performance tests with different types of payload. + +See the [`kafka`](kafka) folder for an end-to-end example of using the bulk helper for indexing data from a Kafka topic. diff --git a/_examples/bulk/kafka/.env b/_examples/bulk/kafka/.env new file mode 100644 index 0000000000..2169e14570 --- /dev/null +++ b/_examples/bulk/kafka/.env @@ -0,0 +1,7 @@ +COMPOSE_PROJECT_NAME=kafka + +CONFLUENT_VERSION=5.4.0 +ELASTIC_VERSION=8.0.0-SNAPSHOT + +KAFKA_MEMORY=1G +ES_MEMORY=1G diff --git a/_examples/bulk/kafka/Makefile b/_examples/bulk/kafka/Makefile new file mode 100644 index 0000000000..64ce79bfe0 --- /dev/null +++ b/_examples/bulk/kafka/Makefile @@ -0,0 +1,49 @@ +SHELL := /bin/bash + +test: + go build -o /dev/null kafka.go + +setup: stack status wait_for_kibana load_kibana_dashboard + +clean: + @docker-compose down --volumes + +run: + go run kafka.go + +stack: + @docker-compose up --detach + +status: + @{ \ + cols=`tput cols`; max=98; i=1; \ + while [[ "$$i" -lt "$$cols" && "$$i" -lt "$$max" ]]; do printf '-'; let i=$$i+1; done; printf "\n"; \ + docker-compose ps; \ + i=1; while [[ "$$i" -lt "$$cols" && "$$i" -lt "$$max" ]]; do printf '-'; let i=$$i+1; done; printf "\n"; \ + } + +wait_for_kibana: + @{ \ + printf "Waiting for Kibana..."; \ + until docker inspect kibana > /dev/null 2>&1 && [[ `docker inspect -f '{{ .State.Health.Status }}' kibana` == "healthy" ]]; do printf '.'; sleep 5; done; \ + printf "\nOpen dashboard at \n"; \ + } + +load_kibana_dashboard: + @{ \ + curl -s -S -X POST -H 'kbn-xsrf: true' 'http://localhost:5601/api/saved_objects/_import?overwrite=true' --form file=@etc/kibana-objects.ndjson > /dev/null; \ + } + +save_kibana_dashboard: + @{ \ + curl -s -S -X POST -H 'Content-Type: application/json' -H 'kbn-xsrf: true' -o './etc/kibana-objects.ndjson' 'http://localhost:5601/api/saved_objects/_export' -d ' \ +{ \ + "objects": [ \ + { "type": "index-pattern", "id": "stocks-index-pattern" }, \ + { "type": "dashboard", "id": "140b5490-5fce-11ea-a238-bf5970186390" } \ + ], \ + "includeReferencesDeep": true \ +}'; \ + } + +.PHONY: test setup run clean stack status wait_for_kibana load_kibana_dashboard save_kibana_dashboard diff --git a/_examples/bulk/kafka/README.md b/_examples/bulk/kafka/README.md new file mode 100644 index 0000000000..5b1af7d1d8 --- /dev/null +++ b/_examples/bulk/kafka/README.md @@ -0,0 +1,19 @@ +# Example: Bulk indexing from a Kafka topic + +This example demonstrates using the `BulkIndexer` component to ingest data consumed from a Kafka topic. + +The provided `docker-compose.yml` file launches a realistic environment with Zookeeper, Kafka, Confluent Control Center, Elasticsearch and Kibana, and allows to inspect data flows, indexer metrics, and see the ingested data in a dashboard. + +![Screenshot](screenshot.png) + +First, launch the environment and wait until it's ready: + + make setup + +Then, launch the Kafka producers and consumers and the Elasticsearch indexer: + + make run + +Open the [_Kibana_ dashboard](http://localhost:5601/app/kibana#/dashboard/140b5490-5fce-11ea-a238-bf5970186390) to see the results, the [_Kibana_ APM application](http://localhost:5601/app/apm#/services/kafka/transactions?rangeFrom=now-15m&rangeTo=now&refreshPaused=true&refreshInterval=0&transactionType=indexing) to see the indexer metrics, and [_Confluent Control Center_](http://localhost:9021/) to inspect the Kafka cluster and see details about the topic and performance of consumers. + +See the [`producer/producer.go`](producer/producer.go) file for the Kafka producer, [`consumer/consumer.go`](consumer/consumer.go) for the Kafka consumer, and the [`kafka.go`](kafka.go) file for the main workflow. The default configuration will launch one producer, four consumers, one indexer, and will send 1,000 messages per second; see `go run kafka.go --help` for changing the defaults. diff --git a/_examples/bulk/kafka/consumer/consumer.go b/_examples/bulk/kafka/consumer/consumer.go new file mode 100644 index 0000000000..6722704c50 --- /dev/null +++ b/_examples/bulk/kafka/consumer/consumer.go @@ -0,0 +1,119 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +package consumer + +import ( + "bytes" + "context" + "fmt" + "time" + + "github.com/segmentio/kafka-go" + + "go.elastic.co/apm" + + "github.com/elastic/go-elasticsearch/v7/esutil" +) + +type Consumer struct { + BrokerURL string + TopicName string + + Indexer esutil.BulkIndexer + reader *kafka.Reader + + startTime time.Time + totalMessages int64 + totalErrors int64 + totalBytes int64 +} + +func (c *Consumer) Run(ctx context.Context) (err error) { + if c.Indexer == nil { + panic(fmt.Sprintf("%T.Indexer is nil", c)) + } + c.startTime = time.Now() + + c.reader = kafka.NewReader(kafka.ReaderConfig{ + Brokers: []string{c.BrokerURL}, + GroupID: "go-elasticsearch-demo", + Topic: c.TopicName, + // MinBytes: 1e+6, // 1MB + // MaxBytes: 5e+6, // 5MB + + ReadLagInterval: 1 * time.Second, + }) + + for { + msg, err := c.reader.ReadMessage(ctx) + if err != nil { + return fmt.Errorf("reader: %s", err) + } + // log.Printf("%v/%v/%v:%s\n", msg.Topic, msg.Partition, msg.Offset, string(msg.Value)) + + if err := c.Indexer.Add(ctx, + esutil.BulkIndexerItem{ + Action: "create", + Body: bytes.NewReader(msg.Value), + OnSuccess: func(ctx context.Context, item esutil.BulkIndexerItem, res esutil.BulkIndexerResponseItem) { + // log.Printf("Indexed %s/%s", res.Index, res.DocumentID) + }, + OnFailure: func(ctx context.Context, item esutil.BulkIndexerItem, res esutil.BulkIndexerResponseItem, err error) { + if err != nil { + apm.CaptureError(ctx, err).Send() + } else { + if res.Error.Type != "" { + // log.Printf("%s:%s", res.Error.Type, res.Error.Reason) + // apm.CaptureError(ctx, fmt.Errorf("%s:%s", res.Error.Type, res.Error.Reason)).Send() + } else { + // log.Printf("%s/%s %s (%d)", res.Index, res.DocumentID, res.Result, res.Status) + // apm.CaptureError(ctx, fmt.Errorf("%s/%s %s (%d)", res.Index, res.DocumentID, res.Result, res.Status)).Send() + } + + } + }, + }); err != nil { + apm.DefaultTracer.NewError(err).Send() + return fmt.Errorf("indexer: %s", err) + } + } + c.reader.Close() + c.Indexer.Close(ctx) + + return nil +} + +type Stats struct { + Duration time.Duration + TotalLag int64 + TotalMessages int64 + TotalErrors int64 + TotalBytes int64 + Throughput float64 +} + +func (c *Consumer) Stats() Stats { + if c.reader == nil || c.Indexer == nil { + return Stats{} + } + + duration := time.Since(c.startTime) + readerStats := c.reader.Stats() + + c.totalMessages += readerStats.Messages + c.totalErrors += readerStats.Errors + c.totalBytes += readerStats.Bytes + + rate := float64(c.totalMessages) / duration.Seconds() + + return Stats{ + Duration: duration, + TotalLag: readerStats.Lag, + TotalMessages: c.totalMessages, + TotalErrors: c.totalErrors, + TotalBytes: c.totalBytes, + Throughput: rate, + } +} diff --git a/_examples/bulk/kafka/docker-compose.yml b/_examples/bulk/kafka/docker-compose.yml new file mode 100644 index 0000000000..30d439b264 --- /dev/null +++ b/_examples/bulk/kafka/docker-compose.yml @@ -0,0 +1,129 @@ +version: "3.7" + +services: + zookeeper: + container_name: zookeeper + image: confluentinc/cp-zookeeper:${CONFLUENT_VERSION} + networks: + - kafka + environment: + ZOOKEEPER_SERVER_ID: 1 + ZOOKEEPER_CLIENT_PORT: 2181 + ZOOKEEPER_TICK_TIME: 2000 + KAFKA_OPTS: '-Dzookeeper.4lw.commands.whitelist=ruok' + healthcheck: + test: echo "ruok" | nc localhost 2181 | grep "imok" + + kafka: + container_name: kafka + image: confluentinc/cp-server:${CONFLUENT_VERSION} + depends_on: + - zookeeper + ports: + # NOTE: Use kafka:29092 for connections within Docker + - 9092:9092 + networks: + - kafka + volumes: + - kafka-data:/var/lib/kafka/data + environment: + KAFKA_BROKER_ID: 1 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_HEAP_OPTS: '-Xms${KAFKA_MEMORY} -Xmx${KAFKA_MEMORY}' + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT + KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 + KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" + KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter + KAFKA_LOG4J_ROOT_LOGLEVEL: WARN + KAFKA_TOOLS_LOG4J_LOGLEVEL: ERROR + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 + KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 100 + KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 1 + CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: kafka:29092 + CONFLUENT_METRICS_REPORTER_ZOOKEEPER_CONNECT: zookeeper:2181 + CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 1 + CONFLUENT_METRICS_ENABLE: 'true' + restart: on-failure + healthcheck: + test: nc -z localhost 9092 + + control-center: + container_name: control-center + image: confluentinc/cp-enterprise-control-center:${CONFLUENT_VERSION} + hostname: control-center + depends_on: + - zookeeper + - kafka + ports: + - 9021:9021 + networks: + - kafka + environment: + CONTROL_CENTER_BOOTSTRAP_SERVERS: 'kafka:29092' + CONTROL_CENTER_ZOOKEEPER_CONNECT: 'zookeeper:2181' + CONTROL_CENTER_REPLICATION_FACTOR: 1 + CONTROL_CENTER_INTERNAL_TOPICS_PARTITIONS: 1 + CONTROL_CENTER_MONITORING_INTERCEPTOR_TOPIC_PARTITIONS: 1 + CONFLUENT_METRICS_TOPIC_REPLICATION: 1 + PORT: 9021 + ulimits: { nofile: { soft: 16384, hard: 16384 } } + healthcheck: + test: curl --head --max-time 120 --retry 120 --retry-delay 1 --show-error --silent http://localhost:9021 + + elasticsearch: + container_name: elasticsearch + image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION} + volumes: + - es-data:/usr/share/elasticsearch/data + networks: + - elasticsearch + ports: + - 9200:9200 + environment: + - node.name=elasticsearch + - cluster.name=go-elasticsearch-kafka-demo + - cluster.initial_master_nodes=elasticsearch + - discovery.seed_hosts=elasticsearch + - network.host=elasticsearch,_local_ + - network.publish_host=elasticsearch + - bootstrap.memory_lock=true + - ES_JAVA_OPTS=-Xms${ES_MEMORY} -Xmx${ES_MEMORY} + ulimits: { nofile: { soft: 65535, hard: 65535 }, memlock: -1 } + healthcheck: + test: curl --head --max-time 120 --retry 120 --retry-delay 1 --show-error --silent http://localhost:9200 + + kibana: + container_name: kibana + image: docker.elastic.co/kibana/kibana:${ELASTIC_VERSION} + depends_on: ['elasticsearch'] + networks: + - elasticsearch + ports: + - 5601:5601 + environment: + - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 + - KIBANA_LOGGING_QUIET=true + healthcheck: + test: curl --max-time 120 --retry 120 --retry-delay 1 --show-error --silent http://localhost:5601 + + apm_server: + container_name: apm_server + image: docker.elastic.co/apm/apm-server:${ELASTIC_VERSION} + depends_on: ['elasticsearch', 'kibana'] + command: -e --strict.perms=false + networks: + - elasticsearch + ports: + - 8200:8200 + restart: on-failure + healthcheck: + test: curl --max-time 120 --retry 120 --retry-delay 1 --show-error --silent http://localhost:8200 + +networks: + kafka: + elasticsearch: + +volumes: + kafka-data: + es-data: diff --git a/_examples/bulk/kafka/etc/kibana-objects.ndjson b/_examples/bulk/kafka/etc/kibana-objects.ndjson new file mode 100644 index 0000000000..febc50d7f1 --- /dev/null +++ b/_examples/bulk/kafka/etc/kibana-objects.ndjson @@ -0,0 +1,8 @@ +{"attributes":{"fields":"[{\"name\":\"_id\",\"type\":\"string\",\"esTypes\":[\"_id\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"esTypes\":[\"_index\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"esTypes\":[\"_source\"],\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"esTypes\":[\"_type\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"account\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"amount\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"price\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"quantity\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"side\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"symbol\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"time\",\"type\":\"date\",\"esTypes\":[\"date\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true}]","timeFieldName":"time","title":"stocks*"},"id":"stocks-index-pattern","migrationVersion":{"index-pattern":"7.6.0"},"references":[],"type":"index-pattern","updated_at":"2020-03-08T07:16:40.796Z","version":"WzMsMV0="} +{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[]}"},"title":"Timeline","uiStateJSON":"{}","version":1,"visState":"{\"title\":\"Timeline\",\"type\":\"metrics\",\"params\":{\"annotations\":[{\"color\":\"#F00\",\"fields\":\"\",\"icon\":\"fa-tag\",\"id\":\"a9a38ce0-5fc7-11ea-9dfe-a575a96938ae\",\"ignore_global_filters\":1,\"ignore_panel_filters\":1,\"index_pattern\":\"\",\"query_string\":{\"language\":\"kuery\",\"query\":\"\"},\"template\":\"\"}],\"axis_formatter\":\"number\",\"axis_position\":\"left\",\"axis_scale\":\"normal\",\"background_color_rules\":[{\"id\":\"1b1b3fd0-5fc8-11ea-9dfe-a575a96938ae\"}],\"bar_color_rules\":[{\"id\":\"1e32b900-5fc8-11ea-9dfe-a575a96938ae\"}],\"default_index_pattern\":\"stocks*\",\"default_timefield\":\"time\",\"gauge_color_rules\":[{\"id\":\"1fcbcf90-5fc8-11ea-9dfe-a575a96938ae\"}],\"gauge_inner_width\":10,\"gauge_style\":\"half\",\"gauge_width\":10,\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"index_pattern\":\"stocks\",\"interval\":\"\",\"isModelInvalid\":false,\"series\":[{\"axis_position\":\"right\",\"chart_type\":\"bar\",\"color\":\"rgba(0,84,188,1)\",\"fill\":0.5,\"formatter\":\"number\",\"hidden\":false,\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"label\":\"Trades\",\"line_width\":1,\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"count\"}],\"point_size\":1,\"separate_axis\":0,\"split_mode\":\"everything\",\"stacked\":\"none\",\"terms_field\":\"symbol\",\"axis_min\":\"0\",\"axis_max\":\"1000\",\"type\":\"timeseries\"},{\"axis_position\":\"right\",\"chart_type\":\"line\",\"color\":\"rgba(211,192,91,0.65)\",\"fill\":0.5,\"formatter\":\"number\",\"hidden\":false,\"id\":\"c0f53f10-5fc7-11ea-9dfe-a575a96938ae\",\"label\":\"Volume\",\"line_width\":1,\"metrics\":[{\"field\":\"amount\",\"id\":\"c0f53f11-5fc7-11ea-9dfe-a575a96938ae\",\"percentiles\":[{\"id\":\"3049f580-5fc9-11ea-9dfe-a575a96938ae\",\"mode\":\"line\",\"shade\":0.2,\"value\":50}],\"type\":\"sum\"}],\"point_size\":1,\"separate_axis\":1,\"split_mode\":\"everything\",\"stacked\":\"none\",\"terms_field\":\"symbol\",\"type\":\"timeseries\",\"value_template\":\"${{value}}\"},{\"id\":\"c6e77fa0-6111-11ea-a5d2-d3bd7837d38b\",\"color\":\"rgba(25,77,51,1)\",\"split_mode\":\"filter\",\"metrics\":[{\"id\":\"c6e77fa1-6111-11ea-a5d2-d3bd7837d38b\",\"type\":\"avg\",\"field\":\"price\"}],\"separate_axis\":1,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":\"00\",\"fill\":\"0\",\"stacked\":\"none\",\"label\":\"Buy\",\"type\":\"timeseries\",\"terms_field\":\"side\",\"terms_size\":\"2\",\"terms_order_by\":\"_key\",\"value_template\":\"${{value}}\",\"filter\":{\"query\":\"side : \\\"BUY\\\" \",\"language\":\"kuery\"}},{\"id\":\"5f562c50-6112-11ea-a5d2-d3bd7837d38b\",\"color\":\"rgba(159,5,0,1)\",\"split_mode\":\"filter\",\"metrics\":[{\"id\":\"5f593990-6112-11ea-a5d2-d3bd7837d38b\",\"type\":\"avg\",\"field\":\"price\"}],\"separate_axis\":1,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":\"00\",\"fill\":\"0\",\"stacked\":\"none\",\"label\":\"Sell\",\"type\":\"timeseries\",\"terms_field\":\"side\",\"terms_size\":\"2\",\"terms_order_by\":\"_key\",\"value_template\":\"${{value}}\",\"filter\":{\"query\":\"side : \\\"SELL\\\" \",\"language\":\"kuery\"}}],\"show_grid\":1,\"show_legend\":1,\"time_field\":\"time\",\"type\":\"timeseries\",\"pivot_id\":\"symbol\",\"pivot_type\":\"string\",\"pivot_label\":\"Symbol\"},\"aggs\":[]}"},"id":"ba131000-5fcc-11ea-a238-bf5970186390","migrationVersion":{"visualization":"7.4.2"},"references":[],"type":"visualization","updated_at":"2020-03-08T08:46:43.866Z","version":"WzkzMSwxXQ=="} +{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"},"title":"Trades by Side","uiStateJSON":"{}","version":1,"visState":"{\"title\":\"Trades by Side\",\"type\":\"pie\",\"params\":{\"type\":\"pie\",\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":true,\"labels\":{\"show\":true,\"values\":false,\"last_level\":false,\"truncate\":50}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"side\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":2,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\"}}]}"},"id":"e96fbcd0-5fcd-11ea-a238-bf5970186390","migrationVersion":{"visualization":"7.4.2"},"references":[{"id":"stocks-index-pattern","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}],"type":"visualization","updated_at":"2020-03-08T07:47:00.842Z","version":"WzMwNSwxXQ=="} +{"attributes":{"expression":"kibana\n| kibana_context query=\"{\\\"query\\\":\\\"\\\",\\\"language\\\":\\\"kuery\\\"}\" filters=\"[]\"\n| lens_merge_tables layerIds=\"c234107c-d568-4988-bc9c-e8a2f3976f71\" \n tables={esaggs index=\"stocks-index-pattern\" metricsAtAllLevels=false partialRows=false includeFormatHints=true aggConfigs={lens_auto_date aggConfigs=\"[{\\\"id\\\":\\\"7e7c15ce-c564-40d0-95f1-e2e768effb24\\\",\\\"enabled\\\":true,\\\"type\\\":\\\"terms\\\",\\\"schema\\\":\\\"segment\\\",\\\"params\\\":{\\\"field\\\":\\\"account\\\",\\\"orderBy\\\":\\\"3c6e3bde-20c2-4f82-92fd-6b8a664558e5\\\",\\\"order\\\":\\\"desc\\\",\\\"size\\\":10,\\\"otherBucket\\\":false,\\\"otherBucketLabel\\\":\\\"Other\\\",\\\"missingBucket\\\":false,\\\"missingBucketLabel\\\":\\\"Missing\\\"}},{\\\"id\\\":\\\"3c6e3bde-20c2-4f82-92fd-6b8a664558e5\\\",\\\"enabled\\\":true,\\\"type\\\":\\\"count\\\",\\\"schema\\\":\\\"metric\\\",\\\"params\\\":{}}]\"} | lens_rename_columns idMap=\"{\\\"col-0-7e7c15ce-c564-40d0-95f1-e2e768effb24\\\":{\\\"label\\\":\\\"Accounts\\\",\\\"dataType\\\":\\\"string\\\",\\\"operationType\\\":\\\"terms\\\",\\\"scale\\\":\\\"ordinal\\\",\\\"sourceField\\\":\\\"account\\\",\\\"isBucketed\\\":true,\\\"params\\\":{\\\"size\\\":10,\\\"orderBy\\\":{\\\"type\\\":\\\"column\\\",\\\"columnId\\\":\\\"3c6e3bde-20c2-4f82-92fd-6b8a664558e5\\\"},\\\"orderDirection\\\":\\\"desc\\\"},\\\"id\\\":\\\"7e7c15ce-c564-40d0-95f1-e2e768effb24\\\"},\\\"col-1-3c6e3bde-20c2-4f82-92fd-6b8a664558e5\\\":{\\\"label\\\":\\\"Trades\\\",\\\"dataType\\\":\\\"number\\\",\\\"operationType\\\":\\\"count\\\",\\\"isBucketed\\\":false,\\\"scale\\\":\\\"ratio\\\",\\\"sourceField\\\":\\\"Records\\\",\\\"id\\\":\\\"3c6e3bde-20c2-4f82-92fd-6b8a664558e5\\\"}}\"}\n| lens_xy_chart xTitle=\"Accounts\" yTitle=\"Trades\" legend={lens_xy_legendConfig isVisible=true position=\"right\"} \n layers={lens_xy_layer layerId=\"c234107c-d568-4988-bc9c-e8a2f3976f71\" hide=false xAccessor=\"7e7c15ce-c564-40d0-95f1-e2e768effb24\" yScaleType=\"linear\" xScaleType=\"ordinal\" isHistogram=false splitAccessor=undefined seriesType=\"bar_horizontal\" accessors=\"3c6e3bde-20c2-4f82-92fd-6b8a664558e5\" columnToLabel=\"{\\\"3c6e3bde-20c2-4f82-92fd-6b8a664558e5\\\":\\\"Trades\\\"}\"}","state":{"datasourceMetaData":{"filterableIndexPatterns":[{"id":"stocks-index-pattern","title":"stocks*"}]},"datasourceStates":{"indexpattern":{"currentIndexPatternId":"stocks-index-pattern","layers":{"c234107c-d568-4988-bc9c-e8a2f3976f71":{"columnOrder":["7e7c15ce-c564-40d0-95f1-e2e768effb24","3c6e3bde-20c2-4f82-92fd-6b8a664558e5"],"columns":{"3c6e3bde-20c2-4f82-92fd-6b8a664558e5":{"dataType":"number","isBucketed":false,"label":"Trades","operationType":"count","scale":"ratio","sourceField":"Records"},"7e7c15ce-c564-40d0-95f1-e2e768effb24":{"dataType":"string","isBucketed":true,"label":"Accounts","operationType":"terms","params":{"orderBy":{"columnId":"3c6e3bde-20c2-4f82-92fd-6b8a664558e5","type":"column"},"orderDirection":"desc","size":10},"scale":"ordinal","sourceField":"account"}},"indexPatternId":"stocks-index-pattern"}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"layers":[{"accessors":["3c6e3bde-20c2-4f82-92fd-6b8a664558e5","0ce4f43c-6b35-4e60-b6a9-cdc9bbc473e2"],"layerId":"c234107c-d568-4988-bc9c-e8a2f3976f71","position":"top","seriesType":"bar_horizontal","showGridlines":false,"splitAccessor":"62b36bc8-ea6b-49ef-8940-9da3865b3173","xAccessor":"7e7c15ce-c564-40d0-95f1-e2e768effb24"}],"legend":{"isVisible":true,"position":"right"},"preferredSeriesType":"bar_horizontal"}},"title":"Trades by Account","visualizationType":"lnsXY"},"id":"fb7a9910-5fd5-11ea-9216-cffe4a4e87d2","references":[],"type":"lens","updated_at":"2020-03-08T07:16:40.796Z","version":"WzYsMV0="} +{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"},"title":"Symbols by Amount","uiStateJSON":"{}","version":1,"visState":"{\"title\":\"Symbols by Amount\",\"type\":\"horizontal_bar\",\"params\":{\"type\":\"histogram\",\"grid\":{\"categoryLines\":false},\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"type\":\"category\",\"position\":\"left\",\"show\":false,\"style\":{},\"scale\":{\"type\":\"linear\"},\"labels\":{\"show\":false,\"rotate\":0,\"filter\":false,\"truncate\":200},\"title\":{}}],\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"name\":\"LeftAxis-1\",\"type\":\"value\",\"position\":\"bottom\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\",\"mode\":\"normal\"},\"labels\":{\"show\":true,\"rotate\":75,\"filter\":true,\"truncate\":100},\"title\":{\"text\":\"Amount\"}}],\"seriesParams\":[{\"show\":true,\"type\":\"histogram\",\"mode\":\"stacked\",\"data\":{\"label\":\"Amount\",\"id\":\"1\"},\"valueAxis\":\"ValueAxis-1\",\"drawLinesBetweenPoints\":true,\"lineWidth\":2,\"showCircles\":true}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"bottom\",\"times\":[],\"addTimeMarker\":false,\"labels\":{\"show\":false},\"thresholdLine\":{\"show\":false,\"value\":10,\"width\":1,\"style\":\"full\",\"color\":\"#E7664C\"}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"sum\",\"schema\":\"metric\",\"params\":{\"field\":\"amount\",\"customLabel\":\"Amount\"}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"split\",\"params\":{\"field\":\"symbol\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":5,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"Symbol\",\"row\":true}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"group\",\"params\":{\"field\":\"side\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":5,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\"}}]}"},"id":"f7bdf800-610e-11ea-b327-61404d5d790e","migrationVersion":{"visualization":"7.4.2"},"references":[{"id":"stocks-index-pattern","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}],"type":"visualization","updated_at":"2020-03-08T07:32:30.208Z","version":"WzE1MywxXQ=="} +{"attributes":{"expression":"kibana\n| kibana_context query=\"{\\\"query\\\":\\\"\\\",\\\"language\\\":\\\"kuery\\\"}\" filters=\"[]\"\n| lens_merge_tables layerIds=\"076198d9-6805-4272-b37c-4bccd5c1594b\" \n tables={esaggs index=\"stocks-index-pattern\" metricsAtAllLevels=false partialRows=false includeFormatHints=true aggConfigs={lens_auto_date aggConfigs=\"[{\\\"id\\\":\\\"13b859ef-3659-4cad-a001-ec895e8d6767\\\",\\\"enabled\\\":true,\\\"type\\\":\\\"terms\\\",\\\"schema\\\":\\\"segment\\\",\\\"params\\\":{\\\"field\\\":\\\"symbol\\\",\\\"orderBy\\\":\\\"_key\\\",\\\"order\\\":\\\"asc\\\",\\\"size\\\":10,\\\"otherBucket\\\":false,\\\"otherBucketLabel\\\":\\\"Other\\\",\\\"missingBucket\\\":false,\\\"missingBucketLabel\\\":\\\"Missing\\\"}},{\\\"id\\\":\\\"69896c33-5403-4874-86c2-a113ff715d9c\\\",\\\"enabled\\\":true,\\\"type\\\":\\\"date_histogram\\\",\\\"schema\\\":\\\"segment\\\",\\\"params\\\":{\\\"field\\\":\\\"time\\\",\\\"useNormalizedEsInterval\\\":true,\\\"interval\\\":\\\"auto\\\",\\\"drop_partials\\\":false,\\\"min_doc_count\\\":0,\\\"extended_bounds\\\":{}}},{\\\"id\\\":\\\"3cff11c2-a9d1-46bc-b317-247f9cb734bc\\\",\\\"enabled\\\":true,\\\"type\\\":\\\"sum\\\",\\\"schema\\\":\\\"metric\\\",\\\"params\\\":{\\\"field\\\":\\\"amount\\\",\\\"missing\\\":0}}]\"} | lens_rename_columns idMap=\"{\\\"col-0-13b859ef-3659-4cad-a001-ec895e8d6767\\\":{\\\"dataType\\\":\\\"string\\\",\\\"isBucketed\\\":true,\\\"label\\\":\\\"Top values of symbol\\\",\\\"operationType\\\":\\\"terms\\\",\\\"params\\\":{\\\"orderBy\\\":{\\\"type\\\":\\\"alphabetical\\\"},\\\"orderDirection\\\":\\\"asc\\\",\\\"size\\\":10},\\\"scale\\\":\\\"ordinal\\\",\\\"sourceField\\\":\\\"symbol\\\",\\\"id\\\":\\\"13b859ef-3659-4cad-a001-ec895e8d6767\\\"},\\\"col-1-69896c33-5403-4874-86c2-a113ff715d9c\\\":{\\\"dataType\\\":\\\"date\\\",\\\"isBucketed\\\":true,\\\"label\\\":\\\"Time\\\",\\\"operationType\\\":\\\"date_histogram\\\",\\\"params\\\":{\\\"interval\\\":\\\"auto\\\"},\\\"scale\\\":\\\"interval\\\",\\\"sourceField\\\":\\\"time\\\",\\\"id\\\":\\\"69896c33-5403-4874-86c2-a113ff715d9c\\\"},\\\"col-2-3cff11c2-a9d1-46bc-b317-247f9cb734bc\\\":{\\\"dataType\\\":\\\"number\\\",\\\"isBucketed\\\":false,\\\"label\\\":\\\"Volume\\\",\\\"operationType\\\":\\\"sum\\\",\\\"scale\\\":\\\"ratio\\\",\\\"sourceField\\\":\\\"amount\\\",\\\"id\\\":\\\"3cff11c2-a9d1-46bc-b317-247f9cb734bc\\\"}}\"}\n| lens_xy_chart xTitle=\"Time\" yTitle=\"Volume\" legend={lens_xy_legendConfig isVisible=true position=\"right\"} \n layers={lens_xy_layer layerId=\"076198d9-6805-4272-b37c-4bccd5c1594b\" hide=false xAccessor=\"69896c33-5403-4874-86c2-a113ff715d9c\" yScaleType=\"linear\" xScaleType=\"time\" isHistogram=true splitAccessor=\"13b859ef-3659-4cad-a001-ec895e8d6767\" seriesType=\"bar_stacked\" accessors=\"3cff11c2-a9d1-46bc-b317-247f9cb734bc\" columnToLabel=\"{\\\"3cff11c2-a9d1-46bc-b317-247f9cb734bc\\\":\\\"Volume\\\",\\\"13b859ef-3659-4cad-a001-ec895e8d6767\\\":\\\"Top values of symbol\\\"}\"}","state":{"datasourceMetaData":{"filterableIndexPatterns":[{"id":"stocks-index-pattern","title":"stocks*"}]},"datasourceStates":{"indexpattern":{"currentIndexPatternId":"stocks-index-pattern","layers":{"076198d9-6805-4272-b37c-4bccd5c1594b":{"columnOrder":["13b859ef-3659-4cad-a001-ec895e8d6767","69896c33-5403-4874-86c2-a113ff715d9c","3cff11c2-a9d1-46bc-b317-247f9cb734bc"],"columns":{"13b859ef-3659-4cad-a001-ec895e8d6767":{"dataType":"string","isBucketed":true,"label":"Top values of symbol","operationType":"terms","params":{"orderBy":{"type":"alphabetical"},"orderDirection":"asc","size":10},"scale":"ordinal","sourceField":"symbol"},"3cff11c2-a9d1-46bc-b317-247f9cb734bc":{"dataType":"number","isBucketed":false,"label":"Volume","operationType":"sum","scale":"ratio","sourceField":"amount"},"69896c33-5403-4874-86c2-a113ff715d9c":{"dataType":"date","isBucketed":true,"label":"Time","operationType":"date_histogram","params":{"interval":"auto"},"scale":"interval","sourceField":"time"}},"indexPatternId":"stocks-index-pattern"}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"layers":[{"accessors":["3cff11c2-a9d1-46bc-b317-247f9cb734bc","db3f5244-b217-4140-8f3e-5492fb247555"],"layerId":"076198d9-6805-4272-b37c-4bccd5c1594b","position":"top","seriesType":"bar_stacked","showGridlines":false,"splitAccessor":"13b859ef-3659-4cad-a001-ec895e8d6767","xAccessor":"69896c33-5403-4874-86c2-a113ff715d9c"}],"legend":{"isVisible":true,"position":"right"},"preferredSeriesType":"bar_stacked"}},"title":"Symbols by Time","visualizationType":"lnsXY"},"id":"55903530-5fcd-11ea-a238-bf5970186390","references":[],"type":"lens","updated_at":"2020-03-08T08:45:59.329Z","version":"WzkxNywxXQ=="} +{"attributes":{"description":"","hits":0,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[]}"},"optionsJSON":"{\"hidePanelTitles\":false,\"useMargins\":true}","panelsJSON":"[{\"version\":\"8.0.0-SNAPSHOT\",\"gridData\":{\"x\":0,\"y\":0,\"w\":48,\"h\":9,\"i\":\"be2ff307-1383-4896-be32-3bf41b175629\"},\"panelIndex\":\"be2ff307-1383-4896-be32-3bf41b175629\",\"embeddableConfig\":{},\"panelRefName\":\"panel_0\"},{\"version\":\"8.0.0-SNAPSHOT\",\"gridData\":{\"x\":0,\"y\":9,\"w\":10,\"h\":10,\"i\":\"b31d60e9-8b89-46d2-833b-5db3e143cc4d\"},\"panelIndex\":\"b31d60e9-8b89-46d2-833b-5db3e143cc4d\",\"embeddableConfig\":{\"vis\":{\"legendOpen\":false}},\"panelRefName\":\"panel_1\"},{\"version\":\"8.0.0-SNAPSHOT\",\"gridData\":{\"x\":10,\"y\":9,\"w\":11,\"h\":10,\"i\":\"5db3a824-52dc-49e1-b6d1-20736db0f572\"},\"panelIndex\":\"5db3a824-52dc-49e1-b6d1-20736db0f572\",\"embeddableConfig\":{},\"panelRefName\":\"panel_2\"},{\"version\":\"8.0.0-SNAPSHOT\",\"gridData\":{\"x\":21,\"y\":9,\"w\":11,\"h\":10,\"i\":\"5488f083-7d67-49f7-9d7e-1fe576cf13ef\"},\"panelIndex\":\"5488f083-7d67-49f7-9d7e-1fe576cf13ef\",\"embeddableConfig\":{\"vis\":{\"legendOpen\":false}},\"panelRefName\":\"panel_3\"},{\"version\":\"8.0.0-SNAPSHOT\",\"gridData\":{\"x\":32,\"y\":9,\"w\":16,\"h\":10,\"i\":\"5cc46a50-9ead-493d-accf-7ff80ed7df0b\"},\"panelIndex\":\"5cc46a50-9ead-493d-accf-7ff80ed7df0b\",\"embeddableConfig\":{},\"panelRefName\":\"panel_4\"}]","refreshInterval":{"pause":false,"value":5000},"timeFrom":"now-15m","timeRestore":true,"timeTo":"now","title":"Stocks","version":1},"id":"140b5490-5fce-11ea-a238-bf5970186390","migrationVersion":{"dashboard":"7.3.0"},"references":[{"id":"ba131000-5fcc-11ea-a238-bf5970186390","name":"panel_0","type":"visualization"},{"id":"e96fbcd0-5fcd-11ea-a238-bf5970186390","name":"panel_1","type":"visualization"},{"id":"fb7a9910-5fd5-11ea-9216-cffe4a4e87d2","name":"panel_2","type":"lens"},{"id":"f7bdf800-610e-11ea-b327-61404d5d790e","name":"panel_3","type":"visualization"},{"id":"55903530-5fcd-11ea-a238-bf5970186390","name":"panel_4","type":"lens"}],"type":"dashboard","updated_at":"2020-03-08T08:05:52.292Z","version":"WzcyNCwxXQ=="} +{"exportedCount":7,"missingRefCount":0,"missingReferences":[]} \ No newline at end of file diff --git a/_examples/bulk/kafka/go.mod b/_examples/bulk/kafka/go.mod new file mode 100644 index 0000000000..79382f01dc --- /dev/null +++ b/_examples/bulk/kafka/go.mod @@ -0,0 +1,13 @@ +module github.com/elastic/go-elasticsearch/v7/_examples/bulk/kafka + +go 1.11 + +replace github.com/elastic/go-elasticsearch/v7 => ../../.. + +require ( + github.com/dustin/go-humanize v1.0.0 + github.com/elastic/go-elasticsearch/v7 7.x + github.com/segmentio/kafka-go v0.3.5 + go.elastic.co/apm v1.7.1 + go.elastic.co/apm/module/apmelasticsearch v1.7.1 +) diff --git a/_examples/bulk/kafka/kafka.go b/_examples/bulk/kafka/kafka.go new file mode 100644 index 0000000000..ad9c86a274 --- /dev/null +++ b/_examples/bulk/kafka/kafka.go @@ -0,0 +1,368 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +build ignore + +package main + +import ( + "context" + "expvar" + "flag" + "fmt" + "log" + "net/http" + "os" + "os/signal" + "strings" + "sync" + "time" + + _ "net/http/pprof" + + "github.com/dustin/go-humanize" + + "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v7/esutil" + + "go.elastic.co/apm" + "go.elastic.co/apm/module/apmelasticsearch" + + "github.com/elastic/go-elasticsearch/v7/_examples/bulk/kafka/consumer" + "github.com/elastic/go-elasticsearch/v7/_examples/bulk/kafka/producer" +) + +var ( + brokerURL string + + topicName = "stocks" + topicParts = 4 + msgRate int + + indexName = "stocks" + numProducers = 1 + numConsumers = 4 + numIndexers = 1 + flushBytes = 0 // Default + numWorkers = 0 // Default + indexerError error + + mapping = `{ + "mappings": { + "properties": { + "time": { "type": "date" }, + "symbol": { "type": "keyword" }, + "side": { "type": "keyword" }, + "account": { "type": "keyword" }, + "quantity": { "type": "long" }, + "price": { "type": "long" }, + "amount": { "type": "long" } + } + }}}` +) + +func init() { + if v := os.Getenv("KAFKA_URL"); v != "" { + brokerURL = v + } else { + brokerURL = "localhost:9092" + } + flag.IntVar(&msgRate, "rate", 1000, "Producer rate (msg/sec)") + flag.IntVar(&numProducers, "producers", numProducers, "Number of producers") + flag.IntVar(&numConsumers, "consumers", numConsumers, "Number of consumers") + flag.IntVar(&numIndexers, "indexers", numIndexers, "Number of indexers") + flag.Parse() +} + +func main() { + log.SetFlags(0) + + // Serve the "/debug/pprof/" and "/debug/vars" pages + // + go func() { log.Println(http.ListenAndServe("localhost:6060", nil)) }() + + var ( + wg sync.WaitGroup + ctx = context.Background() + + producers []*producer.Producer + consumers []*consumer.Consumer + indexers []esutil.BulkIndexer + ) + + done := make(chan os.Signal) + signal.Notify(done, os.Interrupt) + go func() { <-done; log.Println("\n"); os.Exit(0) }() + + // Set up producers + // + for i := 1; i <= numProducers; i++ { + producers = append(producers, + &producer.Producer{ + BrokerURL: brokerURL, + TopicName: topicName, + TopicParts: topicParts, + MessageRate: msgRate}) + } + + // Create an Elasticsearch client + // + es, err := elasticsearch.NewClient(elasticsearch.Config{ + RetryOnStatus: []int{502, 503, 504, 429}, // Add 429 to the list of retryable statuses + RetryBackoff: func(i int) time.Duration { return time.Duration(i) * 100 * time.Millisecond }, + MaxRetries: 5, + EnableMetrics: true, + Transport: apmelasticsearch.WrapRoundTripper(http.DefaultTransport), + }) + if err != nil { + log.Fatalf("Error: NewClient(): %s", err) + } + // Export client metrics to the "expvar" package + expvar.Publish("go-elasticsearch", expvar.Func(func() interface{} { m, _ := es.Metrics(); return m })) + + // Create the "stocks" index with correct mappings + // + res, err := es.Indices.Exists([]string{indexName}) + if err != nil { + log.Fatalf("Error: Indices.Exists: %s", err) + } + res.Body.Close() + if res.StatusCode == 404 { + res, err := es.Indices.Create( + indexName, + es.Indices.Create.WithBody(strings.NewReader(mapping)), + es.Indices.Create.WithWaitForActiveShards("1"), + ) + if err != nil { + log.Fatalf("Error: Indices.Create: %s", err) + } + if res.IsError() { + log.Fatalf("Error: Indices.Create: %s", res) + } + } + + // Set up indexers + // + for i := 1; i <= numIndexers; i++ { + idx, err := esutil.NewBulkIndexer(esutil.BulkIndexerConfig{ + Index: indexName, + Client: es, + NumWorkers: numWorkers, + FlushBytes: int(flushBytes), + // Elastic APM: Instrument the flush operations and capture errors + OnFlushStart: func(ctx context.Context) context.Context { + txn := apm.DefaultTracer.StartTransaction("Bulk", "indexing") + return apm.ContextWithTransaction(ctx, txn) + }, + OnFlushEnd: func(ctx context.Context) { + apm.TransactionFromContext(ctx).End() + }, + OnError: func(ctx context.Context, err error) { + indexerError = err + apm.CaptureError(ctx, err).Send() + }, + }) + if err != nil { + log.Fatalf("ERROR: NewBulkIndexer(): %s", err) + } + indexers = append(indexers, idx) + } + + // Set up consumers + // + for i := 1; i <= numConsumers; i++ { + consumers = append(consumers, + &consumer.Consumer{ + BrokerURL: brokerURL, + TopicName: topicName, + Indexer: indexers[i%numIndexers]}) + } + + // Set up reporting output + // + reporter := time.NewTicker(500 * time.Millisecond) + defer reporter.Stop() + go func() { + fmt.Printf("Initializing... producers=%d consumers=%d indexers=%d\n", numProducers, numConsumers, numIndexers) + for { + select { + case <-reporter.C: + fmt.Print(report(producers, consumers, indexers)) + } + } + }() + errcleaner := time.NewTicker(10 * time.Second) + defer errcleaner.Stop() + go func() { + for { + select { + case <-errcleaner.C: + indexerError = nil + } + } + }() + + // Create the Kafka topic + // + if len(producers) > 0 { + if err := producers[0].CreateTopic(ctx); err != nil { + log.Fatalf("ERROR: Producer: %s", err) + } + } + + // Launch consumers + // + for _, c := range consumers { + wg.Add(1) + go func(c *consumer.Consumer) { + defer wg.Done() + if err := c.Run(ctx); err != nil { + log.Fatalf("ERROR: Consumer: %s", err) + } + }(c) + } + + // Launch producers + // + time.Sleep(5 * time.Second) // Leave some room for consumers to connect + for _, p := range producers { + wg.Add(1) + go func(p *producer.Producer) { + defer wg.Done() + if err := p.Run(ctx); err != nil { + log.Fatalf("ERROR: Producer: %s", err) + } + }(p) + } + + wg.Wait() + + fmt.Print(report(producers, consumers, indexers)) +} + +func report( + producers []*producer.Producer, + consumers []*consumer.Consumer, + indexers []esutil.BulkIndexer, +) string { + var ( + b strings.Builder + + value string + currRow = 1 + numCols = 6 + colWidth = 20 + + divider = func(last bool) { + fmt.Fprintf(&b, "\033[%d;0H", currRow) + fmt.Fprint(&b, "┣") + for i := 1; i <= numCols; i++ { + fmt.Fprint(&b, strings.Repeat("━", colWidth)) + if last && i == 5 { + fmt.Fprint(&b, "┷") + continue + } + if i < numCols { + fmt.Fprint(&b, "┿") + } + } + fmt.Fprint(&b, "┫") + currRow++ + } + ) + + fmt.Print("\033[2J\033[K") + fmt.Printf("\033[%d;0H", currRow) + + fmt.Fprint(&b, "┏") + for i := 1; i <= numCols; i++ { + fmt.Fprint(&b, strings.Repeat("━", colWidth)) + if i < numCols { + fmt.Fprint(&b, "┯") + } + } + fmt.Fprint(&b, "┓") + currRow++ + + for i, p := range producers { + fmt.Fprintf(&b, "\033[%d;0H", currRow) + value = fmt.Sprintf("Producer %d", i+1) + fmt.Fprintf(&b, "┃ %-*s│", colWidth-1, value) + s := p.Stats() + value = fmt.Sprintf("duration=%s", s.Duration.Truncate(time.Second)) + fmt.Fprintf(&b, " %-*s│", colWidth-1, value) + value = fmt.Sprintf("msg/sec=%s", humanize.FtoaWithDigits(s.Throughput, 2)) + fmt.Fprintf(&b, " %-*s│", colWidth-1, value) + value = fmt.Sprintf("sent=%s", humanize.Comma(int64(s.TotalMessages))) + fmt.Fprintf(&b, " %-*s│", colWidth-1, value) + value = fmt.Sprintf("bytes=%s", humanize.Bytes(uint64(s.TotalBytes))) + fmt.Fprintf(&b, " %-*s│", colWidth-1, value) + value = fmt.Sprintf("errors=%s", humanize.Comma(int64(s.TotalErrors))) + fmt.Fprintf(&b, " %-*s┃", colWidth-1, value) + currRow++ + divider(i == len(producers)-1) + } + + for i, c := range consumers { + fmt.Fprintf(&b, "\033[%d;0H", currRow) + value = fmt.Sprintf("Consumer %d", i+1) + fmt.Fprintf(&b, "┃ %-*s│", colWidth-1, value) + s := c.Stats() + value = fmt.Sprintf("lagging=%s", humanize.Comma(s.TotalLag)) + fmt.Fprintf(&b, " %-*s│", colWidth-1, value) + value = fmt.Sprintf("msg/sec=%s", humanize.FtoaWithDigits(s.Throughput, 2)) + fmt.Fprintf(&b, " %-*s│", colWidth-1, value) + value = fmt.Sprintf("received=%s", humanize.Comma(s.TotalMessages)) + fmt.Fprintf(&b, " %-*s│", colWidth-1, value) + value = fmt.Sprintf("bytes=%s", humanize.Bytes(uint64(s.TotalBytes))) + fmt.Fprintf(&b, " %-*s│", colWidth-1, value) + value = fmt.Sprintf("errors=%s", humanize.Comma(s.TotalErrors)) + fmt.Fprintf(&b, " %-*s┃", colWidth-1, value) + currRow++ + divider(i == len(consumers)-1) + } + + for i, x := range indexers { + fmt.Fprintf(&b, "\033[%d;0H", currRow) + value = fmt.Sprintf("Indexer %d", i+1) + fmt.Fprintf(&b, "┃ %-*s│", colWidth-1, value) + s := x.Stats() + value = fmt.Sprintf("added=%s", humanize.Comma(int64(s.NumAdded))) + fmt.Fprintf(&b, " %-*s│", colWidth-1, value) + value = fmt.Sprintf("flushed=%s", humanize.Comma(int64(s.NumFlushed))) + fmt.Fprintf(&b, " %-*s│", colWidth-1, value) + value = fmt.Sprintf("failed=%s", humanize.Comma(int64(s.NumFailed))) + fmt.Fprintf(&b, " %-*s│", colWidth-1, value) + if indexerError != nil { + value = "err=" + indexerError.Error() + if len(value) > 2*colWidth { + value = value[:2*colWidth] + } + } else { + value = "" + } + fmt.Fprintf(&b, " %-*s┃", 2*colWidth, value) + currRow++ + if i < len(indexers)-1 { + divider(true) + } + } + + fmt.Fprintf(&b, "\033[%d;0H", currRow) + fmt.Fprint(&b, "┗") + for i := 1; i <= numCols; i++ { + fmt.Fprint(&b, strings.Repeat("━", colWidth)) + if i == 5 { + fmt.Fprint(&b, "━") + continue + } + if i < numCols { + fmt.Fprint(&b, "┷") + } + } + fmt.Fprint(&b, "┛") + currRow++ + + return b.String() +} diff --git a/_examples/bulk/kafka/producer/producer.go b/_examples/bulk/kafka/producer/producer.go new file mode 100644 index 0000000000..604772d89a --- /dev/null +++ b/_examples/bulk/kafka/producer/producer.go @@ -0,0 +1,187 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +package producer + +import ( + "bytes" + "context" + "fmt" + "math/rand" + "net" + "time" + + "github.com/segmentio/kafka-go" +) + +var ( + sides = []string{"BUY", "SELL"} + symbols = []string{"KBCU", "KBCU", "KBCU", "KJPR", "KJPR", "KSJD", "KXCV", "WRHV", "WTJB", "WMLU"} + accounts = []string{"ABC123", "ABC123", "ABC123", "LMN456", "LMN456", "STU789"} +) + +func init() { + rand.Seed(time.Now().UnixNano()) + kafka.DefaultClientID = "go-elasticsearch-kafka-demo" +} + +type Producer struct { + BrokerURL string + TopicName string + TopicParts int + MessageRate int + + writer *kafka.Writer + + startTime time.Time + totalMessages int64 + totalErrors int64 + totalBytes int64 +} + +func (p *Producer) Run(ctx context.Context) error { + var messages []kafka.Message + p.startTime = time.Now() + + p.writer = kafka.NewWriter(kafka.WriterConfig{ + Brokers: []string{p.BrokerURL}, + Topic: p.TopicName, + }) + + ticker := time.NewTicker(time.Second) + + for { + select { + case t := <-ticker.C: + for i := 1; i <= p.MessageRate; i++ { + messages = append(messages, kafka.Message{Value: p.generateMessage(t)}) + } + if err := p.writer.WriteMessages(ctx, messages...); err != nil { + messages = messages[:0] + return err + } + messages = messages[:0] + } + } + + p.writer.Close() + ticker.Stop() + + return nil +} + +func (p *Producer) CreateTopic(ctx context.Context) error { + conn, err := net.Dial("tcp", p.BrokerURL) + if err != nil { + return err + } + + return kafka.NewConn(conn, "", 0).CreateTopics( + kafka.TopicConfig{ + Topic: p.TopicName, + NumPartitions: p.TopicParts, + ReplicationFactor: 1, + }) +} + +func (p *Producer) generateMessage(t time.Time) []byte { + var ( + buf bytes.Buffer + + timestamp time.Time + timeshift time.Duration + side string + quantity int + price int + amount int + symbol string + account string + ) + + timestamp = t + if timestamp.Minute() == 2 { + timeshift = -(time.Duration(time.Minute)) + } else { + timeshift = time.Duration(time.Duration(rand.ExpFloat64()/2.0*100) * time.Second) + } + switch { + case timestamp.Minute()%5 == 0: + side = "SELL" + default: + if timestamp.Second()%3 == 0 { + side = "SELL" + } else { + side = "BUY" + } + } + switch { + case timestamp.Minute()%3 == 0: + quantity = rand.Intn(250) + 500 + case timestamp.Second()%6 == 0: + quantity = rand.Intn(300) + 50 + case timestamp.Second()%12 == 0: + quantity = rand.Intn(10) + 1 + default: + quantity = rand.Intn(150) + 10 + } + if side == "SELL" { + price = int(100.0 + 15.0*rand.NormFloat64()) + } else { + price = int(250.0 + 50.0*rand.NormFloat64()) + } + amount = quantity * price + if timestamp.Second()%4 == 0 { + symbol = "KXCV" + } else { + symbol = symbols[rand.Intn(len(symbols))] + } + if timestamp.Minute()%5 == 0 && timestamp.Second() > 30 { + account = "STU789" + } else { + account = accounts[rand.Intn(len(accounts))] + } + + fmt.Fprintf(&buf, + `{"time":"%s", "symbol":"%s", "side":"%s", "quantity":%d, "price":%d, "amount":%d, "account":"%s"}`, + timestamp.UTC().Add(timeshift).Format(time.RFC3339), + symbol, + side, + quantity, + price, + amount, + account, + ) + return buf.Bytes() +} + +type Stats struct { + Duration time.Duration + TotalMessages int64 + TotalErrors int64 + TotalBytes int64 + Throughput float64 +} + +func (p *Producer) Stats() Stats { + if p.writer == nil { + return Stats{} + } + + duration := time.Since(p.startTime) + writerStats := p.writer.Stats() + + p.totalMessages += writerStats.Messages + p.totalErrors += writerStats.Errors + p.totalBytes += writerStats.Bytes + + rate := float64(p.totalMessages) / duration.Seconds() + + return Stats{ + Duration: duration, + TotalMessages: p.totalMessages, + TotalErrors: p.totalErrors, + TotalBytes: p.totalBytes, + Throughput: rate, + } +} diff --git a/_examples/bulk/kafka/screenshot.png b/_examples/bulk/kafka/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..5fb33ba2a86191dfe3cf2b2f32badf75e0c67e12 GIT binary patch literal 568571 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

GH{WVk{r*agcZ=-jzq-v%{n8g) z^6P^SKD3)|f6Tsn!MCEklu!3L!4~`m_GS0w)a8(=02&zFyP(b$GQofU{rC4zCWgZg zKRg6^8q&gP<`*1k7<8M88{%~INq)hh2a8eb#>^lY4a?53KDoLxWSG>yv|-O(FTGQ# zilx=4lS)iJUur=W+MsMKTWLcE7P&fDm8+4ZOZ5Pbah4r(=mqw#hrVZ{hHouB$X&F! zk-AiFmdYiO>YQq+GC;Ek6L3mPm-?B?oTp7tt{6h%BP1Ot=d07;a>a~F*Y(H*XK|t} z4mGMqs4?V9OdqwRcEeQ$xn)ruk_Tu3BQIBKOwHkox|}A3{NgoMGwms>KJi093226EpMqYu+AW`uY`l3(3 zfLE{0?vVaPdY2eEn?dSSc%rTamW6$@ZMPjxvYE4=v9V)zw2bszsgbTp^lH;=kZ9a5XN9e*n4t2b-Y3;MsSVQaXDyiFZDPbQ zZV;;ITzgQv%ghj5wW*~mm%4<>xKTyUz-v!CQ?pW^*QrSTdK=$=j#XtJ7^%agw1+nJ z!Ge&iLZb?9@Me z%`O{yt(Z(jVoX&CwodapP;Z;7J)qW=uYQ5S=4W5}gB^arr8Z*Ju2R<&oump~CaJ6@ z=b;3BnKv=&yXS5v**_osk?p_7BpLf1qA{|3lX0>oI;i!#`pqic-ngW4qaCzUz8$dl zJ~nqwn$4ZDQ8zN~qifvP*>i6^XGc%c;ffZW)J!yQc5=SZ_>iOdqN1wIrY@LjeWW^g zaNQy5+u45l+w44~`HR^pE3-leLOHhA9!FTeId4jmMYq;zUdhkP()g=;DtpI=cF%9L z2m1J$6&q~a;GHCWHQ3&M=bthhKS3%JeYB<;X^+1;)ecZRHU`l;pzGR0W|maSn_QPj zZBVyfR#lfv9ejjsHDOO3biH9K$|q=jAgM$S!L->9`1s(F^2f)f#2A$lw81$v6noH%wFv7JYnK5(b%w#@D>#&{z2975xUPuE4 zSoCqEcVGrFH^<|`93UJf0DTe$!4RG9_ z(AFtixa5a=L|Upd<~{-*9e+}OnTybEVcZ&4EMw7?vJr&K&fCiRi%HbnO=2D?@h8v< z=ExbRf58nLk1r}pMmg)O)9nv`yvDxxrPEzv=EM_@wv)ebl85)}SLkhlj|(sSj$L%| zkL`sQUa_OaK>F^5Kk#)0@QcQc@;*d7XgX%}NM7ABz9Ef+JMo0$-9YmRCw^H{x&6HT z!I;5O4*^&AXyFg>h!5=fGoG@`fAMSk@S|B`4n>T@yYIR=*_R%=|5m%~@?YEEWCw{u z_P5@8*cnBDf8nWr+0TCdD@pr_DJ58cyZJAgOSAPGsJ7l8i`!?$Q6d?vJul^hepC`i~@iO6`FC_i>dm;NN=7b@p3@optuNwa&SNp_mpR>u63N?NY+kl1fS~N^C}}om!(Z39)5=Qbxbl?a0bji`X&?;p zHJAUR-MQj#?B=(8&n6aCDIcMDbgTvdw1^;7&t8%EqyJ$`tOs*Zm%h3T^2p;Vk3|I7#WGuR8lSRuG zTWp+6IdtltTB8@5Hfp_cv^XxZ)taK?wfRq#Gb~Iof=P&e9{5mQfG@Og_eEr9Q%gJg z-)ZDgd8QTq$6-*08}6UX4BUM-VFzlge!m1l6DQfzPu*voitu*jS!Y|}#0m+EagjX#yLg#Yhk;IY*26MYAN>%-L!yU#V4pN(;%v3-LO`bf8}PyQyWL z1U_Y|AAyW`T)6mt19M)GQ>HAkHJk5tCMpFJrYavQ?g3q0xs%XufIws6PtOm*SQ?Rk z)yN(RGpFQkv$HB2L^Ek59Fg!!n=x<}LD~xt002M$NklZ2f z0msh|4y=0#t$guuZQRCNdGS<%JvO-XPeiBEhr7xwKYP2z|89u^3k3(Wm0;m9>TxV! z$3EUhN8d!a$IK6Y_b(hh|I!DEaN+5Z=Z67&p6l`UFuorH5~67mUt61d>o z=d=@~b)iT?`QxT)e#HE$Lt{2jM-F&QI4Seo*-N!h_=e)n5ey76UOIQLAAzb>~{ zIM#6-P=Q%n|1?K~BYd@U_cleNo2z*uYWr*UDFpBgN8e%R9pTMC6R$S5XWI7d&skgR zejArwBop%j!B+o}XS8$>Vnh0k&Kl+WI4M5_jU90uhxy@k$JdVw5dux#hQr!;PMmDn z>CLvIafTh~Es#&HUTN+Xx_5Pp%;od*q}DIqf_9`6g6|r3baQ^9%qC#;k@pl{`mHg5A7U} zgD(d?{5@ZWXE@~c_xb(jl04q{6d{Tjnhv{m?b7-%(+R3@Wr0T1x^?TE@B?cGo}&$f zP!3?x zKl{zktW`oB1Yc+xaX&Gko#Pck+9lX7D=E;p3bZI^>-#6Fzp1HNG)U_gLIJ0&v_vLx z-;m%($`8U9Z781*{Ql~fKkla!bnv`bE0e`{-h6F98^OWx^SyWf%FUZzE6(FNT>Cf( zyzz$X6t(RNr?JGCJ|01}$M;yiJzqFV^W%+}z#E1Lr!ey*KKC7xIC*hDS>BUP7fut9 zj)oJw4EX~Ir))nf7g%J~{g!e5RThzdAT9Bj&R&@4EWGt!VljZCbjd6(r3TIWu(&cI9=ONDXP=O0epjR)Pau zz|eAVQH7C^Bcrd?BC@6Le)Hd0>TAzghBj{*sykE9GxR|_CcFsOHhW~aaeOnoN32q9 zr7Zzp02dw!J~(?;er_t!zbvrRR6qyLmMV<`@bQV~Y$QpksR$5)a{T5B9|CDQ)lO9( z#WW$*NWeZrCyZ}j_BN|lRIrWP*VxWgkK0sj_!etJv3>UztCFMG%8Dw%3c@3%2`+6N zGgfMndHb}uYu3cuCK?v%J|}5{&I($Ieu2I?rtRviwfxD8g@axc^p!9V^Fumtr8QJE zVVbqeT&865Ou>^Tm(-55?r?P;6F&^oZ=jYT;<=OUKNUY9tP~wauia^rI*YWC z>`)iULGdxdg*&CoX3gDY(rQ{O?ZL~`rh${`QH|qa`fbGVHcI-!lZoT_*!e*W1Tq@O zVg5~oJ8FE>aZIepitSCd;ot*yZO`X*iauHWE1`|XPa<50FMO+Ud`JS;l4&}@Q|Ggg zW3KRghJ)zTj&3aw3Zet4y@wL$0PZSgXDnPU z74y&9ZfRQPW>>1eWTL9E=bn#%FLNG_w=uciDXr3FZ+?$7FSgkF-EG#;Jwtsj2m(V0 z`}bb+mv+a!-?O5^Vrhq9%GKlEDkt*3$k6*TDqPoWec7(K@ESR>l;C0CHmj_dr8)_6 zAU;bQ?mZ-0iofeSimZNnhmA=qvuSy+*pbvcos?FJ#>_L!X<`zkKh^wzvuw1|SXbd= ziT?5HlBDD9&+L7Ha88)pzWN%QQ!Xdndaw6biA;%E9cWXa&D4^rX?9TW_{kHCEhaN= z=8}`Meh30k@ZRw2i$QS34{2!`wyU|=TI!3XDLPTwbqF-k$dz`AG(t{BqRy~(3MN|! zC-6nXhT9*oVy1;F1)MUYDMVtUIGkoizjli9v7tinE&%w1&<2czf zqJ(*Td^wjf^e5a_%&%t7oZ$pnVR&fc_~haEZv;&~`Fmly_-D|Lgh|>pR}TnQxrZ>9 z56Q#u*U8%FpAA=z=cg*M_5(-h-JPl`P90oNTqZ`OzeEaS!k;@gu;ug5c}XEP=B0x~ zoC$`6oh=h0YFk7uV8Cz^!OJI{*TXqkEdd@W3^!PAugky zT12wX)rOv-GiJ;<2}T0DP|A9k%A}Waw@s~BVmB}UuHAmmyY2tH9g!1G4CnrYJ`fr0LM!)~sUiSU`3E*OwbLKLA(%NCQ~Kp?O~5 z+ow~-52J-kUov(&q8jh_+ridJTJi@xgYO+C_=dyv^3Nl!Gx2!qkrpjj0~Oihjr)L?CsOe3=^DPvMg*S~9Woc2oYiWRGB;UG z=MqiYXpRZMXz3uJ9)75ITp#i~-h%^GpAg(*;0Io&oze`^iF~ANw#B5$=;yQJ!WX>V zJlJWq4clctYTB?Ikl&!v;o+)`qq6#}zGc7q|4jp9DuE83K&hz`7U`M$M;@hN@zq#Q zlkj{}!E9}E_DDs0iBzN?vx*7RZQS@NcA!C_QRBSe`(|Xgz9#1TF1_=Xsja(g?fM7p zoU`7ljVc`u6I9<24Tzc%YmVE_c-jebQu= zR72N6gcDarW23$OuoI4s&yz`}1P4GGHQYEtl*^UI-Tb-lvR^;+6MOd!U(mZTG@wSn zmo_5gdw%^>HmUeBD;THK!N_)N?1}p#;eD%r)KMsnkhd*+m;LhLpW6rD`eA2Uh9;qF zxT_;hh&Wz+1+)v@@RuS0bw@;#1GRg^V|@}b$s|z`K%aT_3FkaJMXK(OrjA&?VDKG= zEAndBoUI@UxfW9h^wM!pS)0tgqoxI}w3>q6(bouc0IH)qdE(c>xBKb-@Fe*7tN61J zTr~I?53Q|rwrlr`ws1ZnkOg@-xVrD4#bG!c<6!?3__{W$KF`140zGkX-qg}y(gV!YD{ zgTD5)uQ}n%aGDwT`0?5)IGMics;it6>O1ee(=NXFVte@Ehuwx9!4i(CD=Op4uP|4rG%XYNLlKji)Jhi~oIZ1e&mvU(gmT<-bnV|_;1Q<=ak5N(~xT229M zPf$GS@0L0tFRcIium9?|f%Tn{mqadtZx7Ovw+dj6( z)Z<~D%w~A}!!TKZYK3SiQbUeq%RfNvZnv0bQ;!$<=H^=2wU5`rYrt+cJiTxY+#U%D zFc13pbw5$WnUC7qO)tBbgx3NI>I|0*V-bF;0ik-+4j;7Gw)KED>ddO`F=a&1gAz8C7{*jo3UploD3 z`T?Kl1#^Zrv@xkWwo7e4d$#;vluom#PN0YYhv{G5xbb%0k_+sX8{Tj4z5Z6`3kcHy zNJw#YnVi&S+4djqvHAn!ZANL4wKN}gLZZY)B6C!_+FW<2UXHz^^0B1N0Gqmae}r2N zZ0?U8TVRdScwlqmc&vX3>N3RtgiD6+2iM`J;p?F}6Yq?iJNz_!od{*<@1y5tiy7@p zvx3ZOX|o-)bq8nK!FH*+hKe$A*T_U;@$|(uvrNzB;|EQ!;~n#q!$J6#om<>yZ+6u@ zn_5z7TX)H~6=R#uKGvj;OqE}&_P!~Wm%dHW^6F*Eg5Q7oedH9bEqpz4DV~m;JNz_! zee7_>ks2c@J2yB@oG^Wk7cRm$G_g85T5b7~f0l56uiHF%(kF$hhkc4Jhf4Lhaf$|l zK)_{8n!BGr!cW83VLC8|!Kt92!s-w2lu-Y$90%WT=Pkb0jmKb&4=x@46}}F`4X#yM ze0A0tH`>M>4@-Tz-fhg24sjI-!vd$6=7fl%8pagW458`pDO_@BuJBW?5wFG8ue1~d zLLRQh20{b+BTqCYtUTi-Ts9GM_*wXxmT>Sfqv{+h9@{M;gf#x*ntcI`!MO+Ef#6_9oX}a_xOZ@$+n|*ujZD(TrjbQ6Z<^^ej&i_UGKUz$RE7V z$uPR|Ay9)Z{k)5222P=I7|mK4O$>w*IBBk^sBjLQ(LTYHY4YUB&bcodHwbOKkbyEh z+p%*%JB4x1I-P_-2$LqlyyKL*yu93*Ieq-&A9vb82rO_KO}g^REBo_e5``HM?@91W+@)^#*E{&^Uu@U?%=_i*=*_RPcZ<jw(49YN@ctBl80ZiZwNx~GnD|loyzREz`qi@7Ke*z-<5uv|%$;UN*{(zwUXz{l&6>GyF5KkQvN`1LX!_1y|JBCw~{c+tyj? z%rm5tG}ih$o2;)z+BwCjC1_$m)J3JXf1iBtU6=?orEJyi^C; zIw6z)9UWy^v~;0O=zdg=x3ASwK3la6c*;)(`Q+YHyR^BGmns3kj4-0i*U&Vx`!XR>!Up%QXqcg zXyuOgdGd1H)e>KQ&~B45UUp_yu}G#SJNa3V-wqPvfYadZ`?uM-3on$@%pH5alk)Fv` zlD)=WYgwv08EPR~0How}2%eqD^Am+TfWhD^!DRubalm{M+5D{8`HKGHHjyWSFPe5~ z*4VUPa_kg2PG4lNtiM;9T34x01I?Ggc)%xtc3wxjZ1ANqlA&<%!I%oSJ$#)AVPt&i zJ*Q<-FvT`)eM;}3Clv%>x|{?~*L^uA79S3uMtVlC1G~owd}mi&ZdK*QWs0Dg&X!5eu$L^3B?-a8N{BUUwQ&DJr z=+GW3nK;kA$9m-$H%Lc=JNP*?Bc%F-+-$r4P4Bh;^Rutn-^#f+ffT~R@x*Zf%b^9l ze#@&iOB%Fg3S&D)epuR~MM5J9&8SwlE6bUGcBc|FX@gK>#B;HY0fk7(`D*4|>T z?A>ISoqenGW5Ro3=G0lXSti8G&tD>xM-LxS8h*vPV)+);x?oE7Q!-D!)cF}BlBPUm z1r31sBc|hhE)LWfe(KpfB;YHtkG}gs``sTtC#|glD>?gO7uaCLYKMJzy!d#4!<8R; zpRt~%cj~Ua2P{A5umU<1%KxBD-csU%K^0*WnwzUY58~~^5*kgOSmI0ukCzubmdE}b z#y@<0?2wX`NT!)V+YwG+HWp6MZ8Vx0z6|Sa5_O>I6HdUw(KCW3pSZ_ZP0R~EMAY); zL&-E`Fa<+%$R}X2CrHfepTFMU;0G@uydrWKrg#WMNZj|Pb@}7--8+i=-v1KUv<+I3 zm;3B}@Hs-_9v^@0F5UotJWV{RygPh5{5^gr=1a`Ob5i1c599Rr|9lE0^2o_<@u`M? zvhhs{Ph&|dw}t2Xw#9ujp^|u+cu)1CnM7cQkv_m=GV_VNKKVI2--ZRl~!7;albTW@>N%;Tq4+0@>_HeE>YQ~w+jBa zynIW|8*foLdyF~lAGT}3i-Z?Q=GGg_qL zS7{(WFxXJkH7I2ExC-^>fd3dk4zylZss|G?PT>(yAe3^+Wg5sC+>HMPpCoDE?nwO> zu0H|D3BjfI0SpE~PJ|nxt+eT_AbqV&z%s3^R~mKNG%>z>f-l=U+N3pgSdm(aH2(AD zq;sGAhseZG&xWbd7a#HsWiSERx_yI9(`KQ(WU3Z%opSP>XXQmxY}dY>?z!XVA*GLY zLt{vrlja^Yo4Tzu^JO`?6~p-EB+?-cZlDb#^&7bcat^}enBfkFGx%2svWKgAiuojU zv$Rt*jt0{4;Y)oij1MV9{Di!6Ic`>XXla3T;{-oWtYkPL{KKzSzBaLpukifraPs&L zAQ;^4|2-1EqOQhaHV&R;!t==UU$KSr5Kh5k$*>9c#&9`;id|{(0Q1W1nU~tOT?ic; zv_Y4EItl3hTWU{C?TqZ-A%THtCQZa(Zqg6e*8ZIREp!)0qXW;;tZR^l-Aga%{k1=i z2Jnag)M+*K8x%seT-Ag$+l~fTP=;V6`t>SGV?og@o1#OKty`Z_)r055#IXj=!Qq7s z_e;BBnT^XlEUq}B$aA?GR|7)#fksQ{B$Hem2otHNTN^E49A64FP^znU*n$#8m(jZd z4N>OhGR+leowUm|9R5w(dBavJzjhIsl1f9Uv8&vs<~(O*S+7dtX}4HDPUGXDZ-0GI zK9Tx*mkB23j~myoux5?1v(J31d_Rq|tCxMwe(>;@>`?tKx84}6k=zf|T_i&7e|pmK zjYA#=E`8b{pERWfr4~&MoN@d4f^SUWFwvS(T;a4w5gMP|G%O_&s`2^w_SXqnPVgsl zAA$(h&2GIRe&jp+p$a#Dh3+T2M;Q_(KZJ27h2i+;iLkiu$5}W(g!+sy4&Y`Cfq=ayS;aW=N!{qA>d_3G7j*=3hGJdma* zP7o}3yQS?CEVu%6xjtGHgpnFX9jK%x))g)Tv*1SrAq^)Z;NcmF#Zs0Wo_0yF)!vh0 z<-J>N`K1zUEcvai_{Dv8XwEHKh#qm#qYBH;aQV<^puGMoLX8$C`tI%t?4y0X%#H0j zg`7CP*gkdRk8Qk?MJ_h!J~4H6_Q;<^Q=MjFZKKD_ z*NXC_7nGYRqDGhM>gtLH<+R9;`>S;LboKNJZl|Ji2!WI|cM{qrKM~_3$fAys@a^tK zi$*6Tf-h;5Xex|ED^v6`lZH~sdFNYmZoYM@@3|k7Q|;_AJ=U_O(=y*gX8F>Q`4m?^ z0YkTRUkiI(5OvExM^w`*O1sR&_S)paDXy(uI!*HYJeVJ3&Zo_1BsH+RZc(J9@j1n!Km8V>uRtQ( z>sHjQq5R+~9Ffo9UqysgzrlmzqYys~50}QMDM#Vor2L?AL*S}kBhrRLU>KPsRdUfZ z(k)*oDLZ6BF;lFfxj=Q%8v2b0W3iY*zaNxYfc$b{+BHr-NLXYwH8)wbaE#n{jh-KX zi6ifNZ76>I#6xz|oBmS$Ds3L|6q+j2r_8if>*X-^f-@bD4a*P0FBzW&{L8bL{8?n# zc{4h-`P*qLUn{Vto>Dj7I;DL!WE`I?`qHnVfibw>ypmDBlKIc@fMYd+nDSLR#tqDt=s&REt&NWH2Rfh<2vm}$N;JpFd{`ZA=xkr4JNz_U?X0C6jwMj+gt}Vy(z7R~_*DY=B zGNpRK&X{|#n;#e}@L#sx8)XwXtlDi8ie_luAo7tK9Zy`1^d554d9+h=UB2a{Hrld9 z>chSx_RuT4H9t%hk9F#E^5zEwdFj%id*;QbZ1tMEZ28hJiDrGOquFxQw;#IVpX}H7 z{-a%g%~ynZu3KNR_8}$XU%!4hDdR11{h&HWf=hq5=}_QM<0h+^Hd{QU!xVZ< zIu#pS##penWc?-L#8dd1TYmlO@B80;JHc`&4~MQk@tiVzd>Q{N5mxxV&&&GRr+!$X z1Z%l)8WvWPyy0@M*EPOR&p!KXXJUsY*7MIl@2nqw{_~$Zb2@w>5e;nBs#VU46DDBqmED5BP+0=vJ9#_?H59 z#+*BUnkkKHXMV$9k|O!Q37lp_)O z12yFg`NT=rsVXnd6h#|J&CRi_ny*?~?j@E|HD3;syXDZb)GZRdeIg6S3_?RGr7LPu zfPegDt9u!WzJ&wY$x_#U$MxT{U;p7#@;j7g(<;x@;-=K!XH6FI~ zhC226Sld{WXR}KV$^>AC9qgDRfe?Z!@r^c6jji&KFFzLGL?6Ik^!-qN5RRhE7@7FB zN%J8yqeArU9zu;>*y5kC*Z3&OB11`cSsv({iF8G^m4o6z&49W113E^ zyPuEz{HxL<(t!arXnxRpC1t}(>;CkQE&YWDEvf^Fv_d&V)%)Y{;cCmxDbzd2n=o*Y zFnHeabQl6R+51g%Cu6ikKJDgBzeb_rAGQlGc#ku0CLlNCkN!@Jj|*tDb^DWc_QD%1 zPlpI;F$EnkMW57j^)^kVS~nJhcLoAMY2Ju0%j7e!Ng7mT(nLk@%UC?7`9b61z`=c1 ze?&h0N~fwG@Cvlhc%Lqkf3bC2H`_%8Rl<2-!wXK#!$+GRcuoY#-k8iB6`?LGt)ikPw>&m>k{w@@QCV- z&JZSwDRa%qPOK$Z|FX6QKjunk;pyS)OLpJi3kx3nJztLRM0h?=xQ_6>@cl5Hepn$o zgv{${^{pl8~&X-@MAzexy2_-1cI@{zQNipGBC(MRPTL4AWGZT2;A z1OA*y=bd|=?cBN334=zWpUeC@|MC5UcGORQ`co(LdEtc@12Ghs8adl0yS%gJbPPlf&1!*{7>NO@Tiv3h1?R@?R*YvW0$P zL$JdO>z;e=aW=M(J@%O4gpOzgIKac9Tt!8ti$*{+0knpQY=DIM8{hbb3uhTbL6Dlc z9Md6bN3u>{r1T&A*vCfQj9{TQa&}&jn6)u61;U^pKbvVS^)&Ho!`jzr^_?a5;)X}G zn3pEb{97z%#a*_eQsIZC?SKXY8b(Zbq`tnuMp$nIcY1`QW!IhhA_pgiXs5JG*f1`4 zl3jMrM{MJkN3@_N!kA8FB@826E+>@1qDzHTuusC5E-iRc6vH;m{8I*{iE<`@ZL_c;dNs$$1~P=U(}l?(b2Qh#9IA z-!<}dpgNP`+bzwa0H5IWNGlRcX{@uCchn}mU2+hk7Vz?@8Dr8 zDwu0Und?Q@K5ObKu)fH6;n^#bmR8FeGr=uNIk7~I-St}%e!!XMxSSFRN*hHtP8WTD z$LUL3v;gLWn$!3G=VFLH<;C zA^ebtFZK3mu`EaDnH!(7u5;w1!v?rhY4~_Q^S>CLLP8(oYeh|!VX+K2K3Ocae zq@1C!UyACcxk242{EuONpsC_t#t7O84Toi#r1F`WV|A}rQEy6ZPt7`MqAU~rg1IF; z??C$_dM9kzyWPsCXnxWH9P=GE4JV6#8Ka$D@?TXnQyWuhfl7-F{uwmhMma8q8*d2Y za>h=y1*K=&b~&>jH|Y|MY4s5kPXa&0q=}kVBO&va^|tq>o2}*k-`Kc=d#tBmfpC(a zIE`Zt1pIt=G&=Op51K2Y8i(nJs;yT}*;Cd$VYY9p^-L*saBJ&#%OrEQ_&rT@?$EeF z3uAaX^utvfz$x5sVsAG;xH+ObX0v7X^~?J{VpFG_DM4U`=0uH4y^~U;RSEr>#}11( zY7cF)bI!fRGJ3XJr{?djUisRH>76QgB*ru2EqGsuU-Uau8dF92lVswy-)8nK6g;(4 z_>5+L2w-ZC7tD>@*4twFB;!5q{r6E{w=~+yip%WhuRd;b=QQfwFWwb=x{fre`9bha zf|%Bx3AS=gwZhIHu?d+emK~X_`Jp7~{4g5&`uP`u1#}D|ht=D6?)$ub^_DMMn%*t7 zhgv1jK(H6Qhgx+gcb0tn#ky;4#S{N+Z@yIik<=d2aQw@&QS;dd{NV8&75~!f@}n2+ z++!KBCd(gJD4yz8zajw9Gl!FKW**gClA}W|gqpSW2W@IurJHj^64zIL{Xm(~_8VR1 z-v96?bx~N!^|x?<2RvL3f}kNE*rHd$(SZ__I`ITQv+-sv&Bl89^5xED0^!+l6wMlz zITZ)cxKgODu6AqfV~NVk7+$k>jdR(6kOTiXv=;#s(R?ujBf>9-z2LKU?b<fh9XWdeQS=g4G*$;Ux4-@_&U zj7V*m{Xg{33P%T`o#D)z2wLnL2!;cFKJ%H+xIGSQ4x+B%7ZvRx1RWU?T6=s_C7`4n z$=5L)4kvn_I!{I&VeKd!NWb*bOHSy8$(#=pPXs$0g~O8wlt1{v54wEp-9DxLflu@` zpD%v#i!K<@zy9mLI$nUkP8PntuG8PADe%UpfIkjxCu_6FazF z>SUa-3vboQH@+~oZC`B-w+Sr5F9R7Uv7Ce9}TW@ZRb2I_)R$ z9|2#7gJ{7?ZmLe;()PV(eP>>1=~|GdYonJU73mA6Zm^{bq-mv7$!MEQOJu%=;Db|Y zXyiXQxOCT!wgdNr=fUYexCB~FiO<8oLvV$I^Bch8>_DxdXEs?X+H+cW+l&-%{^pSFWhSrvg)l} zLNB5+=BnMifPG*4J`D4N(-hLFY{B?)34u@)c33F;{bjDcPO8^ejW~Ph<{x^_yL$h;Od_6O_$#adt$9kO519= znRV9ETOMf2`2P3bq8Yeidf6d!Ai_Iq+bdeqhsE;Uu}9sf^H{d z$4JXO>*~w3S>v9x?2I#&5pFK+myUHg{5x3^sO zN&C+gAGP}0EzLub;xJ}0e7o6jGyS9Yr1P`Bo##`*3r|yzTR8eXL@krH-Fysk6_u$gU0Q zXYsN&vpZ|oIgKsmr4yz@KR@U^OYfsRMdW(Z`M234D{r^E9{2}){OKRq3okvaC|z5f z5H(GGzhl>PHlt#>!pUb_PWo=^mY@V72l)80*gxLX9_~3!Jv;e@oJ5TFa8gT9)43^p~eC-~IGee=xsHlfNgTP6quKXw1Mr^cU|7H+QKmiEzR^7KZQE z9SL^j%OL}_c)Ar<(PdZ`J9e3PeyLaz)2c+a>oUqA9s ziolBf2j7Vw?(=~UMw4jw*=L{S%)H+E*0A+wHdDJGaxZ;W-O+d;{V(_CL=o4iqJDMm6KCdr(yx-x8$Di!@ml-gT6{X9p zf_rGG;O8YH^@#ijjj@hMo@HG6Hk0&Ny>iXR9Hfd0py0gux{2Upj+?G}DL9bMM((mHFo ze72S8)X>!dZ)(xqr^QmtDqX)ixGD!q4n`a%!s@ zdT>>f>Xiz9ev#^w)|DUwYgj&`xH1gpUj$8zji@zrPE@#gjj!lq(%w2>+CyWt@kYxb zV1DKvH?{?5NWXE<&krNgH|X2J{RTXpYD<{*;M3oC8i$#hTQVk$wGUnOANGfb|3Mqa zFKg^`dd}%&fKNX^zzdX@uZ~Qq0!0^GYU%fU%h3c)DjI#P_`-8&79BpcUD3KKR41p{ zom!B~akDCGQ%HCGmO&3_N}>!KF2cRTC74N}O+(%EOh3Mi3vkwFFdc@{*T0*nVkmu8 zo_fRMZIp0bLH&Vl9vAQokGF2k7kPQbdN0maXy+GY{=8J?I`S!|`hujw((-JS-<+;L z{I}(N_eskdS8Ti9bfI4j~`r-xC@ajy8-( z`b*j~3U;x7-&!|6mlV&@J%T8N$Fb%MF?(TpgM0>Uup&kHLs%5}3lcCT=pE2ESRZgb zNx=c0Tff@Q>^ir9jghAQO_$kxM5c1gLC}MZE8j``4Zsez`cwm&e~jz+?WF4xjYbC# zm{JmV*M4p3zXPbp|Ci{ztc}@7qp?HuE%!b=(q_w+Epr=k1P-K!AAZlpw<_ZEG{JNltM8q=a_2n;r+4k<;>x4TT=wb!H_^(vO z1O{j|`3?Uy*IeWBa8SH?^Jc>e;JWLsb6QOZX%M#H)cSa62aX&fcv`rMj`I(&z~PA} zp0M)razo1st*eO>Cp!9I>h$I}zuC?^?>zBVU=@JL6oNS%Y46#y$68uioK_U{fNltj z5UN~!$t4aeU&nExn6wx;(|?}FlV;LQ@`39}boS4}+EMfu{*UmZMBkzr1zq4fqRydJ zhU0Ad5@95QAm$vO5QOpjuDf(FqP+pU?CbG)PJf@Kz-bDI0($YVL`-9%cq1kTb{KcA zc}ei%;Kf4X9{*7JC;7?1m*bmz9+v+d&g%-Eq(5F5nXc>>F0FnQe~)!W0uB?3l78oMq$BJnPMCYHeLDB-qM2fX!r_cnXBmxTjnE? zz48UKT&m_Qv{be?mTNl?v}+M@x9x48WvTNPS&R+55^!C;ak@Cfb&vbLoe&55u=sTK zgr3ta@Pl87dz$vcc6E?Pn@zoBTBOx;c+ONS$kS#)bkQooQi`y#-|RH2vKB1O_VS+B74`)y3-`PQg#&@;;9=SHW; zZ8{C{JPk~EJ?TG+-8AF$NBz962| z{kpvtn=;$+rynPtCPDku7QutRf`tLU9oP_D@tLa=j&(iaG9=75M zv5pp7basoCuK23$sFNVAdyEy1fydzJpl$A3e`o^^eK+mgZZpd&+(xZWW+JN0E#M2) zkB4RIGGSts>eHMOZ%h2k-E-r_!42B}>?=>(rHd|+Hq2P@yPS`@f7DB@5_)J8f_cFl z(Q${&ktP&K8wtM9vqZS$=b8I<*TEmhyP`p=#%689!C>=SGQ|!_Ae7(Tq_EPDTTA;z z*4{foV>EEKJBYq&AM|q@OZZ-3M?>GF{U-c~ShZpO12%TdWUH(^OJ+bg?C+CboGQEg zlK*G7-}w={dD+*r=$|WGHIJyyem)apMZrOS#d_t-Dn%N9%rU)(Yb{zNwR-VV&|c>5 zfJP(Z8_=sq+#01xF|Mf`z~?n16%urpjD$eXqJHI~ury#)VKGZoJW} z-7=SZ%OzLaA0PR){HZOGwxUdDMF$}x-!17@tNC=@@Bhi>E`OIrrA?D2T14hwV}193 zPpY)<7d|7+55wULPWs62Q|z_17QN>EQn!$U=!xYPlO|(K<4K}=%au?%BU6GD_4U9Q zIZir=lF9g&@xgnjVB!p$Q+|bnK}T%&frCzit!nBe5=!JL($*U5j21YW1bq?j7kxRF z&>!DNa0ujM<2P2$=4<6sY{B$E1DQNN`77U7+~+x*Mu3V}x4mjtoqw6=1Z>{j@JCP@ zUc{03yy+G8vJO5P<-~rx%#E3keM*GOeTQ58kH?q!6}Z6E8_F8G$}GRL+RDeQw8nM` z`&d`tEL;6fAB6eW*Wo~_yr(aCq^4!twr#6*7_mnJwa*1+p3M2QMHNynb&`M!tUk?! zSy{P?F!p)-?Sp@7mv#Mbn_hLkas=i^m~DbuZ0z0w4egYdRGyISVy zv?)B^G!at5#-;7DS7f48Qhufr47;&HOZ1o=;Kv`n5MoZ$+}+yN;^w=YoUzueckrGA zHMXZ(rc`@(+3wn1F8^O%eT&Sqa~)3p9SvTj;4j&rQ$RoN#UCeKmw-W#Uu7J@v~JX9 zmvt8H9x1Vz9!)y;+;d&jD*UiqcG+dl^a#F3(`VPNU2Y7p#zqSt$Gr$0NC-v{VkC>o zyLIc<{;JW|0UlaIB))-*R*Z*5ThR1DsKG`*oEI}Go`VDJMo@*&ghc&3LzBj@|GAGw z30gC(&BA#RE&=0s1v>qGsZR6#OMS-L>u7Yp=C}f&xPT28^7X9Jdczyl9a_#|zJn7q{Wc0T=ptS|rPNEVS|3QE1nZ z?z`_ktt~2@r3Qj7_;SgTC63=P6{G*~3FQ0OYeG>L2iypcZn@zBl5pmHMJ16ogG|X%Wbf|ElFxngm;Y{6 z;o<6=XS7v|Hx|mPUwm3oxo+@W*<4xtD@1GMJi0`7STb!$(V|WW$&^VB zlJyEv=2zy^2gDb##*;Dk4~H*fJuV@^#p@hDz&JINS7z1=gd;P?El1Pyhfx z07*naROwnA1++}DZ4zcpDXGw@!Wc)HI1vJzgd;Q|IokMd;fzp&MIR1l{d0E_&*QG4 zFML*e(2k_&lsA8(<;dYS8(N&;MvBX&^`Om=qrpHO9-i+rz4@gXFJ zj5(H3z1uQ!V=^sh(qg*U_O+I(&4pGrevf5!y)0isS8J1}5YECQ%uA{+Xn!16M_efTZ?ySy@$yOlvG-cct5XTx;tI>WrM27>0zNs zl5Tsecgdl5qs^|GEBf|GNJmQ%QIV5&IE=+tF(c&<+cDP0zG+X0{Xg(V2jtxA`^-VkY zK!y0Xr!h`xYa8mMQ5n@ndZKU&%BLxsUP<9h349J%ndiHVs7~y>)gK2@^I!YlTue_2<~un=*L$8r$AW0eU*Y~vF7*Q;tER{ zS0MjsI>px98=ZHl{GjczMhU#DiWf@zLVkLLk86W#Q_zkupY_A#c^nUiQ=ACH&JXaG za0#NuN%$EhXn;1V<4d%OFL%Dhaw651DStZcG9&fj@ zMQF};c?0^8+b4hRza19*h~ql|S7H~<;a#Z;6&~AWRk^EeYs-bAL#B&RiC>-3&=ANLO3fJ#Ce*-1GJRrkKq!}$cskMCqMZ~r-gyW4rW&${_uzGumAe5 zEnkA02@<#yR;0~c6=7?y7p#jF;4vis%Kll@(9QP4c zLId!@u{MH1=mdX|9DI$O#J%B(;C#C5X$t&Lp#bB9R}?!+{=XrU*R*ksQ45$P{e(}0 zm|%DTA!+xX_n^W zMXk`3YXuX^+(M%DNWB&|B@!y&OM}HlP!d|CYmpe;yU8-AEwsKY2~!Z>NN~YQq)&_d zw6-R-qe_dy9;>h0YE$L3G+Ud~Xiulf2uy+$d?B$}rid2O@-0$XcBU4^n}p}(+N9za zBsdjJimyzgh=kTI-$p6V-)-rayi+nMIm^ZIsoGSKT`f4$en=fBb09T(T(0%X-W|bN zn&{E1K3~1|8Ep#lt#s@-Z3wi{cfK(2nZV08s8wWl%QRjRsj3q?w6?a((dRn(-ndB5 zBmj$_QV#SfIN(y(W)}1*%HJpLp6<|wnj8){wzjwp1f~qJlpJg9jOo<)c^fzWJt{9hIl$IS z&nNmY6QV15exR;MME;0$zq143lKd`-cBsUAeu4iGf@NwmlD21~rTqGKvtMkq)E#TB z@1+%%alSSH63m6+x*z%j|AGhOC_{8~QHbL7b#S$j3iE^KGs-8!*TYTZ-(+x!9+j1) zQ|^waZF}$`xsBRy`yN|o=}YCaMD3%$!u`f?qJACFf&oXU`T2q0r8JE>nZiS7tB=vXV*`o?&tN{ox$&&ZsrKxP3Q>Ky zUV@x*H#Y$@3^$A~^*{&jj{^shhviKD>8-15fg)3}S#-3QT=H<|B<*l|?EKPI@}o7y z*4Gr;!LC`BorhC(;U&i~eKPBa)g82yVx8z}Ga-4R`b{PdnjezUH+jD?SM=F~Pk!Gn zJ@0RHA}QzOIXqtHILdn%|)5wQ%qAxuFu7Ut!=gP9aXNeqj!Ne&unr@$@td^*qAp2 zf_}@8If}T<#-ty#SrfO}A_-secdwFAY?WnXm5bl9ZM?$D<0qvgXBV}~=hG~W8=TP& z%#))X7e^a!QPDV4f{VFxudtur|4o}WTPBlg7ye#0ZCz<;b?1DlwIP+O`o(Api>suJk9I&m_GLR1b$4+8D^6PEn2=#LMV5MMA<< zjo0DETljt9#;4jhQU1kNZG6Se)6V~tWU8vFKe>FO8wt4lP7^P0*|EtM&sZ!?2hGE& zz3y4!{Lm*sEn{d}#cX^0rPX%E{4@GDFNtvBTc5aO%!TpwkHL+181MeZt}4q;+hPkR zJS!*k#nKp(a7-GuiSLUr+6QEJ_xFCvu3P>Y%>z|Jknyecg^;E1T~tfaAze`g)Adev?>9Hzn4gEf--h5TT(h!L zZI9-HlA<{_wftSSZsR?+?DEfOyk%*;ie8%c3N!ZG)Uj)@#VvNaDLT7Tf5~|n^r!}=FC`RXU&=-A+!Q@$aNu{S2DTGe)GUD?8SA@+clRj z(|Sa~IJ5>y+HdNcWbX@5;2o0&4OG_glFa=2v@X;%s4~4;zm3sBPap{BNBB4|fRE|a zB59K#jJW*rKvM<(Etqs62qF<|#S0)=C&4!Nkk zZ2U2IBC&o4KJFdRh#@cQX6iyq2s}y9hP-Gf;cJF()*#du)Q?*Bz_{3l}&+8F@~m&6Gc#PE+825(VN@s)Rwo-1>%W8!s{Lc*am zlRXl3CQ?*TvAN}%ml%%OmkX7gnLNgQ8&Z})#oLAVX)!*(~*YFPew#53Z2JC zr5Ti=#mAv0Ex>ZJY{GfVtmVs}wY2wUX`@wX`TJkC?M*B`Sn!Q5L6;0U`7E9|&-N2e zII?7DSvEpiyrkD{vW$zbwoaX>xWtP@C;xpq0W-ot>l*E%y*01c*-PFXoWv(ZLmN76 zT8p&dcyi6%?v$F-;gORTeiC-ny|&6GJ@ZG4{neMGorEtGt>U!E&y&eiryMIoqck?U zT1@oHq|I%5waKqjbgrj2-!I=q=O`R(`RE9w_Tj+tkjy9^Tl1JLo_nTKQ%;Jf_^D5u z)ySTmmQq<|lX45hD;d@$ZKV_~d{ea0=&RnRl`R{P5eAr^_330UQX!2mz1%Swi>NK> zW5-*u7C|-Hanm>TGOGPYWd799Hc3%p_Ex5|g> zcF$cdme9wOR7!mok-5>qXCJdeRaaZfiz_VmLNp=d>|7h&#KeNX=3uo|$q^{0{XVJ> z^8)4&MFmCH&@2J0e1l|5qm9$0A&UpKg}GtRzFqD#bZU8}(@Y!tKS*Q~O?IPV7ASG(8hWU?|@eve40^2XfKQ(*Z;Idbf}NQ>vE zZ108+Yf3YHyeZS| zO!@B`RCca#?t1V zuVJFGomU`%?!&fg$wHZ4v{-d*lQs_Rl5e$Xb8@*h1PVtk8YW9%kNN1nn(dm~X1cN1 zqjGHC5SUGpw#C-hnypJ(OA&3RFd3jv13bH>fmdy_suT`e^W%`d9#o-BGqfS|W@ZAf z@!n$N({@=-?lx^KQ{^o88Ea|-j!sQecFWy&uQr|1`iLB`C5x`s?A2@cuikIXvAK+n zLC{ae54B2dmN`pNr8F4IZTIe1#Cq=hjP2~LvbppA%Hbvy z|1>FH4`WAfKFg9XzMQlJcBs3;#$}FfF7t@8Rw$fMWQUp+l`+mg{#mkbWnrBfByI4OCVVrd(2R;m=zhU@H;WhN z+b{0_qRp6km7TeS6Mt!tiD#(?K~tuLHkp|+wM>(Lp{O+V&}dBh-b$#5pQ?-X#;!fj z+m!NiZThrx?3H!D(OkX3&X{qD$e?#w?1-IHvCF1coNrG`!zVjKLSh{@F%}p<^j)$P zw4+x7yDFP8ZI;`#cgt@d4!>hs54ec1D$6{3&E?nI=YRHf1rC^IQxthDhWY5QG#ec) z>8oU@F)g}h$&en!J=bmlpdG*Z)vsK5a@Niy{Mg)n`|Zv*CqkQh@4eSPA|I9rXfVA& z5W}V$LC~P6ymRI{jSe(hF!{o-3lVG{oXe&g~!^w2}jJdJ~0qD!$pC!{*%Fq3-Vfd`zK6uxA@5iJwm-LwsX0s#X+00($~nuG?6LRQMIpQ%1or`nCpEjn?Q z8IoSQZP)<^LW*?BLB^ZWB8`qd_X)Q?-E75#^|o7CTy0O`bg4R<2#4h1QMkcd)_; zRvHL-dSxz-+cFfnX1@e>GkFUMWAY~^P5>j;A@%aunuo0W{NT#-YT7o@d_7QXX9+M)!A(Mk3vY6NXLQS;FT`A z7mlB*!}=x%D-jojHR*bp*1h<=b?@9{DIbuDn0$RiBn+Zev3d!%N@eHo1%rtILciT6 z$Z28Wn?g;}iE>s}wier*a!GKbwvfOJGld{R4b2ap~)EV~Vx?kIcofoO?gEfx^at^)9WW*thCXqb=O} zygl>Gcqx?Rif6}b&M1?~#q-*vWZ9yHSF48P^BlqmoUI>dc+F|TuoDnMxl$6=Q7CF7uO*fPi+oRu%GX&AOGB0WEDYWsK2dyY| zzZ56Oxaf5qof)>TMYNO#3Q?VUdn7!U)>U0ckM+vIc5VG$`EzQM7EytO6QfDNSQ$;u z!Fj+mVvFZpX{%oRsZFg|Y>z(uJ-hLocUjK%UDl)D5p90eA;MD{HWHB8v?bQD<_DH? z&D(|l=-+pk<3*&^+P>#C^|v;Z5@vKe`ZJ$N<3mE_$h3=XCMWUg2lBJwKDKnM`91WY zoMsx`P|$&lSJhV;&O}JP?B+I~bEI#02|jXKYnuC8WEPs9S)lUx_e+kOE2DX}^Otwn zCE6(G_M3erUvdG3u{1_=<#cK8?cTf73K!{+BVi633D5p#0tQ~JTd0i)eOXz3^7A7f zHxim+vY8cWjAwT>_ZJ;{!C^w0OuYANTuQTvIZOYNw>q)(KrTlQaeb%WE3>N>**Wun zY+t+M-);AOpRr|^+$OCLX-aA>aYP4A>o#qb7ICfS={;6=c&kjXC)l#f{zjU%o^}Ip z2i54_DMW5NAm2ti?3}aN7)I>u#qY2OR{z?ryY#$Ze2XfbUGg0#Q?iD}!&asP05tc4 zxoi-`BtK|7YZ}a(I^8QVCQUaIZRCRhdfeDN`_y&swV(dsr}n|O|8Mm{wi6cd{CLw~ z{K9aCTT6|uCXds_7hUXl96<_NCmfV=xO&@dw;5r-arAuat+!f5MTG;52^r=(2yO6j zLwft$-|mD!J9h4HQF{?=ppnCxo5UKM16jS=wU0EfK5#iWYl+wOk6j(^}M9AM)d z8u~6@zTDBCb`s?cZ7B||X(Kp$yq|vhX(xz7NP>12zJ(B&;a3RZisu>fH#9UjO&Xes z<_$tJ`k6c)-s?pI>IV<{bLrBhPS^-89yc!p^7wHd0Z>Jp7kxf|fbU_U)%HeDw1xC~ z_t6`Lj-D3~2Ez~jH~5FIll>m4jp4FflTK!zgy91_@i+HQO=8cb^*z9S!%j^_rv@sE zBveP4C^@xblH@eO6OfYtCYD*VW;q0SaqQf=(=o?|7hLG>F}b2Hidrcr9h`2EcyW;T zth3HK;m-E>IKc5ggYNnFxW1j4NlKdpJb}p&CIPiFDYxMrLzgyDH61a#AivOQl{h-7t&#Ea=cEO=a}KRd=m3E|sNm%r z(`jjR$97AbKHbsYwVlbUtlY+~Y_%hYYPHzJltDriE$o|`70FF-qnY!pAiBwF)AH;{ zue5h0NP!LmWDjq2g1fmmk#5~4+UW#V|N8TaE-}H5$Opv1Z+yWrKkx-hm!s6aj&_Sl z3&bkVu+-XplGey?6aC|xkmMWuap2n2R4b>DTb$`ax16K*HjlB!wjTMqVv`O#VLlhu*%bBUy<`VQ2WNrld!osvDN7_l_l*rkA;9~1Ch4pIr%1;X%XQYnK{?`H1=IZ z2{=N-mLshy(`K{fyXw#pPOAsT4EQ@!4Q<8{22QI;!l$%RW2F9&e8b4c%@vnk>W5->*?t4-Ab`6YtCy5qvW1XTNf0?qZ8Hlt6z^t4^Jc&RhVESWgj zHa`7Fg^$j#JzLgWkN7b2jW8Im_yLZK;o)F<<)9-Cj8V+U&+t!blF_^-UpX6NSF7)eLcc7M*^`Ie7Z zy0i}u9_kQ}WLsJJJiGsqFWZc&i{yZKsCJMWGvXPdg<;}FG_6F(yJ#Yg&#O|M5=2j$ z>*j)h4^>VZ!c3WJk z<1l4|>w$d!nZJXUNtZSg)1~QFWk37vhipdWa+^`Q$n2i)Sk8MCB~bH z?f4-ZE!=_XhSI@3(Ey2;8>(Vf24ct!bH(G}Pw$n26a%C#^F`09%vb!Go zy!?92b8Cnm@nvO6v9vO$Nb9l6X3F98Gtd9Ty-zBpE_VF@Ne1c|K!x_RcGy?FS!SPe zoUc6mWtEpNw8(S6vpSinr{?JW5X-WC4N*JXvdLC&HLILBN$bLNr{x(y8{J>}#&u6Z zcJ6m+UY|a7nw>fKV!QK?zqfZ?hhQoxv#2z!N%kxOaDN`>FBH6Pr90axG9|<=H^d$WOA3jbP9KZ{I!#!{?YU8x;P>p;~%#xyp%%HSj z$$Z;Q7G3c>Yo7V{)|XLkC9%h>y7N+%87q?o7HPp|1{Nf;45zi6grjP$s+8ojK-vJs zd1Y2#yUijw^WDM)m3AC4#v(fHtln*Dv(AyWO<=oAIsZ&6V(YElVC@nJZLNOAmY#K^ zgHQW_L7g};?b2Z5o|+zCxTMPe%}n{@dC1BuF3}=Xjz00R!{hjevMOq7wpGh7%A)*v zR#S1Fb?=pfxGIIR)rn?y%3f&&5)^%-j+6<^wq2W4%Ic)#&6$f z)d%+3)Z)o*5K|uxBP{6ebwO_n=mg4XXc?$8UB za#Ch-LY}_;)z(s=#kNkqiPF;(pCp_!OTmpvQ=$8?G`AE|w^tf9m?wpoY!05v^tH6g zL`E7Y;2=WBaDF^#vgN4XIvWls3Rs(>l1Q^b&zj};rF5LyZdr1IJlRUeJZGDmmdP1v zjs`LsL_~LEaudG+n~qaUW7=>MUcOFRPwfil4V|@J4ERB9!ncP>i=^a&1=c)$fpxY? zV4^n50h6UoooCUF&s)bO(!3F^nPd@C`hKH|Zuv_uj>L>Srx_-mMli#>FceUzQ(`Gvt>9XR7Km zH7ttYt4G3?IG;f$5`4xp_)NcS_S8AHW#?x34XSW?X@9ggcq#SsnJY;*2!;fT2jqly zd+i>(>B^g|dCki<{-W5e1aJS6Bf8gfOym zbN{dRdG5KngaoO|@7sR=2cA67eV#KvpU+vJ^BFUcZqpcmIz}8ls86Qi*=+rW6*jb_ z#Etp281E3|RVNw$ZKi+b<`iNWe4&*$97dg?6KFX(Ib>UKK_0>YeiQGSG+xEVNtz5w znpz^zna0sN>y?Hbt=4M#&`#Ulh)t%tK30I8F`&g55iAn;;eyJSAYBXX)nZ)ZPD>;U zCJgGWb!lwGKd{7bw(V*NT$Zc09)=G7?fS9*77t&+9&EY(s6s_&e*D!K9LCLdN%6t9 zbk#p?DqkL$2fEt!s?An23!7U*4@c?&S|vY)_afe&pz!4U?^H-Mslb>1(j2UOlwjJIy z52-E*@TA9Nyie_nGE z&5g~nY_R9JBfK?ZFkJK7{1qSAp~H@L_-kSelg+|o#++?`eFG`2BY))P%48&rH`bv> zxn;JE9#G)sHNkjq@QtSjigW$KtslUT#uTMhm+^3@MN;{QG2@&k!zmxXXNQeG+!?6% z{c3OX#qRmCZb404s&-86cW|yfj)LIpzq=Rz%YQ^^0c6|i7Ec5JN_{_Xx-SBP`1%Q73X)J0jN`v`R)%b9 z-Tc#EaBzheW%`~RV@#Yl!A?Kz6qnDwPOCgq`r+CH#UYFpU2bBJdc$6hj!;3zmCEE<-fm*itAt9 zn)0|~C)tG;oEQ5h*b2vQz5TA;e&_G4f4{zN4V9Lb!noaHxBmKPwr2GjyY_}3+mJz} zd~3vmZHBYA`MvL6XF~=Lq7QGi-~Zu$n@*j@?7rzo--QW0ELOMug+C4NYBypC`>Tlk zldm7R)WIYU>N#{8G-V{Nq@=_ZEGCazgwvrEgpe*W>`MpLB2Gbh>Am!xmoH!LI-lO_ zop)2{i9_!@3d%!<@j8pA_v+Ldh&_kiw?X;IFr&WfN@AmylGtE78ZmlIwH3b>WY$@m=EmB1QWbe za|ZMsi8|F{>svmAG%VbSqeA65EIjXhvxC3s^!GI|E4_klEvRfIZK%bt^=8}3sd^7K z?K+VcBdD#cpiJedg`pBkjjVTmKU=t9t8Is2ken!2pkiRKh!8OnO>t#Jdslsx)y{j; z(u+r1!GR~)+{Le0X}`lQB>|=e;_Y?eKEWxxDg-V=&_bxVlucHht%dnh)@K0rNiwad zSBWiMv&;@1Im*G;RYeVP%Sru>Uap=Aws!q$Jc9IP0iMSxXuegFS3gd3on0B9ib_VH zp@em7Y)5XIbw`RuV)%Yzr91(K(VKC1kK`4eY*bCRHPS~Ks^3y=X=PCzp}mPY-5le> z0RVbQMu$Fk$S}*@Fq=g&wj+?7P}qrTP0!q(&`5$+x8$NOx5LW2Ot*DAOL0Zdq#ptf z&hb&Q3XBLgZ$WX2tdtnn^XRjS!FMrv`}Hlg=iZ!dhp};y zQByy52%OQJ+ym94Z)$@dwzofg$4(!AqNT%i+xGqMTGkzR*(&TgWx~W6Gx{JHecSPh z1w%qiY|0T8$UEVV)-u$ZHd$Gh$+o6;jBRfKhpib%LUyyvbFQ__@;7MGwVL(wZ8d%J=rjM|RE)GaQD~#HpzeC-@C7ZnZ$eZn zwc)1sl73YF3Ah_?0Y4Fam-jHnq{yH{EV*vGg`qtMQ|Mgd*5H8?ZSqGC+rbBnv&1x{ z$CL-}g-^juSyZBeb4R){%U5aI za8ApGLl|nXr!Bev02l=HK}i4+1RL3oT2-^uMr?Z1nznDT5C+HbG@!40$yZ;&>t5gx z;5|N%fF4wC+dL#XqE94rwTjA}xR-y~Dt44RiACW`XjVBMZ-Os89O|vhy>;IeLo}wo z+cU4b&6q#M$_7A-z}PXym5J~cg^j}_V|(5EZ&|{mV=ZU=MBB9uwc@89u`b`d5|~j} z!CVC?ovTC8KPbd9kQ^+-fxzl@E0J(PRaj#ganvcU9Y|N1qAK zGhpf>X_KFU9V?9dVrXA#-8FxI$Trt(Mv`Q-RU8y-`?;>wm~}Ts(e~d2hYvzjort-_GdLkv8{FX}VIKAQak zM&=jTXjHpl^#L0WTxz$#YccrKr4s-O<>`389hZT2)T41M{*&qXRr&kA~0@W0)U=pX;i z$I(50eXVGkGkx&+`f~hx-P`Bozs1M(ObmUCFgnC5A&^Wear1}B*`NcGMT+lkljsWS0)8{T{}{NqZcr;>k_B;$D35#ZHna9=`ih*ZmnseMu^DYJ)$_SN-FIuW$SJ z9mV;qck$o9=(Dfa2Ap&}{Osd6BKgE+dGPRq?9y|-YQ1^}8VViN+o#q2qmO2q7zE|z zWvuyk*loYLo3XIPF1+x(SYQ02b^X7V-otMr+9BV(;(EL4ic9fgn{US*d$diObR>P} z9mf#5^R9bsTlF@(=dN3A4MHI2UT}rI{_2ws)_#A!7-rJ>=bdd|Iq`INfU7<{^}}iQ z-#_}5{q@<0=~wCYz5l++vf1~ab=DcXfpX*lBka!K{M_xIw6_1`(^+=uw|-=I-u^4c zchC5m&y=vwNTY5lAhha=v|XopWbEm-n<#8&EU}|x~LUoBdAIxb0QH&hhJ(;?p-t; z6}ND9F2syiqfLu!K(Ar$)J+>=SBBzoxpJe=zHDu%Q`0gnJ+lvD?AUHXL@!o1pH6M0 zy-QI)>osGES^onp7q3Lk4clxBsz(XU8(6@xfQ)E@g+1od1vpAUH@$w*T${gaj+LU` zBlqw!#<`(-gF7u$zOgz6&qImshT^zP*dx!eUU#AWj$;xC!4cG+cTXjIG;i zfK8)q&+BHrvNdV3A!3oNAn6_&XQ95uY|N#W;}_QfY+`ueeVCJ9sX38>tD7p+%Emtl z8ywxojkfHmYha8?q5{gGej95x!ehz?Zdx$6!i>waviwFn>o6AlIV;#S2qrqMj+PY% z*R<43q;8NFsoBb+KiI^muC1cYX@9rYQ?EwNs2}EI0;vj;(ndBR*bQ>{WWy)sLJWp+ zW$1ed#>_{byzC%*;E0nP15GEHx|(60$@Y;pBL1DEtyG3Kj1uinMExKcb;E%JCSbp1 zj7|UKuY9DQ&_su2id68Zl3cw2rdlscVByrtgqhf*r>kcebuh9Qakx4OhmtC(*i>Qp zJ$pL_kG{LST?{o?{RP+Q4B~>bB*nzIh{fT%>bn$)vjazOEj6 z$3OM`9BfK;hrwI9X`Q1T-$s@1@={FI8(bzOC*j7u!e&;iv%zJ9Y}YFFK#@T7JC2I!^{W_<}b>Bi(e z&oLhyyrM8tye1e}t2WNFEUAdGaTXL~PEonwFi9`WU??(OPC9V5_7>xxB|ir27E2JX3` zZ`E1MUNMEXY+YkHy^1aWUHHOTIulBXItAl)_xDDFbuFPl~gEG{{XkO7YyXVV% z3%pZ8b=0RGhYRJ{q7&0Es3Vo&d3U_&onE))!*7>2Lp5#7gK<#3y^cAhE+A1~pCFcl zxyJL>s!diq_fzZAzZ`;Uw)E4^u$B<&Nsm6^=00s-9UNRbSB(JQstsw~a*DZ77 zs0tD+T*W%6ufA)Z(1Aw30x`SgUcHVnufa(KNeV}o@Y)Sm@7rL;%BXgA(?C=f=Ub1| zrKmcxX?GwAU@9EyXCo4P&5Q|MI8bo?%eDE7;w>20RUgd>O{_a~*E%66S0$_6tQ%4? z8T*d1d5b5v;oH?AsAmjUz-iNl1vaeDXqes1lTlh!zecXhPM>t4%~|v}O9?Nta6*pN z>;i{;$>u;us)sAwJH;>YE$GQP|p8q#K5@X*@Rw?lXR)}`QoE50uOPIvz< zKD~<&{iFAa(^+2e>DtGQ&qvShJ9F|r=M@*XeO~+eTWbmJGbFhq8%CX7Qup%k>nv~I zR!IbX=R4nVYI<|#%yF6yO0WIHlqpl3vF;;|INU~!8s!XR%NCOiZ%ZOb`yDZU&OGx> z`{N(~Xb(R4pfhvPrK=7d+HiH^i6`3CS6}Ted5!zWKmOsqd)T=j|BHV#UumEAzyl9B zL*`XgRSvJRh4jul@3{KPbC|EMY{1G`xb|y)9j5Ag+SHy-ZG8FVmz^Y)hxPtwqAyd7 zpp&k>zmctoO+t<*|P_dcSD?{kJ5{=^rzq5>^%H+!Rz(# zVMARWWu^UX-P(0_>#cX7#@xr|&YkC^gs#8t8l(dY?2OY-#fI1n#>w3op{~IF@rUtU zqv-y~dcWoAfiA;y8UQu;>5`tTjHZeE{g=P|#ffjp3jGsLJmCyN7Zw&e`$00AmX3X( zyYIT&4J6Vnmgwner=4a`KKZ1JtATkWgQbF>=ss_QJdrBB>=Nlxd9e#Fqc*}aT$_=i zO%NzyV=dLA9h_Qs!8ozL>D14;bWKmg4KoXR21vOJPsKoKeWWLLEAnhm?#FCi=2>3) zW)_3`mPA_I3Uk*9l_nOs8J1hy?sKfYG;fJ?>q>)@nhNJLNEf_Q{bd}pxNsCIFAJT- zgUefKl)vgLn=h2Tc*TcSz`C@xR}tPza$#H@Vp})Ou}lnR*TejhuBVJ^dnTJYOd5=t z+Lo0jP2?3*2q&>E~O<=E{!G^LJ4gr%b zBL&Mt4nE74teeKdem>myE`)yEi)9y21aC+5Eg zck1Qv(gB?b-oQfj5j=*L4zpPc@#;jIMSqUI;_E_u;Z0kFk7rG>GmkmVlCeD!e)lO$ zKk9gKN$`}{$F{&!X~G7FRNw*{^|T$mlSe9ii-rj5NeQ{ux3JvGdr_CxMK<}~_l;4K8fNs+G9>TL-Qs05l6l0F!sDB{^5njE3 zEo$I8H=r--kG-*xLyyP4$UDT7t7~Y<<*RR!0A<6=W>Utg<#IkYW&v+kHgU6%)a%uw zH{Jp_Azhe2d#<&lHy*Ld9TnE4Yj@HJ-f5PdT5Cs^&a$J+X4tT9?>I(6L(&K&r1B}7 zdg1C>SCZ-rj$FTQhqpGG=!_nKKY7u~VgDCcdCpYEHY7(;2Ml3zD}bNI@3?;K+p;h4 zjqk_6BT;>iab5J0f<3HMXnA)SQKrTiXg+P@Hf!Fw3A`}pc-*OMp7$8nl`rBckvUT> zZRl78jxZ7}I#)j>zUaDo%Q_5LkAb;;g0;^15O^Z_sB|t)C;3L(D*Dkp(jgp(bM)10erF`uKj6AnAL)b{u|e$LUFBNL`q&5mkE^YQbL@=-jc z4X=QaGwB%1fjOPPTqG&9>AN;s)0?k5hQG_-l^xKMqiN!?onc;Keuj}y&G;`k zI(qAr&VsQ;YmJrbms=@D*U} z4ZN5mdZ*3Q#~ik56Rz)i7rzD;15_^K<^4;Cu|6-ACGTRAS`l-_m)kzBOAz-*hrr59 zcb}J}V#GXn`|Y=#gpBf1Xp6hR{r8J17VWW<*Tn=D$>G_kH?>cEA zrT1|=%S+7g&6~GiCZrK2)&~2>Yj4=szIv{UzINSOysf<*>r)8NjsBmD{4ls z{qv1jw$DBPB8>b-hyVT2=2$`h1`i&l<>h5IZTdXB@BTj_C0FePLIw>Qh@G*(R^+wU zT!F+;fvfS(oxAL{*Wb0iefq>&@B)msqM|-_>M1AT!7gA%>f^X^hay!s9j}NB=xZyH z%=??2eb#9%T|8{{EJnJ*f&~lh&fh(W!Fr^z3F^20+xqpDcIl-*M7r-R_igREbufyC zFmC?S&cEPNyW@^~obZbH9De+D5%wBpzS{Bq)bMi`}H2hsY082obpcG%BErXSmc`} zebYu8L2Ay|fP4MsDqBBDNwxq0KmbWZK~%ADk@YGlb*Fi;_9znN=y&`=C3qd20G9R} zz@WSm+X#|)ftwKx+Vm!}0Nq}*+Cm%WTDQSRS_>!D9IaVjY?N$R{|`%yRKxVbI}H$` zAeU0jim=d2LnJVS3dZ1~K@P_{6%>sO=u>X%D_2M3x|+D>;7^c;q(9aXr=*~Sv^axC zx*(GcZW+Hf;E_xVzW@|KQzw_})>;e3A(Nq{{*)_;95EMSc|uR2%yg?;zRJSbThNBT zeUO9+oF+>wEq89^LA;CN-Xk59z{WVgTb^xOyBu6H`LozkJLTz0^eXkjNJ6?TUT5~+ z^l6;>LMvHwIdK&HgOj?pGQl_a?3&#dI~0K}EqxQrLvK84ttb8xm-dB$YE^t%=mc&P zHbll))AHHaK|(w~iZiuH^+;pkz8)Ce@#i1d^{4)vg*r?J;OA&Uk$_7ZJp^#@&~Q`| z_g(P>-_+DBJ8jbU?7a`~aSR!47TPFLHK(_*v1zSeYfbCtSRyV+Ww@776A2-hLc_&_>_hBO>Sg7vNPp*zZu5EvN!Z2E~0nbZFGifoU^2O|!vuGg<$^zV` z2X?4}GWbZN;@j2sOL<1WMB6G!l~RnvN=@ajuRV=T4xIqf-=Z|26sn)-ch%}u^wp3Z zI-t~QZoSpguDi_=8RMj4m;s}%g!XL4(~mZrdjP4eWHvhq_RL!MI zaj!wPX(x<<^~J%GMg0ybwA`N7wXlzEUx(xu zd8-@%i9mM07lHy^ed6A_u^@tHtq>}ck%BTee)u{`jZcz*Yd6iaZb+0wy7#ltr)(s# zTSJH1d%n?PU0YQT*Uq3eu{sgQRmT z?Oods&710{#ref}(%eG(qwR=K$~&nMZ-3=wOFLu&%%@=NiZG_9aFA1Q#kJP>)HBw| zm@Ub=pwCCkP#d_k84$e=DjsA@S1yjV-_tX9)(#htO)(*`$W7yhMZY5bC+oXQetSomCl%xf%Bsj>o2Je;FTS~$xb!5tO zsCF{ea7j%q3Po3|Hc0W7@;b&_&V z85OS2TpBBr7ze7iZ9sLlii1H^#%bGb?HBf8wjMNMg8g;cR8;0Tt3i#sH=a<1Q{~~x zY-@ze-~HL`UHp&evu{WIr)cURPpy4gY}5$sw$<;zzS&y0rt)*e>W0Xi*X2F65 z&TE>CP7A)mjn=S&tKg(KVkC_lH_o-#*Wq7nzVBcD{;#HQA79MFva&K~O#Haxj&u7o zy%Up6#>Hj$T9Q#>>In{#bdtey?E{5-(WtMBoC4`kU&hR3W9iB(uXJ>*GJTx(<$uxN zDqpH$z55NbZFM`4N|j_Pdo!MU^&jTGDb8mFG1!0d(_h$i*WYNTo^hf5K<6g!67@Zl%f1^;!q{qxPKHfZ2L_bvX9@^<@0UOxQr|kJD#nOe7_?oo zpP+Xv784{^%I1fSi8hRzkWA6$UxegUv06!sl07Hr%TeiJQ^h*KO^%3D*EeS%J%a59 zm?rsYD=;=F!^ip#1B1<0kdN{bhq4t9GlMXwI~xu(DtvuaDSs>FA^9NY5)Bo3k z8V)UuFYMJ9X2nV;>aHczZYnLR7w@FPw1yMaeue!MBd8BgL;4T0c}wRzLz#N7xUFnd ztzv~$bHbg(f>bAxu09|_by2y3bpnzI^$bWY3@9#L6b6B6fcC=};e@Fa%IWIT_DA*9R-Y%7vL!fPw`6(XzV!@hn4Pd7(9^|1DMbE+!9CQ{JX8kT%&O{g8X z_9;*5B$}yjsI|8y-(e>n{%z})hnfkD4F?C}Xn^aC9vlr4$Cv5pK=~^VF&g_8pK6c2 z^Z;}sZhJt7E*-ibp#&`MH?6Q8i#8#xk{+XPE$Ne31T-vOXf4>!5$shT;dmu#P{jqs zF}e%XRluo?vr`wM#p33%VX8-sNH)9lUKzxbNh4@uOWaqPKBb#=2_pSa6;y3)z7Pfv+XGT_}AZ`r5=4!5RHS%eQBWXXf* zo17Sh$w%YX5M0&ITD-vZ9e$GDml@pE_tej}A_?%$+@-dmVVEteF2Z(Dh83iKU^$^B zmWS7=GE^&iadMr07={Xq@VLX~O7@dvhpQC{wpP&$bR|R3;S5C7k3Y}4{`@s-9x%od z@Bg}m{(LiDfsX5Z5Ui6)WO)z#uggmnd+>~8{!AhSgqBsS%sM) zn0?W-V$Nz2RMwx9^=bbA_CXpCE2$zC_2lG-=}hCQfA7aG{nq=;?0j2^I$6u?w=8t% zc~*1AHP&M#L&qW*iU}KRaF@3%Be}{JEM3I4z_zy(z<^d?3hEuu%kJ>?Wx4(v5Bq(f z2h|UbzHMvBMrx^-jUPS6O1iFQ91q54jjg^7{;u-$9D}duO7Wo2Fj7ULGtC`>nWH!8 zNcgikEQrcRI-Iz)u1!H+E>GZ-fD}>pNf%fxaqE#bBdY+G9ra_CDdrz4g9$MBThn0z zgV$I+)n6DJYLJAE6kEZY)EhHcHwc+8Nr4QDzOb%@F~(v@1wdqZ;FMUzk{(A2LPR{5j=f_{pc)X)*PXi8Sv|`=5xy<3CS;%LQ9=QAT(1UPP4|AZb zcY+P=m1%PrGi$J|)RpxWK#axxSLi{wh>h!lZupQn{l~!7qda-DZKXDKipb6FE7}5iV-6_H}Vpu16eT`B*~)t z1s7c43?R!0vJ4(8XhWm)^u&o1-KJk^Pcqq{4ZaR$6<5pw zFO}psRALs%%b6GgC!c(>V^qm*sDf;Nm^d`8fZscR6pk<>nvRJ$K)3 zuf6h|J^0YiosAmRSCXjeM^Q3x^N$XjwT2onpxj9kR;*r)hRh1Q;r6wD{Yprs{`cjK z5iYZT(?6b$%Qzgq<){CH(e2~y;;&t3mtXmPd-JWgcdPa9e}5ld#FyLk*In)2Yn;35 z?%&znzxlCKFH?V$RHo(~g+D#`h-GDGL4ULDowxsPSAXjw)XDC0^SZwKanj!xAT06X zEAQ9|#~-K9vA(N1N-F5OZ{Ouq+1y9|G|-1mI{9q+=+(|v(06Y5wiOrkf~m_Mjo|ye z`>{X%Kpq_*C-0BK_EVk$k^rnr&z|wK-+}iz+9Qu(^$f})7*Duv^9J)r#DD`=7BPV> z9SyFVw^v!eqQP#!6|+blxI!%AEUyQpv*<+ZF`OMNCbfuJy)DP8W+E|UT`V_c1){{& z7^6PG>R=Kvbhiy4q^`%C(}0qGHgC>0MA0`R?SNg0Mhx0k%(cdYj=_6bJqCH@B?B8A z3^c*Q1BMYqgQX%X?$)1^bYRY8AcL6-8gS$-NNo}0$DJzaQxrEGgc}7R#(to!Kpmt< z&vF+>X(g7v3AgV5WMg(&mm+H>|0cXPC9v_$cA`j8zW6HpKz&;KHRExm8d@Sa2q8Dd(Ek&=j;Vyl-Vvk{aK3L{_^}KQSNNfFT_vg6g9UKmsDd z^%$}R5Nw)cCqp<_1j+<%O?CCw2vaHHU`ay+^%a5yYB6hC5)i>3I?VEZ{gPE*T7$!$ z9e9Pwp|oHUmPZ_I0G$Upn1;={J#0hWKr2dGjrXXxa3?+nCYIC-f<<)#;-bljtZu1U z<-A0R2Gd?Z)#uEct(Eu9cy4NNp1b1krs@L6 z~Sv8VETBHlOd#48n2jC&^XM#%`odx|k9ImtBLyxu{)iZ70f_Kru zo#>cEqOsOUl66Tz_0MY9)D+Smw7G%7K)GS?mVnA&J#oa?qnt{}txw!zXN*7H1`jxZ z`r-BxX3TQDKPAEB?13$hRX6^RWjyo<;{#=~Q55BBjOY!GJ~``M8#ZJ+Cl_MQM(Ipt z6TmhtcBJueT}W!Im(R_l7W)SmZaSp8u3v_ zeZ>@tNyezbl;5xmh9}J6)^R77FiAK)}&<$P-zA@~AA@G6|DjWK$lDou=a^?1dL z;5{vjdX~KX01yW&NgO2MzB;m@(wdRtaX4ks=lWDD-n@Dbv03wLPCKBf=6AU?$35N=jyd)vujv&3K9n{m-kman~lRJm(NQ;gL(| z&sUfY9BXTL^t6iYz>tJ;)7{!iUu+H*1zLnD%lP2DQt?9LvkR`wfG+lp9$=aQlMP$7 z`9|s?ydLSKC5+EQTv?K?p{okrt}W_XngW{eHt19{lGzk|@|Gok@=t3y=4;kiFaVET z*>0?I@I&e$VPge-VV5<*C}@PCD`~9u{Y@}VV@%5!G~AN!z0J0s{B7%z)f0LHhn!B&oHA;H8Q4!U>qo4jV(#^pQA^X|ongg;|W6D)YHu=Y#r+7}4QVPq9?&j*02wzsj|H zGvj^&hgT^-`=ixgb%mwedAB8(mcevwh>Z{0=u6$XE1oK|)4Mo3Kt1uSsl44>0Zv;b zalt`XglEN5qJi*3x{1DI<9dX!pu{J5jBLGw@|jHC>hQX8u(Q5nOV9sNb`t9GQ@ z{6!yFeccwk-Qm5mWi)eVvh`a0vGt$+j_v&EJJyN~xwO|GvBYm4Wev~1VvR|%(@2{@ zRxqyy>#>gT=I6H<{k9(;I-xVsej{^uZVvYA5({khg6T*Q9Ol|AdvnUS2^(>%*G{vs z2cO3{03!%ykmhCuPruE01k4GowF5_7U=O_hmgS^I?4+WBZoEp>{7oDF6?zbT?hfC* zj}KDI%K@kBtJYB_^AswJEif#FzrD>DVvI@ZSttI1H!(xv3`SHGpGxmw?};#a7hUST zKdEl_d5@p%jTq}tRm=o!(8YX{M2ggw6toeS4Ne6y8geg~Mq&UA41ede>u{ZIZb`VrigEM4ZBF%ZU>XzzsMkG01iOtUASdftvd z?id&6>8GEwH{P0TPyFQ}H^wNzvSrKdt~+nDnoGY0<7l#DEN-gWVpm`LUHdU!y{1f= zYCpT>CdRj}F8}k-Ki7^v_H>*Y)PO7YWt6R;G8JU2=~qAd9(@ie{^*$H`^huUK5uv2 zc`aj8p<839?@*=$(JB-x~0x zE80HjoznRC%PCa`P&*fzU6;xN1lY7`zIFSW!w0UYj}HwHQdEp7nVD*uMD<%YeXH|MQJa zfNu-+P~BZ!xw~}Hdi(mzHckN&JS!`i*jcct?P{0QJ=UzBYeT#Cvn&`c&Ap19jiLw! zP&1QiZ1livduQH43@SG;=mlv=C};qRM2tVLx2lzJ&cSyAzXMoBI3-QP14)T3Tu}jY zOycFLG#B;LB3+(xm#hIz{0kJW7QuNsAe+-hqqi<>P5cNnjF} z3BX1cy0u7T^vLN+8z@hcERqsxM$T4(_(=*ub`j%aJ<4#zL1VNI9?pWMdO7 zHI0+K?r3RLTPt}a%VS&?3n*-TB*J_W%=W;WaHo2RVbYb&_nL~RM={hbvD>g{@w?dJ zS!V~1I*TUITG}RcxqYDr!7HF0wK<;7g7i=qwvAHk#G|jUho}9{d6G$?9;%NP`MDWY z*0=>D#GLr2!wgE*rWgFk#zb~e2`A@ln05qqwFI**s02v`unRVCgk#lHZDzM-tqbQ_ z_^vxGykeP!Sb#EmyGgr0_EoC3vgsn8PI0Hs{m2eI;815fMYQAEAS9?Q%1`ff4<7Wx zeG_iodv}lGnP>GMNpTD=8)7${cO6n_GwkKJ{zh4hVSIak_7po5{3N{nre*x#`_4GF z7%@S=3dTCw6zc&~WmDA#Hl|TpRJqYh3j}#Tn_jWN29*tU8xO%->LCmy(2Ew6tu{RG zJsaC+mW}Ma09Ya^NWa{J9>`N=JNyEZ1Yi}D~=(lWT zHE=Q#hWVI?1Ou;v_E3uu9=$>(!z~QcE_fgGW0faKsIK&>?K zUT!<5ylhR|P=^zIVQ40U`^d0KJmXegy@!0-#`S1_RUZV#Va5n;Lv|u4Ww}-^XYVJ7Gy-%TC#dq3%4_h7R#YxgMAP9-udh z=jeAba5xhk=CepkW31V}3lVPaQ6TXQbYT{4oBXzWH_Lf5s-_h&Cj}xNcij zpd#kRV#&LF&seMsgc7(V1Z*FW+dvuY;UG6#f z9pK;7gT7Nwn8gQjK(J`pTdZxES2;k6)bC^tMpYDA%S_>PyqH5IF`1yx_N+PAYy>s*z)x1jtLM@$26#8?|~sfAS_ zQ6V*>kt0VssSHV9s4PidX#Dj-d1&L(zAU}>L2GesjQl&@^;;WvpO@0>z1HUOaeW>> zt>S5uFSsiBbdG@=edp8Yo210!GHf*%#pMTNWJU#_PDgZD0TT*VsoTBf)cpQ{_5%%qUdw zUWko-FTV6Lc8JOyK4i37l1Kh9YR;Uw_Vf#Hb|@9JX3bg*g8w8Y736Vq(5O*(V*Uhs zP;a>L@U6Gru|NFb?bvkn20d!{4)4rS(HoB=S@>)o)mD)~~;9ZrEyLvFRhRO)X@!I1`*)AboL771u*NXY!e>U`sWw1 z>4Fi1J)&9`!3_`HPu@9}geY9HnE3nPAU2I+LP*e_k za-;}nn-lxgS8lhaEB^#jC*5t%kb~F*Z=xri7^iW<9U3+P$)IJHG4?oXObuh$Zh=jo z_n4h~@;xxzGQl-Aub@}mA!!%(g&t&-Rv|f=(`gSse(PC>wUPk2qoQ9f^ee96UiSr>snD0d3oa$E{V+&pOM`Ex=n>j`i5I##-sqNh1zKax4*MNhKos zWv>5)a0%`VhQbK6jo?#8T7UT~Yrg$@OTPJGOYT{Mq*MzMJH2h%+^IGpG!d1}D(pS% zM0B$Za;IO2zS`H9cgeJ0j9uC2@!y4Bg}^|pzG@wt5TFUC@RvR``+o${}pBS8u4WQq&sNEbrh>sih|^un8kd+{UP8+9nvvBN&q~5({6bqkbI2TMAMjjuh0Q`90v#8+^-lZ~PATwsyHMLrFCjyq|LBQ5l| zVJQWcKP1D-%ZA&wEvrz&gl796WTlVaZcD#NrGP1; z@hw|6Tgx4HSm-A|wbX-ApF8QSSM|F2A-X{x@isJN6{Rx{u4Xamjrn1Spmvb^nW?~8|C|~90#s{1} zBvQ{%IZU+Q{@xm{xynMn`i-SbVt&FYfk-Oo7XU%8bk7;u)X(h##A^3k6sUX2i?Ggh_a4sz^bxa|_Oz%C+a#6F@!J>jsBW9o4 zEqDqZlD-m?OiUOBrS~xNclY7n=#OuUx0^H&TP)hUslJkSlJt+%0EKg@(P^J2I{V;* z4@|aV#jKQlB=uuS6$yS~UdoHu$1-jXJOn4b-(Nv>RXgN9{*`;5+}*W25<#EkTHfPE z_tMg03<%!~jUsu?x~MDb*#{rE$F)zYU=OlJIql4^*@-6{>FnJ|@{MFJ6czQgQ%;&_ zdGwW@QK>nf_x@`8zeB#FeTAcro`e+8GxpU>uVRkQvL}&Vz3Q76K{Kbge(@AiLFb%% z5t3#P;JvF3o4K3q(o6o!F=qx0U~L}_x!7eIG^or*3?Js;{*B8og${pjmtMviF*VsS z7=QJPn_XB!t)g`8u}Neq)7&y&b)% z-l7|MK6~z|KiN$``33lWjQOF}X3lsP`e!Z5_x*}PXh&rPD-~DG|ExdiBm$%+40#jq z2Bg&r0Z!j#d`-H;avgvB?YBF9W(^n>oOaxJ|oM)!*FKFdUe8U-F_S_dA= z%9@P{%pc{eoRwz)Q9)IWb99dQMn zs+Ys#s){+B()Gseb-FEN;U*D#ac)x*8*#l{X>|$xZB!{tyEV%kGbqSQ3tJ3Fa>Cch z24ld)lWgZZ(=e1eA%F?>l6Y`FUWB$I9kFZIPUoFUHbB%eowC)VHnE1bOdN}fklGWi zuv4XA(N@L;^5K%{wrSN0>r#omoj=}Z5e)e@FJFUaFBW#uyrRj1o4~>1FVwBOMVN$y zuK}~kseh@LjB0cl46R|BZ%T{zvw^3yyVCJM)-NwyUbI+}o z&<`(Prz4faBBJ&OS6kDZQD#SsL8KgEHdjNYzPBMgom`$X-l12T7-Y{=+`W&$Z?2S)}dUfON&p40v)k zEXEu=)6POC^x$Dl!4B^2sK~*lrKQn^4w_)qo9E)e?(cTc=yNQwak}o(;2kq$MEXl3G64QhxM5R)6#5mj27fU{+vDg!%+{ z-XqgJUkDe|KeEuc(bn?mbd0VKLyd<%0Uq`(58@G58&|l*F!K8`?$ubYw2v$|Sxy8J zIc4mIZLm^@4~-iUYyl;_`>2IaM`}!IdDl>KfE67%&Ni&P$m-vF+mau;0h+GLln@_7 z&%_dp8LL{C%?6kBk)ekMb5k=av8|k%x@C^&sV&F$x$Nt2^()z}%f}n%`mI#~dX<>0 zm3s~LI3iStog_#pd5AvWKQE0$UKNo+^`@ETOBHd^2G<+ia_wn?CogiL6!&hmx~v-tw>iZ6| zC3VZ};E5O0c0a257KuDyM229@Mk*QSWP=gANk{}8G5V;sNMH7oXfh53f`l8BVLqk8 z#Mz1g@`5~^LBQN~gsu4eccGK^D@rs1H{}=Zq(f9m7m0~9WbhDY_vL%v`<{y{Bhy-6Ym@%W zGtbzB2@{<6uy1_h8*XEzL)(&)5@*C!>OfNUk|P+c&lUIe*I(zf{_9R6KJzN;wCjdF}Vag*+%l4 z9i@;DW9?UtY3gk;c8w~qGeVv2v>x#u9I zb|!r-!2b__@Lktm^-c9r@cDf0s~3T{fF6AL{@XD2=g&R!xRdtGL7L6&{iA7JCj09T z%~mxzylMl${wnLs&R2C70%h<{9O6qZxx`Hp@#ScsR0k24SwV*GB>f|f^I_u-bMJKG zp%Vg~BxtbJgr=Z@MR658!rYJj_$QQr$`qS2&e`1*FV7&7au7l6h9hAOu3?B1knpml zsLA++-=28XvIyA;{zhy^b1zh^8ex7QDU?3j`e)7r`P(c#t2g_DZdT1HZ|e%Yh;-+7 ztetI7QXgx8;Zn7Ei4{)x7OEWUvC+apro*sjT@+2ZsV%a_QI6f9HI;MVoCY>+7A?oc zU%@DA0Y9OG4|kqcA3n&8<>LhFudg5D%7W#{X3fzHz0VJaA(kHW+5BN zV{t9~##Vtra`%@!IO4Vx7+|62Ua?vjSvj2MhSyfu>eJ7)gmK4P)|qER3oPE5K+>=K zk=5SxV+%|4pFG(T*cK#$mM@=fb*OUnOkLxQm5$})w97{9lZ-tf@ct85Bv6U{64P$o z`uR5V(-$#>_EY=koWEKN44I5wbvEwcuiAf|`CAx?viSr<3ueaNLtDNb$J@(yJ_*E! z9&(W_TKR_k_3uBiXI{O>UY@qv8Ye$xWhZ^rzJ2=FZT#4YHVk_i^4N0X5hqwbJo%L3 zCF-){&$S7oC)t%JTn0>>+_izi%J;yUKMX__z+QnwA z$+nLxy5r%hyOni$+cG1wky@gEM#m&gY`fPW+D@3Z327M?23Ag0OsbPYTD#!rg!VPA zU4nu5f}jsakJ1B)@) zOw$6ZgLe2*+?}G-*ISVa3Qu{>(yzGQsn4}AHiH17s4i_a+bwN}KLQ9#s;Hqg2X)_a z>)Um`9X)oqjV?h#(zYNygoHp64Ev?CIBv&%amgV1vKW-q1;&;n5)-@STf))jS@^q8 zTFWK3x$(5EEuGYdJ|BUpk~;Em%X@z=Hn!F>R?~(U41#nHkEmDL{K*!}YcDHtZZ^`lPe<65LYd;jimPq|5RrdZJ&x2ng3u8@7c$L?DUr+UH!9=IF>};c5LN229iGLI~%E%wQH>Y z+N&-5ipvlI?t`jbKUB>Z+A(Dx+mZceqqbcIvm6E^s>`7+FpaOd+x6$f$A3cJ@#Ev( z@#YHb@J}b{sG|-h@(Vc>*-~MVC%$jZH$7sJ_n)?2*j3BP>+4j{T_a=pYAi&;F@&^G zQmr+%W&u&)3cmUj^Z|Em%=K83FY+KbayeCg^&Luc{RjHgxGYuPUb(&KAHZF4dFNE( z)Hj58Z5*TTJFG^4rrkcdHOOvn{|-MvKR(h|7(*huUiUQ)BCu}R}xSPzU}VE=lJtQVegBS zdvqDfmPUfwDn^{7S>#q-+6y<_aD!uXh*6@Ta>XQ)#FW}BwJ9;X1k>xT`?fQhE#{qq zVD_I7v|rN!yqG|`B*mq=i@_tiK~f77vr%nVo8=8nLIApJKdAS@tEUsC6FkKf^G=4o zD84@nj>_NDgqS$-jGTQfTWQ1;($!h|EcPH`1Su$v@?NxPv0Zu9bvR$i$Aj7^_sugp z+>ies{1NQ+Ph-kWKl<<87(s%O7>R zTS0M^cSj-kmg?fP|L)5WU3X_aue;B`ecb)^8*LN;V1H%5fAUqGC7LQRKutapUDf2G zAOPyStj=q2@c^s2SD$?Mag|PktAg^{TTmM5Q2VqU#Z?}fm_%6Z zk*stgx|XIIw}{nQX)7vI8&KIAgjX*u?piRms!gAm6|OcIMm83su!O7`CV{h0!}s_l z6xoVTfW!fW%mQs^b65Lt;a2L&QYfJun*i%ArEU#2g^FxgQGsn-@t&2Xt+7oQ3r^Ca zHkFN#>P`7FRG5skP$i6*40IDR`wr(+_jzaFHG-HoKy}Slr)b6?Vgtr68`(??M{fVB zN>d*#dYYPP3!BFrPKZC6{fv{$sjaQH?X_zyH@lB*diIajdh#`h#x`Tn7?;u+t1)cb z)#@6WtbakSbw#yp9Za1v#ODPMiO|kpwa898@(51zaUaa$t_6lyf)+82+F$g=Q?71lECeM>?TDQn1Zn|ARz zHu0qMEQyoat)EQAC2cRj6Bsg7eljl-gFj_zgPEAy4W=2)Ea0FG1iuox;1P%aAflFcZj8GvJmg?~3BetTn=rG<_Ct{?u;N*=t&8u|=GI)@FbO4SCS zPmv{k>k8Zc;;U!{uA}%S+<`YX1+=2Y zwIt3IcFQ+L4-kXe3M>++qYRBw2}fswjU#Yw%Ar{XV#&J!+-Ig|*~D=-SWWc;JA6n# zizE)T9m}>@8WM8a>q&Y?ZBc(pg5Fc|ds^d;YDDXC7Y-9hr38HmhO3Nr@ z>OAY6j9RE2h*Szj@?d~U4J{F3SN|5SG(O14cm(N?WTXlscx-EIJ`B8}O2W5zdVt93 z3!GxD#z_6pLuePYMx1~i)Lk(s45K52s%lH+YK!zJc1${lSL)S_5#ajz7R$)&#zt@IkZgSH!+kZ7Rq%78Q`@@XWJ7ch&9v*uZL!VariRAnh&!}D2s6ZUK{ zn$KcNsNu@9A(YgZ2XVyLyGiB@(WANGYFH0CG35Nf2&RlBeO$Jkp>pDW9r3{!V7<9>g$R~bJ~ z{u<*c>UK!PB%?aw41WWIhPp=LF#e*(m5>ij&_<0huD^M_?a|-phfPV=l9Oj$K=1O( zMOK0Yr|f~n#&uxS2qPc~2LMUf6>98R?3eeC5ypL-yUuz(a^KNz;V9 zmmANDE&1Iitf}@wY?oof4tn3)e6bsy?NMLG2fA+)#2ndDY3Z-tX{{rUwuTAkS@-l! zNJ28cw8-0|q}$rUZvCypejFWtJLqrTShJ*d8<5PBWN9jMV+2}iSjK@0^Jce_B5Pti zapNF;Mj^hxX+Dh~AK3Xp>jl>P$wzI=PcF8m^KZ74QKRV)zy^5sm^Is4K3r~f_g!z@ zh*!UJmnEV?5E^}`wJusyS(lve4qz84d~2ffqUyM0{$ z{fpcMn=d0s)$PL%KXmG0lDrZ_OnV01CGDgjBgs;mQ+VTzHykd+2oZf~4 zk;=+S$4vXO>gY1w&wqp~Z%o|dP51cV+oSiMHg)&UiYt6~mM%W8{qgMU7oT@W@8Z9I z)^q#xzU@lqpG6199($BcJo0e%l)-+seY(#o=Rf^>e0#IAvtrGOe;<4KFFg44o~HEM zzxx-m*=tmvpU0>Fz1Kuv!bjI8x|n*5{{P1W&*hdbvs@(VF5OYNwA6160tynvQs?l$ zHDQZesFMz#hk&j38i*a^BAQn3{E3K1erEtu9-07kDNXy!zt_a3d{rmice~iUgd!{m z@Q~Gtihw5l8q}J)cFEpAv7z(Tg$WJOGVWa`X08yLV3Af^~;!?d8Pw(}t zB)eLASZx?1!r@fgP+N?#>HeIa*4VJV^>*s`1UvDUH&|)kY8F(1@jh*0ls?SrL-k&_ zp3NaD8A)l`me^Wr%{#VHCW|UI3tA*AzI!IF`>l7e_dy=|EtQyz3~UqO0(KjQA6KuL zjco)5Fiv~wYB+Ud6Br8D*zoQ%tT4NR1u>%jZ16(~N!XwmV9P2HNhcp|cx$l9Q?+v| zDqFZOX4NPLLwM^JU?N!3Xxc8%TY0D@ti&B~9gFuMh{@1ki`OmXB#RS87GIJ~Xr4FQ z>VJnloxeV1RyNS`e)tp1Kks~--&|+gkh%$zrgHOo>z>ntY$$_zIQR<24$cAWwct;~ zwvSG3#nhoD#O0grO!BSk*H|Kxx5wFTc~EbMKfw{Bxk)1rwK4C%V=YhKkEfqMSn5FB zXd?lj{9L}m0h{xTqmH(n^A}t7G`teQ)N*u!NPm4e(>65?u*jS@Y|Y!R+q^`)*1=#2 zXiB(>UJh?CO8C8O#Z()2z~!7UoNk2$gHU_OwUohQtZx2vHbC-v2Q3S?T#iQk-O)fi z-pM{zUk+Drz*El>i&!1-rqsD2l2=GW9n%OuM-EfU1 zOnJZ>KACAbi2P>f^tQ5+0j?b}JPG#X<$epVdKL`8oudP5B3Oq206+jqL_t(vj_&Tg zzqfsF%d733!zc7n|1=T+7hi+q2YSc!mmq)T5tJLyT98f*q{3cBwhWt2qG^hBi|%DG zI(y~jSaBgizn8`-{bbP9USoJud^R^N)tjyH zh375lka12DFtM!MS~-kpLSnI18*J*l8%^vZJTX>I+E9Gg71+CE*EZ(AFRVO--G zan)Ze+h$wW!8ultxWIa*Eu)=*Yj@Y*K(-j+Vc^}uSP{V4_jBPZzK?o1gID@e17l^6 zp?z(0#fLEAv2CXDh4{{cA!=lXd-&w!??`ep0>Bxu%y#zum@%czOW7!Fo%`H8Rmm-jhf?P)8%oqFfq(3HArmS6E(31ClW}p>$LUY#Kw8o> zzqQF}wYI%_z0FE#w5(~bI<-kL*<9M_xZ}JpGDc)1Z9pmr)pLhy;1Q2=2b+KnJihmp z9%AD#fDoNEz5ND8r7|tNX0MR^ zWox|s=hpb=2bdSJ_p)G~)uRI5w0yZ!Cubmcv=z`|6edylKseDL8v1gA+O5sF4k-2P zHzc|Tuxl&J|JGe0K92vU_hKv^c;JD0jO7vky`yx#Tp!Puq4l(wB^{+v{vEyVEHB0X zJVE)1=_tva&J1_UKGA0#602-qH!*dNIO0fmsD1a{cRLk3;Xo=-PU`2cF95VaOTU=Z zz$DcqPiwkPJ@r)ASCo$!U}D}$jZfa+q%P+7KKlNj7KCpP8-G_D+CRs~^WS|O-Q%DC z(_pZ-`ucYHHVY0?Gdk_mlbv*3d${Z^um7vx1cNU-#M9K5owv^~9=HD8{=CyoT+l)D ze^l^*k}(>7*rKjtl$)zL0u;e z61UU;tWoO>Yk3z4;j%$pa&WoMxry1d%-CsVTyOYQyFQ7;Thy7+lllrdd+$ zHcU0pKFUxVCAKIrXxS|Zj0p$tWs^YP1A~#=i7zROvf^>Ja@9vLnP!5U@s@(veWVl{ z9vNM&d&+t{VpI{j=SL%!jyreYB3_*gYOX+~t$_`W;8?kFoee7N#|950$J8s4Nzr!h zpl$N962L+<(-oVa_Mk@S9(t>hYGPo^-lp-0(xo z7=O59*kqv&b||VCtJkk`-e5MtuziDQr=ccLkloudzyC{1DK3FghJ*%i_GP&{<%uS`Atu`V z=r61lhFD^njK3mzmWGX@EqEOH|JXYZ_`a)h|3AN(*`#gSv`tsiy=V(%w?IqTGF4DO z1ca-A3lv;ez4z+HadCp^)xRj?f(i(TGG$aKWwm9N(w*+6D^0WWTmSdxe19kTB~7{j zMPEJbFW+^>bDr~@^_*uszTB#QcpYx)7h>?W5e68Xb0k1wZ1B{E!i#X)(o$y|w!VSh z{!|wBl8|Hb11yFIn#fzvJ42$b-CcXDjiGI|F?l!|$hLPbJ;cFFT&f9d)C&LOaEsr~ zhU0~YG2pxkW5LiQ8}k?{FL6&#)X%}>=mt8JwOqq~RA#X?r2AVM9sA-vvt8#a!>8)n0jp8KrDCr%FNL}~S&1$|+8KP&kvo3j7@y7k(; z#V$PYQyAaIhD^4-opcP0Cf7zvr#_i2dl!1heplR1{g`K;#(mRw;MR$K1}1_A<~(e2 zgkdBEw9`4ht25;a7L5@DkQh+;fEc-X7`m6_jqBUsCNgBSMPX#cVBEQJ&wUHVfPlWB zM1V+@S= zqF|h29F(1_7!o1F;MI;{EXj)%S#4$n(mpV;cGg(0QKM`~X@9%-)%&d*Z%$ z9p#nFwHNsH?WXG<=|Sj&WmlVDOs!p}}Y&25-mD zu!3j*=nTZicov-g=i&6%-NH+INmVz7q(|(<`z&?h$1PQPnDyTFGV@Clk|Hp$p<$2z z+;&sH*`*)*_Q_sz0xi0kt3SCt9O z-synPQ%q~oQ3wW7e9&MkyyaF)&w1RMuekvHG1p#ri5)uaa9fRfos+yGu7+bVyluz` zE8n=xrj8%&7%S>4E??Cl3u{m&WwXwZ=d$FjH=*`zZU!YtyVtzSbOS;Z(HNA zaY$rg>uSwn=lmi@-Gg~ZhQRZzIKLHU&`y|x7?)Om%J#?H_T6uK5T4bp)Hl7R+A=Wa z3O;gy6`psY6@Tl8R($H|IOeFa)}JG3_46NEGt8pWCmy#M_x;%tPd#iA=9T$n*p4mwTfOt| zyB5>+o6>cCC%Ap^`F59I*K|HjZd~Eo=i#qF=cBe?d(5kwxb2Dd;YM%->qy#zIjX0h zhjC9?Z^Y2`VTT>+)a|4eCS%@Ghm+RB4L9Hn0LJszkP6p(;GvHg>ds zx#Ef|9PZ^cOOip76jI2=-=5(3M}8Na9$)_I;n#E5clzev^;E~)JpYk(d#}qD9#mI< zu;uacUYGlR&i?=o_O^AHKcJsLjAn1sybt2}29~(0bc7{BDZ4OdM0E8(O(F_W47alNahujUByQwsM-#vF%C&gZ;!?~3JqPc|XUGssRIhYuLUM8I zzqza8vN?1=F`2m6$)W#AeS<7v=CDBDxWndr=PJAJ(Ffg$+1Ngd*_5$i!*i3{xWTxo ztJ}bYREULk)X2mPLLDXC1S5)x-Z5RsUv+c!A)-tmvw1 zEUryB>80K!MvhK?M^%lnm8ihfW6Mb@VP&XNFwF+#WbxaMe-ImjsZcx=^(3T&LNN9M z*U;HEB&9Y0`Gc_Q!2q7yu0h-R_JSb*4QwAg$ToiXT+3&(8Dg_7oOh)MJ;S+Svpd52 zT>fQifR;H!b@dRQ5|94H@@5`k1EwBlEihz8^_pwrdcR`Bd$EAV1#?)7dh*bsW8=oR zZE*i_c;!O624<2NgY2m+hOzMoQXL_r)*LfR%r@{8rp4qjGt369%g@#+0LuA-ad zGf!FU#1FvC!zH)c(7~Tg*Qs2+3-Z>6eKgFNwdl&!>#cqF~m#+5#A#c^y?K{KJS7;T~f+N)QorP!Q@ zx2%DIlFw#ed34Z&ygY@ly;Rf(<^h{GmG8b&j-wZF98=?AQzL>mILVC3W{r>I=|OSD zz??Y#L>qv5Tny%Q@Q(44_!Y$)Z0ojaTkz@}+kjL}eqPj?mM*o>xI-Po)G_wzYMr`9 zoP0E=1i0X;HlY3E6DHz8?@()-^Az+Lz}l(ZXqPAq$F?n7tsa%I;$x3-Qi(1fn6-Ha zO|~?Kz+2W~$4PbdZSAf>o9&(+vTd7f-)Iz`py}qiEFE}y*b}_u6@~62YhX&KUyqoCVe;`-yyn+PtAG=jXMjZ8(yqDq zC;xWZCy(G8@q8S;bH6NI`1ihFke}*1u-^dZ!7xL9$#rXyXdP$;0|sZulYQ-P0Wg2oqD~|g0L>dw#<8~X6K!;~$ojEK)Rwq& zU9)wgE@CDi9%;#k?z8;Q{JZ5Je}WYsH_P50JkZirRh9>1D8hIcRv%?NR6FjVkMu!0 zSsVd)pag(O)?*9WPu!#~D>!93Sz)b8zT0KuRi@AhWC z=tQHU2ihQx5f?&tx!qdYNz6A#>L@r$kkkJu%m9mCLdZ(IiV z|L6r)^!0CB-WeDfC0_o7$@bzIAF$T*K57-Gp5kl^N|M*DH)z*5hkV6f|8Fy-CmXN7 z&RXX@3G49*)ZSs2!(HZW|9($-DlY}u0($n@ zXI;M9tLR``5dWaFWawYqkY!Ljip(IHwAM{RXR8MJjbXP~8rKQL+lzw9!M#KLix zu{sUf%4hQA$yUXpC^zoAQIFg~%H!F?t^ECcTU#BAdP(ERJJvSqTP!uI7%pYo#B)%@ z;F_KPrMeL7kIL7Ar>!tM7T+iVauP}Zf71c z-1Qa-eu3jEIifm=|%T_sr&6Ff`#0)|#9rq$mWZl80iQT~%w2SJce_F8U zwSs$-eUO?_Ulxx;dL3#bM@@&x!6JC`t5$OQ`BsP6c}dY`du#O$t8GI{AdC@Eq*Elq zEeVftNa?IxyTS&s@ZMav8Si345X(nNj0IJste+*TS0N6MEs~rd5$@sG=y`VGlXfUf ztn{KcZSXy}!B87(13q?+wIKDly^TQ8S;=ic?OAiGZ7J4CR-N!IOf3(FYB$Xc*5LqVOBw`V7nr=%6I5y%IAsh0^Z zM@J6VyC#(yLE({XOdom5T3>#_@{c>-T3>(FGK*fdypLVrHrq9sVb~kmWGBtQ05m7W zb6#I$D_UWGqK4PTDf^NYb8Pa&bHF&Kof+IfyQT$B)Vgdi8$6_WGX2p_C$3-@xE(OH z10U2^bfBN$#>R#%c-YbxecM8nsJc~6w6bDO^YLQ0`4x=H&VS4zcU)u1&)k7MrO~7d z+AxU?qvG&7n=)n?B~@AV!Z#74Uxyp>an=m8Na_?~a<&J`Q@@L_c}if^H_gIHcyob^ z)W{lNeZ^wfnbO9$y}f-q3RY+!#zrgs#V=as{(CHa1shk&Xm9JBYPx)R_OIIG1SRq} z_|kzRUgb8q(h6p1D!FlurI)^Lu?sJD_H@vC@yWBf`BL#gPWzXTj(31aaNjFYo(c|kq{eT^|4X5qXjz> zk|4`3#)ii%%fQHSbyfb<%LPXREZR})EFO1|)xjW1H(bmL6Aq0T}` z@j!%Rk)<<14NjyQIB4J)RKl>MfyX(GGb!k#U;I^=pwROU+)k&&NMr+xL|O9n1y*?S z=}v{D42jFZgC;qKyQ_N^!~jtKW?{}h?JV2z@sC;RRK}-XNai3N={iF;iWo<=&&;*V zv{{VB{jr0Ctui``8=IMjT8})%Ha#)NijW%0pjy{XgPq!q_bR_DJ^0qi!q$#PqPERL z`r!1BSgcpRHMEx5yhWRN3$r#_YNIjyUC6kdPE~;q#+(rS7S&_0Lyr8*X5`yEo4re~ zdySJJq$$$$@5-vnZ62Njt1Aw&VSR_$%5$e!^xB_V?C4Wn|8TTP&dN(Cl43yBY<|m@ zteImMo_!jkcF+yguJF z^N7vG``a-I5BQZ4aHl2+%r1?CAb_I%Hv2(Ys*TIa z%JJg$lJj7wF}C=$GaZA_jnf^8f;$o^or1@G@D#jpf7LeGu}AY*l(Ab5A~XlY8GEOU zoow?kmOHYN^^L|e-oMef)h568B8%b|x`;)egQ^l2Z2nO)dkS6_GaE!{hMP<{3DA^WUv?ng|wexUzLeKb{v z`uE*mwZhNgL5w)1z53g^Grwv5O9on|ywoyJuCe;1OBgdo(Uz#wIXtA0EZ#)jkeG7? zt8jiEMJiihxR=>)dY2n=KnxQ5kEBw6Vcc$cYazzKTP=Rjl)%`(qCiVhD;GZHp)Edc zqGkALQ(uVmTx~5(D%Nh!IRI-a*QQE`A*?igY4|y3*w!giZSx=QvxYz2VCm2O1^adr z0RcO09$v+NmxB7Rye~<`NbBa4PCCi0o2Bx!V8H?>X|J`m*4Ls1IdG9_1|7^!n>Nj@ zSGAd!hhMpkmvo948){2OJHV-R(W|e$>g?HQ%`QoOeG>yp>9ihKUf!I8%s|NYjgQ;4 zsW4r4q4OdqRYlRb8{^*32sr@T z0Sx>dF`)55Key_7zYiAO;l%-;T{LO{)j*-3>-6c<-Mt0`8C~;?Aonu+M}wzl1SzlG z#m!CkZrtbM+utYK>N)A_jdA2P_NRIGW9ayxo{Q4pE@lvQkZq1+BV2F2%T7?cCfs#0 zaDyedYJGc=vsWycYP&r)?{T~1ZyW9RkNm+Nf9x82@^3$~KR)~uT)NM*p+j&- z&*EFBjCti1NL|#h;L%20CFZQK+KX$yaUgYiVgoP6(vg!dwDJL?EQ!=jxReD`MWyu( zuXH;8TN8M13I!9nG7zqGVpYkecN+`CH{N~~1E*D}2+H=3Ha#plINeOISqW1|8#j@6 zu%Oi9y_}QW5DcBV+kRy`@BNLvj%a=SvQJv^_z5nmV+sTX>2G@wvq2IwBatk+{qY-Z z7>pxHZ3%}#@&`Q)FyF=;YJ6l~?TDB$v&M{z&Nb>)p?7WIerf z6q0)f9jiT9Y!+SmZ`O9#udHpwa%=nZeU^9eC($zDJGkp0=yk0Uor5+ z;?_2-fMI|&?EZr>I)-b`!=^}a&1ALl4NM9tGAj*pS1jmld|dC z0q(dFQM1U%pK+X}V9q8{DGhNV-*X@9NV*F=xu1Hx7p^eC``lbqjLyMJ4|K0OWO2}A zGNsD)i*npWD=b?2hV7`YwUJd)9U%|ZWw&8Z-$~3yFB3-W9LCU&!~ht@<2j|qR#E<3 zB&X)s@grZhN&OaKP`Jv{)$=(ShoLGiqLPY&+%0xQwr;T^yroI?%C%ii(Ylqy14Loz zd^She)zEz~wkRhBpFnvcxfDZ6j5HY}0HUo6Fckf!ZE0cLFx189Ym&fAveAgP)?4vN z7$j^~^4X+Ls2FF(QdtuH_$-40c;*FduMK(OH~-T%-iFE`8$I=1s^VxseJr_+&D;xr zwLUNvWi!U3S=lMyI2+^iQ-6Wkxy|*-y`vouM3<}j17#*qdkimq(JF8spM+7Mwrxn` zDUx4pTe)p%#Wq-Cy$#9#tCiypJYqX7X6pePCXD;13hY|t_R;{}Njbp$E^KJDlMcVw z7B2XMrGE4UtNi{=R(t{~EMiK#(1AEf)rk4?^z(PxG1D$%Ozs2iQD#S!jx@|6YUj+6 zNWcB^Iotf$L)LWTHF$_xXBpbYB~g8|DFkiDeYRwW52R7*Hd*M&2Q4!e?<-t65^t(%nt}nXQ zrptFBjeZ;8nf4NHc^*>C~H0KB(I0TEpVLZsdx9`%vffRWVGpJ*5-(92U$jX_K!YNf{saw%cxVW*zk2=OspwJZi}my{>{?LHSA&M2vu2Zn?$1 zlgF|9@4w&0{nMWwbPN`K@O5{Q_T$f<=hoe4s`P?E+6Y%)eYIoYNTXrq%$bhK_N6a< z$+?b~=Qep1JNDRPU3{g{Pe!-pkxk*e^FHF3A~HHH4_g0hA=jhYg%@53Bdo=#%Khap ze{o*YZ8G@yFXe_uS*E+qFF&ee_X0>SBLOee6IufPn)T*aZWc z>NJ+(p2})wol#PG4LmVnk#(b!hwRpDc3nsaA^m)tSeC$Uc1Xd3M2RAF@xJ zd$nD4{-^Aka}To%PQS#?`oMRc*B-aIglIBI9HiGQVbdgO0Wsp(yzMnHX?v(OZU~z| zv$5}jM8UdcmL58jO=8jp z=Ms!McajouiF2as7W&ghA;h9DgJh6r2I-nY#VL+hzC`k!bWxY2ogbw}Cbbyic2`d4 z$U-UyhY5=!Ivl&`N^8CXCeX++78`?I1uZUFP!8`?Vw>tpZ2t0Qo42^$)-@mOjEhHX zyKPwgpq)B8VYA0o+Xs#;v@v}bV{jZ=LF$4ng=GfPE{mRajGUlOT>;l)SAU^}NN+Z4+@?5z4K_fu35?9P)vGK8Gc$_2b?42hy^nRt2wGDg zi=TS7wP8!DbKH)i++C-nUHe<7k6jY-C|c2`0t4l(zrWMs*ay*OaL=J5Uok_aDmG&9 zNc;XhU$H~RAL=}1slRj^I+F5vZ{SrNa7|F36#X}(k<4ouVP!=-ZOWu0ZEXK7Hee)D zaLpJPhe3_99aY0PE-EC*Ho&C7!0{5)j<5~Yj&he{&L8T5kt^)c9BmQQWgU&>d=72{ z;PqF-d@>!u>)`9wEAlqXka3j7CRCCzS-dtcUtxs@O}1z;jAHPr!-LVo###}oPcBY( z1O$MR@W^Llv~x$w8eTwJ5?b)M3c<{6cz&Lh9DkA(R19#&k=rY!w2a;PY@Ygm_=DE` z@=FYl8XtY=gna*U&sXwjef~L%A9a%DmqWWSg9JLVhVBJ3 z?C^PZ#=*5#S+bOVEX6x9*F63hTM*3(Mq^(*PcTKo<&_x2-f375ve~cCvl_ft70*T* z3A{=|v%RiL2A(5G6RltWy45!Az_|C3FcXma(x$e%kZt@hwxtri2ieH~`neU&Ji|ht zKE^^XAmyX)TD*59%iO$(!ia8}w`rFPKIJ6H+VE)Dr`I+sJ*>C2Rj=<1V{Y2qdp7H0 zx-{SPeQWy3_bq{uWNqLhYHO7*0&5Qe-t;KCk-AeU4CiH!-fhugqc|Wz)fuV7PPp-D zJCZ83f1AB_`WU>qUnGy-+)v07GcinibAY(R$Pc<<+du38!1*+`l2FdNoyUF+IQk_8HymlKS|t<7~d993pHvDkGTLR_j5 zfx%LrV4RKiv0m8vD=UWic*begH1{DGuP{*6j_)K0|Ex7KtPjHX++dNT&PGj}c}P_2 z#=H`$!odnOYZFlyd--0=Y~KW6&^q1;OJYb9@vjX}iKN(TNQ5(of0f@&^C%-n0~`>n zfASgTlM$9bdUSx>Y`b+XEZd%Z(^y@~+_bH(Cd)AGu7DuEB!@I|Gz=YXYtr>WJzf4C zb=kFTI+wh+Pm=VJX3Adm>aT{Bm13V z?ufCWxPs@o=bmfNOE+Q`$%wL;S7)4YhLc{Bt9u2hRmt7Ff?yRKVvs1Vu7CU6-`ux% z3wJKF{rn>sL`#~NPC4Zi*9Iax;Y-a_i?AX1O5gyWabs zp5Kk2e0KNS+cHFFl7L#YXpv(^iYX>ZGu2%*DO|{)_S&^;O|&LkuL|SGk9QJOqDuwU zPxz6Pn+`jrR;TNMZ~y}bFwi{))L-7=Ox=CPf6uoP7t|?*f-2+(B|li|giCR{2EEfj zGC-|xQJE<5=G+(VCY-j9+@p85$c zEzaCC3p4*N#bP@%e2g`3+2*81oQE={Q5^S6y0n^vJKiZj#EdyLUH|NhmO!*TGGc_a zH8qn5gF1UL34zEfS7WlA4Mab@dd;;{#=c_X`YyEQwkABxB&;b^$cB9*uAPCcZ8LS) zjH}tCQ%PxJ;FY^z;a9GnrKX~53%_O<5-t4NsFSX#45!`ANT0m^v^Dn|#mPR>1*y2z zwP@ppn`lIz0?%s!9+XZDf}w+kTX|j?Czk^l=*dTTBL6f}LQ+X;LkwOn>|MQuKX8>~ zp^$$UUKs}Uw#BR8wh^d8=tRFe{06uN=hR6mZGyiTNt9E@o`OVKaXVg>wkv*Brrx(P z*Jk=7K}EaEeRq5NL9by9g{FX03_k~>ZzEkP&$V}ZI|gkQv|-SuUFo3{yegklmB^&2 z7QX0X7CHQA=UK?ZS_UI+>yGWtUHHyKKUBjqR^M7^Tbj!4mFk2I8iLDW7Sa%j^@*>r zA$c#OhKGHh##U?YTgk~LZA$t!%4u&~+On0pxF5I@zMSh}+P(=|Xu(*w;R3j|a*`#W z4}I&P2jWui7U&?6#|iJu%PlnbPsC}phUS#@jV{Mf?PlBFI?!z{5_o0-AWN`VQky&6 z3Rezy0j;a9uq-UxA5}5vG|7U+(MT)rUzv~1iK8q@de^?~c$SyHpzQ+uLK~6@89mn0 ztCmqR&9A&{;d9Ql493nA;Io}(x}gV83+?by zUojT@mth3H&v;bEM!Npj5$|1sH%q6&Z#oGx85ii)+xy$Aug|en8yY#y#GBd971q4u z0V^+BO+RSB;@2`O4k4ii!!NvHl{JRqv^8mA+IAfun!tC9#;5Y3mRR*BJi5!KP(JFVk+-ZaiP~e5jWhI_)VRT-P>kL-m@!e9q4G48piD6{hE-I$ z&0f$RyY@Gaw>A=0Tz;{o9=O?>Vb+VLL<4Q8K_ni0z+%&mfFBM`$wQjjGK(MGOXV#e z>7c|tcRNF{j&`!`t?$C&F7)8i(^eXHH0Jvs<+dTgk$U7_+*V`D$k9iZ)~Tz;Nx5m4 zG)@xFhxIM_wy|NTV+amHdU9y-5*rww5AoK}A6sz^p5dCYoh=z_Y{d(b$1mU9xUD+k z9j@?mCtBXrbL}UCi>+qEGH{=2ZwsGBb>33D)t-FzH+Ird;0hZ?tr+-sV?efzHP-Jk zK2Wz-q+42$T1iel(VBnslx61LXQ4m*z|9S7=K64r#FLTFT;Wih)*)gJZ#d0%Ljl(COX)Sl&YPG+-(YC$y zHcTndrFlbbpt$;RuQrp*bTJ194yd%$eNR~Y;6ss4!=skQBgJ<=UtZ8oE-iWNI$sbU zxOPVmqFZ^%nlNI5y}s-tY_u_4qy`JdjA;XG0O z{`bFkOdCo4XoLRIkABo`z<>N>?EA5Hsj8}S%o^FMQ4m8ys$xstUg9K$yp+BUW@Xse z2d#hgO;SS&x=N)>(m*3vgDR*llJpTXNRs=xab+_`-xbuBqAN)&DX4sXllccRmV6Ks zL5u^fsdD3ru9V07C20SlpgO9r>Cw0E-oU81J`ct3DhcDi>%IT^z0cm{-!+cXYA+*t z*xgU*0Sp|#Ko1yT{6KUe7=(I=^1gm8JyLO!6*QUX^g^B94?fZ*zW3gH-QX~6 z*f7T-*1#ic{4zAHL04R3orbJjxzhgl$3M2mm0s$*J%DJkQklByw2C7lE5In?bGVT` z`=>YA^&j~b_HTx{g|Hi_6^l55`_kZ^^#`*A|CI*|)#$(qODucaqHH>J3a>o*?1J#1 zjgRukesXD@x&w@;9l!at6<&QEqbKf5*+8jGK_-&WNu-{(HkaCv-aD}&bGY?hHJ8m9 z3*XpaPA2Ox5yIv(f4)r}E4xc6dunl;?M$J+@9N0HhlPu{jT}BJR|k49nUgc{yAx)e zMmAy_WP7WX3`fGJX_;+rt0b-#JE}%d8&?-z=&Hq5zrF+P#L2TcHNdV7u%@w#!Hr`C z36>P9SfM_Bog_d;HZV|WYx~Nz7W>}!Y(DOfu#97M;R*{ETyG0AzZ!c*Iz^;FjmTH8soF+%&uPNweXV z$GEqbF9o+v93YRe1*_^TUi~Tzt)W&Dud$NoYO7BUvHIfS){?<^_NtdGG5G{eD%Fkw zO$YVSGXMw?s-I{9yk*uR`PHl3Qn;-Svw?89aZMIPcJ!c%vOr58bd2R+KMU_b^ykVl z8<_vPZEqO{?9?buo`|g5@JhG&N~g(7NK<(pPr?J`${tW;0`^l-6B5%;c#wCN=(@M8 z-v`gKjo`$|Yvdrf6Mo50(m){?jN#d*TjIHAEj_l1mmO`RGJUZwEwJSFH-V+lDc>A; z^VH0 z={^7{NV|{lx}?IdGULB&d2MgTpzLbYwdhCkV3!^_-I~_Dfw!L`8xq-Mlg8mHok%Fm^3TsRkU1{71P!kW;*+B!B zSy8NxjU!$o>&Kw7rn-tA1RAGmFsAL8$bSsV$kj@3oShT1Pde4CdnhkZEsiZ6@vKW0UlCF zL%gx3$yV1qW!oADxPDw3Sp#F7F)6u@i;c~f$b#M3ecD9+r;a3 zd;n%QC&CC$Gd46|d7~Bl;rkYQ;!bNjj%MwTzI#=LS%^dDjU zGt2FyX>2wlBWx}vlrmcyEY-l~5%p4~l^UBv7|E4~qhD?%$&+00l0}Y~VX;H7i8m5^ zJd5A3?LYn>OH|=iONQJB4{?%(N|%9|EE_&)m`|-R=LW7@=VYxiNP049x^4^Ub+ikO zq;^tpZQfIV6P_Tvps$lc_4Em|plkCgJ9$m>n{5rAEo*9PZ0ZDHF3hv?vro5;NLfS% z4|RFC>XK)ew%PphD=;+*om5Z?xLwwiCA=5o;ZeriH*eo!73Ca`P&avf+pF-FGnI^4!0G#%V9|XTW7GfXBn%ubAV%pOx zp5{Bx^zi9~8~@Iy(YF-++`rfJ`z@%hl4Q}Irn0iK-CmOzE>hoEu4{#UJGy_cf|xv2RaGVxIZ1)(0R0dQvTI)^JcypOZ}SX4*_ra;si&TD z45B%6=9r|#6i+zX-}?G|4_psm;9n90jJdE&-+u$+?vU*VHgSGs=v%)F{IK(1ln}on;?O%CDRR!-TF;2bp zPC<)>C^jteDwqW3VO)(5AzTXkDPQwlj0II*9EMR0F<-b7QH!xoD2S25%?- zq0||-;Lbydi|Xo}i-%S=E4?uac+|l&U`(-5s8W7D_Sqj<1{$ZvN%X zmiN`KS<#e3Y|Lux8T1~2x><=kG1S5=&cu?7U*+ZT;PQnDA)Ly1XRu_WJ-WlMOQ#gr z83Ly=5^WpTvrQ&(9xwvC)oipFV&ZbQ9;3}DNeNugI?}mW2KHE#g*gjOzjkq`?13JX zI2T^6rvrN^Osr&(VSyh9UY*R9^(o^tp095@!BN-$yM!MGAGK>90cEmlsh zoMa~Zv*}M*F|Mme_kF>_pB!mJ$D-e#e%)SLd$6;?QdAIuR-oM&3-~O++JMPULosc> zV+}^E4`qRl$Egr*m_^vCPbYd1fkG#l0c=c9{+dNzd)kIfIo!4)CDxk8D^wghrTePKXl>3Lu1 zL6Q`u*czHV9*Hp8*4bmq=A-WI#~s1Fzwjz;CpshFsB3Q)Vr&}2c)Lo%c;ETl^VW7) zmGz5Borb+0v_3fXj5Wc0=u^^!0rNbo&%*|hWNk2r8pcDM;uW#6C9>tA?iPvUTfWqo z7_Y?KE5MFWQ6V(NVo>&QrXO5M&k5U8FJLQz&2B+HG)wo2fd|o17{*lVqBRzqG|}>5 z4C|fxTb4Xk6}NBOZGWSDjjhEqW?KCtkD9GqX0ef@t@ZKytnf>?;THWU4k}8!;FrED z7u)gKCt3Qw+bufnFc_404FZ4=E(rto*}$8kPHe0KRYpf{mRG2$Ih!x#OQpB6HSk1b-@gc^1kp~`jB+8vFA&ps0NP23t$&c-{{@`!&fJPgKN4C{#7ujEz^uZ(; zcJ#n+US5+G(2tW-kHxOfX&4C(+d&hKvEQ$F&Xz5Io=wDwPMSw_pz))%rPfxg`m=rL z^y`5M^e}ixD_&y@OO`s1I)3+q z7RJDQ;qfQpT%eh>0nG*}$(IgQ`08IRidu6TiA|X*E+HSCZ{_#Ko72Gl7OmZ4`9tu^ z)7r5SRC-6h8XsU5Mv&~VWp7yCS$KM4Gn>X{PziQ9N{>6jmi}dqrGEGY%i#Gif^=X; zr}k@B+4`EbY(yES*aMZ|6|L^$xDrR2!R4zlp737uH_=xwRFtQTnqq%=;x3ysY!YL6 zKX8tL{V50A+OPi)_&7xi1|c2@WM>0&6---Kvw%K#9nZ4NOd{2%ad>dZh1ToFORePe z@wUEb8kA<7e5xntN^fhgcsZhjFlhgi)rKTUW)A z+{qn(m9~96(-;ok+Ma&gVqg4%MVKd>uDIMXH~*CSOtDxUb{Z+3qFe)~kx)(DeyjC) z`~ll3=L?KWG9d3md%i*R_VGdO7=_Nu@tU}0dmY}O7^jfZQ+x$ogkP;`@=@*Fgl(aE z`v1@hF(sjIfQZKMO2)WY!g^AYMLw;|pv#}#ee+QjM_!y{^jT^*QrVIn7Hz7fo+CA_ zer5gK#$PsD#JurRKiZT_(tgaCF^*Z}$3ZbLWU|2rt$oG#kwm;02{JM*$sAk%sslj)*{IS1r`lh%Bia)EYA+}FWH(l{r|W@m z00Rdw&60KeYxnM@`LvR8WvGCoN?&mRfB~U)#Qpg&GSUXFDc^aaLA!$(>1DSdYY` z%3JK|ILX0v>zL9ftyg-4?FbDcbsuXJI2j}`!Z0`300E8*4ki{(AzZ;G)~>aIM%|FKDVqf8_fl|n`RU^3;(;%+*U*dlYN8V^TpU*CVgN*jjbP!9w2?}J1{(f!kEQzz zv;3o`TNLD0Vc$V;I4>zk9w=g0{3@w?ALOD4ZWSokuAtFD=F04X-yj)ZTzuKB;lxW` zv;-%(&&YcixQLYL6g61HDL)?^%KcpPd{YM$A@ia4CV%#6d4S4l2uC=S@_tKNtLCi?(m>RxfVg32C-6QqXFJ2JNfd9 z7N2ztRSq`WWJ)%>!!P;3z>BiTjDF~&)`}{Zqy>c1+;(fH6+XB&$cYfN31yI`E1juM ztdOnkDcqBv^HC8co8Lg(nF=aN_K&~nP0#SEEG>Zi0xKvxn>I+sL-6e3^jBY@AWir1 zc1oMgN8qSMGr~DzQbe1UZEG!>XtbR$cjvva9)?bV?Wh@Od4sSdlzPdAuwTtD>Suil zk<-OP1+7+n9aN3`U zmt$`#Xb+Dsmk+Qc-+0C1hfE9Xb7{kw(=HzT0LeW0#JTu&=nmk?zw`=gyYKgw8aL4* z(@(T0F2F?_?QPl>zp4u-_puR3*c39hA$b>{G#L>GB$W6jsf{pdc8FVAx^9Q1HrKfE zD+F`8tqf^27!wHiu)aGreqG~R5AAq;gF#eCOKmjUcW+`Pv|!pm_DEU(3SSP`@U=g22O$* zkCY!{zD{wUcaqs_DwCh<54u2A!o9A(u*hwVU~Bq zL~B{G($a&*GM|X1a)Q9%QFfma%a&MV;xsn?eF7;!0ZsdaOK=%IYqmuWon|fbo@Lya zXHjg-B(vd5002M$Nkl|{_0y8rKylKYKpwBU8x}23cKh@s{SEl|b zMsVHd{^s(?*ofhy?B<8B$EMpEZsQ{*#mbh;xRD*&H<^P1a`&lDwlv zqb`LFLQUw|pk~l|sDiX}-&|sc(8si9l1j}6)XokWGdA01Bv9LB+byUgiCr}uP>K*# zSM`G~3I-3hmI)Uk75j)ynNe>AQPd0@dfSri6Ud4&p4ei3!cw#F<9Aqi!Cx#~R>fRd zZ?*k;S!=8m*Xo0rKcTa$?nkY<($Pi;rm;dU3@X^s7w=^gFMa&!R#^QZ8_@S04xCCY zR{bUn+wvfe>cRg`L9f(StR0dtI?@a0S;1L9#GwTeH8=mP`lPJ*8+ba?i=-~G<5nOCh^Dy`+o8M4B*ug4@K4p&^wo8JX5$t8Bjf;SYbXV~#n- zr1B%F59KQf{>sWqr;a8jfK#P;OoA>_;X|0{wB^z=j}BKe`4Th4@v4cku;BREoP8Btj(D-$4LP_3#U3J zW~P{Gq9X<2MK~$p@b}$3+;^ED_;UaQ{|Xpjh|rGcpQ z?8NE!%pk>8&?$f>1PunBX{2vrDrvCLcOO>+r8hX{2hyI9q%=Ae@oBq@r#v*cDUN)Ds)*@<5{-j>|4$_ABex91nGX206ksW1d;6KIf*|6est(u5PKV51OY{1z>ImQX~O}_j*BkysR?9<;`cVf?m?>=9_ zueqa*lVt^!3CO%;!9jUCIZSgZn!s&ysFaiV+GaeOjAHRAZ#$f{VkICR-(h7D7;lAr zkQV91X0O#2Z5(Xt8;4_LQe{b>pHo;ice3eGfJdI##Rs8o(g%0dEe;1#4RGbEXh7+T zhmJKC%OVdii>gEd%)sDFy|%!TGiO`t3(s40(X%%An?Im@+8~UmJ@z3~U$wDR&bq^| z>fW9&_w9Jd_7|42))l{9;cX@Vv>0?!E8$-5i{)8Nr?p8fgpr;S?tMCyDf&g9GwCGCSslx#`3CeI>S#LByG#OW&9(N6bIp*1tR- zyAGw6#3Nd=Np_+**$l}zI(AFgpSyga2Vc(&c!`zb3V6nGw)}CVs7^fu0OXwtW&p^^ zAeEEhl(H4ONU|p*do8=-f%XHpX?cv|#9208LM)~;OL4D!(S_E=>6_YKF!*wN#IGWR zkb1(V!p>iR&usExmWo1So%*B4Z%2RIbG~e}+4#3|Vi%WW)#wqnv#~kor&-+ZA3bDS z&-V)u+(EwqzB}k)AK(p=_RudxWAqA`j4_?k!N6!)&&Cu z1A2!=Q`I(lU~d~*c`Uem*y`8QCtHVLvm=f{b6mog!y`h5>NeJ0oVGAJ4LN*(>}) zbFGbVn}$|mq!yL0pWkfpU;Wxia3S#E28vzs<+bZ?kZp=_F+B4mYkT}53&BVVF%~Cb z-fw#y)yw7BP{KAssHuT56lpVgVB%n+m5sc{4cJf`6fE=HGZy>Kk6^emK2X0lKD%*y zKgI`UBZrGswS8^l{N?1?o9UsSmDyHoJ5}4L;yA9u%WOy){fB?^*NwNDy1q7Ye1%OI zdydVScblC$`*YMgYFjoeu|;d2wX;wB88*eR|Ks|xwyL5AnuoeJW0R<8OR|9ZKsgY__6S5ON==l zW@9nlC*QEbNVP4i!`mhKNApm<X@9e5tM+w^ZLPLsmJC>17jHNRZ@UgPUdJyLphsv z?f=jim*`_vdXGnR#Ttm;6d{g{Xqu^jQJYlyPGdm9l_R&^ioqj_I-wrwAvTXvIUR- z&Qb%%SY0csoGIBF(^{(YI!b9Bera6|)yA*WIo&Vg+efZ>?IBMvByF z&N=67*2)9ip{wk#NE%-*yv1-)5aU4-8e-ard7+^1lH^#ia)n)S#TAZeB#E5r>T360 z454`#k=6$P;~&RS3X&iS@)RW-F_H@LjG9wVJ=Nr4N^!-260=Emhh$({IMV^I*6Okw zqkJU+q#(EigCs>flR)r^@u|4Vck*PI@&sRZ_plFtw3hb2-6d0*dlO`@NgmV0020GS zj4tg>ghTBYB*`NcG8x8Jkf{sdTIy3$jZ+Xa<@?|NzEg*i1lIToW945{NUbg^mVs1q~2-FEP_x_k()p^-q0yECsZq&^lf29(AJ-3Gs4aqS+|WO~me5N0!(#|EQ`QvkVC z4Uz_N9aD)H%FpS^vnffzj7a|Z|15sZ^*!e6$__FL(mHTdp!*->#iB7Zh>0Aj7v^K9 zDj`Xb1fHi_Lqjo0jM#i~H3ly;Hl*?xPW3qX+gNKwVK(t;dGSHbEL?Bp>7}S$Y_f*3 z52I>u}jYZ#TDI&4F1`hB&9CL(%|3QTLJ0d>Jf8&vp;4G%Tj=n)es zD{ardxz)C2#@LP*p0e=7S(fBPzbLT|J1^UA1FE6zCF~_-g9``|ByQ7Eh@+CfFP4lCV*uc|I z3nW3b?v*boU1ATb;PatdcpW`tBV{A|wC@Psy`VFxb45}0Dm-c$+K`)&QWy;_ zv1w+Lo~&7K5lPcPbFHa-Hff`6C5ybeCaIuCZFsMRmLGi!>5c)mvtWc}MozNA=I5=! z##>phjksf8Z;iMNU-9d?7Db{j{;6*|hDqx2zaX)5x7A&Fxh1QRJP>1_GLmbm%_@*8 z;m|qroOzWMMjOW>?vFgwq52IWJj!9dimiFy|Wn~2(-Fh*cZWX}J%g;6baWx~kKEpzYa z!Bsy<=MaI)FOq!qHiRe5hZ)q#hGO?8ZQGg~Y-rJ2Hfi)Jsx_z6*jP(Xwp42c8^2@i z!3A?|3F=~_Moh8Cp8r2PNhU9vWZuQ{N6Yui6N!pZnmRc@ex9 z93nD)%}o|P%N~EqTpvnNPM@@4|()rFk?3qxT-> z@PfmN$iP7eTya35@pix<`YP=&K1de64C6vdYCfDQ=MSrFX9NYHDU!0IAJWF|9rtq2 zF8gXJ7+YdYx$%XMjb~iXK6caJgeOV&9Czp}D@Em2 zw*B0A0f!(mae}3O{UeLaJkilg;?;%dWEEO?D5@eHglPP9F#3GCY7Q*HK9?8`^^Nt; zmX@xvrBvFB`KoKbanO2Lbrpr|3a{`cMoI+c)w(5hs0Y7@1{icz{2D5d>#Pmq=CPY@ zvBZQ?)^rwX=8_h2(rz#y-N6%#KgL|y45L|rJ&+~})@~j1g|CXkB{Y`A&3!S4PrZ-E z<@xV6SpFxF?qbf9w5j5B2e01gpeC_wF_Kl#!(~$`7kp_9VI5J_r_=^~?iyQq`+e5( zt*b5ix&N@lBY(Eo2QPwI$hra?xxBl7@E2PhvjkotPk9;|dzuA}{r7#nYRxZZi(paSJq5+nfwitZ1$|Q-ev8V!+u9 z%6;+vzxSP9(mXOS_O-8l&2juS7;5qoBS(xP4S3>yOBY#UmpWn4>48oZp5tUflirFI zE8L*2$wdRB#90+rM)Hn9uU5gAw>!+J+&u*`fHWvccU55=HV70np%mm{+b6#S-Tx?? zaZVhv^NR*EXIml<_mZd+v?Ae0*qH?{x;uYOtKjnlOQOIc#P9^@{VIO zC@K{J7)Q-dzi828Pq+Axp_Ye4h+y9(U&;+^@L(5*6X;-(;<5!FoJz47$zzcz!g+eTRZ&Y zHh*)Gv%e9?=7@urlT6`WVUKudhZopbn1u)7ew+nu@++UW{BK{6D%~))CbAcTsv33P z_k6p-18{Z1Z+Gx=GKHoGwra4u06cNpD$T|&Hfprx6|wO{96yFl6%UW<>hKFLh5uNL z@9#3aQtvA$2-`sH6*M7@PykFDHg4f0b~_8Q5!Rd#y|9tXAvEE?ogRQ!Dpt{tf6SV{ zafw9^o{U-^(j1Y#R?}K;g9}#R-kG{Vsa1XET6yDY+py*y8~EW-mMWQRqsmh@6nii) zE?RDHY(0d%N-tv42RQN5rj%AfI-%YM=Dm%5nZvF80v0>3zvgU*2tRGL+nu+qIMNfc zrA60(es!MO5!&Genen2yrI6+@JnhKFL+p^l=myw`ic!+O;Fr9jlovmKw$;2s1xwMZC$lRE1`Yrn2&K-sgSPTSz*;X z*!ZEoB>PzX^INR6u+~OL=UU0kotzGS$hJ4VhUD5#Tl?o#*7VTxR&@T^cyF4<1}lp$%oX0= zK7Z;Y3{NkzDHBl1*;;P#0rX=T`;8UTR+3af{WQEDJ1u2M()6-Iq*sfv8B~~$iXiq* zI_5X_+wjwh84G1IsF|PO31C9H2c~t|d7relTfdB?$K$Bxof&*zhP{Zf$73I+!Uo2k zwDpDo-cSj7i*Xaoe^S9qFvo_sA~`m^$}y5$V(O{<28V-Jb29T@8%Cf*8t2&1w>^5F<(+wf zv#r+B*1(*+>o}E}5N@8!~N%LR}-~L;Rd-`|hVzD^#tf5tj^*xzqgk6ZBxv>*4+f-|_+UC?JceG4M= zNRRrwHz7Aq#m{}tz3=*MZ}Q&nI8;|<2dnA*&gJi)P?M8_B!Z+OCaEAbtfYR#`Ir44 z=?}{*g2W3YF{D9T6O!x)X%H3H{U<;E2_m;G?leM!&)H|6ZFk*umpgG#+^HDSQ}E@v zhyD2D8(7!e;GW$?A+i4k2oq8L45v|@LN<*qO0R3DxrGUt6G5FAr&lcxPB-DK`?%TE zJaWg$m%L;o|8$!b{rAru6Ut@SZN5QK!S_x8bFg&`SiQ`|hgBAJ)6J zvUZ@Y+|DVgVK^1L6L6qVB}>^3>f9UkxHOVPGTO<3-;8(tFgzXU_1OV=!Qbg--%dl8irSxgt< zW?D>{T|-c^{z7vwHY4Q&Epq;K)^gA9&91qc=2yEWk@y*6FTSyoGSapqe7H5e{e~5f zgGt$^5=Iyca~8Q+Ik2+46{w@&kuE&i8j}NH0MK(Ly7f1Zn|y0 z>Z`cuKElHC4#$EgG6v}nwI_=r7Xq+40Uf~0EASLX@~`zL|8AiX2P4*x>vrKCTUkM9 zkEzHVue#zF`c83D-FsA(C5OUnoyX_Z5=#u3=!@HOHGAg+7AlwhHg4L^oI*9|LwnDN( z5;g8#;{`BjQxw9^hwviQBn*2s7z^KygjDaotF3fEh1I^X+*V!pGb_ec)6gG$&9;R( zZG|!Jq-4N@Y=(uaM%nPMec86W@`i1@;|@z8#g(pJX7S@@J9siMAzXo7@gO{QdYAi< zz1Ky+`H*uTyyb7sXBRE^m8!}d6+dW-8;_j2Q7g(2g*sQV-iG!s zu}PH`HmvdxJE>uc_yKO&f3KA}(EyFk!dgk|*oc(WBQTP^fc+z&F zni|7sl$XR(r7|q^iY835*0)}_$Yj(^b8r`;+$1Vs4bMMk1!rIEm@9&(JqVEYko%Cm z*JV%m%}u7fc=oS?tAEOV^q0NNx1BzePJ#ZVF)@1B(Wo$C!%v~O#Nwl|AB1G8BLo%M zg&ria6~~zIh(W_`^Hw}?(wFM6Uscg}Fl!QyP>}2j!oI>wzlL@-|0e$YWwVn`MeTEd zC16z5{ODI!_<^rjdd4wUka@+%3_F@4(s(qRZ*M1#22TT6As}_ZXds4%n3Zr#`KezB z8vP02@lZ+KHvxlA49kYhHrtj*Upw=7Yq|SQE4t$ItS?v>i3`~UzfMvX2376+mtaOl ztpwGYgzt|k$^~^``Xka{@yQ2U=oi0q^yHY)eh%-FuTR+yr3W8*hK_3-s@EH{$+2 zH+`;TMt9$RzPV|7DnpVZKI|zkpKosb?#l4r_vh+i*q^jYg={Ah0?sV9xcD*LC{9F;+6?QP^)?12X!aLhc}W0Ex2x^?TEDxcKLw7>BN!o^7P z>UbW8{jI~hm98rs9=BcJ=i+U5aTL#gf45-Vn|yW$@1D}*=0EyQb3KI)qaKF^-&*R>sddx#Gq z=B|HMdVin$ZBP04RPH{#XDZS12uCpQ?WD3#KWMz+EE<`3lJ-V$duC!q^_j zaH2}Hxc7VYM^RaDManRa2%{x~XnlxHzT0fI=i}QKn+<<{0Q(vjTcjVhT$)vuXOQew zX`Lg1GkIr9Bl$xm06V+c>KrTB?1eeqR(z?80FFGtq~fKv^p$m1eZw(kXW$KCK%gSQ zs;x^7`~Ii}Ui9pXEbr)Jg9TtaF7`dIca%bP=7dx#3u$Ojo7YtJa@3w?XcT!zS?_;h z7T4gX2wO(=7%OqLhMz1|0fx0p&Mo`JjY{1y<2M@Eb z#LLB)*q=Z;ZRCq*pKLpBxy$kNoHuUdc+K0ZsPv!mn zB0F?Ymk11MbvqeFmSjc>gYL426M-4jRmH*2L8`q}i)b|$ch&X*R&)I&*3?jC1)u$j zm5zsI@?a9w;0X_P&s^M#ktQ{hd<--ff4R!q7S2bCrw@jK`+{3Gl5TwZ`{AK;Nvc`4 zU$LRfV4H=G!mI4~E7&?UeeMJIxsRPQeovmn&{G>k#Jnd+%}=U2Iy-7fl_1SjV9VC8 z#Vz)qtRaDfA&lFY<{_9!dEp(_J8vgys7MbLt+27Z9z&uI?~=*>cz{Fg1SZpvK5NJo z8x}hzp{gcz4^=QIlhU|VVK6tiX0TNjLNX%!KMz>=u5VcCw5t%J>TUhUGS`QyF%~Te z+s=n5N+-tcfbk=3)3Xm_pQ#x;Q=B$Km!h>W3%Q2nZzBPPl*-_WKqA8tE?NCE2UNS{ zWwGrMB;=lb%<`|i&Z$f~CdlsU1y0KP_OlmXf8HICZP~HK2KK9<-DwNhg8M~)YC_o> zBH!>-7*tCayKEXRz1YgG|E5*Uo@L9|HQLtbID2#1l7Iq2DH~V%S1U>l$2;60+a4+d zbV-__-i=KwXHTlzdZ0Q5ZN^{%MH8=BZE^(k%KUWfENkWftm!wuu-HYPWK7|ZNDP;p z;5_&>)LY9R@34|jUhT$Z)8WxB^dK6gP8=XckgC@Fonce4YrLGycXKPLCV4R&F=((o z_x5@_Sj?uJptWo>>$y!^*4T`ruubNg`uAPI z+}(Gd#>es3uJ3)GJ$)CWtZSN{;`+S)QCAOVuDvE1JJvzA_9mCHSMeU$6j$|7@Jz8& z@E)kWjrK#bFC?2lk_eI(gp4n5s@dciNcw*D)mPixxpUoj9e%%4yGidR&V2i5BP_Kz zc|`LPYO1#+pZuY}%JsMqgG`70eskUxCaKUVXs`G82)-UFE2(jW5Je-y!>emg!KdAd zX3MXCeJl2@-eP^;Y-gW!nq6@IM_?Xkj~KMS&qq>Xy4UaaJMOYkBdbuYoMGSmkL&G{ zi!Wd=j6GM<`1n1Q{jdJs<6!aIOYFPf`=Px&|8+Eg7TTvid8y5wJ!=Lr=D_>`=;l+@ydDs0}okKW0PHU(MRmu4}Z}0L!YQ1%Q`;`7Ppbr=B$U{+s36~Qqr~M$ww{mqaRt@cW$u!epLZONuuTNGzcG@ z9_7zG!7bEeR|cwhr@6kP^s)t#TCoJf$7}+3Y{&Zu6BBU$BZ8Pl6vYETS{dz>5wH5+<9yLH%xWeV=>+N22X0p0Y3k znc9Q_@KIx73T=k)*tDyU?}qk+ULk84h{9u2s(#=nEH)HxNRmR74G~F`KobsExm`$Y zL%uS~E=F7a(KBe5!`&FLFT?5I1&P|#=EDAWDRh4d34rVXmA*v3jbOZXW7A-|7Se$* zjMPV4b+AChZAj@f;#q0?%X5(;D#Z}^XzP<|vEs~n>zChby&~&u+CirQ4E9~-&$H_E z6q*t#GSare9K) zGKuSh(2K-u{(ydX*etLFo_C^SkdR?RExJ+shWU5}oQ5qj7V50H1Df*b{~52~O7+v& z7#_)(v~8=&i(L|?Jtq=9)<`&(-J$+{%MsjbX43_Orfv%!BPTJ$YaGwPYmd3~^nr1X z{9_!-wBGnFq_S}-{$Jm=f+LP}HkXjkLiQ)m-rh3EWf0=f2<1B~PBvP<_yQ{^4q3m_ zVk__0*XA#;w>1r;$&anRGa{5*reI7WDYn2`aBJV1M!ik8qZsQ8F!!f0oPB>N2IJCbVnQVk#8Sh@b zW}%@aYFK2wA(2Nn0GH|O{TW$X*2E_5;E|tjgAj;o}vR* zopSp;bh0k94PDpWo=Kxky*Brf=FbgMZ4%Q$o_&2@xp4)bfA6otq0)&V;NcQmS@|n? z+n-9?HLlMi7lwb-y_h@RUXz$X!hwRc9d;MwIZHux5mQL6)^o!^Z1m};AclzS2EE^c zZwJ{wy8ZUs9n(kN(56nE0=%a?&uFrNq`lp!QKOt>l;}>9PBOSH8j&$=9sK*e)YdX1 zB25v|v>0EKuzD|pFT0NU=7nGXuWfkgMOWP5!;i2dF2BM`X;&YoJ2*Uz{^x&v$40}{ z`R;fA(>W*7a}Bup@^xQu={=n*kKFqW8#dC`cqt~#o%fQRciuVfes^WM2>;@LeEm0V zsAYjF^*8IsyAsGqJDrlw%0p{PSPgYp=a-Kls6SY$whGW}JATJ^tYT zv!jnX((e7^efG1PZ?WI}`X)C{UjC`iyRqfWGdlMtm8CY3V}~F8_$GVe@dvE_8`nAv zuR+~&!h~_y>v{~^Uk78F=282?wO_Nle}5a!8=CF%fBUR`;hL*##`L3uZ(sbX-SvOJ zabxRy*+ha_)0lSV`u|TEd?O2ZKT&uIAXmZnX{|hLT34jR3}T5bx4OameQ69PM{O*b zh_z8p!zFjeXKGMot}7}Ssm+_L?VDe>{GZ-zVJ1zfCb;kWiyy5+7;Gajp3*TUZtnNE zGy#?f;@B+R-&@cCpH(+T~ zR>%fTDprokQ$SjW)}C>tc|c>6W6=3=U=KyLfBt8|uLt-a1ux}_Cl`gu;ON;&a|N5# z7+&`hsXSZXM89zTAcHIWV#~)S)Fw7)32fu7Tfc;FFbN`!R$2U_6=4gdJceDT!V;?} z-D&;%gze3>WwxPlB;y5}dgb*0**gmWyNaui&w7LqBMC9skOTr0x8UyXMT-<^(PAyo z(w4TgUny27looAqDDGCA;;s<_!3iV*BJ1Dzo%_zq-Ix2`TY08?h;}~5 z7@}9N-eTXbclh}8>7t2KDgp@U+eJtewPFB~)Sl&`OdlcbcZIBO){b8_RLBAi;}i_4 z%L;^$WZI4fS|nWHUDwJff^}sh#dgq88Bl*5R_HG_=7uj5zMk=5m@!ujW;ZP*J%+s) z=|4m`R4bG7QVC!3F3i0-`Ta0% z^m3{ZP{X#;v?I=fc+q_u-cO32e#26x%*i-gir8MnXoSCTUvW=>lM0%poLvmj)Z5S9swgK)lpyWzWeTQ z_~D1Eu){u&3WO~Ej2T~tM;?79{NZ=M z7U5kaEWP+|=ZAMiqoqL>ILf5sojUb{aLu(hh;jKjVe2h7Q-KEW9buVij13yNc)BiV zTNr0{5xX~R-+S-e{f5EEL>y^X=iU=l@AgQbZFugbU^VS@sgR+CAZPvPh9L9ezlRiDU7z#m!9H z)@N%lx!Qe0Ju6Xi^sxMBIn19t7%J&i;_C;UdRII~0mP9svZ_!fdx;ySPKq>aQiCfd zQ_@9<=ElE5#nH!viZP--t!0h|Uz(TFPLXRym$c-&a2UL>-K#_lGNLKbC|f|_A)UM# zzo|0Gz_jlD_rjOQh`?aUrNh8ePE!@~MhthR@`+eU<(sBPXhgYH{6=g?{F7XMq&Hdw z+kLC(rV9zZh(<)m0-Dn;k^0DLEvJ<4G>>GWddI4!VR%*(z6*W2`5?C8rU6suN6UL{empW<)DZ zmvF&c?Zr%)66XHylu)tvQK4eQNd0D66(*$;Q65Ms4l=1X~U0q3Ul6JaGG^&`OYLa~KEk(CcCXTev(vzlMb;NNxWB5!l zvEaSIm-%W0jiWw^{HEe)npA{Dy5fnyMIoEizZ472!{XrGXF6LK9x^S1`Bf=MfuWTq2Ex>ZoAmYAE1i(!6D@0pkZo|Ov(ue)!x43L4T`tV1 z86&4pR!c9{OSXkh4NEOi7sicQGmIbfYFKvh`@+!D`@@j3hr=>`9}24teJ*T%=t*Jp z*a>1_xKssF5&p^qf7F>D-&Dou>d+usv8v4>{UVwn^Tcp!-xXF2y@rZFNxo&}U+_#N z<^}1mtMQG$^QcU@>jU2i<*b~ryckfQp!Zq^2hypUVmDT zJXcK*jgv-GlSIiP0xhb)B#`#E&%sB8DzV|j31Ja0Rw832MOm5-G=^9(nAbEkyz@y} z_}|NqhZ*1X3CqX<1VhT66=Bua5-K)yWD%jJu}@g6{Hrjy*SlheaA`@$!W1;+2OemF z$~#_c*WE+o@NwbWi_Vdg)xOt0MK#)aq>0S zT%*FC6HYimPrYK2jerQl#@OaWV8mpc@iRxBvqcGi?A5&b>Z{GTy6v{x)TlAxwCfl@ zCLRKuV~#mSwqG0=Zn@zaxs0^M;%xrGd;~+%2-NIdGs#CQi!vazjSG8-!}}o|M;PynxVSit z__O(Iq;~v)j?rxgnRHT4b*65;_10Ue>BUw#FhMZHJEKiPNJzayaLK_xIJBb>sG=ce zJaO6@LQB%39mdt_O*+E@-dMiRUG{es1odBg)leqdCuJjs1?~|J5r(t4@$AiS;J^W4 z!}Zq;zdiG;Flo|c6;cctvV?5?T3-c0)8$*)WA8&mAhtr-YmZ$;`{ZKTx^$N&%Y7=e(68u8~H}-%km=JSwZZ?HOL}yxh)c>uma0B-h5Xz z&k(f59YXtOUwlu#KUujJM_hh8{|}y zdii)7A>{S>>@_js@nuFrc%1TZTgpe&w{O204wbpmbZpuau)+G-aCPG_fYp2&$j{ zksf;wZs0??6Y=d}eyL*>BAgo3cTm`9+{Dng&tlr?Hi!Y|?DZ@QzG63__kez(|8XaU zDSx>rl%4qpU6F4T!B^u4?}f5$b`gV|^R-?l*WZXPdvbZ-2!Uv51sTCc{>q6>^))i| zmlNSi#h7#$A;(|KV7Z|-s$(tXw?s6dsQ1)4DSkWZgUnXowYO|N+jP57^S`G;$zJ=* zQRdYBMi~%G{gph>_KWH-_AKNR5DmSW?`3c;gV4F>TokH)e^#iF$x*%F$0xw|l=XY- z;QCO|??MXQApF)#n-oL?u1U&WD+06nPp60SF=O=`PhQx5F}Fg zc1e5IMtIDPV4X+!$Vtq)&(@@Dwv+j;V>$<|x>W`rfJQw#MM(uUCPl(I!awwBhR4J0Qv zvG`CUlgdH6Zlm8N-(MugP1Uq+h%et8^?`8(rD1!NG{7&r{9VF zG1)-YtGqT0E1eMrmwh08>d5f*yb+;_lPCMW7iQIn(P>#wtCYp5On#;IN!|^idhgxB zC%4OS?SJ}R==+ObiPn^85klq(6}{l$5hG`{Oz)ubiGbeBclV%6l2nFB`w~A~7!e}x)AS7Tr z8xFqlW98kByhq~+jU)P840Cs-<6VMHOSH0xd(c4#sYVrPu$S}aKmS>U9=rntYiQ9R zG{J`IzWeU0lTpi~kma=Z2~Fr{bHqa!!!?_;FzP^s2&Er*;C?;ihb?Vr3L(frsK>4k z-tnG$?y2t;4K(T<2MHkv;`_ickHXM4jyiJfwb$x4F)+eee)>?rKiCNRM7D;BRR}q( z=QGucggp1646b3s!G=(h14o1oXZ_(f;f5P;7JD-%s(@nOAMP#(9POk+gM03|Km7E_ z1H*2+M%w}Z@cUnd6HoqS*nPKM6uaziA}Pm3!;kk3wj)Li505->Q@H$!tHa&*JQAjT zI6WMC@Bz9-tgr0e*kSuE!|A{LO*r$nzYJe}^;J0awBO6t!{K`R@E*JG91c0`xN!Y7 zmxdbYEB^SWzl2p+l(~pa)&)wdS7-m_{BZFFzZJpxk|Laz18%vJL+u!L-F=^M+kdVP4?X;-wsjrx{c5J^Ka9yzr-^aXU7P{K z$A8VW*M!qfJxx20i!QoI8xSn(^HO+8SmI~Zg3jSDfBB0ZrO1n!Hf@@!6tcQOoRd#J zIlZDm-1E*mPggYP#Gqr+__knV{E`-_J+!O>m6Xg6^X7gn``aVwKOG$Hnbj{Aw(1$w zO6N;M$Ap1=}>Sz0Pm&hOpk*mhmEIT!z|fF4uhf zT=_3CzBojVd7USdMH$p+X`-@7%urv>WI8qY6uSWAi)#@Mx%d@K>r{Xx_!WpQe6@t% zI>DqtUKS#Ox>sKarPxnlpe^`h#kT|btp^9GOHCE!(n&8C#>;j9nLP+TV!t6*J?^qcCE;T01f9kPNvGoq2P6lA1TI_U)aJEhcfm!SCLUd`EKv(#rKEN*m6X{J$ zHr`Uskr!HoiC?Sul{Wxcetcu?s}Dk>Mpgkr0tp`t+qH}xNfRffJBmRoj{@aZSL!-tb9 zL*L#~A6P(;c6XtEUfy$U&Ad>x**0O$yv8v1(u<;T(w;|!ro{(nT|lETvz<)FR|+8x z-ZJ@JXndBdJu743uPh87v}E}5>(BN3()uW4srNsa6gCh8z*Vw%I9s+@mzGA~UoFC} zGCA73LhLR|{l%70uJJo#VQll*L?z<9`Cki*PsU$)jN1vb@pv>= zu2%sPw8)qEOn9C2}I+K7y?T`oSpZx12U%0du^P>h9c)5<#VzynqI zfdC8bCp2crm#upwboiQ zt)YRY`*r`V~>TWpMF|x1+BDFWWbm2 znQyeyT`RI&Vu``w=%bDdha7yM2t}uaKmOl2;WM#!bIQp-Q>~M?#RxIRkLOGOMuR$H z_zxRRR`bD_p!n4#+^v{kzHe7Y} zzt!mT+H0*6es0QV;EDtbedL2;0!kWbfjfKbwoxTMU%$xupb|$YOCadX3zp5OG&zs zyd?z@dskC?ms^tw=NHoRI-oZ+;+Ch4$iAAKOyUh?-)ed+n3wt7PNe!g@L(n07pODTK$J5IpC zzPEPsoADi|@$I1RjdrZ6uWaR5ex*?N?mMBRt~T_NRo_PGFspjWyK9VAxf9#71ROe= z-|mKQ&*qoOTC`%`tC!qMN6@QIhVf0J>My5El}TlgUQ*gI>QavWLfVL4B9N?HWzEp^ z(X>!GaosR)@_V7z=39o|Vy^_-d6iYrmF!ZkyMAx&tq=1>$S`=o;4pE-8ewr6r&LIr zUP-@DCEJNBil;yBE$>^*0*9~XjtN5>#l{?(q@hykg77PS7(<+_{K|@arL?h3GF5+h55~cwS=gknr-`le8b`ErI|Rj^6%wa@cb1 zokJhtYp!UUgoQjQiqthO8dPukkiE?w@&|IT^p>jyrUW z%vk%M|NN(F^!)tiKUZM|!WeVVXTpPK(Lqi3=Kuge07*naROHE%)01%%>{vX6FpSYH zEt7c!G_1RC?1tq>JN1S0U+_Wj|WQtll^IL5ZPXvae@X(#v=>|N_s z#>wjJntEK+E>^!dtqZr@vg5TK;iRyuFY6UID&SpK@~54exX#*P*X=h_ElcbMo%y@NL~&(#rH{a9tIgL7@4fq8=xAY( zd`9{$iDfs)IIMARmvW^QL@M{t^?)md(iI8G|Ht2-cNvF?%6i1vo5eC)P)alAy9U2n) zVe=c}TT}D)v1{v_r%`lL(7yMGX`> z3(*zdy1G(b=|!6cZ56|`#W*Ctu2>tURLO(PBh+nlN^h(PN-+ABz0dD6x&@N3e0bpv=8~(^&V6o zT8FPxPI3BO)JFZzf_5?rqaUi1tukl^d*d_z4Yjh0UjNc_p?uf9byXQn z*;?5?l+?eqj^BvKoZqpqUDW-XXa<4l*b(DH-(HKUDtrl=nWDXt6JJT!s&>7-?Qg0+ z1Q8}rnbALd`SeS&=+s{fPm3_9P6Y3{>I40;{Oab*_-oCHVq9EKJ1i3c1@%A#K2i}D z9+$M2U)2mspi6xaUTfwzg#mKF!aO;}jT2@1$R3lgXU>oXgE_K&dw}{eE^L(T_%$ND zoL^rn!XQ!U7du>RaVnSX-tBdav#7iA$v9(VCgcbju;Ih@EVN7*yWm(z<-{kpZ%vsp zMaQ>j)uSMPJagD<-jT{$Sg3kMNMiv*PGe zLwD_WRbg9jYij@N6yyF`7>O?1rG0|M?u^$V%QAB|XQ$b;Dv-F4?uD&gPT^SxS!FZy_M(l$uVf|80($h7&Hh(geWnTL3B^k*3#s!p zc3Nix&chUpUk=5gq1&s=Xh59@s5c2l2Zqzc&}In+ku)dj`))*R=tNh+i%W6w=*)Y{ z$ZnWd&n+69j4b)-E``%Fe(uQFj1*T~zFO1P#R;k`A1T#n2U(L7KhhauCHwI{U_A}z z1XR$(iCI3D?tbar#msC$A{q&a!s3Eh<@$~kOgUbH#b5jk-aSs5Ra1H-7NZ#T>5d-I zBbHh-&*g(W%{D1r!y(fnL&!8y#+VO?D1m3GpQZE;UQT^ z^ZsE#7!utscjPT_Z|COYPxr;{xB3YCmxDGaN-o%%A*A(N6NXt`btzO~UAIuNtg<2orj&xy3b1Sa2J3NVD8igJTl)*n{WMOzZcYj4 zrJ}<*|5yT*Dx{>$*RQ>7ES}(HHTdZw_4GBNR#Ci9Ac9yj@a+wO-Oo|41SUs?U%fn0 z#)VVab%k+z>~vvrGy%d;_0+t4H&Kw zynU^GYfE7Qjgo=K=TEiF->n;EZaV;xzeVaHKKa9%+IimbI9JSx+PD~wP7o=E6Y2=U zUn1fMKyGzMP$Qx?w!m3){>rV``#uhjTFB_-j>zNkBqy|Xlvy#Z5x) zf)~cB{GM#)%VEx?DSXtxasU8e(|)@kG!wMr$mh5X*@@8%SOD$Pf@*3D5v4P?O!-K^ zp@bq#%g|*Pq=_QIlz2_$U=WHR5$~KMW;o(kV!}U|m~BGb711Lom_)?zd#=cs91fF- zRLKBYE59v3Z3GXf??aD`Fp0S{5RKd^_=LNgXflEMJS}XLyncr&7xkviGw<_NC^$RU z$Xm%0vXewCqzmewCLe<3M3=2=d)^Z0x9jLP-)cQ}Ktm+|sz$ivSL3*@;1-%6BS>l6 z`P4}4TSLn1zjd~Lx29P{^ls~ngawJA0+;B6$o=n~*Ny(SOU{0FWlFqfL)Dj3B-X8q zALS0r`Rr`#6nL;#`{KB>5QegAuFf>{%*^Jsb-Yfw=9liK2eYUeze|CZ>pBT~Z+S|Y zs83MWJy-d*+^64be_eV*h4n(a=5`D=^*Z<}TS|RYep#$}@7mWa`6v)){!suD5JO_P zBqE#de$kD1d;}{_4y_rL*zX@fAQm8OHTe-J)KZR*bz4t3Ea919CmE#ZAc4)g#n@@v zPc@nJX%k!iZBCvlho*pErAEAP-f50?=Zu!R+7fq7amKs64}FOG9~k8GDl$FwxIc-F z6B@-3k|$IwE6gZ!3wmo>y5DXo-=uR$RBcg9n1vO)M^syP-xep$L=of3q**KHdj|e) zQ4uUNT~!Yzyta*>XwpY>(LlmLvy?S!Q(h-92u@>o!F_<9^(cQJV{_G~iMxuXr>o@C z)6gpLwxtti(nFKP&oCJ7%+pn@$DY5N!;(Fg^YvaGuA-^Jr3N?Dn&s--+G-Bd6Gq`! zpGNAX@A%ispnw&(c*Fzw*SJZIp&FkD;lLZUKTKXE`i0e_Y`bH7B5vi+9#$2->wF1h zTuh+&qz20aw1M<|i%LgMX2pc>R>bp@XB_H2(vq^je6q7COV}w-=-8RqYYOV*slcpd zQmt&*NlrG|4Goqhs{Zkv7Dh*wp&wuEt5*_80@I!%yy)50(dRwnZUNS}A#3zv5ehfuH`LrbEXPfj!b>LpheSA!>|-7RhTNJ!sRPnRD=gb%7)V z6ZYB%uI&`Q4V-|WvZ&2B0zUWf0 zNzD42;NG9l+aK-9a>RW4L^%hi{pf0uEj9Y!5=j}92*0ADn>fyVQLK*B##KNPV3-u& z4Jt?(c-3qCX~^pLm&}~czag@b;;Zyi2L-^H5eUf z)omHTw=mATp*G@eVj5o7HhoKVE(Zz<#%kJ7q-ft;#ZNd~u%A5@FyPzb9I1x<4&RT2 zV4x~cbP&n%EHkN9wzd|FM3m;7)L1lsM9Gt?40chq%5(X=%_~C4!uUgV%yifwYL{Df zmkC?`XVyd6)LoZ}gyc=i6eSsMnd9fZ>73W(RQ#TU6im`;0|$wb(VLowHu`Dr+&&05 zOWl3`MEw3{uu2aaE((`99baSICcfd-7Yex)xtR@h5gv%qRrS3P&3NAtEZvc$VS**L z*5ksYfVj=@gr&nW(l3Rp{k9k^eY1L{v9LK|kBds)3Nje3cZ3wl!Yh36N+`ZorTtcd z!Cz`(7jbUg4!HYM@UkS+d@&kjT1&=nO z$AOkFb{Qdah?tX~L&#L1Lwzt*s$X70{vmo$)A`db&X(NMM{1kCP3*1oFW~Pr2g^nS zCsjQ|TN#Y_%gtf#b$2zCnQ!Q)DAI?_6$kQz%RW^TOrm6cGD&dp+6!kLgyZiMa|CH% zMmyqv+=KM z(s8TaX@8M_v#9T7H~*EL*iw(Js-&_qX=jiJjX>W$7iG9>xKZ)TnsMiffQ7!rL^W6Y z>GHPuK;3?2E3tvD0umfcMG0NsZu-_WgY)I}+8u!ytVl+1sxp!Yj=l3av-qowgAJ^D z=+U*oClWlOG#=F2n1GtfrHee_rrRz12cap$a(h+a2{S#(CMdJ*%7Dk=VcvcBh`c^U4j^%*?$ zcQX?r0}gLeA6i>x;)d|46xVYdtd7e*6{^nfqr0J~>o{b;=^8SXXRy#gW*PgI_QnPN zkIJ-l4_6pgv3x-xc*8}4uw!sRY+@MIxr0DJ94S!yB*(rJpKgSRZJebhP3X7$LXYSU zmw=JoC&G*2+v*u79F^ChmXvXcG90qwuR3OKQ{ITA8_}mdSbYJ?V0ih0y4}rndP|=1tAx^b8dZepAc$I6JY0 zqh3Dswg!hdLc z+c~4@SUSI5D|E6$cY?|LSj+J{?(^TXPSB>-z*G#`IyPTP|L4!M2YZ{CC{2B z4KRfxB;y)!HyqkDGFo6z3SQi6f1{yiuRf1o8z%jAq~~#krtke~U-14|^%yU{{h~Xs zFK>F^z@fGv>b^DS32{sU!`k+7v+6?@P`9OE9d9xO^-ro@<1+2LzA#RVD=YV<#`hx= zn2(>J%`vO*xfm~aq&t>3g8L6o7<4>39*!88Ub}ZW(8lZ~AA*+iT;y*{$GJaSnulS9oe*@s@po0M?o(< zB`r0$jZHyF%`MJwp8T-&Rx|iN!dKjuMTv5#;1tkjyga9Wc}s#`;h^w+E3rjpBP`dB zI6bwED7KxDy^|6xrAlyB#4fWbMs@IkM%!ZR$R;jQ^)6(p^A3#4i?ilm0476liRw@8 z(KJ?0#WC6_cw^<2lW)Z6(T;;)QmgyaScFxcrS@SL+n^q-+5v^j1fs>OYKA4T2!=yP zM$sOI&iZVS*+8&V4e!pZEzIY{g$rrV)zUmdQ$Z5_#=>9*EA0enX_NlP?#5%0=Sxf> zJq!|+i%)tzgxuPyge%U*bBGpOv<4WE17?}zy=FFFRne+$gr&i@_U$Tl0O<^eIwp$ci3 zFG@ffUI|q|T^c5NhuP^d>*fl#-(-S)Zs=X%!=QyT*9{n)w);(+vE0;4;@%Aown^0y zWsq0bK)GPeSRkIYXd;pXK$DA!vnDvSzu4_PkJLC8KhXPNYv0+Zd zXi?8iU7|5*kift@7sqEt!s7hb-GZGJrr?FB`_s+h5BwFj-%)x~07xVD1i<0=fjH4r z(g(c@jXt-_(&$nm)QEkCa*0m((v5YhhPNlnX%6PP`Rar;tBUYqNGT>S^{uVi(Ony| z1dVJcPcw2XC5>nh;|D5XUvEIVw-@jZi+AaS#K}kc+7VXYgRrx~kwhHV?_HZe`VZEe zE=k+5AOy=Q@%<$u2(5*Fbr!|?IiTk}&ZVunG=8bc2e%2J=JTq3mF-uu4XBR*AK6-O z>zZ$2Uck6?_Lk@P16cr-H03*Y`zW#GJo>nA!7hZrkyGMo$V%w&UIelkFiww)Aa);wtMKjo`aM5Va2z?mBL!w+jdB zu>23jtec{Q`|-`*`>0pLF%ssH;=h_A35>zWzd4RH1kGuAE~^iOIYR!dq7e+b!H}Mo zTBLGSDc_78JJ8mm>Zh!EJn6lXo}LGPGC_D`mO#Kj-AN{9p&R>%nuyxT;}LhLM617V z$C;svs(lopF`#WzQ3#vybO$zof6o}pE+zu_`PcO<`N5kZCgVzimwnZ}7y?7nBRt17 z7flVNr$+D^ITOPC8W}S!@ zok@kFU3lR>QUCs31W+H}Mq=e6(0z5PB_yT^rSNTjZr*n!0?{Jjd>62ud#_OTu@w^Y zqaW_==41d*vVm{QgeF$GLK>$`jEc1K;1pmCb6RC+wuUiE-?wmix`pU z`S8+OWy!dJ3Rg+JvwW}-G_W%nGfYX^CUfheISk%F8Q~uIytqK~SiTVx^i2hx^~AFj zUSskGabgV(j&dAo3^M&j#W7-)eDI15DHy>j(E}d`A-59$$0|RcUa4*t^~?LpcA~KS zyAlQjgqzSe1(1?D-Yfs)emcgm=#g|rg`*Yi)+teR)t9)Eb~qs+YbZ#$Wx~@F)2*U# z)e1`QjBOY~u&B60Fs8C3eI7PA6tf?Eacb?WDlc^|{l(4KL*Zcrzr6`5`+)CB_-0*Z zJ^a_7g$0f(O#hSzDcneS_p6}@NAJ}biNSdT50P7?&e!hWeDe_so_H;v+`RL-{loEW zFi}2F@?#n-)6*tE-XSny+hHf1)<3Kl4Em^O7BfS8l}46_?h@k>@vPY=kabzwF9NM& za%BEOM5Rw@$T+khAkd~C(;U4Lj-_Rp$?KGN6+D2F#&_QN(m}p$jMyx%Yhmo!MkKf} zB>tB8zO14#tw`cMr_aMRtJw(d{N~oHlsIbX;;9fPPdz(5t#{u_S)9H!_vbzZP6gE? zAv%@~#oaEY1t8WNA%y3;NB;M{t zwxyq2e7}UZ$MOtR8F*hx&Lem|9R8fQ$09beEPVSr|11D8Q2YcrcQ|BcecR%XXjwk0 z*(Q0kKXoi#z*l0F0`c|n%kEjCC^7*Jl9(|Be*_RhkO_eksdU&aCc@%^0So_Lykex3 zORl2)!JA}+CE}UJZ5$;Lhl!@#c2K^OoW%Irq}eNFf}`KKmGJ|X3_5mtze42vs-o{y zz*97t#eG#31j9U!dHHOwJ~vmTQb<-N)EDfi7sZE$&kQK5&fr=f7fjn5!qa~}%^f8y zXq0!Scfj?fQ94WvTKZ6$te9I+q*2*F=AdWEXu)9g=;SXxxN{73wSD^LO$K)N+PmpK z4q8Mcp>uyJx++|9|7o&<*a#ZW3}v;{dXM83VH;O6>tvwdxu!|KGjRV^c@XN!_g#Fz z0FS*gUBsaSDU{e$oSeyDDnAY0j|hk3`C~N>MJV%k?Da2%I;HgV^pZAv&le*MRmE&3 z(IDwhCek!Iy0rWA^YgO)-cwRyye4#7*vcCEMYP16@z9##Rw7ArM#V4FYed|(GEwG% z=(G<=K8(yJ9z9sXDXiZu+g$5z?KKXK%?Xe3-g=4gZkgHEm&t_;ObAZ((TVrkNf>d#2Li{R6;AdmRX+>V}x$C z)=^xC-z6U)TaArknSW-fVFIzgI?v?C&_5%EkfwC`4UUmq0uo61C6VPEGi((d)gY1kfvQUy!hJoP3NEv5&iL51Z;N`lzzNUw39G%&sy|p5f)j0y z4U0&-&kMyGNTEjGaTqA&<-Ee4a#ZuSt4JZh8cfNo;YkxJpc9Vvf|HO+7ewx*u+RYw z^$wgtCNp_>B8!Q0FNZKK{uO!O#yrF-5@i85XMgQ;8XXH^wd{j`TlMQU&H5FY&-HXT zrq0?~+qv*G?21%FI%`_w0**69eJ<8mDkT!MyN|P!(V^0|Ok8;Yis*@?hr#zdHUnyQ zWixp())u7CjP~6@P-~@t!HHED13b#o>AmDqH{Qeb^6cgrvF0>L_OplSM2*d2hwK~> zur3vXL$LkHVWcc~CAZ!EL>eH84Re1z_oK`-mxNlBn(zfu5%AN9axBY=a+yI++K>$G z@M3a4Y?V%yMlj3rtRqb zK;_aJk&tISiZK=;8X+&G&~#HxZB*v;kcAx4YSYqQa1zpL9TuyhoMoz6(&wO|bo9Rh`cd)nS%>l(EKNW1LJHQLvK*zuRa(FA?@sqFrye z@1XwzA`0oHeC)nZ_XfoJb=TEHh~HJguu}EIScy`00 zzK#b~*0`U$$XKZDThg74l=1f<8yO{F zXpF~&w5mWydX0YpB%260slvQ7i7Z~rh|hF~(9we2d?RTQLvD4>mGN+d0!GdJZn;9X))q|jTE#BpC!We!L#7eqjF~*SLw&6jK zBrf+F1{vp@WzK0(HG%>r+H+o54?g9|lCIZj1AP}I#+D_-#NuGhc~ZT58nD~SO|0Qw zWzdEwe`n*?3BvL<{FJI%gw%ObJE~^br-j@7YK7f4uJs@Y3!Rynp?aVy z0xwq=Ke-x_m2NEW?648&6#8c(xk4wd)X1DpYE8W`p$D(D#vzf(@Is5)dY~6TVnrXjqPy|cjAV@d$bVA>#2rQiMjJ$ z8BQtfYED85T&ax4Jr)y7%R2Q#AhL$}H^?9Tqo%|PqZ{tlW@@7AZI@95_Ro7Ne z^ph6A^^zjcQ$P)Nl!Dd$u@=y!yvV(lz3Wwj7PDk((L^^fX1tOM<8BG#=bKb-iUd~Dz?=0sLYo><=`^i!xtOuxh^olN=$NIEIn##|R9 zMvCy-55$or{oSnIPQPoRu9=#dJ2ZZKVCUPsk1kdq>(B)cdWx-g%{Yeieb<_zHHXMX z%rELa*(G#(b7?*-SmGDPfgJ+3+vv+CPaEG$ci(d)Uf6r=%|F{ZZ(h&bQxiC&5ySA4 z*s!t-kRPY8j~b$zwu=qp^KjU$W*v6bP^jSx-@B^0@0?onoSgG%>+`cu6TkW5w>soW zFWm*aS-`;g&ySoaq@_OMDBO&ws3=|NGA)?@OtFFyXVS9oJOLz#KQW&%6OWjmDHGvt z*?Q6YMQ~>{3t2AD?71&uu)nh`^T%6eqyRdoog3_3>ZArn+rVgmfgt*wQ*t6L`NogC z3v1{XzRf}CiEy2Ks-TX$pq@FYpDP^xH#mqeRpunQKZuL4;>i7@@N8-noPtv-AuQB; zBIV*{u3x-!WD*2J0DI$qv@iKTZdiv3E8Ac76$wdtr_dm3@?^}#7_x^-n!E4)0f`7c zOPGGVL8D-#qNZMjU`qAoZ`MfXbmi|~4WX%a#;+04=5T&*&dzw>ox0`Lma1?Se3$k{ zmH6K0O5fX4si!{SeNPPTi}*u)$3r|;s3xK~5+N5J)H!WrvKwgk1JvvcM;gEhOXXcy z_({a=jzrj-7(Rmw)^(gwr$}Uy6ff-3iW9^?5Wp4hi}p$*-0)NM;8^T}n|z1j{Qr3A zUD%e<{t88P$TTY)+!LfWJd-UqO2I{oo){>}J&yaoSk*AW0FRVr56G(8Pqy<40nXfSgS%nDbNf(2En(~^K z`8n@TsN3>l6aVD+kSburf}+q^U>Dk#&gWcY9JsFK_SXx7hp|%n$Wh#KWSCUEKG4=c z7R)71YUU0I&K1kj4l*0pWJ@(vGY2>5rm?PycBpX4g@=`aUlKX94UEC>D3L4r#Y zTRF+an#+ax?5j_a=I3pwinI?Y`h5MspzIEuP_a^7#}c%-m-~ThEGXdgA2pQzg$?wz z$Ta*Gwz?^`F5GzOBK155iUI=%Tzd>y(7!2p^iwT+X*Oy(97a8GLSLd18d;0vJCMS# z9wJ4fL0k)367XWd+cm$;#*#K5qvd{Om961RyeneCCK<#bIjCOM zW8(mT!0GJYb zQe=$WB;Rad;~(?&#O3evJzoLZ?HE-Z52g5F)weB{Ql{47#q_dCE1#q_bF)0*FWzXH z)qCMNTK)cxV?QrOcjEvPVnAjMt;7`oYs2Q`F`S#gMRi~NZyjS~8r@Xu! zha-ulp89?S-a*g5JiKVZp-r9PVx>Rucv0^3+#iomS&%G+s%?_}98@}k5y>dNDm6S`=%uN58dvR)b84JOh?oLR`3LZXPgeAkSlyp`P+33#^23nR z-*ae9IJg&1i8L4uk7l_;?tRhC>bNN?q=0HiOiIjN-~nhEy}srZ9RyJm=MKH}9fN%z zPw5a}#(>`~R{+%u<^g-F!V3Z*K^97nqR`D;HIV)uO5)J|xu)js62KzM zH0G^-W)=-jtA_56C-i#u1%wFzyA7an_#_)Mix!T@a$doeSgd0_o}It%ghQt|hY)Il zQQ=3GvQjX1z|KjWnIz}$(h{27kcKGc)8aoig!~=)6nPHQolQuH zf9<2~r`W}RePcQ{S9zI=wry%S2&vKc1eX!TD?*z(@pXyxbzz)od#-WAK*{>VGYI5h%`?B^JgM*_sxGf%pf3M zAf;p|u?jzncem!HbAKx@5Ek$S0~q5#@&#O;N`P=4p%XE$UTX zJ~T~Bk(40JT_4V>cX0v08WY0L!YyeZxX0lHx=`SdH)tqL=_NYLARZi^K?>&O^8^H+ z6|<+zQ``u2GnAxrIIyscVn0#fI}LWI*nIL2^ddIY?Fb1P2%X2NT-GgdA^!u~82bVS zv6%COu=9N`SGsq5d;P%7NlBWjGugzQDEDHY=+1F7bLXcj%rcfXi?z4FJ@Sfj zBp7ukF#f@kVYU4HIQT5EzFHM=UAS=UfB&smiTb_VA z42n;|e^zV2={q_fAq%YLwkRAn9mvl8m1Ytq5?Zx>C6OOOM-GIvl_Q(=AS^qYCndj$ z2eq|yDFa-G0W-03H6|@8YE(ygSYn$r&Sa zTg%nS%XyjfdsdB!lpYOcGPQ;21;Ok5Eb6MU! z)bk?sq})-)4u`-z_etb`AfUjjh9{trf~^2CFLmWMU1~; zXq*DzcJxnXS;H#J%jJ~{P=&aob7$=AiIi5MIltsrp|IuBG2|8Eq#%BY5VUD{tCJ1e zmffUQ9hj5lH^BbW77THl3_MvyDdAu4GmyQm`Xd%a zwl_TXGmQWz@2{2srjqb|fxXU0Rg~_mgx0CMMB>4&zJBc5AqP z^yxgf@v{KXtcFHqki7B3zXW9ub*aT@m9W{lU9hKRoChqJ$+eoJp>6dJPtmCsA9b~{ zu#_57ADJ5!TaCrs@{ErBHYX3rDLu({`oa$_nP);j}1KhF#R=07nl; z#tcEX@YY|9it;r~+ z#4)vngLI4%5clKd>NsAe!La{PO%bPma-C2Y;NX zsyOY)fb%B~B4|7*bSIB0SsmBQ_9vrto=ngDNdomdlLJyabL#;W-i4Z`CZeL3)Iq;% z3o3K7C|3{w>*CCpwgN>I=7q6zCYG#22C%+)6#mduVWM{YaP2lrR^ysQ79bBNOYVM= zOB=n`>z>NR9_RgO?0Hy0!OjPAGWx~H`$qYRkOTR;z@pwVwlDv~91dv@r3Mb~w;Tap zASwrr|BI4gUp!z*=U?1KJ8ZEePF(P8`8t5i zwK7MNw})+2I7#t@C%TKuU-Y%q!cQNf5KJ>1>yaHsXyPU46%d zKg79xAM0hZ?zax)qGV&~{CnxY-?1kr?D9a@GSrKcP`_DGno>u|rlONAizzes@vkXN zl^|+Owp>t&Av-CN)5aAt;Q&xO1{W`*s5fukMoVp-lYx6oh<_eH2BzObf9>eF%kSU< z$)ZjhPaFSXNauJ_i&FF{1&eLG{dS(58u55Wd*JNr{A>I+l&|A-kd**_kcWW(6w?_9 zp%^ivL_09MtWfMh8Yy~paY@0t2kt5VJa+Xf7+1p?hY`MDRKcgp{kK!=a6bS4xARCX zDpHUpw%++(Kad8lx)I#z_fn9PckS#eaNEG!5$!+Pl^o>x_fsyd zUqt;myZg_P5Q2l5M|%?%+m;m}>ZarI)mNaAng9Q*gI58cIEL=RZu~V5|A*)F-zOBX zd5FN465;A{ycba+@BLri$-n)r0CIo-?*V`$fepg{(O-@v(s$M&t{`ntqV(7QH5>jt zH*!{~H-CnGd(=FD|Mx%nA2SDN`?o7$WmQv-V##Tt_YI8P-;)4kpY6}qApy^r%O#Iz zyT};H_$EouG&EdBN$JeIE0npa6O6B{h;ra$pZ(VKV6!{)ZJd$XDFLc2N3H3NIyx4* zFE0{dvsiFJBNCDAVrS=_AD0^azpg=Pi1(6XG=O`}o|bEEfN_;&yS-FoiAhjVqC#tSTtCG5au)-RP8R>Jr)TI78mrLl_ zGQmQy4G2UD)K z2_j>(3{C8eJjdlF37yMz2tb(dCUN{Otb38U$Kism{`^7G5I!L zBtaOeGUtTrK@>4N|FI8NTTq=H@hXB<)oeJv^^ONsLKr9 zJ)U>QBrLGIzUyQ)xu47u67VO&@ZFyTSP=%oA9_99kg3ixWrSNKC+}{m;#5=Bb!LV6*GBZ{3`VTxe}=?MF3Y zV&dLA=e^MG*ALc+>4d{VsNwz!SOCd_^cm0y1_5C_p~R%55Ws8X&~@JmhIv6Gcc(-n z;buf5<5vTtz77X`YI-Qp6b%R-ctXzoUPz>(Nr`~76qnrVq{i_HeK9oIz>^OsD7MCoq_6Rbd3{aQl{Ewm$-No809)gYuiL=f`tQfTIJr z`ln3|cH3S67SSJGDXjH)0buKvZSs#0=%2|@JPob4*GKbZ#SkIj@p}8haC!lL1rc-0 z?>A2i`aU=FuNLG>lXdJ{^0t$27dx5&qfB=daRqFA1g`aQ=wIrbMz}b8d06Z`g22dQ zqg>kInY<+Ru>_9Rm<+yAb9vIC?Tj4WB=F7#N{wKgf^o54{#gp2-gd1))4w>2cXs>| z_xMs0y=7X@vWSE*02y)@PJ90R-k>1%kT!T1e#7T(Jpg7IsOCDOTUXl-I0J`pSph{Y zA5@D#*wj*%P_tw`ZXloHb_*CSG)!Sg4vNzm5P5S1h9DH?H3A68_1&lMGjtTOnklHh zo{0a!$Y&sWKvAOL4jf`;T67-5wRfi_{9%h6KK^K3jTIJ-{h zE=vP5HJT6LclQ9I*Mu8>FHg#Pdh3TkcBTQsEgl|TX=az{c_hcg6takSRm}h~{{hRw zgJ|fhqIw)eQb+#<0m4wt+n~V>@gd(gHhHO?p)HRU*CIQ_Z&gsDg%z*)hP`Twp zlPz>51xXAw!VLIZvz=sD)YE;S@~y`4YgBu(>CQ{?b-sW0090zMQ^uKT`qx5k{XwsS zKoyNEvUFIEW(hffRyPPxkkHh$`BEVv2S2zOA2x+RVw)q<=*e1b0-uKGtdTuMPlcZL z(Graf$*8NZFI%a{(Kp1AIYOl3d z4Uk5-eR{Z=9Y$nGLMu9NJMUoLBIrg=<7@_I8&i4xj4XW)EFu(rc4TCv8UPPVDH47d zZztc`z`o^t<@+$3U0U6<@eZf6vJ_JW(!)a71KtXyAP>Q$s071&3w)6B5w*!>I0B{s zlIB(zzvJ9z=|j^MP(9jJXZGwju+E##5SDKb00^kTBnXE;_ga^20daMpk6Wu=6ifeY zb)GOK?)%1v)w%a&>^(M}{f{LJ@HgM?cat%Z0?qvdbXHH9t2&#cPrtMaU!Se(Jc8)5 z+{J@mBh>(9$)eNVkidM2L$#*;edlTO_^Q!q=!>w2>}#FZdm6&EL8ch)yuKQazn zoHt)}%npzG8;((t15T-YNZw zq!7mk5zf_2R03m@hy5`#NK>P%^XY8W@rSKVzI}P)k+q~I#b$DAfO)!AP0a{u7KCM? z>A0hBgE{-3S^!Nn-X-~SI%{N2U~HgN2xjKRavMwI!>i7EwhL*YB7HPcUS-XhX~P0x z0@bGm*MQ@;^Y*d?Th=E)@Rl6w&8>a>g0OdP=U?}Zw^Ef<-_Izqcio8J6_A*b?XeWi6p>+rE;uu%_V$jqVZj3 z55HxPc8z+l_F?zcTh4lS8PRz2x02vf@U26w|6<$|2>=fKV=HeXv3@J8Voc^>TF3hU zi`KOr$WLnvRA-U@j+K*x4%&nXmBKvQKniW#@U+20!Ok8YbntuBA*0ESk6aJ`i#yC> z+2d#kYE>9h1}6ofzuF3TY+h-goq)`e`!+3`lQfidHxkp5o#b2G;CjhunAaYo_;#no z0OhmnKQl3KVok*xx8Z4Roe1SRnThj4BZ3X;N0vJ3fpUiQla2JqF}ypSOMvvz&&;`K z^w;|e+{+)E*xu6A${5sKM9`As2%hv^JWoH1687DNoR z<(+r6;iHu3I^4GKy>G|fMh1}Hp+%3SULcuF6Q-Eoq}iGCB9vGX8GXO>ql)d0BZzM1 zCDA&R7|3qCieMtAoxT8#@QA-cD3XU=UI;OX5ZAnlh(&*7u|+je9yTN|?}{Eqw!U4` z7i%k7f|v#N^d*+@ZT#RnLLAVHfH$yBqFgd!Z$e>J7}JcIs357HYP) zYJG1#4nQw}cho*2T+e}xOEEV`?+`oIoVW3CY~AV?Pv>!^e1nl+$N-Pa@*PiDJj#X86(D>teLGXdwIc7@ojypO}*>`lTX zkRYZpK5bm1?ssIa3D{{=DXCJp?VA=UL8w9eP+M5_6DYA?W4QgK-e-!hTQ*wGT!?2E z!?NGlF6GDqcu2wMH^Jv&HZ|Ke?M}Oo!AcAgH9ihb-qT&%Ep7FfNQ>p`++z{w1~!ur z@)AUEoxSjy=YeAhz&~1EspIYJpX;3G8G__;5{pn?n?U`shVU_pUjtVgKn7)1z;Us= zo!n{+PWQ1Po9`s@`Nx&I_J$)il^5|?Nj8E^!Q_^*ryY-Okf$bmG_zm~r-i602?wwq zyv0VaJLt)=*J2^OxL_aO^|H4UjF{v~a1|^syi4W060*ooPi6j~FSkuo81dMUDAnP9 z-!okI&S|^--8w;_l$^(hkNUwmpKYPxNSQ^A%g4iv7JJThLnWa}eKN8HcMNdo2Mr)a zx$Qm=xmE{;s41>t#jsj{ULg+ltsRPIUfL800_!<1C62z|J{Ecf(NNc^;(42b2v+A+SS_|99sup3iD?7 zLnBZFPnLT)5E1trE}PTpepu(*JnM30>T>)E9~}M$p79PNn552PPVm*dOdk#v+TRZ4 zZRrtsW3W@zpt2hIdlTfOp#Frf!S5LTQMq(6{+q6j+$>~Ju51@K zW{mTax8=-vE0IC3vfB7Jk0xJ4CRo0_EgU@N?J;2XKp@bW3N;hnr&p5pbx6G@?)dwY zMNvd(Q!<#BsnhL0_A4z;Y%HM*C{BhXPTDr(w+@((jTg4h8Y8w_%TOl04x5ha<(|5G z9p8U_ZS`JkECO&B9e3^*Z*OgPuUV4JF&pmIWhlq2g_pgGiIohdk)awZH+uW+z-nK=6@!o z=w>_rt64&o?c~4vgN$DPKfc~NE~{<(9u{~cq`OO6QbM|sE&=J3?(Xg`>FyGwk!~bJ z8tLxtj)!;SIp_Y)J@3<4i0QKx4aCb??!U7RX{|_$wZ^*I(Rh1Qm+Hk}c{vekD&%}l1Pq^#< zcz!1bwpb|U8N@Mq3vT}ZD{`k3HknzzgqU*5f4Lfa=y}Wcl@$<(<``D}*ilhc^}&97 zPvbN9>U$TgziRte4`_pWbYsK=HcVWfl@x#U%04O+sl2J_c@6AI^fwYIF|y&Vq4rBo zN3U1t+P9}e8PToVJO9-Uqp`4+++{Rq(6ia~WHt74f0m@>|H87R?%Z}YXi}+PzY}rpnY-cZ;%+h`k?dak!lzH_P^ToSM#m~eQcTdwT3r)GyZJwi13Tmz;{=#`vsEqBHQckPi-Wv zZP&nwl;|1H$PUlb!};pPgd8&e6spBmD-H=)W2=piq;C6%6%V`~C01A?J0Rp1B zfLkxRn)biq_eKJ;;2Z#kQfG7LdwQ_{wUz<|MVQ^R00fub*~Wn0!_6tgVHOa2#RiD! zDCr#H)q*7LSFLWBugt&JDXRim!&zlyWFlYX z00@iLrah2ScB)$N9DpTW$?;w)-2gq?-C(=k1?;aViK?GMPk?fMBVFr5$#2P8fLy7o zF#I=y*<~hRAGkT0=gS-tjdwxA!vvEHZ=vN&u9jh)6J=E#UyfD4C?g5PQf^XxVvL)zCrMl3*dmQ9KN~4eM9XA zs9qAbo&X#VNE)#C?qQ3){X^#jAjd!hki6P56&+8<8KX2yNYzecA#y1(wT1t{Ab(oM z;wy+0s%+uquP#nTe=bMr!7skK*(7P&N$8qm`(Xho&-qG)B7yTG%SrQgrh69vg%zgq z09?5ffIfxv3YWql<^YM~w6iP+G4R;)L?aar33jTxe1uK>YFvQZ?e8M!iPGWXP!v|5 zN%m)8A`n25`40dDL=T9``>{WzVNH0{w9oKshI9!?azsQalbWwC`ixV3T=9R0jHEZ& zdc9P74WxJrGo$!G`2Zv=ZX7L=BSyUcRpC{TD(t-In#7j}Co(%T)$7FWBIFO-iHRox z`}sNU4wH{m6Ef>LK(H=}MAuOH6S(gmWYG>1Y=486Ec&_Ur^Qt*&gefZ4HE*rt*rT| z=}oqp>t;gt&RE{ZlegYr4+{6)f~27K$3tt=Rp|L|(#ifq#1R6V|7+2!7ZI?89+05@i?@kfqq27@zxg!?53b%>VPMxiDRJ7L1}Ua99u$( z?ye3?Re*T2Dg#IoR)=A}dyB=pOF(cGu-Y9Qtk)e>f`xKA2HIQp7Pz^ZpOu61AVmv% zcK{J$J?uv2C-4FU(8X8ic#6tcGCSUXx9{g2@93H4+i<~}M%Y6-{^9EIZ0OlvVUvxJ z=6i^|A5Lw64y2_CATViODU?phg+z*AB+C}GF%UwNsz5~tPfkz6px>ZaeDj-;{eF4| z*fhUVo{{urvQY_YrEUc7>R_sQdC9lXkd7UL_P8jwyZ_k)(nv_83d(UOWtI|ZcAs}$fix5*J)~5DnGLxM;Y_JP6MX=<{jCyE$`=lPx(Z*xbQj|=c@4TtF}c&FyKm5so_JV^JJd}N z>s5Xipw1DYQ1cN1=9@Cn*LGQHNV(rfsg5Hi>j~siM;{TCNnk%+^OOO^H$$HLd0<9`?BHM zHR%cQxM9O*kVKmr@;u^$J?<~}iv&mgHOVWhCoXY`;_ZCKUVV^u=}BZc z%Zsqkso`VMUgALhEp+~S`yAduA~Jhr@Ei^@dF=See^krFOVghsT??o(x74z9QNR)+ zBYTxGl(YS(m|@fuc5-skM0@5$FhtLf1ij4WyHm_8GP5^`%1ECIyT(Y7ng|BZ1mUzB zS0-E^$So(`8y%?T(KVB5IBa6`9SH@XV=o$BkFH@O`ztS$$MUH#Fu5TPaX<&8ks;)K zhD%&?ppVk|hvVrBXaK37NC@5-$Lv1~*Po4No76`a)aOJKWoW#QjTDI;K!|1Khk+Q+ zzhymQ+4wD>a1;GF_~%GDR&UL%Et|JX`2Bf0MvylHc9H1?ofi)Re&#(3siHBD{ma% zd?l5;>Gk)XeKv=;ue0Hca?zC-SfKvnCGYsclJsPEZuhmqv$?HEUA_M2mPaolPzc)V z$(4s!bYcBtI{8|K`oQ}(ZJOH`{~+kE~<4gOqW|M=&-pFpj- zK%iigahd9k9p69JsQ*$4yo&NU#FN*HnUA67Xp|4((?P}>#T=v4 z(tVNreX97c`v3KH-`DSf;{4Lz9{)LS{(0j0b25>Ud?KmB-AEPWeUfp9`$r%Dt>lnr z@uxYotKt9ag1`Om??38}33SMzYp^cWB#r-TGl6rPS(pVh=ReOp|21B`L=aUNJvnCu z;sO8T7yW&l>F{9V6GOydOJe?mss10$^vw+Sc>@ZSl`pZtT5tdVeUd1`hXyL)PVW=% z4ZZu=Uw!${hIXKelaXk2i@YWm8?67?cqTt+bEf+Ddi}?!e*Y1J3i1HSJS;%)X=KUu zh4Kdr&xibL6u0A6=iOHSkQsRkl9|lb{Tlw}k)V*U*KbG?<>-(h;1xh30=un&OTt1V ztqaEwBTJ2H4D690ySQ}Uw8ad*_QjM8PHy{Ntrg;CWLU1c5al+8UhS$Gs2<@uKTxzx_`jb1{c2c{Pwc!vPh3Va3|HRQ6hY3i zCm~%OV~Z47Z%!A+)N!*f|NO{bU!*PoMWj=*OhD=e2+gi`1Y{F9LX!&d^Yepm6*N6^ zd*U?mXDJG={_S;n$Uv!%ep8Zq-v?+r0%o+=auTN(Bu^IGNSsi*PV!13u!PZ^^zS~z z=J06rlW)=}*D3x_d;h9R0}hB;tpQ4K^fa!hN$t1McmhoAVV(jY-qShG>X{H z%1Wo8uM*|!#ZB|kiR(y&oPGP{t@sd2~Hig1c5URbcg{9Ajemp~-9u{8WsEyQC_-F|7= z*)LE*f?n&iKeB2vu*p|zGH^j$s)*2>(TrjQE60q3-F}cz)QYtd`qp=AL-O_&|59Jy zHOUuUB*a+Yo2rH0EXS9EUQniTR&$=JIPpLX{Ra+xrf~}I#229m;x7fiU#g9H(EfeK z{MCc2hKW{S7}2hYI(G69IFNS_Bf?j;3&GQK;nuUIJP}2&h)8A*7OxhC*H% z)}&cp+A7{i@p&rCi-V+_y|wkZiU@*LJTso8iODs6RssVA^FBaQBz3rcJmOg!ZAuf9 z-;;rJ!G*BIZaD}taf?39;lz|H`hw+43#SDqW}i)mscG>=Rmu@6^!wY~il2 zJCMmQ>{nA9B)#&(&WTMzf(O1N+3lXnC1#;%I`bx`)7Qxwi-{hFKY#a?$9}CAHIqM4IqR$-iATuqnmRtAhLbM} zNA3HXY~}b^40G_kytw=e!zNJOwvpKWQKR&vC|tY}!%BVP-W<`roz`%qWL!m=G^ zSa*bV=s7-_(D9u-`>^YK{#R2P-!(y?0c*BdtVz#C=G*l;X4+|a9REaHojrtFBV{>WI%vWe3B>rz&KPb)6Ao?e-x-!QS}DGnnFItsZ(Px z|5gD~GFul^Jr_9YagF^du{!AYz*GC?lEfrAEpNc~0?K|#yxX_E zpdy0k(kwb69;k1V4wxv1&f@1qAO=3)mRfkuD+&g$L@9$XW`;_+b%xl2 zNg-gHSV07xjUP$z85+ejZ>ed(p~Qyx-Smj3S_~I}C*54}7O;@cg)k-3Dk}OYTndQN zA*q=lN}?ZjR(HAY;c9b(GNu+G^{-N4^U+JX3@aLmmr`T9tgufOQk+w1YVPZ*rt_{* zN1eLwk0fF@sguBd7Zf~>lspEi^DmL*&vYr){RnzBT|y&0oEx7MRM8t#VZp1VL)rhWJb{z+(bocTm z*)%x{>Uy=`V( z36@kEdhe^VkL{ehUb+&e-KAxDU~V-}|8R$%mO*>Bq%3xL81(4Xv<%hCFbhgwgetX; z5`7&E7P2Bg7>WG`Z#=Ug6&?oP$=J$a<|1ooox>mN*C**DBr z#C`s}Q{H@BAV%!oMIrLmkLu=oW9T%|FfS3h(L~|UWU;G8D%(D{3#xu}_l%*l2;PoC z1`n7o?O&zetrcMP?4OG3S z1U9qZEp1l&NtbiUjlNV6tD-Ff+{8qk!RINOerOqbdc4Gk!*4S(Fx1M+e7fntdWg}L zdOlGkH^Ki@R@i!fwTYp$81EC=ar+Hk4GI^*3P4=l@mQP)E_c~|j#`f)0DTVTH- zHplM(?~6!E7ts=(w)w#K?(zi~btyorZqND^0z!TQtxD&BVYGc5(Qu@o>u9uqH{`J% zjvP4R=^%=dzZ48k3yQ{(NQ!LmQ?5`WTZ&ABGyh>eZrdKjzd)lOZGO$6n-urfwmbUq zp~DyI;(GaMv_$cA+_4n(aol~4p0O5ATmIC;oEEu6#3wh{pBP z{E*sYHqJ7A;$yF942&@+yH$Drg~+qJ5d#G=(PwkrWnOM)cDLA?WwmPuw9t?BaG~KGfzBgM#6&MsG zes|tj^$1AIM23Gg%Q5av*H<_^NUQ2Z!BDcXB>>QQmdUNoV2Q?bxx;Qjw+XSg>(dSp z+EOTE-n93H_B-+Tt@|&2R;L4*N#Oe7s_>|&Lb)Q@oYD&1_W<5c6Iji3V0QJ?tAVbH zgCR^x+F7gDO=NsF{qLu~YQS0k+P#@@7@#05c0OLhz{RD} zv$Gd&w%gc2-RlrqB^8ENoUJxAeGEdp00ehq06;DIRiiF#4_UkBV3^jxut0nA@r-nAkHNhP%jgvFY*xmA}0{qE(I0OSf<+Uam0gMUC|` z-vuH3>$!Sss*&BUz;Kh%Y~RUhL-}=#-xr3FyGNqD?Z}R@-jsw zfE0R*%%C~%VYHVvi)$9c&|Sqmqj?q9NkV$1-sM{`ZA+&2}1`dCTJhpT}lCb$0KGrv+pLR}hmShTJ6tu1(@g zyLwq?xg2^=Si)+*HSGX1efSFVjl8-#o+rmG*(-R&b!4HhJ4KxKE}{bH!`Hy2y=Yy< zFDKiyxbgTrIIjKu^4kNrp8D1(6t;krM+(tIyyVL)MnCg~gOSE8>m!q#48RXBS&z4~ zb~|B?iUI;ySa%7aI06Qm}Q$eoj3SmzA(j=gQca zY1*&!$7iv!w_{((vA;Ov?iedoA%C_y+SHh zx97O&u?&7h${at~nJH=3bUvJ#_)z{yhLf1fp}`;jL*Ld=+GdmNqG(iF-@@x{AbnbH zKAV0oww>qn;x)%n%Q*vQ7L#6XLkjarl3-PZMn!DihxNoLygIyoHs?EzLq$7Tj2+!p z{-}Te5wS)|<-5MMh4H?1s5NsB)!eS* zVQjmp_Agp%8lOO?(4~qQzC^u5yF|alxCAa-2TncZN4bwaf*L0s{>Ty;nw7da>wp66 zvl9s=rRV~?#mvf=Cux$o^BfrLonJUrC# z`}NCSeYQ9Ks4D4K-##a0a^+qh*k0^%kAA4KlM&0Kq$gH6$; zCbs)cWO%qesZf?dPY7)f;$v9(qT7ILmKRik1wek*YSv_{b^(fSeY?kN{-=JnNUWi&ZBYqH-#b7uWqM`HVZBszd~F}o&Reyjh!-xKZgXF~p`v(miL z0Kr035&!8TYi}_*Ea;q0f8UjS&%WWPYRoU(s!jAlNDiZ;w(6~Jkq*zX0FI_BE{E;@ z(@TT5_9IVXU5r|0jxObGTk5Dxyq6a&Yi$Mt3Vj1Js(t4p?IhDrHk#3VR}JY;C+klH z!N|n1NTWfB_yw`=Ts3zI0;)2JVfNQ-4vZl%&ZcVBXhXgCin1gK=D%6mTP(K;4=<-( zv~9e!O?Dwss&+m~wQ-rMAOZgze32m@kILxVlDN&kFc#t*AXD}#(;PTnH>qe&Hjw0gTGMNXXiJ6GJ?<2wjpGXUd z9X3VYOv}%W)tOI+>P*>gRQ9N$1%f|78lzH|Id#^;6;lDTzlg_uN+5^;eJO*wE9&9` zp|99nj63&-$~H0;Toe%b6UN`teTvZiR4FBP!hIE?eRowoOcPoK?UC5D0tC+T4WVzvNnA^9bY zC*lR6%Ro>#>RdxP)>0tkw`+&7m059u+|p`OY0z%m zvu>Pf3(%!@^ahZgjzhomQ07Z`A(F}FKzQsh_&LN{I4EeOt+(B}oKMI2)?ry$x9cc; zKFBy6BITq?%dOn%!)nAd-eqzQl?=*_qWo+9V|jG>?H|jp59g1=bYw50f4kQb9g5A~ zQA{CJP>*N(6-YWr-ImIoktu~4TGFM{$Jw1w_wvn7mWF0zg)aJiUz4=G0&{b74F<5g zj12N8aFr8ZP2{;dbH3Z${l&xdxn#1W#56aS|MeGU-mWl`(qHDH;Z@`jGI)&lc+P|L zN_kFDP3c9R`mR`oGWt#IXMKp(H|xN``*0$-tGl~|tKyW1Jhnx28KP*aPt?BfBH66Jv?i9SY~GuE;)KE2AmVWmD9G`%F(Okz-OM#Xnmm}6AEySoib zTOEEBY1FQ<;*P}OQ%wvNJQheACN#CaKvJ{&K)zKA3`|Tudy^&pQhr2~IQ;zP*B@)~&Ef?FpCOt?t$uKZMPsrv z?;So)cZaUU3&r51KrvBK`S;p|KZw0I9(8Jz5zS`5e61zJLDoy5hA-SrJgxuGT6pN< zI{OX|{xP5F>YD`JAM>4r800Y~e)=TDCU51WyzRe^jD(ck;Uh3M;onoKO}u|QZ)Y4^ z#6Q97{3La@ay$Zd8RGkSv}3~AYg1%xec@z^GX_E5cgHTX5@#twaK01HA;PG1R8|4y;Ca=-mgT*5L z){#42K7&U=UbibfEz!sWLBmIe?zkutu7o^MEn(matNI&GyN$}hii(OX2QNLn@j<{T zY3=6{-iq60O2ZDNRp9*qi5(&!QQllEMosM9n%CH(O&rv|7w)%U-F6!#L`GW`6>n`Q zKU1tHtbRJ3^_n1v9{~wa5{PM!cne(wJ=S@oh}Aqb&52ZTwk6yS+3dm+7rA>RqOdE>2_GBVzS!x zJ>V^JL=-B>AJ`b5efxZ^?eYNrdcGT-VoFj{L1@-;aZYf)qSy_sR(0u^q;zGQ=0{!A z8$GPdpATo|r(ARP@i&*YJi{k4R$Z?3eWt%^)nd>}4{=dH&kOR~-) z{Er+aIHUwLE3|pJJZ8|)+Aq#ZTkL1Cu*ex>IC40!*H=ZbY|hc}tnzdZg$HN`Jfvd< z3uZkHuxK|efBNl0q{G1G{Q`h+N?mBIP1^XRNYu*N?xj}u64!I1T9dI)66G5840b&~ zNj)rFR|B^<-Bx_AH%$Wg7;<82qV)nWMTzR%bOhcN0Y1SZL+pJ_hw6*VOy~tz_h&A3*Pw% z^3w3^DGyDOGk#7W`Z>T{z}95;*x!#UvjuS$+2qT6vY$A^A6EQ zV2m6?x?2GE-1C~(M|pHCU(LJ^NUEQkEeXCI9NYvf|9NvKPIw03k*7`^cYc?n= zsgJ`2I(7$+vj>9r{roL2vi~*hK_a6L!y{x~FqD&4^YzBXRtUc$QLQbIJxBQt-MXDcuq!v~ zbpGLX4cR;U;r1+6C2YRFrp-Q(-But=C8?a3fZZkw6t)-HxrII|#_H0~1Oq=p0L0yB zMbWA)qrmqPv~(BexsPZ^0pa4BE$2vI(D>oYH&UJD47J47no_c%VDC`$Dodc>{eac? z{4|;b`+bg@7$><6;W+b+SLB*|JYtYBK4*FBk=yChCHrzn22HT$PL={dZoQP^9|<(U zK0rp<^1hhGpKcwIlX9e9Pj1>^{b`{w_$hgr61?MEpA`y!9%9pnS) z;_03Da*SI9GY}d&Qm`z)Uqf0Z29RF|AfCGWOh@R)trK6SV(toaWCVm-Ps6n>=rc2q z_fj%N-F<7tdKr?;`p^uGxKYk1o?ZZ2mAblz2A@fUGw%tR~4 z-ibsnq*J0oLSjx}gHN{L-}88X?2bQUZuwYtYZrCVV7tL+XUjZ<#^M>_-O$-Vc>C6{ zciJmouTVk1m6x_No}N_A7vJ-({+!yWMwO~JDt4E?Da;Swht6z^er^ZPWS5-j6^|eK z1^M0y0$31qEHjPUI3K@aychHZpGBl?6I_D$0glZPyOsLfk;sww63Y=&=Th1o#62me znReAPX=x#b=t-1%Z)^38uhv*Yxb&S6a&&#W8owYPfV^A#SE z(XEN#dM4v0c6BE^#8S@1*<{ina>sWL4_~lIxAfy5NM|yIlf>6I25XbD6-4`dgU4>u zs^tGzsKtCa-jL$VH3ynd&L+xh!(*ol-`whO%3#}iYe~|}RtQdOcxEqs&??bSCXe*V z1Fl{|KSGuDu0@-X1HnRzZv87T83;K0Hee{pQ1T@H!nnAM`t$|fMqFy25coaL-~hY1c{PYjHm*|&RjwD-&5lCtt7{C9IXd1*}&H4;Y$T$rr3?mVKL z^rmhDrkM)-1@!9SGc&dHVOB-zxMXOqc8JzyTWe3Qb&4eueh@8(ZwoKy>qlL2y!vDu z-IuO^0^NxaZ-9);tXgL5@iwlU*i$Pfp)Y@PH(Ak@r_nX6J5Ecm%PmaqFpLUd;Cb3B z?3>fxFES)QxPIx&Jc#h-ee-u6R8hO3qu*qQ04vfBU4GiT& zv7;wd4IY{_RbRQ-!{;4IW@m$b+M8u^yL(jLyWNT95;Oud%PkgYb~*a!^tD#pH_lX^ znMIW0p13rAcf75Io>0bfCYS9eKu%hgR`kkoN0%n*ofqTA+oG2F#h;D5jF|xwy^A+u zoI{Pa6M1MHI*?mx%$I#c$OpAr{borA7Q@#I8SLeei?_WctG`*y1V`2W%^mM(nsc*nu|k^`VD?vb8@tE9K$I~pCO^C)SXhpxB$6}j zq}OmqA9ejXoR!Aj=x{yXU`y6DlKhZ35Wu~h=k9fIYOrk-FyYjGv^^W>cwICtNx~1} z;Z>PqPzBYPFQ0W!FIG@39eG`-|7LB7Ax%^O+T9B>0lGa|PdDQBlS%n+v$#eZZQ5_W z7PVJCgH65*8WxejDHgc#Cq`I$q{xw`I4+q$bLD>4o;)I%f`500EabwrZ;;^Ts;IzA z0V{!vYE^WbD9cyQOVvqeV@>-7?4mUvU&F=M-YF{ts8gKjO$cdWKn9NKj5@96F1(TX z%_7O$K+?gi1)jZcku6*KK8gbr-0%CssR%XCZkd3(B<@eSm+!cYz&(7yJ=lErSy*ET zGBApnFXt#g@WoPri+6#J^Dn$)J=h`nWkr!G2khJ3h`5`+?`5Miw zqE2;5xT9}6m>GSXx>B3d?5gu|10QFFH)SIIH^t9`G79#Cp*AacUR+*4z2EK|CWBA|Fx&Zv*k`S@B^9SKLy+v7|wtGL1UAx8+zb!jcaNUbNv%pb}LS z_T&JGhk|f6IeSD?nrew_L|t}4^b4o&r|_?`v9kDtyqcuTE_h$4ujNws?DhaZOpbjE z%YpYZVNJYA<&r0#d#oVk#hs%nCA1=%(Mwy`(X0Kbvnl#t?ULC&XeaQm$h8}D0sYK> z^iWt>#d?3`0+>Y`1q*#Mnfxs%lCOq6383n)^&mx60CZyl0~9O$KWkqVeQe!WGN4cS zYiJ;!-+_QIvw7C%3A`m+fiJM7&?{7YyIwx~5fVGnr_^izAUnKQ6CIG8{Fd&?F94Oz zX;^$aRPkKM$^&eF07)kGO88-+quuDO;H3N?&;767kD37#ak8w!j!w%^FMVF}Z`v$B zlobjxI@GnVo6lYTzs3C45XO5zsuFHh1_*u;Y1&w}qR;uWLH~F`z6nm%EiZ$`-zMkp zz4qTV%-%rr88$IDim_tXvOBI$l>S@){@0W5Ad^w@x%@2zE|mW55sFlw9fWa;PZW1V z=6|d@|5d^tKUQAr4k3&?eqtbT%l)@r_$=KqCnKF8mbBqsX85l%!tfX2zN*GC!w7Z| zW9a|dS2mDf5iXYEfMtF9%)k1nf+{96Wq3Z_?p>Y6+U4~ZdFGv#X+EU3)dyOdEXvcH zT)MV4zKuTq-yr>SueQYbAXhPoKg-enYEoF#3y>hoJ1?=&-GPnmb&XFTsP|&E9Qi*X zNwSn)Nqvi3`%!l3q! z5~gB|MSJ=$e|^E4+y_?>1(YExN8(M)j|uI%F7sxC=eBZ(s+%g1nm$1xj+us@#b45I z6jbB8hCWWi+nWE=@y!N)#n>NuQ-Lw`6%~x7MsN&l$?qc&AdsTaRsW==Bwu?isL03# znGEO|V~C%Wvh>ClgTs@m8J$ILz3%Tm6EEArTuZ*kF~I8%Pl^?ifn)K1cuY5>nM`J@ zUVzn=*6(HGJL55Y5*_;K(0>l?-D_ZE^rOUmMmi$lX4}fT3y_{ScvzmQbxNnZEXly; z9*i^dNv9u~;<<|?PS;AOzvN6cGo=-3%d=-%md3jKM9;KLqb<4H$FHnY`lme3nvMB= zVjE@I9}`5Hgp>0lM*s-s4KjuN8#vucJwy&BX?evnIF4hMWeZ%^^>ShF7=Rxp0-YeZ zqNR5X12;lJ<`5#x;jMQwB>NDfD+e$PyBu7hE$xon1QJH{45Hpw#>~eJFwn!LX{FE3 z+LIWJWG1@v@otjxJH6b^OKu_HtxcPvyN~q~dQC$^nwVOLFYbt6j|!2=-Tts4^9Z;b zG2W2HNhZY)r_jBPc>go~1Z-dH1|WupO4J%HLff5`Wxe~VA@AanEG7sALQZ>U4KUuZ zO08}mY0T8sxxT73XQIV@F1FlHR0>+uMY*24OrxgUBCoUhmHtNAhlpBA-XN+^u4k0% zO0ms@)2!PIg&!mxDlt&&HpCTLq%}WBC_N272{)Lm3JD2QVvA}rJeBHGBq-6oY_a>9y#r< z6*WtQd=R?rvA&`|mi~{OQpCbs5m9F54f1Bc7s>yezK@ECFta@eSPamX2SC!4ZZn98I|7ID(|7_LPu)kH6O9V?z) zUl*zIKS;x4Gsf8f$!bUR)mg~t-DfHMa>3n(7nkSG49Mr(%xdwE)lJv-R^nL%Yq9djCsxkRZ47agHZlEiS(ktCrI)$rqi9#Ge

G40^sJXEm_&YvwcEgy6)gr=A{>xo?)iuoN-a54zuuXJmq- z3G#MYVKhzIR%(?WYp%*TwjY~9%859W@2-x9ZMEgv!ENy*{pw8~n3sE*?&_+L^?DOn zq3BJqErT{*4Rncb`??18epW#_*c>Z!wRpo2*MG44OfgB@g25mp{d&|disqa)gN0q* zI?{%co-E_U-#4S=nsYHSJ|5%lT5)8&6ADIa^_}&sq<^rM1VAtr0Kn3OjJ{P7H`tMX z(W$T1;Rz~woEV^5bmE*eH3zS3YckUpW*_F#Me z%Jy5m=B{BL=nvL^tk^cbu*sdDetk($+hG<`2<66KX_(pIRsoC@&iEbWWkEAxvNSy^rgx02)x0Iml^yx z{DiBsT!-`D;ww+4E43}F!Z~rpzN)j@exFSpk?ZYMkTiS6C_E@xYPt?x>$;D08qDz) zY87Lf*t9dARwMC^GM!j35@Ajpf$_e!Ru5lat@^thGCGIcsgqZ}QoFly2a9c~x%FTP z-%ix{luRMspe5N((p9^PpEa*vw4O$v2^f1 zhjpYPEyOdlc*cGh!bu)&+imyJ)FduSiI0bQ-rcNgts(to@p|tPxifcaVE0fOTfuD2 zwmg8*njFqKUX0AiTpT84$?M9K5c1l^2kCgi&?mD*0!kV&{?i1^J6ufOnw;5?DLzEf>+kE94qVZJhh?^Bg|3G1A6(qI>CPo(WeZ8>3y~loAX=2jg^dV1k&PgA zIbjbX;nq0fTty+F{fxFy7gmU!Ok2|F$!8>|XY@nU-X=o?*s5jI%EG+7gXyP(qQgJi zw%50lq>Vg>Q=IE{0WUHTgwEvb_%r{2hlj`UMz_-a(RoN<4 zSP=pWP?)BR@f=xWVzaSYzB-Fp&2oHpGw}*OXJYu!sc@!e;Qn=s=V1ai4HJ|61FPvm zNE8t-kf`%f2I}rQuRo;HKJ)ElqupliOuO?k9gm#u(5w6ci#xGDoVBo+7e-KDXKDf= zA8yU{QMZKSuA~LDlgswA9V73mF~1q>nEkoRW2gDx^1NP*F7gtT!JEp2xzo z=MI*+|C9)8FjYQJEt#_}n^71=I46$*ADJybheI73)KRF}SRH`N*Go=LenOW+f_l(_ z1evKzMBcT8^Aj8z77^cRtf|>jRXAacRxA`~mph3ENuythff!aE38%{|NIhbjnV@@+ z(+=zEi$qE%$U@m%JDe_&&s0=x#*L3&PEPzmJE@!yYYMXu98Y}BCPeloR30AkC2WIa z+*?TLXK8w|n+bUVS5n9-fs=hbScctcC#|M3E-SFO+R!Cv8RG8Y9G6wUH_72UCRx50 zDdK}Xqg*DB1WFmv%BF$$V_g`L+X+$U<2mE`Zq$4)aBqU2=1s8tZJmlvJcr22{&Anz zi06+LWdejB*{J1=q#|;$!u|Svu5kaVa>!B-NHZR(~2P!s+alibadv` z+N-d#73(BzF{(;_O&=Vn#Gv;xCeWpsv4&5SS6n)U2O|-33V!^el#75R@^CU?Jej9K zH87uBP`cyW-1lSrGcy0}XJ|x@H>Qu@Y;d)_c3+&LqoWUUe@@t3?8dWEm)hwaQyJT< z!{;bRcr((K4Sl(9vy`Y%Q^;9VXEPw#wEqpCT((=3LGo9YJI0;+cx8B z6cA+jxKTDStW-A>88B4BFSY^w)&r<=g^p@{1ajWCepyaqiqV*Kq;(C`4-ZzEbS9%|fbO*Cl=E$uld!SiMlZT<{ev%qWYdHP}Z)CUg#pv%(F%Z1PZgpSmyw)9) z=Eu!`LKYe^SEm20NwsR9WJ|SXgq^EDT{m537V0G}3(zJ#3Vrxs*aMU3dUZS= zvE;VSmidS-Fv53E-g>&l&3ZXudQrh`t?wP%GO=uWYJSHZg1#-PR_nh{b)Y*lXBg4Z zZ@BuED%}~YXx8rNEAB6k-$xHg2ww-Uw}Lw>Cm%kxn0VEJXaGQH14rG7Qfw-kpsA^$kV)O&zye1;U<<74c}DIsD-dRRsgY zEv{N?8TwRqBP~H(p7lQUZ!ha9%T{g&#EuPl1qRB9$%Q&TiN3&Ky*@Ohu_tn$piZ&G zAi$vWmqa&i=i@E5FS?QGqpR#-r7gt)CY6i(im_$#DyG`Fvyew)|`th?itwX zJSDslfmlzQzRwdfMR$Cs^5-#JpoH9~yc93o2f^WnH7ZHFOuI(A&4d>Jw-tOq>qv5; zwhKB!-nsNWfq@?EXmYGFI$yz)5@zB!H`XFnee((0%w)P!I0+Th$+!@K(hKXSi(D`k zsmk~v;Z1@q4fGMpl=yu}EG2%rFl+$vaAaqr#NbR{UsleM7MCP$gcdGQ|Lf?6cdmj2 zw-ST-yNF^WHXMF8{wgHl{;C{B`lGL#>Br`kC+0ToO}oD=Z@BDjd>9CKy$Yk#Pp=$+ zazZS{)J{aIKB0=dG+PU{pFy;odprH`n&_c&0cpz@<|t>AR(awAmt_-=d4NnzZgiDQ z%!N`9;c(g8r|tIcso46sd~K;-&ic-^^HmDH!1iJar81UKUMJnNcK%hM&t^YT0psEoIOVWfX3*zyr)OjIe%$c!1h6bJkW(Q z9N|BKqton))crBc>-rwECpM~AF9NyR?SrW9!tgvaWhVH>6>;f*3|pyJ(FKz>yvdho z-(}o1w6i(&qa^L!n1_dT6mS_~@jqona=;QA69N74Li$U;ZOwN)pR~~2e{?GbQqaf1 zv{&{9lk*va43|z{gXx{=^q?Wrfz>s|iTr-z-^;jyQjEPv6mgr52nbSTb@_;0yc+tq z)5`+`1te2;+5?3HlSQ!(F1sfHKy{GF__bUIlT5gX8K0wpncREG40LChur^z?GS0VJ z=oRxXjS!UnT(jf|BI$p-&>uOUjws<11G@LG_!X)@z#E~MJ7;j7Y7M&a