From 9e8395c69c9d3bd5ae127477b6664f39d7a60924 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Wed, 19 Aug 2020 09:29:37 +0200 Subject: [PATCH] API: Update the APIs for Elasticsearch 7.9 (a479a2a7fce) --- esapi/api._.go | 2 +- esapi/api.clear_scroll.go | 2 +- esapi/api.indices.add_block.go | 2 +- esapi/api.indices.resolve_index.go | 2 +- esapi/api.xpack.indices.create_data_stream.go | 19 ++----------------- 5 files changed, 6 insertions(+), 21 deletions(-) diff --git a/esapi/api._.go b/esapi/api._.go index 670fb181fc..569b24c4e6 100755 --- a/esapi/api._.go +++ b/esapi/api._.go @@ -1,4 +1,4 @@ -// Code generated from specification version 7.9.0 (d48c9bd47be): DO NOT EDIT +// Code generated from specification version 7.9.0 (a479a2a7fce): DO NOT EDIT package esapi diff --git a/esapi/api.clear_scroll.go b/esapi/api.clear_scroll.go index 786589a8b3..a62502c290 100644 --- a/esapi/api.clear_scroll.go +++ b/esapi/api.clear_scroll.go @@ -27,7 +27,7 @@ func newClearScrollFunc(t Transport) ClearScroll { // ClearScroll explicitly clears the search context for a scroll. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#_clear_scroll_api. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-scroll-api.html. // type ClearScroll func(o ...func(*ClearScrollRequest)) (*Response, error) diff --git a/esapi/api.indices.add_block.go b/esapi/api.indices.add_block.go index 0286ce2f10..338a385f6c 100644 --- a/esapi/api.indices.add_block.go +++ b/esapi/api.indices.add_block.go @@ -28,7 +28,7 @@ func newIndicesAddBlockFunc(t Transport) IndicesAddBlock { // IndicesAddBlock adds a block to an index. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-blocks.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html. // type IndicesAddBlock func(index []string, block string, o ...func(*IndicesAddBlockRequest)) (*Response, error) diff --git a/esapi/api.indices.resolve_index.go b/esapi/api.indices.resolve_index.go index 15c092e49c..389d403d20 100644 --- a/esapi/api.indices.resolve_index.go +++ b/esapi/api.indices.resolve_index.go @@ -28,7 +28,7 @@ func newIndicesResolveIndexFunc(t Transport) IndicesResolveIndex { // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index.html. +// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index-api.html. // type IndicesResolveIndex func(name []string, o ...func(*IndicesResolveIndexRequest)) (*Response, error) diff --git a/esapi/api.xpack.indices.create_data_stream.go b/esapi/api.xpack.indices.create_data_stream.go index af801bbe04..aaf927fde2 100644 --- a/esapi/api.xpack.indices.create_data_stream.go +++ b/esapi/api.xpack.indices.create_data_stream.go @@ -8,7 +8,6 @@ package esapi import ( "context" - "io" "net/http" "strings" ) @@ -25,7 +24,7 @@ func newIndicesCreateDataStreamFunc(t Transport) IndicesCreateDataStream { // ----- API Definition ------------------------------------------------------- -// IndicesCreateDataStream - Creates or updates a data stream +// IndicesCreateDataStream - Creates a data stream // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. // @@ -34,8 +33,6 @@ type IndicesCreateDataStream func(name string, o ...func(*IndicesCreateDataStrea // IndicesCreateDataStreamRequest configures the Indices Create Data Stream API request. // type IndicesCreateDataStreamRequest struct { - Body io.Reader - Name string Pretty bool @@ -83,7 +80,7 @@ func (r IndicesCreateDataStreamRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, err := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), nil) if err != nil { return nil, err } @@ -96,10 +93,6 @@ func (r IndicesCreateDataStreamRequest) Do(ctx context.Context, transport Transp 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 @@ -138,14 +131,6 @@ func (f IndicesCreateDataStream) WithContext(v context.Context) func(*IndicesCre } } -// WithBody - The data stream definition. -// -func (f IndicesCreateDataStream) WithBody(v io.Reader) func(*IndicesCreateDataStreamRequest) { - return func(r *IndicesCreateDataStreamRequest) { - r.Body = v - } -} - // WithPretty makes the response body pretty-printed. // func (f IndicesCreateDataStream) WithPretty() func(*IndicesCreateDataStreamRequest) {