diff --git a/esapi/api._.go b/esapi/api._.go index e500c4a4b3..d15b255c81 100755 --- a/esapi/api._.go +++ b/esapi/api._.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -// Code generated from specification version 9.1.0 (9732617): DO NOT EDIT +// Code generated from specification version 9.1.0 (5a59fa7): DO NOT EDIT package esapi @@ -244,6 +244,7 @@ type API struct { TransformPutTransform TransformPutTransform TransformResetTransform TransformResetTransform TransformScheduleNowTransform TransformScheduleNowTransform + TransformSetUpgradeMode TransformSetUpgradeMode TransformStartTransform TransformStartTransform TransformStopTransform TransformStopTransform TransformUpdateTransform TransformUpdateTransform @@ -893,6 +894,7 @@ func New(t Transport) *API { TransformPutTransform: newTransformPutTransformFunc(t), TransformResetTransform: newTransformResetTransformFunc(t), TransformScheduleNowTransform: newTransformScheduleNowTransformFunc(t), + TransformSetUpgradeMode: newTransformSetUpgradeModeFunc(t), TransformStartTransform: newTransformStartTransformFunc(t), TransformStopTransform: newTransformStopTransformFunc(t), TransformUpdateTransform: newTransformUpdateTransformFunc(t), diff --git a/esapi/api.bulk.go b/esapi/api.bulk.go index 12246ca0a4..c191f36c48 100644 --- a/esapi/api.bulk.go +++ b/esapi/api.bulk.go @@ -45,9 +45,9 @@ func newBulkFunc(t Transport) Bulk { // ----- API Definition ------------------------------------------------------- -// Bulk allows to perform multiple index/update/delete operations in a single request. +// Bulk bulk index or delete documents // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk. type Bulk func(body io.Reader, o ...func(*BulkRequest)) (*Response, error) // BulkRequest configures the Bulk API request. @@ -282,7 +282,7 @@ func (f Bulk) WithRefresh(v string) func(*BulkRequest) { } } -// WithRequireAlias - if true, the request’s actions must target an index alias. defaults to false.. +// WithRequireAlias - if true, the request's actions must target an index alias. defaults to false.. func (f Bulk) WithRequireAlias(v bool) func(*BulkRequest) { return func(r *BulkRequest) { r.RequireAlias = &v diff --git a/esapi/api.cat.aliases.go b/esapi/api.cat.aliases.go index 0f4531d37d..07c6083e34 100644 --- a/esapi/api.cat.aliases.go +++ b/esapi/api.cat.aliases.go @@ -44,21 +44,23 @@ func newCatAliasesFunc(t Transport) CatAliases { // ----- API Definition ------------------------------------------------------- -// CatAliases shows information about currently configured aliases to indices including filter and routing infos. +// CatAliases get aliases // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-aliases. type CatAliases func(o ...func(*CatAliasesRequest)) (*Response, error) // CatAliasesRequest configures the Cat Aliases API request. type CatAliasesRequest struct { Name []string - ExpandWildcards string + Bytes string + ExpandWildcards []string Format string H []string Help *bool MasterTimeout time.Duration S []string + Time string V *bool Pretty bool @@ -108,8 +110,12 @@ func (r CatAliasesRequest) Do(providedCtx context.Context, transport Transport) params = make(map[string]string) - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.Format != "" { @@ -132,6 +138,10 @@ func (r CatAliasesRequest) Do(providedCtx context.Context, transport Transport) params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -221,8 +231,15 @@ func (f CatAliases) WithName(v ...string) func(*CatAliasesRequest) { } } +// WithBytes - the unit in which to display byte values. +func (f CatAliases) WithBytes(v string) func(*CatAliasesRequest) { + return func(r *CatAliasesRequest) { + r.Bytes = v + } +} + // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f CatAliases) WithExpandWildcards(v string) func(*CatAliasesRequest) { +func (f CatAliases) WithExpandWildcards(v ...string) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { r.ExpandWildcards = v } @@ -263,6 +280,13 @@ func (f CatAliases) WithS(v ...string) func(*CatAliasesRequest) { } } +// WithTime - the unit in which to display time values. +func (f CatAliases) WithTime(v string) func(*CatAliasesRequest) { + return func(r *CatAliasesRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. func (f CatAliases) WithV(v bool) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { diff --git a/esapi/api.cat.allocation.go b/esapi/api.cat.allocation.go index 3c2b5c1e73..6cfd9ba037 100644 --- a/esapi/api.cat.allocation.go +++ b/esapi/api.cat.allocation.go @@ -44,9 +44,9 @@ func newCatAllocationFunc(t Transport) CatAllocation { // ----- API Definition ------------------------------------------------------- -// CatAllocation provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. +// CatAllocation get shard allocation information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-allocation. type CatAllocation func(o ...func(*CatAllocationRequest)) (*Response, error) // CatAllocationRequest configures the Cat Allocation API request. @@ -60,6 +60,7 @@ type CatAllocationRequest struct { Local *bool MasterTimeout time.Duration S []string + Time string V *bool Pretty bool @@ -137,6 +138,10 @@ func (r CatAllocationRequest) Do(providedCtx context.Context, transport Transpor params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -275,6 +280,13 @@ func (f CatAllocation) WithS(v ...string) func(*CatAllocationRequest) { } } +// WithTime - the unit in which to display time values. +func (f CatAllocation) WithTime(v string) func(*CatAllocationRequest) { + return func(r *CatAllocationRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. func (f CatAllocation) WithV(v bool) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { diff --git a/esapi/api.cat.component_templates.go b/esapi/api.cat.component_templates.go index 1ff1108a5a..4f0d20b8d5 100644 --- a/esapi/api.cat.component_templates.go +++ b/esapi/api.cat.component_templates.go @@ -44,21 +44,23 @@ func newCatComponentTemplatesFunc(t Transport) CatComponentTemplates { // ----- API Definition ------------------------------------------------------- -// CatComponentTemplates returns information about existing component_templates templates. +// CatComponentTemplates get component templates // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-component-templates.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-component-templates. type CatComponentTemplates func(o ...func(*CatComponentTemplatesRequest)) (*Response, error) // CatComponentTemplatesRequest configures the Cat Component Templates API request. type CatComponentTemplatesRequest struct { Name string + Bytes string Format string H []string Help *bool Local *bool MasterTimeout time.Duration S []string + Time string V *bool Pretty bool @@ -108,6 +110,10 @@ func (r CatComponentTemplatesRequest) Do(providedCtx context.Context, transport params = make(map[string]string) + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Format != "" { params["format"] = r.Format } @@ -132,6 +138,10 @@ func (r CatComponentTemplatesRequest) Do(providedCtx context.Context, transport params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -221,6 +231,13 @@ func (f CatComponentTemplates) WithName(v string) func(*CatComponentTemplatesReq } } +// WithBytes - the unit in which to display byte values. +func (f CatComponentTemplates) WithBytes(v string) func(*CatComponentTemplatesRequest) { + return func(r *CatComponentTemplatesRequest) { + r.Bytes = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. func (f CatComponentTemplates) WithFormat(v string) func(*CatComponentTemplatesRequest) { return func(r *CatComponentTemplatesRequest) { @@ -263,6 +280,13 @@ func (f CatComponentTemplates) WithS(v ...string) func(*CatComponentTemplatesReq } } +// WithTime - the unit in which to display time values. +func (f CatComponentTemplates) WithTime(v string) func(*CatComponentTemplatesRequest) { + return func(r *CatComponentTemplatesRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. func (f CatComponentTemplates) WithV(v bool) func(*CatComponentTemplatesRequest) { return func(r *CatComponentTemplatesRequest) { diff --git a/esapi/api.cat.count.go b/esapi/api.cat.count.go index 1fe9cde57c..45eca5e240 100644 --- a/esapi/api.cat.count.go +++ b/esapi/api.cat.count.go @@ -43,19 +43,21 @@ func newCatCountFunc(t Transport) CatCount { // ----- API Definition ------------------------------------------------------- -// CatCount provides quick access to the document count of the entire cluster, or individual indices. +// CatCount get a document count // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-count. type CatCount func(o ...func(*CatCountRequest)) (*Response, error) // CatCountRequest configures the Cat Count API request. type CatCountRequest struct { Index []string + Bytes string Format string H []string Help *bool S []string + Time string V *bool Pretty bool @@ -105,6 +107,10 @@ func (r CatCountRequest) Do(providedCtx context.Context, transport Transport) (* params = make(map[string]string) + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Format != "" { params["format"] = r.Format } @@ -121,6 +127,10 @@ func (r CatCountRequest) Do(providedCtx context.Context, transport Transport) (* params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -210,6 +220,13 @@ func (f CatCount) WithIndex(v ...string) func(*CatCountRequest) { } } +// WithBytes - the unit in which to display byte values. +func (f CatCount) WithBytes(v string) func(*CatCountRequest) { + return func(r *CatCountRequest) { + r.Bytes = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. func (f CatCount) WithFormat(v string) func(*CatCountRequest) { return func(r *CatCountRequest) { @@ -238,6 +255,13 @@ func (f CatCount) WithS(v ...string) func(*CatCountRequest) { } } +// WithTime - the unit in which to display time values. +func (f CatCount) WithTime(v string) func(*CatCountRequest) { + return func(r *CatCountRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. func (f CatCount) WithV(v bool) func(*CatCountRequest) { return func(r *CatCountRequest) { diff --git a/esapi/api.cat.fielddata.go b/esapi/api.cat.fielddata.go index 6189777d64..40b8739b0e 100644 --- a/esapi/api.cat.fielddata.go +++ b/esapi/api.cat.fielddata.go @@ -43,9 +43,9 @@ func newCatFielddataFunc(t Transport) CatFielddata { // ----- API Definition ------------------------------------------------------- -// CatFielddata shows how much heap memory is currently being used by fielddata on every data node in the cluster. +// CatFielddata get field data cache information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-fielddata. type CatFielddata func(o ...func(*CatFielddataRequest)) (*Response, error) // CatFielddataRequest configures the Cat Fielddata API request. @@ -57,6 +57,7 @@ type CatFielddataRequest struct { H []string Help *bool S []string + Time string V *bool Pretty bool @@ -130,6 +131,10 @@ func (r CatFielddataRequest) Do(providedCtx context.Context, transport Transport params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -254,6 +259,13 @@ func (f CatFielddata) WithS(v ...string) func(*CatFielddataRequest) { } } +// WithTime - the unit in which to display time values. +func (f CatFielddata) WithTime(v string) func(*CatFielddataRequest) { + return func(r *CatFielddataRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. func (f CatFielddata) WithV(v bool) func(*CatFielddataRequest) { return func(r *CatFielddataRequest) { diff --git a/esapi/api.cat.health.go b/esapi/api.cat.health.go index 9b8404b01b..872b111a0e 100644 --- a/esapi/api.cat.health.go +++ b/esapi/api.cat.health.go @@ -43,13 +43,14 @@ func newCatHealthFunc(t Transport) CatHealth { // ----- API Definition ------------------------------------------------------- -// CatHealth returns a concise representation of the cluster health. +// CatHealth get the cluster health status // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-health. type CatHealth func(o ...func(*CatHealthRequest)) (*Response, error) // CatHealthRequest configures the Cat Health API request. type CatHealthRequest struct { + Bytes string Format string H []string Help *bool @@ -95,6 +96,10 @@ func (r CatHealthRequest) Do(providedCtx context.Context, transport Transport) ( params = make(map[string]string) + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Format != "" { params["format"] = r.Format } @@ -201,6 +206,13 @@ func (f CatHealth) WithContext(v context.Context) func(*CatHealthRequest) { } } +// WithBytes - the unit in which to display byte values. +func (f CatHealth) WithBytes(v string) func(*CatHealthRequest) { + return func(r *CatHealthRequest) { + r.Bytes = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. func (f CatHealth) WithFormat(v string) func(*CatHealthRequest) { return func(r *CatHealthRequest) { diff --git a/esapi/api.cat.help.go b/esapi/api.cat.help.go index 29e795c5e4..de9b98ccb5 100644 --- a/esapi/api.cat.help.go +++ b/esapi/api.cat.help.go @@ -42,9 +42,9 @@ func newCatHelpFunc(t Transport) CatHelp { // ----- API Definition ------------------------------------------------------- -// CatHelp returns help for the Cat APIs. +// CatHelp get CAT help // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-cat. type CatHelp func(o ...func(*CatHelpRequest)) (*Response, error) // CatHelpRequest configures the Cat Help API request. diff --git a/esapi/api.cat.indices.go b/esapi/api.cat.indices.go index a4743da5e1..5d6b5d0661 100644 --- a/esapi/api.cat.indices.go +++ b/esapi/api.cat.indices.go @@ -44,9 +44,9 @@ func newCatIndicesFunc(t Transport) CatIndices { // ----- API Definition ------------------------------------------------------- -// CatIndices returns information about indices: number of primaries and replicas, document counts, disk size, ... +// CatIndices get index information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-indices. type CatIndices func(o ...func(*CatIndicesRequest)) (*Response, error) // CatIndicesRequest configures the Cat Indices API request. @@ -54,7 +54,7 @@ type CatIndicesRequest struct { Index []string Bytes string - ExpandWildcards string + ExpandWildcards []string Format string H []string Health string @@ -117,8 +117,8 @@ func (r CatIndicesRequest) Do(providedCtx context.Context, transport Transport) params["bytes"] = r.Bytes } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.Format != "" { @@ -254,7 +254,7 @@ func (f CatIndices) WithBytes(v string) func(*CatIndicesRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f CatIndices) WithExpandWildcards(v string) func(*CatIndicesRequest) { +func (f CatIndices) WithExpandWildcards(v ...string) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.cat.master.go b/esapi/api.cat.master.go index 689f3af12d..c83f2738eb 100644 --- a/esapi/api.cat.master.go +++ b/esapi/api.cat.master.go @@ -44,19 +44,21 @@ func newCatMasterFunc(t Transport) CatMaster { // ----- API Definition ------------------------------------------------------- -// CatMaster returns information about the master node. +// CatMaster get master node information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-master. type CatMaster func(o ...func(*CatMasterRequest)) (*Response, error) // CatMasterRequest configures the Cat Master API request. type CatMasterRequest struct { + Bytes string Format string H []string Help *bool Local *bool MasterTimeout time.Duration S []string + Time string V *bool Pretty bool @@ -96,6 +98,10 @@ func (r CatMasterRequest) Do(providedCtx context.Context, transport Transport) ( params = make(map[string]string) + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Format != "" { params["format"] = r.Format } @@ -120,6 +126,10 @@ func (r CatMasterRequest) Do(providedCtx context.Context, transport Transport) ( params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -202,6 +212,13 @@ func (f CatMaster) WithContext(v context.Context) func(*CatMasterRequest) { } } +// WithBytes - the unit in which to display byte values. +func (f CatMaster) WithBytes(v string) func(*CatMasterRequest) { + return func(r *CatMasterRequest) { + r.Bytes = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. func (f CatMaster) WithFormat(v string) func(*CatMasterRequest) { return func(r *CatMasterRequest) { @@ -244,6 +261,13 @@ func (f CatMaster) WithS(v ...string) func(*CatMasterRequest) { } } +// WithTime - the unit in which to display time values. +func (f CatMaster) WithTime(v string) func(*CatMasterRequest) { + return func(r *CatMasterRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. func (f CatMaster) WithV(v bool) func(*CatMasterRequest) { return func(r *CatMasterRequest) { diff --git a/esapi/api.cat.nodeattrs.go b/esapi/api.cat.nodeattrs.go index 4df967aea5..01faa3f15f 100644 --- a/esapi/api.cat.nodeattrs.go +++ b/esapi/api.cat.nodeattrs.go @@ -44,19 +44,21 @@ func newCatNodeattrsFunc(t Transport) CatNodeattrs { // ----- API Definition ------------------------------------------------------- -// CatNodeattrs returns information about custom node attributes. +// CatNodeattrs get node attribute information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-nodeattrs. type CatNodeattrs func(o ...func(*CatNodeattrsRequest)) (*Response, error) // CatNodeattrsRequest configures the Cat Nodeattrs API request. type CatNodeattrsRequest struct { + Bytes string Format string H []string Help *bool Local *bool MasterTimeout time.Duration S []string + Time string V *bool Pretty bool @@ -96,6 +98,10 @@ func (r CatNodeattrsRequest) Do(providedCtx context.Context, transport Transport params = make(map[string]string) + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Format != "" { params["format"] = r.Format } @@ -120,6 +126,10 @@ func (r CatNodeattrsRequest) Do(providedCtx context.Context, transport Transport params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -202,6 +212,13 @@ func (f CatNodeattrs) WithContext(v context.Context) func(*CatNodeattrsRequest) } } +// WithBytes - the unit in which to display byte values. +func (f CatNodeattrs) WithBytes(v string) func(*CatNodeattrsRequest) { + return func(r *CatNodeattrsRequest) { + r.Bytes = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. func (f CatNodeattrs) WithFormat(v string) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { @@ -244,6 +261,13 @@ func (f CatNodeattrs) WithS(v ...string) func(*CatNodeattrsRequest) { } } +// WithTime - the unit in which to display time values. +func (f CatNodeattrs) WithTime(v string) func(*CatNodeattrsRequest) { + return func(r *CatNodeattrsRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. func (f CatNodeattrs) WithV(v bool) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { diff --git a/esapi/api.cat.nodes.go b/esapi/api.cat.nodes.go index 54aedcefa3..d3bac1c75c 100644 --- a/esapi/api.cat.nodes.go +++ b/esapi/api.cat.nodes.go @@ -44,9 +44,9 @@ func newCatNodesFunc(t Transport) CatNodes { // ----- API Definition ------------------------------------------------------- -// CatNodes returns basic statistics about performance of cluster nodes. +// CatNodes get node information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-nodes. type CatNodes func(o ...func(*CatNodesRequest)) (*Response, error) // CatNodesRequest configures the Cat Nodes API request. diff --git a/esapi/api.cat.pending_tasks.go b/esapi/api.cat.pending_tasks.go index be63a93be1..70c0a09f0d 100644 --- a/esapi/api.cat.pending_tasks.go +++ b/esapi/api.cat.pending_tasks.go @@ -44,13 +44,14 @@ func newCatPendingTasksFunc(t Transport) CatPendingTasks { // ----- API Definition ------------------------------------------------------- -// CatPendingTasks returns a concise representation of the cluster pending tasks. +// CatPendingTasks get pending task information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-pending-tasks. type CatPendingTasks func(o ...func(*CatPendingTasksRequest)) (*Response, error) // CatPendingTasksRequest configures the Cat Pending Tasks API request. type CatPendingTasksRequest struct { + Bytes string Format string H []string Help *bool @@ -97,6 +98,10 @@ func (r CatPendingTasksRequest) Do(providedCtx context.Context, transport Transp params = make(map[string]string) + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Format != "" { params["format"] = r.Format } @@ -207,6 +212,13 @@ func (f CatPendingTasks) WithContext(v context.Context) func(*CatPendingTasksReq } } +// WithBytes - the unit in which to display byte values. +func (f CatPendingTasks) WithBytes(v string) func(*CatPendingTasksRequest) { + return func(r *CatPendingTasksRequest) { + r.Bytes = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. func (f CatPendingTasks) WithFormat(v string) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { diff --git a/esapi/api.cat.plugins.go b/esapi/api.cat.plugins.go index 19d3a84bc6..3044485a7c 100644 --- a/esapi/api.cat.plugins.go +++ b/esapi/api.cat.plugins.go @@ -44,13 +44,14 @@ func newCatPluginsFunc(t Transport) CatPlugins { // ----- API Definition ------------------------------------------------------- -// CatPlugins returns information about installed plugins across nodes node. +// CatPlugins get plugin information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-plugins. type CatPlugins func(o ...func(*CatPluginsRequest)) (*Response, error) // CatPluginsRequest configures the Cat Plugins API request. type CatPluginsRequest struct { + Bytes string Format string H []string Help *bool @@ -58,6 +59,7 @@ type CatPluginsRequest struct { Local *bool MasterTimeout time.Duration S []string + Time string V *bool Pretty bool @@ -97,6 +99,10 @@ func (r CatPluginsRequest) Do(providedCtx context.Context, transport Transport) params = make(map[string]string) + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Format != "" { params["format"] = r.Format } @@ -125,6 +131,10 @@ func (r CatPluginsRequest) Do(providedCtx context.Context, transport Transport) params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -207,6 +217,13 @@ func (f CatPlugins) WithContext(v context.Context) func(*CatPluginsRequest) { } } +// WithBytes - the unit in which to display byte values. +func (f CatPlugins) WithBytes(v string) func(*CatPluginsRequest) { + return func(r *CatPluginsRequest) { + r.Bytes = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. func (f CatPlugins) WithFormat(v string) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { @@ -256,6 +273,13 @@ func (f CatPlugins) WithS(v ...string) func(*CatPluginsRequest) { } } +// WithTime - the unit in which to display time values. +func (f CatPlugins) WithTime(v string) func(*CatPluginsRequest) { + return func(r *CatPluginsRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. func (f CatPlugins) WithV(v bool) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { diff --git a/esapi/api.cat.recovery.go b/esapi/api.cat.recovery.go index 405edb5259..48e83deb2b 100644 --- a/esapi/api.cat.recovery.go +++ b/esapi/api.cat.recovery.go @@ -43,9 +43,9 @@ func newCatRecoveryFunc(t Transport) CatRecovery { // ----- API Definition ------------------------------------------------------- -// CatRecovery returns information about index shard recoveries, both on-going completed. +// CatRecovery get shard recovery information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-recovery. type CatRecovery func(o ...func(*CatRecoveryRequest)) (*Response, error) // CatRecoveryRequest configures the Cat Recovery API request. diff --git a/esapi/api.cat.repositories.go b/esapi/api.cat.repositories.go index 4377f097c7..caddc1c699 100644 --- a/esapi/api.cat.repositories.go +++ b/esapi/api.cat.repositories.go @@ -44,19 +44,21 @@ func newCatRepositoriesFunc(t Transport) CatRepositories { // ----- API Definition ------------------------------------------------------- -// CatRepositories returns information about snapshot repositories registered in the cluster. +// CatRepositories get snapshot repository information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-repositories. type CatRepositories func(o ...func(*CatRepositoriesRequest)) (*Response, error) // CatRepositoriesRequest configures the Cat Repositories API request. type CatRepositoriesRequest struct { + Bytes string Format string H []string Help *bool Local *bool MasterTimeout time.Duration S []string + Time string V *bool Pretty bool @@ -96,6 +98,10 @@ func (r CatRepositoriesRequest) Do(providedCtx context.Context, transport Transp params = make(map[string]string) + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Format != "" { params["format"] = r.Format } @@ -120,6 +126,10 @@ func (r CatRepositoriesRequest) Do(providedCtx context.Context, transport Transp params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -202,6 +212,13 @@ func (f CatRepositories) WithContext(v context.Context) func(*CatRepositoriesReq } } +// WithBytes - the unit in which to display byte values. +func (f CatRepositories) WithBytes(v string) func(*CatRepositoriesRequest) { + return func(r *CatRepositoriesRequest) { + r.Bytes = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. func (f CatRepositories) WithFormat(v string) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { @@ -244,6 +261,13 @@ func (f CatRepositories) WithS(v ...string) func(*CatRepositoriesRequest) { } } +// WithTime - the unit in which to display time values. +func (f CatRepositories) WithTime(v string) func(*CatRepositoriesRequest) { + return func(r *CatRepositoriesRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. func (f CatRepositories) WithV(v bool) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { diff --git a/esapi/api.cat.segments.go b/esapi/api.cat.segments.go index bf7c801c7d..a77cd36ac7 100644 --- a/esapi/api.cat.segments.go +++ b/esapi/api.cat.segments.go @@ -44,23 +44,29 @@ func newCatSegmentsFunc(t Transport) CatSegments { // ----- API Definition ------------------------------------------------------- -// CatSegments provides low-level information about the segments in the shards of an index. +// CatSegments get segment information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-segments. type CatSegments func(o ...func(*CatSegmentsRequest)) (*Response, error) // CatSegmentsRequest configures the Cat Segments API request. type CatSegmentsRequest struct { Index []string - Bytes string - Format string - H []string - Help *bool - Local *bool - MasterTimeout time.Duration - S []string - V *bool + AllowClosed *bool + AllowNoIndices *bool + Bytes string + ExpandWildcards []string + Format string + H []string + Help *bool + IgnoreThrottled *bool + IgnoreUnavailable *bool + Local *bool + MasterTimeout time.Duration + S []string + Time string + V *bool Pretty bool Human bool @@ -109,10 +115,22 @@ func (r CatSegmentsRequest) Do(providedCtx context.Context, transport Transport) params = make(map[string]string) + if r.AllowClosed != nil { + params["allow_closed"] = strconv.FormatBool(*r.AllowClosed) + } + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + if r.Bytes != "" { params["bytes"] = r.Bytes } + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") + } + if r.Format != "" { params["format"] = r.Format } @@ -125,6 +143,14 @@ func (r CatSegmentsRequest) Do(providedCtx context.Context, transport Transport) params["help"] = strconv.FormatBool(*r.Help) } + if r.IgnoreThrottled != nil { + params["ignore_throttled"] = strconv.FormatBool(*r.IgnoreThrottled) + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + if r.Local != nil { params["local"] = strconv.FormatBool(*r.Local) } @@ -137,6 +163,10 @@ func (r CatSegmentsRequest) Do(providedCtx context.Context, transport Transport) params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -226,6 +256,20 @@ func (f CatSegments) WithIndex(v ...string) func(*CatSegmentsRequest) { } } +// WithAllowClosed - if true, allow closed indices to be returned in the response otherwise if false, keep the legacy behaviour of throwing an exception if index pattern matches closed indices. +func (f CatSegments) WithAllowClosed(v bool) func(*CatSegmentsRequest) { + return func(r *CatSegmentsRequest) { + r.AllowClosed = &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). only allowed when providing an index expression.. +func (f CatSegments) WithAllowNoIndices(v bool) func(*CatSegmentsRequest) { + return func(r *CatSegmentsRequest) { + r.AllowNoIndices = &v + } +} + // WithBytes - the unit in which to display byte values. func (f CatSegments) WithBytes(v string) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { @@ -233,6 +277,13 @@ func (f CatSegments) WithBytes(v string) func(*CatSegmentsRequest) { } } +// WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. +func (f CatSegments) WithExpandWildcards(v ...string) func(*CatSegmentsRequest) { + return func(r *CatSegmentsRequest) { + r.ExpandWildcards = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. func (f CatSegments) WithFormat(v string) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { @@ -254,6 +305,20 @@ func (f CatSegments) WithHelp(v bool) func(*CatSegmentsRequest) { } } +// WithIgnoreThrottled - whether specified concrete, expanded or aliased indices should be ignored when throttled. only allowed when providing an index expression.. +func (f CatSegments) WithIgnoreThrottled(v bool) func(*CatSegmentsRequest) { + return func(r *CatSegmentsRequest) { + r.IgnoreThrottled = &v + } +} + +// WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed). only allowed when providing an index expression.. +func (f CatSegments) WithIgnoreUnavailable(v bool) func(*CatSegmentsRequest) { + return func(r *CatSegmentsRequest) { + r.IgnoreUnavailable = &v + } +} + // WithLocal - return local information, do not retrieve the state from master node (default: false). func (f CatSegments) WithLocal(v bool) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { @@ -275,6 +340,13 @@ func (f CatSegments) WithS(v ...string) func(*CatSegmentsRequest) { } } +// WithTime - the unit in which to display time values. +func (f CatSegments) WithTime(v string) func(*CatSegmentsRequest) { + return func(r *CatSegmentsRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. func (f CatSegments) WithV(v bool) func(*CatSegmentsRequest) { return func(r *CatSegmentsRequest) { diff --git a/esapi/api.cat.shards.go b/esapi/api.cat.shards.go index c993738a89..80d0e1982d 100644 --- a/esapi/api.cat.shards.go +++ b/esapi/api.cat.shards.go @@ -44,9 +44,9 @@ func newCatShardsFunc(t Transport) CatShards { // ----- API Definition ------------------------------------------------------- -// CatShards provides a detailed view of shard allocation on nodes. +// CatShards get shard information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-shards. type CatShards func(o ...func(*CatShardsRequest)) (*Response, error) // CatShardsRequest configures the Cat Shards API request. diff --git a/esapi/api.cat.snapshots.go b/esapi/api.cat.snapshots.go index 33784c5476..82b6a0cc77 100644 --- a/esapi/api.cat.snapshots.go +++ b/esapi/api.cat.snapshots.go @@ -44,15 +44,16 @@ func newCatSnapshotsFunc(t Transport) CatSnapshots { // ----- API Definition ------------------------------------------------------- -// CatSnapshots returns all snapshots in a specific repository. +// CatSnapshots get snapshot information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-snapshots. type CatSnapshots func(o ...func(*CatSnapshotsRequest)) (*Response, error) // CatSnapshotsRequest configures the Cat Snapshots API request. type CatSnapshotsRequest struct { Repository []string + Bytes string Format string H []string Help *bool @@ -109,6 +110,10 @@ func (r CatSnapshotsRequest) Do(providedCtx context.Context, transport Transport params = make(map[string]string) + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Format != "" { params["format"] = r.Format } @@ -226,6 +231,13 @@ func (f CatSnapshots) WithRepository(v ...string) func(*CatSnapshotsRequest) { } } +// WithBytes - the unit in which to display byte values. +func (f CatSnapshots) WithBytes(v string) func(*CatSnapshotsRequest) { + return func(r *CatSnapshotsRequest) { + r.Bytes = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. func (f CatSnapshots) WithFormat(v string) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { diff --git a/esapi/api.cat.tasks.go b/esapi/api.cat.tasks.go index 58fb197a54..9905068144 100644 --- a/esapi/api.cat.tasks.go +++ b/esapi/api.cat.tasks.go @@ -44,16 +44,17 @@ func newCatTasksFunc(t Transport) CatTasks { // ----- API Definition ------------------------------------------------------- -// CatTasks returns information about the tasks currently executing on one or more nodes in the cluster. +// CatTasks get task information // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-tasks. type CatTasks func(o ...func(*CatTasksRequest)) (*Response, error) // CatTasksRequest configures the Cat Tasks API request. type CatTasksRequest struct { Actions []string + Bytes string Detailed *bool Format string H []string @@ -107,6 +108,10 @@ func (r CatTasksRequest) Do(providedCtx context.Context, transport Transport) (* params["actions"] = strings.Join(r.Actions, ",") } + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Detailed != nil { params["detailed"] = strconv.FormatBool(*r.Detailed) } @@ -236,6 +241,13 @@ func (f CatTasks) WithActions(v ...string) func(*CatTasksRequest) { } } +// WithBytes - the unit in which to display byte values. +func (f CatTasks) WithBytes(v string) func(*CatTasksRequest) { + return func(r *CatTasksRequest) { + r.Bytes = v + } +} + // WithDetailed - return detailed task information (default: false). func (f CatTasks) WithDetailed(v bool) func(*CatTasksRequest) { return func(r *CatTasksRequest) { diff --git a/esapi/api.cat.templates.go b/esapi/api.cat.templates.go index 04c03c64cd..e3e5ab6133 100644 --- a/esapi/api.cat.templates.go +++ b/esapi/api.cat.templates.go @@ -44,21 +44,23 @@ func newCatTemplatesFunc(t Transport) CatTemplates { // ----- API Definition ------------------------------------------------------- -// CatTemplates returns information about existing templates. +// CatTemplates get index template information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-templates. type CatTemplates func(o ...func(*CatTemplatesRequest)) (*Response, error) // CatTemplatesRequest configures the Cat Templates API request. type CatTemplatesRequest struct { Name string + Bytes string Format string H []string Help *bool Local *bool MasterTimeout time.Duration S []string + Time string V *bool Pretty bool @@ -108,6 +110,10 @@ func (r CatTemplatesRequest) Do(providedCtx context.Context, transport Transport params = make(map[string]string) + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Format != "" { params["format"] = r.Format } @@ -132,6 +138,10 @@ func (r CatTemplatesRequest) Do(providedCtx context.Context, transport Transport params["s"] = strings.Join(r.S, ",") } + if r.Time != "" { + params["time"] = r.Time + } + if r.V != nil { params["v"] = strconv.FormatBool(*r.V) } @@ -221,6 +231,13 @@ func (f CatTemplates) WithName(v string) func(*CatTemplatesRequest) { } } +// WithBytes - the unit in which to display byte values. +func (f CatTemplates) WithBytes(v string) func(*CatTemplatesRequest) { + return func(r *CatTemplatesRequest) { + r.Bytes = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. func (f CatTemplates) WithFormat(v string) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { @@ -263,6 +280,13 @@ func (f CatTemplates) WithS(v ...string) func(*CatTemplatesRequest) { } } +// WithTime - the unit in which to display time values. +func (f CatTemplates) WithTime(v string) func(*CatTemplatesRequest) { + return func(r *CatTemplatesRequest) { + r.Time = v + } +} + // WithV - verbose mode. display column headers. func (f CatTemplates) WithV(v bool) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { diff --git a/esapi/api.cat.thread_pool.go b/esapi/api.cat.thread_pool.go index 70d18e59d1..2ede17e213 100644 --- a/esapi/api.cat.thread_pool.go +++ b/esapi/api.cat.thread_pool.go @@ -44,16 +44,16 @@ func newCatThreadPoolFunc(t Transport) CatThreadPool { // ----- API Definition ------------------------------------------------------- -// CatThreadPool returns cluster-wide thread pool statistics per node. -// By default the active, queue and rejected statistics are returned for all thread pools. +// CatThreadPool get thread pool statistics // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-thread-pool. type CatThreadPool func(o ...func(*CatThreadPoolRequest)) (*Response, error) // CatThreadPoolRequest configures the Cat Thread Pool API request. type CatThreadPoolRequest struct { ThreadPoolPatterns []string + Bytes string Format string H []string Help *bool @@ -110,6 +110,10 @@ func (r CatThreadPoolRequest) Do(providedCtx context.Context, transport Transpor params = make(map[string]string) + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Format != "" { params["format"] = r.Format } @@ -227,6 +231,13 @@ func (f CatThreadPool) WithThreadPoolPatterns(v ...string) func(*CatThreadPoolRe } } +// WithBytes - the unit in which to display byte values. +func (f CatThreadPool) WithBytes(v string) func(*CatThreadPoolRequest) { + return func(r *CatThreadPoolRequest) { + r.Bytes = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. func (f CatThreadPool) WithFormat(v string) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { diff --git a/esapi/api.clear_scroll.go b/esapi/api.clear_scroll.go index b3a86f7d84..749f09a1e9 100644 --- a/esapi/api.clear_scroll.go +++ b/esapi/api.clear_scroll.go @@ -43,9 +43,9 @@ func newClearScrollFunc(t Transport) ClearScroll { // ----- API Definition ------------------------------------------------------- -// ClearScroll explicitly clears the search context for a scroll. +// ClearScroll clear a scrolling search // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-scroll-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-clear-scroll. type ClearScroll func(o ...func(*ClearScrollRequest)) (*Response, error) // ClearScrollRequest configures the Clear Scroll API request. diff --git a/esapi/api.cluster.allocation_explain.go b/esapi/api.cluster.allocation_explain.go index 8d2f68193c..9757cc27eb 100644 --- a/esapi/api.cluster.allocation_explain.go +++ b/esapi/api.cluster.allocation_explain.go @@ -45,9 +45,9 @@ func newClusterAllocationExplainFunc(t Transport) ClusterAllocationExplain { // ----- API Definition ------------------------------------------------------- -// ClusterAllocationExplain provides explanations for shard allocations in the cluster. +// ClusterAllocationExplain explain the shard allocations // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-allocation-explain. type ClusterAllocationExplain func(o ...func(*ClusterAllocationExplainRequest)) (*Response, error) // ClusterAllocationExplainRequest configures the Cluster Allocation Explain API request. diff --git a/esapi/api.cluster.delete_component_template.go b/esapi/api.cluster.delete_component_template.go index 3c2baed585..4590d2967a 100644 --- a/esapi/api.cluster.delete_component_template.go +++ b/esapi/api.cluster.delete_component_template.go @@ -43,9 +43,9 @@ func newClusterDeleteComponentTemplateFunc(t Transport) ClusterDeleteComponentTe // ----- API Definition ------------------------------------------------------- -// ClusterDeleteComponentTemplate deletes a component template +// ClusterDeleteComponentTemplate delete component templates // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template. type ClusterDeleteComponentTemplate func(name string, o ...func(*ClusterDeleteComponentTemplateRequest)) (*Response, error) // ClusterDeleteComponentTemplateRequest configures the Cluster Delete Component Template API request. diff --git a/esapi/api.cluster.delete_voting_config_exclusions.go b/esapi/api.cluster.delete_voting_config_exclusions.go index 43f7c6103a..d141b53b5f 100644 --- a/esapi/api.cluster.delete_voting_config_exclusions.go +++ b/esapi/api.cluster.delete_voting_config_exclusions.go @@ -44,9 +44,9 @@ func newClusterDeleteVotingConfigExclusionsFunc(t Transport) ClusterDeleteVoting // ----- API Definition ------------------------------------------------------- -// ClusterDeleteVotingConfigExclusions clears cluster voting config exclusions. +// ClusterDeleteVotingConfigExclusions clear cluster voting config exclusions // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-post-voting-config-exclusions. type ClusterDeleteVotingConfigExclusions func(o ...func(*ClusterDeleteVotingConfigExclusionsRequest)) (*Response, error) // ClusterDeleteVotingConfigExclusionsRequest configures the Cluster Delete Voting Config Exclusions API request. diff --git a/esapi/api.cluster.exists_component_template.go b/esapi/api.cluster.exists_component_template.go index 50facc059d..0c4276cfd2 100644 --- a/esapi/api.cluster.exists_component_template.go +++ b/esapi/api.cluster.exists_component_template.go @@ -44,9 +44,9 @@ func newClusterExistsComponentTemplateFunc(t Transport) ClusterExistsComponentTe // ----- API Definition ------------------------------------------------------- -// ClusterExistsComponentTemplate returns information about whether a particular component template exist +// ClusterExistsComponentTemplate check component templates // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template. type ClusterExistsComponentTemplate func(name string, o ...func(*ClusterExistsComponentTemplateRequest)) (*Response, error) // ClusterExistsComponentTemplateRequest configures the Cluster Exists Component Template API request. diff --git a/esapi/api.cluster.get_component_template.go b/esapi/api.cluster.get_component_template.go index 72e7ea4860..4a1670a869 100644 --- a/esapi/api.cluster.get_component_template.go +++ b/esapi/api.cluster.get_component_template.go @@ -44,14 +44,14 @@ func newClusterGetComponentTemplateFunc(t Transport) ClusterGetComponentTemplate // ----- API Definition ------------------------------------------------------- -// ClusterGetComponentTemplate returns one or more component templates +// ClusterGetComponentTemplate get component templates // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template. type ClusterGetComponentTemplate func(o ...func(*ClusterGetComponentTemplateRequest)) (*Response, error) // ClusterGetComponentTemplateRequest configures the Cluster Get Component Template API request. type ClusterGetComponentTemplateRequest struct { - Name []string + Name string FlatSettings *bool IncludeDefaults *bool @@ -90,15 +90,15 @@ func (r ClusterGetComponentTemplateRequest) Do(providedCtx context.Context, tran method = "GET" - path.Grow(7 + 1 + len("_component_template") + 1 + len(strings.Join(r.Name, ","))) + path.Grow(7 + 1 + len("_component_template") + 1 + len(r.Name)) path.WriteString("http://") path.WriteString("/") path.WriteString("_component_template") - if len(r.Name) > 0 { + if r.Name != "" { path.WriteString("/") - path.WriteString(strings.Join(r.Name, ",")) + path.WriteString(r.Name) if instrument, ok := r.Instrument.(Instrumentation); ok { - instrument.RecordPathPart(ctx, "name", strings.Join(r.Name, ",")) + instrument.RecordPathPart(ctx, "name", r.Name) } } @@ -202,8 +202,8 @@ func (f ClusterGetComponentTemplate) WithContext(v context.Context) func(*Cluste } } -// WithName - the comma separated names of the component templates. -func (f ClusterGetComponentTemplate) WithName(v ...string) func(*ClusterGetComponentTemplateRequest) { +// WithName - the name of the component template. wildcard (`*`) expressions are supported.. +func (f ClusterGetComponentTemplate) WithName(v string) func(*ClusterGetComponentTemplateRequest) { return func(r *ClusterGetComponentTemplateRequest) { r.Name = v } diff --git a/esapi/api.cluster.get_settings.go b/esapi/api.cluster.get_settings.go index f50d3ab7d3..9734f377b0 100644 --- a/esapi/api.cluster.get_settings.go +++ b/esapi/api.cluster.get_settings.go @@ -44,9 +44,9 @@ func newClusterGetSettingsFunc(t Transport) ClusterGetSettings { // ----- API Definition ------------------------------------------------------- -// ClusterGetSettings returns cluster settings. +// ClusterGetSettings get cluster-wide settings // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-get-settings.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-get-settings. type ClusterGetSettings func(o ...func(*ClusterGetSettingsRequest)) (*Response, error) // ClusterGetSettingsRequest configures the Cluster Get Settings API request. diff --git a/esapi/api.cluster.health.go b/esapi/api.cluster.health.go index c69ee47469..1430fb4ab2 100644 --- a/esapi/api.cluster.health.go +++ b/esapi/api.cluster.health.go @@ -44,16 +44,16 @@ func newClusterHealthFunc(t Transport) ClusterHealth { // ----- API Definition ------------------------------------------------------- -// ClusterHealth returns basic information about the health of the cluster. +// ClusterHealth get the cluster health status // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-health. type ClusterHealth func(o ...func(*ClusterHealthRequest)) (*Response, error) // ClusterHealthRequest configures the Cluster Health API request. type ClusterHealthRequest struct { Index []string - ExpandWildcards string + ExpandWildcards []string Level string Local *bool MasterTimeout time.Duration @@ -112,8 +112,8 @@ func (r ClusterHealthRequest) Do(providedCtx context.Context, transport Transpor params = make(map[string]string) - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.Level != "" { @@ -242,7 +242,7 @@ 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) { +func (f ClusterHealth) WithExpandWildcards(v ...string) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.cluster.info.go b/esapi/api.cluster.info.go index a0821da150..f27cd6f419 100644 --- a/esapi/api.cluster.info.go +++ b/esapi/api.cluster.info.go @@ -43,9 +43,9 @@ func newClusterInfoFunc(t Transport) ClusterInfo { // ----- API Definition ------------------------------------------------------- -// ClusterInfo returns different information about the cluster. +// ClusterInfo get cluster info // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-info.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-info. type ClusterInfo func(target []string, o ...func(*ClusterInfoRequest)) (*Response, error) // ClusterInfoRequest configures the Cluster Info API request. diff --git a/esapi/api.cluster.pending_tasks.go b/esapi/api.cluster.pending_tasks.go index 5d62db8d92..3bb841818d 100644 --- a/esapi/api.cluster.pending_tasks.go +++ b/esapi/api.cluster.pending_tasks.go @@ -44,10 +44,9 @@ func newClusterPendingTasksFunc(t Transport) ClusterPendingTasks { // ----- API Definition ------------------------------------------------------- -// 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. +// ClusterPendingTasks get the pending cluster tasks // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-pending-tasks. type ClusterPendingTasks func(o ...func(*ClusterPendingTasksRequest)) (*Response, error) // ClusterPendingTasksRequest configures the Cluster Pending Tasks API request. diff --git a/esapi/api.cluster.post_voting_config_exclusions.go b/esapi/api.cluster.post_voting_config_exclusions.go index 91b7ec7f4d..546aa9babe 100644 --- a/esapi/api.cluster.post_voting_config_exclusions.go +++ b/esapi/api.cluster.post_voting_config_exclusions.go @@ -43,9 +43,9 @@ func newClusterPostVotingConfigExclusionsFunc(t Transport) ClusterPostVotingConf // ----- API Definition ------------------------------------------------------- -// ClusterPostVotingConfigExclusions updates the cluster voting config exclusions by node ids or node names. +// ClusterPostVotingConfigExclusions update voting configuration exclusions // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-post-voting-config-exclusions. type ClusterPostVotingConfigExclusions func(o ...func(*ClusterPostVotingConfigExclusionsRequest)) (*Response, error) // ClusterPostVotingConfigExclusionsRequest configures the Cluster Post Voting Config Exclusions API request. diff --git a/esapi/api.cluster.put_component_template.go b/esapi/api.cluster.put_component_template.go index 44885a3e26..9868aaaa50 100644 --- a/esapi/api.cluster.put_component_template.go +++ b/esapi/api.cluster.put_component_template.go @@ -45,9 +45,9 @@ func newClusterPutComponentTemplateFunc(t Transport) ClusterPutComponentTemplate // ----- API Definition ------------------------------------------------------- -// ClusterPutComponentTemplate creates or updates a component template +// ClusterPutComponentTemplate create or update a component template // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template. type ClusterPutComponentTemplate func(name string, body io.Reader, o ...func(*ClusterPutComponentTemplateRequest)) (*Response, error) // ClusterPutComponentTemplateRequest configures the Cluster Put Component Template API request. diff --git a/esapi/api.cluster.put_settings.go b/esapi/api.cluster.put_settings.go index f1ba212710..accaa5f9ec 100644 --- a/esapi/api.cluster.put_settings.go +++ b/esapi/api.cluster.put_settings.go @@ -45,9 +45,9 @@ func newClusterPutSettingsFunc(t Transport) ClusterPutSettings { // ----- API Definition ------------------------------------------------------- -// ClusterPutSettings updates the cluster settings. +// ClusterPutSettings update the cluster settings // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-settings. type ClusterPutSettings func(body io.Reader, o ...func(*ClusterPutSettingsRequest)) (*Response, error) // ClusterPutSettingsRequest configures the Cluster Put Settings API request. diff --git a/esapi/api.cluster.remote_info.go b/esapi/api.cluster.remote_info.go index 00184c9fe1..d6e576c6d9 100644 --- a/esapi/api.cluster.remote_info.go +++ b/esapi/api.cluster.remote_info.go @@ -42,9 +42,9 @@ func newClusterRemoteInfoFunc(t Transport) ClusterRemoteInfo { // ----- API Definition ------------------------------------------------------- -// ClusterRemoteInfo returns the information about configured remote clusters. +// ClusterRemoteInfo get remote cluster information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-remote-info. type ClusterRemoteInfo func(o ...func(*ClusterRemoteInfoRequest)) (*Response, error) // ClusterRemoteInfoRequest configures the Cluster Remote Info API request. diff --git a/esapi/api.cluster.reroute.go b/esapi/api.cluster.reroute.go index b0e8624324..bee4f0b6cb 100644 --- a/esapi/api.cluster.reroute.go +++ b/esapi/api.cluster.reroute.go @@ -45,9 +45,9 @@ func newClusterRerouteFunc(t Transport) ClusterReroute { // ----- API Definition ------------------------------------------------------- -// ClusterReroute allows to manually change the allocation of individual shards in the cluster. +// ClusterReroute reroute the cluster // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-reroute. type ClusterReroute func(o ...func(*ClusterRerouteRequest)) (*Response, error) // ClusterRerouteRequest configures the Cluster Reroute API request. diff --git a/esapi/api.cluster.state.go b/esapi/api.cluster.state.go index bbea2c788e..ce92ff2b67 100644 --- a/esapi/api.cluster.state.go +++ b/esapi/api.cluster.state.go @@ -44,9 +44,9 @@ func newClusterStateFunc(t Transport) ClusterState { // ----- API Definition ------------------------------------------------------- -// ClusterState returns a comprehensive information about the state of the cluster. +// ClusterState get the cluster state // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-state. type ClusterState func(o ...func(*ClusterStateRequest)) (*Response, error) // ClusterStateRequest configures the Cluster State API request. @@ -56,7 +56,7 @@ type ClusterStateRequest struct { Metric []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string FlatSettings *bool IgnoreUnavailable *bool Local *bool @@ -122,8 +122,8 @@ func (r ClusterStateRequest) Do(providedCtx context.Context, transport Transport params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.FlatSettings != nil { @@ -250,7 +250,7 @@ func (f ClusterState) WithAllowNoIndices(v bool) func(*ClusterStateRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f ClusterState) WithExpandWildcards(v string) func(*ClusterStateRequest) { +func (f ClusterState) WithExpandWildcards(v ...string) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.cluster.stats.go b/esapi/api.cluster.stats.go index c4628f8831..4709b7028b 100644 --- a/esapi/api.cluster.stats.go +++ b/esapi/api.cluster.stats.go @@ -44,9 +44,9 @@ func newClusterStatsFunc(t Transport) ClusterStats { // ----- API Definition ------------------------------------------------------- -// ClusterStats returns high-level overview of cluster statistics. +// ClusterStats get cluster statistics // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-stats. type ClusterStats func(o ...func(*ClusterStatsRequest)) (*Response, error) // ClusterStatsRequest configures the Cluster Stats API request. diff --git a/esapi/api.connector.check_in.go b/esapi/api.connector.check_in.go index 75ab402de9..bbb1ad1639 100644 --- a/esapi/api.connector.check_in.go +++ b/esapi/api.connector.check_in.go @@ -42,11 +42,11 @@ func newConnectorCheckInFunc(t Transport) ConnectorCheckIn { // ----- API Definition ------------------------------------------------------- -// ConnectorCheckIn updates the last_seen timestamp in the connector document. +// ConnectorCheckIn check in a connector // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/check-in-connector-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-check-in. type ConnectorCheckIn func(connector_id string, o ...func(*ConnectorCheckInRequest)) (*Response, error) // ConnectorCheckInRequest configures the Connector Check In API request. diff --git a/esapi/api.connector.delete.go b/esapi/api.connector.delete.go index b2110c3714..9d84e36c71 100644 --- a/esapi/api.connector.delete.go +++ b/esapi/api.connector.delete.go @@ -43,11 +43,11 @@ func newConnectorDeleteFunc(t Transport) ConnectorDelete { // ----- API Definition ------------------------------------------------------- -// ConnectorDelete deletes a connector. +// ConnectorDelete delete a connector // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-delete. type ConnectorDelete func(connector_id string, o ...func(*ConnectorDeleteRequest)) (*Response, error) // ConnectorDeleteRequest configures the Connector Delete API request. diff --git a/esapi/api.connector.get.go b/esapi/api.connector.get.go index 7046f1d712..911cdbe840 100644 --- a/esapi/api.connector.get.go +++ b/esapi/api.connector.get.go @@ -43,11 +43,11 @@ func newConnectorGetFunc(t Transport) ConnectorGet { // ----- API Definition ------------------------------------------------------- -// ConnectorGet returns the details about a connector. +// ConnectorGet get a connector // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-get. type ConnectorGet func(connector_id string, o ...func(*ConnectorGetRequest)) (*Response, error) // ConnectorGetRequest configures the Connector Get API request. diff --git a/esapi/api.connector.last_sync.go b/esapi/api.connector.last_sync.go index 7e41ed37aa..ee5ae7d429 100644 --- a/esapi/api.connector.last_sync.go +++ b/esapi/api.connector.last_sync.go @@ -43,11 +43,11 @@ func newConnectorLastSyncFunc(t Transport) ConnectorLastSync { // ----- API Definition ------------------------------------------------------- -// ConnectorLastSync updates the stats of last sync in the connector document. +// ConnectorLastSync update the connector last sync stats // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-last-sync-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-last-sync. type ConnectorLastSync func(body io.Reader, connector_id string, o ...func(*ConnectorLastSyncRequest)) (*Response, error) // ConnectorLastSyncRequest configures the Connector Last Sync API request. diff --git a/esapi/api.connector.list.go b/esapi/api.connector.list.go index d065c08b55..1acae4e102 100644 --- a/esapi/api.connector.list.go +++ b/esapi/api.connector.list.go @@ -43,11 +43,11 @@ func newConnectorListFunc(t Transport) ConnectorList { // ----- API Definition ------------------------------------------------------- -// ConnectorList lists all connectors. +// ConnectorList get all connectors // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-list. type ConnectorList func(o ...func(*ConnectorListRequest)) (*Response, error) // ConnectorListRequest configures the Connector List API request. diff --git a/esapi/api.connector.post.go b/esapi/api.connector.post.go index e1c401b2e0..8fb35de1ab 100644 --- a/esapi/api.connector.post.go +++ b/esapi/api.connector.post.go @@ -43,11 +43,11 @@ func newConnectorPostFunc(t Transport) ConnectorPost { // ----- API Definition ------------------------------------------------------- -// ConnectorPost creates a connector. +// ConnectorPost create a connector // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-put. type ConnectorPost func(o ...func(*ConnectorPostRequest)) (*Response, error) // ConnectorPostRequest configures the Connector Post API request. diff --git a/esapi/api.connector.put.go b/esapi/api.connector.put.go index a8c97406b2..3440d06917 100644 --- a/esapi/api.connector.put.go +++ b/esapi/api.connector.put.go @@ -43,11 +43,11 @@ func newConnectorPutFunc(t Transport) ConnectorPut { // ----- API Definition ------------------------------------------------------- -// ConnectorPut creates or updates a connector. +// ConnectorPut create or update a connector // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-put. type ConnectorPut func(o ...func(*ConnectorPutRequest)) (*Response, error) // ConnectorPutRequest configures the Connector Put API request. diff --git a/esapi/api.connector.secret_delete.go b/esapi/api.connector.secret_delete.go index d35dcc9583..e2b5236f5a 100644 --- a/esapi/api.connector.secret_delete.go +++ b/esapi/api.connector.secret_delete.go @@ -42,7 +42,7 @@ func newConnectorSecretDeleteFunc(t Transport) ConnectorSecretDelete { // ----- API Definition ------------------------------------------------------- -// ConnectorSecretDelete deletes a connector secret. +// ConnectorSecretDelete deletes a connector secret // // This API is experimental. type ConnectorSecretDelete func(id string, o ...func(*ConnectorSecretDeleteRequest)) (*Response, error) diff --git a/esapi/api.connector.secret_get.go b/esapi/api.connector.secret_get.go index c8564455c0..e40801504f 100644 --- a/esapi/api.connector.secret_get.go +++ b/esapi/api.connector.secret_get.go @@ -42,7 +42,7 @@ func newConnectorSecretGetFunc(t Transport) ConnectorSecretGet { // ----- API Definition ------------------------------------------------------- -// ConnectorSecretGet retrieves a secret stored by Connectors. +// ConnectorSecretGet retrieves a secret stored by Connectors // // This API is experimental. type ConnectorSecretGet func(id string, o ...func(*ConnectorSecretGetRequest)) (*Response, error) diff --git a/esapi/api.connector.secret_post.go b/esapi/api.connector.secret_post.go index 13ff872de3..6e7aba0491 100644 --- a/esapi/api.connector.secret_post.go +++ b/esapi/api.connector.secret_post.go @@ -43,7 +43,7 @@ func newConnectorSecretPostFunc(t Transport) ConnectorSecretPost { // ----- API Definition ------------------------------------------------------- -// ConnectorSecretPost creates a secret for a Connector. +// ConnectorSecretPost creates a secret for a Connector // // This API is experimental. type ConnectorSecretPost func(body io.Reader, o ...func(*ConnectorSecretPostRequest)) (*Response, error) diff --git a/esapi/api.connector.secret_put.go b/esapi/api.connector.secret_put.go index d3dde8726c..8bc593c5fd 100644 --- a/esapi/api.connector.secret_put.go +++ b/esapi/api.connector.secret_put.go @@ -43,7 +43,7 @@ func newConnectorSecretPutFunc(t Transport) ConnectorSecretPut { // ----- API Definition ------------------------------------------------------- -// ConnectorSecretPut creates or updates a secret for a Connector. +// ConnectorSecretPut creates or updates a secret for a Connector // // This API is experimental. type ConnectorSecretPut func(id string, body io.Reader, o ...func(*ConnectorSecretPutRequest)) (*Response, error) diff --git a/esapi/api.connector.sync_job_cancel.go b/esapi/api.connector.sync_job_cancel.go index 64f5dc6db2..ed56b37324 100644 --- a/esapi/api.connector.sync_job_cancel.go +++ b/esapi/api.connector.sync_job_cancel.go @@ -42,11 +42,11 @@ func newConnectorSyncJobCancelFunc(t Transport) ConnectorSyncJobCancel { // ----- API Definition ------------------------------------------------------- -// ConnectorSyncJobCancel cancels a connector sync job. +// ConnectorSyncJobCancel cancel a connector sync job // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cancel-connector-sync-job-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-cancel. type ConnectorSyncJobCancel func(connector_sync_job_id string, o ...func(*ConnectorSyncJobCancelRequest)) (*Response, error) // ConnectorSyncJobCancelRequest configures the Connector Sync Job Cancel API request. diff --git a/esapi/api.connector.sync_job_check_in.go b/esapi/api.connector.sync_job_check_in.go index 2626deb29d..427839b5d5 100644 --- a/esapi/api.connector.sync_job_check_in.go +++ b/esapi/api.connector.sync_job_check_in.go @@ -42,11 +42,11 @@ func newConnectorSyncJobCheckInFunc(t Transport) ConnectorSyncJobCheckIn { // ----- API Definition ------------------------------------------------------- -// ConnectorSyncJobCheckIn checks in a connector sync job (refreshes 'last_seen'). +// ConnectorSyncJobCheckIn check in a connector sync job // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/check-in-connector-sync-job-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-check-in. type ConnectorSyncJobCheckIn func(connector_sync_job_id string, o ...func(*ConnectorSyncJobCheckInRequest)) (*Response, error) // ConnectorSyncJobCheckInRequest configures the Connector Sync Job Check In API request. diff --git a/esapi/api.connector.sync_job_claim.go b/esapi/api.connector.sync_job_claim.go index da610e03c8..4c61bb76e0 100644 --- a/esapi/api.connector.sync_job_claim.go +++ b/esapi/api.connector.sync_job_claim.go @@ -43,11 +43,11 @@ func newConnectorSyncJobClaimFunc(t Transport) ConnectorSyncJobClaim { // ----- API Definition ------------------------------------------------------- -// ConnectorSyncJobClaim claims a connector sync job. +// ConnectorSyncJobClaim claim a connector sync job // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/claim-connector-sync-job-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-claim. type ConnectorSyncJobClaim func(body io.Reader, connector_sync_job_id string, o ...func(*ConnectorSyncJobClaimRequest)) (*Response, error) // ConnectorSyncJobClaimRequest configures the Connector Sync Job Claim API request. diff --git a/esapi/api.connector.sync_job_delete.go b/esapi/api.connector.sync_job_delete.go index 3172b229d4..d145b4624d 100644 --- a/esapi/api.connector.sync_job_delete.go +++ b/esapi/api.connector.sync_job_delete.go @@ -42,11 +42,11 @@ func newConnectorSyncJobDeleteFunc(t Transport) ConnectorSyncJobDelete { // ----- API Definition ------------------------------------------------------- -// ConnectorSyncJobDelete deletes a connector sync job. +// ConnectorSyncJobDelete delete a connector sync job // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-sync-job-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-delete. type ConnectorSyncJobDelete func(connector_sync_job_id string, o ...func(*ConnectorSyncJobDeleteRequest)) (*Response, error) // ConnectorSyncJobDeleteRequest configures the Connector Sync Job Delete API request. diff --git a/esapi/api.connector.sync_job_error.go b/esapi/api.connector.sync_job_error.go index ecc7224c15..3ee9b5c367 100644 --- a/esapi/api.connector.sync_job_error.go +++ b/esapi/api.connector.sync_job_error.go @@ -43,11 +43,11 @@ func newConnectorSyncJobErrorFunc(t Transport) ConnectorSyncJobError { // ----- API Definition ------------------------------------------------------- -// ConnectorSyncJobError sets an error for a connector sync job. +// ConnectorSyncJobError set a connector sync job error // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/set-connector-sync-job-error-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-error. type ConnectorSyncJobError func(body io.Reader, connector_sync_job_id string, o ...func(*ConnectorSyncJobErrorRequest)) (*Response, error) // ConnectorSyncJobErrorRequest configures the Connector Sync Job Error API request. diff --git a/esapi/api.connector.sync_job_get.go b/esapi/api.connector.sync_job_get.go index 5e5599e463..9adf598aef 100644 --- a/esapi/api.connector.sync_job_get.go +++ b/esapi/api.connector.sync_job_get.go @@ -42,11 +42,11 @@ func newConnectorSyncJobGetFunc(t Transport) ConnectorSyncJobGet { // ----- API Definition ------------------------------------------------------- -// ConnectorSyncJobGet returns the details about a connector sync job. +// ConnectorSyncJobGet get a connector sync job // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-sync-job-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-get. type ConnectorSyncJobGet func(connector_sync_job_id string, o ...func(*ConnectorSyncJobGetRequest)) (*Response, error) // ConnectorSyncJobGetRequest configures the Connector Sync Job Get API request. diff --git a/esapi/api.connector.sync_job_list.go b/esapi/api.connector.sync_job_list.go index 6d00f01d6a..52cf954825 100644 --- a/esapi/api.connector.sync_job_list.go +++ b/esapi/api.connector.sync_job_list.go @@ -43,11 +43,11 @@ func newConnectorSyncJobListFunc(t Transport) ConnectorSyncJobList { // ----- API Definition ------------------------------------------------------- -// ConnectorSyncJobList lists all connector sync jobs. +// ConnectorSyncJobList get all connector sync jobs // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-sync-jobs-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-list. type ConnectorSyncJobList func(o ...func(*ConnectorSyncJobListRequest)) (*Response, error) // ConnectorSyncJobListRequest configures the Connector Sync Job List API request. @@ -221,7 +221,7 @@ func (f ConnectorSyncJobList) WithSize(v int) func(*ConnectorSyncJobListRequest) } } -// WithStatus - sync job status, which sync jobs are fetched for. +// WithStatus - a sync job status to fetch connector sync jobs for. func (f ConnectorSyncJobList) WithStatus(v string) func(*ConnectorSyncJobListRequest) { return func(r *ConnectorSyncJobListRequest) { r.Status = v diff --git a/esapi/api.connector.sync_job_post.go b/esapi/api.connector.sync_job_post.go index b1b5ac0e1c..c6815c9282 100644 --- a/esapi/api.connector.sync_job_post.go +++ b/esapi/api.connector.sync_job_post.go @@ -43,11 +43,11 @@ func newConnectorSyncJobPostFunc(t Transport) ConnectorSyncJobPost { // ----- API Definition ------------------------------------------------------- -// ConnectorSyncJobPost creates a connector sync job. +// ConnectorSyncJobPost create a connector sync job // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-sync-job-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-post. type ConnectorSyncJobPost func(body io.Reader, o ...func(*ConnectorSyncJobPostRequest)) (*Response, error) // ConnectorSyncJobPostRequest configures the Connector Sync Job Post API request. diff --git a/esapi/api.connector.sync_job_update_stats.go b/esapi/api.connector.sync_job_update_stats.go index bee74b0a31..1c36a69dd5 100644 --- a/esapi/api.connector.sync_job_update_stats.go +++ b/esapi/api.connector.sync_job_update_stats.go @@ -43,11 +43,11 @@ func newConnectorSyncJobUpdateStatsFunc(t Transport) ConnectorSyncJobUpdateStats // ----- API Definition ------------------------------------------------------- -// ConnectorSyncJobUpdateStats updates the stats fields in the connector sync job document. +// ConnectorSyncJobUpdateStats set the connector sync job stats // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/set-connector-sync-job-stats-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-update-stats. type ConnectorSyncJobUpdateStats func(body io.Reader, connector_sync_job_id string, o ...func(*ConnectorSyncJobUpdateStatsRequest)) (*Response, error) // ConnectorSyncJobUpdateStatsRequest configures the Connector Sync Job Update Stats API request. diff --git a/esapi/api.connector.update_active_filtering.go b/esapi/api.connector.update_active_filtering.go index 774a7e22e6..e2e1f225e0 100644 --- a/esapi/api.connector.update_active_filtering.go +++ b/esapi/api.connector.update_active_filtering.go @@ -42,11 +42,11 @@ func newConnectorUpdateActiveFilteringFunc(t Transport) ConnectorUpdateActiveFil // ----- API Definition ------------------------------------------------------- -// ConnectorUpdateActiveFiltering activates the draft filtering rules if they are in a validated state. +// ConnectorUpdateActiveFiltering activate the connector draft filter // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-filtering. type ConnectorUpdateActiveFiltering func(connector_id string, o ...func(*ConnectorUpdateActiveFilteringRequest)) (*Response, error) // ConnectorUpdateActiveFilteringRequest configures the Connector Update Active Filtering API request. diff --git a/esapi/api.connector.update_api_key_id.go b/esapi/api.connector.update_api_key_id.go index 276fcac8bf..eb0ae3359b 100644 --- a/esapi/api.connector.update_api_key_id.go +++ b/esapi/api.connector.update_api_key_id.go @@ -43,11 +43,11 @@ func newConnectorUpdateAPIKeyDocumentIDFunc(t Transport) ConnectorUpdateAPIKeyDo // ----- API Definition ------------------------------------------------------- -// ConnectorUpdateAPIKeyDocumentID updates the API key id and/or API key secret id fields in the connector document. +// ConnectorUpdateAPIKeyDocumentID update the connector API key ID // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-api-key-id-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-api-key-id. type ConnectorUpdateAPIKeyDocumentID func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateAPIKeyDocumentIDRequest)) (*Response, error) // ConnectorUpdateAPIKeyDocumentIDRequest configures the Connector UpdateAPI Key DocumentI D API request. diff --git a/esapi/api.connector.update_configuration.go b/esapi/api.connector.update_configuration.go index c35fc56441..66d26e284a 100644 --- a/esapi/api.connector.update_configuration.go +++ b/esapi/api.connector.update_configuration.go @@ -43,11 +43,11 @@ func newConnectorUpdateConfigurationFunc(t Transport) ConnectorUpdateConfigurati // ----- API Definition ------------------------------------------------------- -// ConnectorUpdateConfiguration updates the connector configuration. +// ConnectorUpdateConfiguration update the connector configuration // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-configuration-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-configuration. type ConnectorUpdateConfiguration func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateConfigurationRequest)) (*Response, error) // ConnectorUpdateConfigurationRequest configures the Connector Update Configuration API request. diff --git a/esapi/api.connector.update_error.go b/esapi/api.connector.update_error.go index 903bd8f169..f5e226eb71 100644 --- a/esapi/api.connector.update_error.go +++ b/esapi/api.connector.update_error.go @@ -43,11 +43,11 @@ func newConnectorUpdateErrorFunc(t Transport) ConnectorUpdateError { // ----- API Definition ------------------------------------------------------- -// ConnectorUpdateError updates the error field in the connector document. +// ConnectorUpdateError update the connector error field // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-error-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-error. type ConnectorUpdateError func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateErrorRequest)) (*Response, error) // ConnectorUpdateErrorRequest configures the Connector Update Error API request. diff --git a/esapi/api.connector.update_features.go b/esapi/api.connector.update_features.go index 7038dc8b08..04371464ea 100644 --- a/esapi/api.connector.update_features.go +++ b/esapi/api.connector.update_features.go @@ -43,11 +43,11 @@ func newConnectorUpdateFeaturesFunc(t Transport) ConnectorUpdateFeatures { // ----- API Definition ------------------------------------------------------- -// ConnectorUpdateFeatures updates the connector features in the connector document. +// ConnectorUpdateFeatures update the connector features // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-features-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-features. type ConnectorUpdateFeatures func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateFeaturesRequest)) (*Response, error) // ConnectorUpdateFeaturesRequest configures the Connector Update Features API request. diff --git a/esapi/api.connector.update_filtering.go b/esapi/api.connector.update_filtering.go index 2225de8a62..8a5bcf1744 100644 --- a/esapi/api.connector.update_filtering.go +++ b/esapi/api.connector.update_filtering.go @@ -43,11 +43,11 @@ func newConnectorUpdateFilteringFunc(t Transport) ConnectorUpdateFiltering { // ----- API Definition ------------------------------------------------------- -// ConnectorUpdateFiltering updates the filtering field in the connector document. +// ConnectorUpdateFiltering update the connector filtering // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-filtering. type ConnectorUpdateFiltering func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateFilteringRequest)) (*Response, error) // ConnectorUpdateFilteringRequest configures the Connector Update Filtering API request. diff --git a/esapi/api.connector.update_filtering_validation.go b/esapi/api.connector.update_filtering_validation.go index 1c6ab2b0ac..347fc5ed89 100644 --- a/esapi/api.connector.update_filtering_validation.go +++ b/esapi/api.connector.update_filtering_validation.go @@ -43,11 +43,11 @@ func newConnectorUpdateFilteringValidationFunc(t Transport) ConnectorUpdateFilte // ----- API Definition ------------------------------------------------------- -// ConnectorUpdateFilteringValidation updates the validation info of the draft filtering rules. +// ConnectorUpdateFilteringValidation update the connector draft filtering validation // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-filtering-validation. type ConnectorUpdateFilteringValidation func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateFilteringValidationRequest)) (*Response, error) // ConnectorUpdateFilteringValidationRequest configures the Connector Update Filtering Validation API request. diff --git a/esapi/api.connector.update_index_name.go b/esapi/api.connector.update_index_name.go index f67204f14b..356bd8de5b 100644 --- a/esapi/api.connector.update_index_name.go +++ b/esapi/api.connector.update_index_name.go @@ -43,11 +43,11 @@ func newConnectorUpdateIndexNameFunc(t Transport) ConnectorUpdateIndexName { // ----- API Definition ------------------------------------------------------- -// ConnectorUpdateIndexName updates the index name of the connector. +// ConnectorUpdateIndexName update the connector index name // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-index-name-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-index-name. type ConnectorUpdateIndexName func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateIndexNameRequest)) (*Response, error) // ConnectorUpdateIndexNameRequest configures the Connector Update Index Name API request. diff --git a/esapi/api.connector.update_name.go b/esapi/api.connector.update_name.go index 3e6fc52bff..42154e62b7 100644 --- a/esapi/api.connector.update_name.go +++ b/esapi/api.connector.update_name.go @@ -43,11 +43,11 @@ func newConnectorUpdateNameFunc(t Transport) ConnectorUpdateName { // ----- API Definition ------------------------------------------------------- -// ConnectorUpdateName updates the name and/or description fields in the connector document. +// ConnectorUpdateName update the connector name and description // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-name-description-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-name. type ConnectorUpdateName func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateNameRequest)) (*Response, error) // ConnectorUpdateNameRequest configures the Connector Update Name API request. diff --git a/esapi/api.connector.update_native.go b/esapi/api.connector.update_native.go index 05b2b0c51f..2d14904a7d 100644 --- a/esapi/api.connector.update_native.go +++ b/esapi/api.connector.update_native.go @@ -43,11 +43,11 @@ func newConnectorUpdateNativeFunc(t Transport) ConnectorUpdateNative { // ----- API Definition ------------------------------------------------------- -// ConnectorUpdateNative updates the is_native flag of the connector. +// ConnectorUpdateNative update the connector is_native flag // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/connector-apis.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-native. type ConnectorUpdateNative func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateNativeRequest)) (*Response, error) // ConnectorUpdateNativeRequest configures the Connector Update Native API request. diff --git a/esapi/api.connector.update_pipeline.go b/esapi/api.connector.update_pipeline.go index 3a438cd0b2..ea88ac76a5 100644 --- a/esapi/api.connector.update_pipeline.go +++ b/esapi/api.connector.update_pipeline.go @@ -43,11 +43,11 @@ func newConnectorUpdatePipelineFunc(t Transport) ConnectorUpdatePipeline { // ----- API Definition ------------------------------------------------------- -// ConnectorUpdatePipeline updates the pipeline field in the connector document. +// ConnectorUpdatePipeline update the connector pipeline // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-pipeline-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-pipeline. type ConnectorUpdatePipeline func(body io.Reader, connector_id string, o ...func(*ConnectorUpdatePipelineRequest)) (*Response, error) // ConnectorUpdatePipelineRequest configures the Connector Update Pipeline API request. diff --git a/esapi/api.connector.update_scheduling.go b/esapi/api.connector.update_scheduling.go index 9cd5219a82..b76f1abe0f 100644 --- a/esapi/api.connector.update_scheduling.go +++ b/esapi/api.connector.update_scheduling.go @@ -43,11 +43,11 @@ func newConnectorUpdateSchedulingFunc(t Transport) ConnectorUpdateScheduling { // ----- API Definition ------------------------------------------------------- -// ConnectorUpdateScheduling updates the scheduling field in the connector document. +// ConnectorUpdateScheduling update the connector scheduling // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-scheduling-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-scheduling. type ConnectorUpdateScheduling func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateSchedulingRequest)) (*Response, error) // ConnectorUpdateSchedulingRequest configures the Connector Update Scheduling API request. diff --git a/esapi/api.connector.update_service_type.go b/esapi/api.connector.update_service_type.go index 98b912fcf2..f98419aba6 100644 --- a/esapi/api.connector.update_service_type.go +++ b/esapi/api.connector.update_service_type.go @@ -43,11 +43,11 @@ func newConnectorUpdateServiceDocumentTypeFunc(t Transport) ConnectorUpdateServi // ----- API Definition ------------------------------------------------------- -// ConnectorUpdateServiceDocumentType updates the service type of the connector. +// ConnectorUpdateServiceDocumentType update the connector service type // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-service-type-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-service-type. type ConnectorUpdateServiceDocumentType func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateServiceDocumentTypeRequest)) (*Response, error) // ConnectorUpdateServiceDocumentTypeRequest configures the Connector Update Service Document Type API request. diff --git a/esapi/api.connector.update_status.go b/esapi/api.connector.update_status.go index fe3bd946e1..8ca3452cfe 100644 --- a/esapi/api.connector.update_status.go +++ b/esapi/api.connector.update_status.go @@ -43,11 +43,11 @@ func newConnectorUpdateStatusFunc(t Transport) ConnectorUpdateStatus { // ----- API Definition ------------------------------------------------------- -// ConnectorUpdateStatus updates the status of the connector. +// ConnectorUpdateStatus update the connector status // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-status-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-status. type ConnectorUpdateStatus func(body io.Reader, connector_id string, o ...func(*ConnectorUpdateStatusRequest)) (*Response, error) // ConnectorUpdateStatusRequest configures the Connector Update Status API request. diff --git a/esapi/api.count.go b/esapi/api.count.go index cfeea1704d..c3e9d79e7d 100644 --- a/esapi/api.count.go +++ b/esapi/api.count.go @@ -44,9 +44,9 @@ func newCountFunc(t Transport) Count { // ----- API Definition ------------------------------------------------------- -// Count returns number of documents matching a query. +// Count count search results // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-count. type Count func(o ...func(*CountRequest)) (*Response, error) // CountRequest configures the Count API request. @@ -60,7 +60,7 @@ type CountRequest struct { AnalyzeWildcard *bool DefaultOperator string Df string - ExpandWildcards string + ExpandWildcards []string IgnoreThrottled *bool IgnoreUnavailable *bool Lenient *bool @@ -135,8 +135,8 @@ func (r CountRequest) Do(providedCtx context.Context, transport Transport) (*Res params["df"] = r.Df } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreThrottled != nil { @@ -306,7 +306,7 @@ func (f Count) WithDf(v string) func(*CountRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f Count) WithExpandWildcards(v string) func(*CountRequest) { +func (f Count) WithExpandWildcards(v ...string) func(*CountRequest) { return func(r *CountRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.create.go b/esapi/api.create.go index 63575133b6..19acf41c64 100644 --- a/esapi/api.create.go +++ b/esapi/api.create.go @@ -45,11 +45,9 @@ func newCreateFunc(t Transport) Create { // ----- API Definition ------------------------------------------------------- -// Create creates a new document in the index. +// Create create a new document in the index // -// Returns a 409 response when a document with a same ID already exists in the index. -// -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-create. type Create func(index string, id string, body io.Reader, o ...func(*CreateRequest)) (*Response, error) // CreateRequest configures the Create API request. @@ -64,7 +62,7 @@ type CreateRequest struct { Refresh string RequireAlias *bool RequireDataStream *bool - Routing string + Routing []string Timeout time.Duration Version *int VersionType string @@ -138,8 +136,8 @@ func (r CreateRequest) Do(providedCtx context.Context, transport Transport) (*Re params["require_data_stream"] = strconv.FormatBool(*r.RequireDataStream) } - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if r.Timeout != 0 { @@ -279,7 +277,7 @@ func (f Create) WithRequireDataStream(v bool) func(*CreateRequest) { } // WithRouting - specific routing value. -func (f Create) WithRouting(v string) func(*CreateRequest) { +func (f Create) WithRouting(v ...string) func(*CreateRequest) { return func(r *CreateRequest) { r.Routing = v } diff --git a/esapi/api.dangling_indices.delete_dangling_index.go b/esapi/api.dangling_indices.delete_dangling_index.go index 4103f63499..ccc5ce01e7 100644 --- a/esapi/api.dangling_indices.delete_dangling_index.go +++ b/esapi/api.dangling_indices.delete_dangling_index.go @@ -44,9 +44,9 @@ func newDanglingIndicesDeleteDanglingIndexFunc(t Transport) DanglingIndicesDelet // ----- API Definition ------------------------------------------------------- -// DanglingIndicesDeleteDanglingIndex deletes the specified dangling index +// DanglingIndicesDeleteDanglingIndex delete a dangling index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-dangling-indices-delete-dangling-index. type DanglingIndicesDeleteDanglingIndex func(index_uuid string, o ...func(*DanglingIndicesDeleteDanglingIndexRequest)) (*Response, error) // DanglingIndicesDeleteDanglingIndexRequest configures the Dangling Indices Delete Dangling Index API request. diff --git a/esapi/api.dangling_indices.import_dangling_index.go b/esapi/api.dangling_indices.import_dangling_index.go index ececdef3aa..a1bb466cfc 100644 --- a/esapi/api.dangling_indices.import_dangling_index.go +++ b/esapi/api.dangling_indices.import_dangling_index.go @@ -44,9 +44,9 @@ func newDanglingIndicesImportDanglingIndexFunc(t Transport) DanglingIndicesImpor // ----- API Definition ------------------------------------------------------- -// DanglingIndicesImportDanglingIndex imports the specified dangling index +// DanglingIndicesImportDanglingIndex import a dangling index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-dangling-indices-import-dangling-index. type DanglingIndicesImportDanglingIndex func(index_uuid string, o ...func(*DanglingIndicesImportDanglingIndexRequest)) (*Response, error) // DanglingIndicesImportDanglingIndexRequest configures the Dangling Indices Import Dangling Index API request. diff --git a/esapi/api.dangling_indices.list_dangling_indices.go b/esapi/api.dangling_indices.list_dangling_indices.go index fd6e88c777..94ed6b10a1 100644 --- a/esapi/api.dangling_indices.list_dangling_indices.go +++ b/esapi/api.dangling_indices.list_dangling_indices.go @@ -42,9 +42,9 @@ func newDanglingIndicesListDanglingIndicesFunc(t Transport) DanglingIndicesListD // ----- API Definition ------------------------------------------------------- -// DanglingIndicesListDanglingIndices returns all dangling indices. +// DanglingIndicesListDanglingIndices get the dangling indices // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-dangling-indices-list-dangling-indices. type DanglingIndicesListDanglingIndices func(o ...func(*DanglingIndicesListDanglingIndicesRequest)) (*Response, error) // DanglingIndicesListDanglingIndicesRequest configures the Dangling Indices List Dangling Indices API request. diff --git a/esapi/api.delete.go b/esapi/api.delete.go index fb7cf0590b..68afc1150f 100644 --- a/esapi/api.delete.go +++ b/esapi/api.delete.go @@ -44,9 +44,9 @@ func newDeleteFunc(t Transport) Delete { // ----- API Definition ------------------------------------------------------- -// Delete removes a document from the index. +// Delete delete a document // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete. type Delete func(index string, id string, o ...func(*DeleteRequest)) (*Response, error) // DeleteRequest configures the Delete API request. @@ -57,7 +57,7 @@ type DeleteRequest struct { IfPrimaryTerm *int IfSeqNo *int Refresh string - Routing string + Routing []string Timeout time.Duration Version *int VersionType string @@ -123,8 +123,8 @@ func (r DeleteRequest) Do(providedCtx context.Context, transport Transport) (*Re params["refresh"] = r.Refresh } - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if r.Timeout != 0 { @@ -243,7 +243,7 @@ func (f Delete) WithRefresh(v string) func(*DeleteRequest) { } // WithRouting - specific routing value. -func (f Delete) WithRouting(v string) func(*DeleteRequest) { +func (f Delete) WithRouting(v ...string) func(*DeleteRequest) { return func(r *DeleteRequest) { r.Routing = v } diff --git a/esapi/api.delete_by_query.go b/esapi/api.delete_by_query.go index c72436a449..c3b052e552 100644 --- a/esapi/api.delete_by_query.go +++ b/esapi/api.delete_by_query.go @@ -47,9 +47,9 @@ func newDeleteByQueryFunc(t Transport) DeleteByQuery { // ----- API Definition ------------------------------------------------------- -// DeleteByQuery deletes documents matching the provided query. +// DeleteByQuery delete documents // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-by-query. type DeleteByQuery func(index []string, body io.Reader, o ...func(*DeleteByQueryRequest)) (*Response, error) // DeleteByQueryRequest configures the Delete By Query API request. @@ -64,7 +64,7 @@ type DeleteByQueryRequest struct { Conflicts string DefaultOperator string Df string - ExpandWildcards string + ExpandWildcards []string From *int IgnoreUnavailable *bool Lenient *bool @@ -159,8 +159,8 @@ func (r DeleteByQueryRequest) Do(providedCtx context.Context, transport Transpor params["df"] = r.Df } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.From != nil { @@ -379,7 +379,7 @@ func (f DeleteByQuery) WithDf(v string) func(*DeleteByQueryRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f DeleteByQuery) WithExpandWildcards(v string) func(*DeleteByQueryRequest) { +func (f DeleteByQuery) WithExpandWildcards(v ...string) func(*DeleteByQueryRequest) { return func(r *DeleteByQueryRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.delete_by_query_rethrottle.go b/esapi/api.delete_by_query_rethrottle.go index 972e018ec7..f3bf92df3c 100644 --- a/esapi/api.delete_by_query_rethrottle.go +++ b/esapi/api.delete_by_query_rethrottle.go @@ -43,9 +43,9 @@ func newDeleteByQueryRethrottleFunc(t Transport) DeleteByQueryRethrottle { // ----- API Definition ------------------------------------------------------- -// DeleteByQueryRethrottle changes the number of requests per second for a particular Delete By Query operation. +// DeleteByQueryRethrottle throttle a delete by query operation // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-by-query-rethrottle. type DeleteByQueryRethrottle func(task_id string, requests_per_second *int, o ...func(*DeleteByQueryRethrottleRequest)) (*Response, error) // DeleteByQueryRethrottleRequest configures the Delete By Query Rethrottle API request. diff --git a/esapi/api.delete_script.go b/esapi/api.delete_script.go index 18a7e0d6f2..1263d9a829 100644 --- a/esapi/api.delete_script.go +++ b/esapi/api.delete_script.go @@ -43,9 +43,9 @@ func newDeleteScriptFunc(t Transport) DeleteScript { // ----- API Definition ------------------------------------------------------- -// DeleteScript deletes a script. +// DeleteScript delete a script or search template // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-script. type DeleteScript func(id string, o ...func(*DeleteScriptRequest)) (*Response, error) // DeleteScriptRequest configures the Delete Script API request. diff --git a/esapi/api.exists.go b/esapi/api.exists.go index 6d490bd9a4..021f07b335 100644 --- a/esapi/api.exists.go +++ b/esapi/api.exists.go @@ -43,9 +43,9 @@ func newExistsFunc(t Transport) Exists { // ----- API Definition ------------------------------------------------------- -// Exists returns information about whether a document exists in an index. +// Exists check a document // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get. type Exists func(index string, id string, o ...func(*ExistsRequest)) (*Response, error) // ExistsRequest configures the Exists API request. @@ -56,7 +56,7 @@ type ExistsRequest struct { Preference string Realtime *bool Refresh *bool - Routing string + Routing []string Source []string SourceExcludes []string SourceIncludes []string @@ -124,8 +124,8 @@ func (r ExistsRequest) Do(providedCtx context.Context, transport Transport) (*Re params["refresh"] = strconv.FormatBool(*r.Refresh) } - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if len(r.Source) > 0 { @@ -252,7 +252,7 @@ func (f Exists) WithRefresh(v bool) func(*ExistsRequest) { } // WithRouting - specific routing value. -func (f Exists) WithRouting(v string) func(*ExistsRequest) { +func (f Exists) WithRouting(v ...string) func(*ExistsRequest) { return func(r *ExistsRequest) { r.Routing = v } diff --git a/esapi/api.exists_source.go b/esapi/api.exists_source.go index 4da7afc11e..c0930cda7b 100644 --- a/esapi/api.exists_source.go +++ b/esapi/api.exists_source.go @@ -43,9 +43,9 @@ func newExistsSourceFunc(t Transport) ExistsSource { // ----- API Definition ------------------------------------------------------- -// ExistsSource returns information about whether a document source exists in an index. +// ExistsSource check for a document source // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get. type ExistsSource func(index string, id string, o ...func(*ExistsSourceRequest)) (*Response, error) // ExistsSourceRequest configures the Exists Source API request. @@ -56,7 +56,7 @@ type ExistsSourceRequest struct { Preference string Realtime *bool Refresh *bool - Routing string + Routing []string Source []string SourceExcludes []string SourceIncludes []string @@ -123,8 +123,8 @@ func (r ExistsSourceRequest) Do(providedCtx context.Context, transport Transport params["refresh"] = strconv.FormatBool(*r.Refresh) } - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if len(r.Source) > 0 { @@ -247,7 +247,7 @@ func (f ExistsSource) WithRefresh(v bool) func(*ExistsSourceRequest) { } // WithRouting - specific routing value. -func (f ExistsSource) WithRouting(v string) func(*ExistsSourceRequest) { +func (f ExistsSource) WithRouting(v ...string) func(*ExistsSourceRequest) { return func(r *ExistsSourceRequest) { r.Routing = v } diff --git a/esapi/api.explain.go b/esapi/api.explain.go index dd35d2c667..1f8313810a 100644 --- a/esapi/api.explain.go +++ b/esapi/api.explain.go @@ -44,9 +44,9 @@ func newExplainFunc(t Transport) Explain { // ----- API Definition ------------------------------------------------------- -// Explain returns information about why a specific matches (or doesn't match) a query. +// Explain explain a document match result // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-explain. type Explain func(index string, id string, o ...func(*ExplainRequest)) (*Response, error) // ExplainRequest configures the Explain API request. @@ -63,7 +63,7 @@ type ExplainRequest struct { Lenient *bool Preference string Query string - Routing string + Routing []string Source []string SourceExcludes []string SourceIncludes []string @@ -145,8 +145,8 @@ func (r ExplainRequest) Do(providedCtx context.Context, transport Transport) (*R params["q"] = r.Query } - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if len(r.Source) > 0 { @@ -307,7 +307,7 @@ func (f Explain) WithQuery(v string) func(*ExplainRequest) { } // WithRouting - specific routing value. -func (f Explain) WithRouting(v string) func(*ExplainRequest) { +func (f Explain) WithRouting(v ...string) func(*ExplainRequest) { return func(r *ExplainRequest) { r.Routing = v } diff --git a/esapi/api.features.get_features.go b/esapi/api.features.get_features.go index 694ab3d50b..17e4702059 100644 --- a/esapi/api.features.get_features.go +++ b/esapi/api.features.get_features.go @@ -43,9 +43,9 @@ func newFeaturesGetFeaturesFunc(t Transport) FeaturesGetFeatures { // ----- API Definition ------------------------------------------------------- -// FeaturesGetFeatures gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot +// FeaturesGetFeatures get the features // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-features-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-features-get-features. type FeaturesGetFeatures func(o ...func(*FeaturesGetFeaturesRequest)) (*Response, error) // FeaturesGetFeaturesRequest configures the Features Get Features API request. diff --git a/esapi/api.features.reset_features.go b/esapi/api.features.reset_features.go index bb62b5bbaa..e0d4ba2a85 100644 --- a/esapi/api.features.reset_features.go +++ b/esapi/api.features.reset_features.go @@ -43,11 +43,11 @@ func newFeaturesResetFeaturesFunc(t Transport) FeaturesResetFeatures { // ----- API Definition ------------------------------------------------------- -// FeaturesResetFeatures resets the internal state of features, usually by deleting system indices +// FeaturesResetFeatures reset the features // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-features-reset-features. type FeaturesResetFeatures func(o ...func(*FeaturesResetFeaturesRequest)) (*Response, error) // FeaturesResetFeaturesRequest configures the Features Reset Features API request. diff --git a/esapi/api.field_caps.go b/esapi/api.field_caps.go index 7e19e6a11b..622f2f9cc8 100644 --- a/esapi/api.field_caps.go +++ b/esapi/api.field_caps.go @@ -44,9 +44,9 @@ func newFieldCapsFunc(t Transport) FieldCaps { // ----- API Definition ------------------------------------------------------- -// FieldCaps returns the information about the capabilities of fields among multiple indices. +// FieldCaps get the field capabilities // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-field-caps. type FieldCaps func(o ...func(*FieldCapsRequest)) (*Response, error) // FieldCapsRequest configures the Field Caps API request. @@ -56,7 +56,7 @@ type FieldCapsRequest struct { Body io.Reader AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string Fields []string Filters []string IgnoreUnavailable *bool @@ -113,8 +113,8 @@ func (r FieldCapsRequest) Do(providedCtx context.Context, transport Transport) ( params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if len(r.Fields) > 0 { @@ -248,7 +248,7 @@ func (f FieldCaps) WithAllowNoIndices(v bool) func(*FieldCapsRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f FieldCaps) WithExpandWildcards(v string) func(*FieldCapsRequest) { +func (f FieldCaps) WithExpandWildcards(v ...string) func(*FieldCapsRequest) { return func(r *FieldCapsRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.fleet.delete_secret.go b/esapi/api.fleet.delete_secret.go index 2d95257052..4660ffb82d 100644 --- a/esapi/api.fleet.delete_secret.go +++ b/esapi/api.fleet.delete_secret.go @@ -42,7 +42,7 @@ func newFleetDeleteSecretFunc(t Transport) FleetDeleteSecret { // ----- API Definition ------------------------------------------------------- -// FleetDeleteSecret deletes a secret stored by Fleet. +// FleetDeleteSecret deletes a secret stored by Fleet // // This API is experimental. type FleetDeleteSecret func(id string, o ...func(*FleetDeleteSecretRequest)) (*Response, error) diff --git a/esapi/api.fleet.get_secret.go b/esapi/api.fleet.get_secret.go index e6a2e9d15f..b873915d15 100644 --- a/esapi/api.fleet.get_secret.go +++ b/esapi/api.fleet.get_secret.go @@ -42,7 +42,7 @@ func newFleetGetSecretFunc(t Transport) FleetGetSecret { // ----- API Definition ------------------------------------------------------- -// FleetGetSecret retrieves a secret stored by Fleet. +// FleetGetSecret retrieves a secret stored by Fleet // // This API is experimental. type FleetGetSecret func(id string, o ...func(*FleetGetSecretRequest)) (*Response, error) diff --git a/esapi/api.fleet.global_checkpoints.go b/esapi/api.fleet.global_checkpoints.go index dd39d96d45..4699b73bbe 100644 --- a/esapi/api.fleet.global_checkpoints.go +++ b/esapi/api.fleet.global_checkpoints.go @@ -44,9 +44,9 @@ func newFleetGlobalCheckpointsFunc(t Transport) FleetGlobalCheckpoints { // ----- API Definition ------------------------------------------------------- -// FleetGlobalCheckpoints returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. +// FleetGlobalCheckpoints get global checkpoints // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-global-checkpoints.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-fleet. type FleetGlobalCheckpoints func(index string, o ...func(*FleetGlobalCheckpointsRequest)) (*Response, error) // FleetGlobalCheckpointsRequest configures the Fleet Global Checkpoints API request. diff --git a/esapi/api.fleet.msearch.go b/esapi/api.fleet.msearch.go index f162520f66..4f5a30b138 100644 --- a/esapi/api.fleet.msearch.go +++ b/esapi/api.fleet.msearch.go @@ -43,7 +43,7 @@ func newFleetMsearchFunc(t Transport) FleetMsearch { // ----- API Definition ------------------------------------------------------- -// FleetMsearch multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. +// FleetMsearch run multiple Fleet searches // // This API is experimental. type FleetMsearch func(body io.Reader, o ...func(*FleetMsearchRequest)) (*Response, error) diff --git a/esapi/api.fleet.post_secret.go b/esapi/api.fleet.post_secret.go index 6478f9187b..e68f772b9c 100644 --- a/esapi/api.fleet.post_secret.go +++ b/esapi/api.fleet.post_secret.go @@ -43,7 +43,7 @@ func newFleetPostSecretFunc(t Transport) FleetPostSecret { // ----- API Definition ------------------------------------------------------- -// FleetPostSecret creates a secret stored by Fleet. +// FleetPostSecret creates a secret stored by Fleet // // This API is experimental. type FleetPostSecret func(body io.Reader, o ...func(*FleetPostSecretRequest)) (*Response, error) diff --git a/esapi/api.fleet.search.go b/esapi/api.fleet.search.go index a763b3d2b6..09f23fd4f2 100644 --- a/esapi/api.fleet.search.go +++ b/esapi/api.fleet.search.go @@ -45,7 +45,7 @@ func newFleetSearchFunc(t Transport) FleetSearch { // ----- API Definition ------------------------------------------------------- -// FleetSearch search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. +// FleetSearch run a Fleet search // // This API is experimental. type FleetSearch func(index string, o ...func(*FleetSearchRequest)) (*Response, error) diff --git a/esapi/api.get.go b/esapi/api.get.go index b8a900c397..238c4dd50a 100644 --- a/esapi/api.get.go +++ b/esapi/api.get.go @@ -43,9 +43,9 @@ func newGetFunc(t Transport) Get { // ----- API Definition ------------------------------------------------------- -// Get returns a document. +// Get get a document by its ID // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get. type Get func(index string, id string, o ...func(*GetRequest)) (*Response, error) // GetRequest configures the Get API request. @@ -57,7 +57,7 @@ type GetRequest struct { Preference string Realtime *bool Refresh *bool - Routing string + Routing []string Source []string SourceExcludes []string SourceIncludes []string @@ -129,8 +129,8 @@ func (r GetRequest) Do(providedCtx context.Context, transport Transport) (*Respo params["refresh"] = strconv.FormatBool(*r.Refresh) } - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if len(r.Source) > 0 { @@ -264,7 +264,7 @@ func (f Get) WithRefresh(v bool) func(*GetRequest) { } // WithRouting - specific routing value. -func (f Get) WithRouting(v string) func(*GetRequest) { +func (f Get) WithRouting(v ...string) func(*GetRequest) { return func(r *GetRequest) { r.Routing = v } diff --git a/esapi/api.get_script.go b/esapi/api.get_script.go index 458416e504..2b14e33117 100644 --- a/esapi/api.get_script.go +++ b/esapi/api.get_script.go @@ -43,9 +43,9 @@ func newGetScriptFunc(t Transport) GetScript { // ----- API Definition ------------------------------------------------------- -// GetScript returns a script. +// GetScript get a script or search template // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script. type GetScript func(id string, o ...func(*GetScriptRequest)) (*Response, error) // GetScriptRequest configures the Get Script API request. diff --git a/esapi/api.get_script_context.go b/esapi/api.get_script_context.go index a93a95a4e2..41f9bc444a 100644 --- a/esapi/api.get_script_context.go +++ b/esapi/api.get_script_context.go @@ -42,9 +42,9 @@ func newGetScriptContextFunc(t Transport) GetScriptContext { // ----- API Definition ------------------------------------------------------- -// GetScriptContext returns all script contexts. +// GetScriptContext get script contexts // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-contexts.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script-context. type GetScriptContext func(o ...func(*GetScriptContextRequest)) (*Response, error) // GetScriptContextRequest configures the Get Script Context API request. diff --git a/esapi/api.get_script_languages.go b/esapi/api.get_script_languages.go index 88b1b9af7d..484b437145 100644 --- a/esapi/api.get_script_languages.go +++ b/esapi/api.get_script_languages.go @@ -42,9 +42,9 @@ func newGetScriptLanguagesFunc(t Transport) GetScriptLanguages { // ----- API Definition ------------------------------------------------------- -// GetScriptLanguages returns available script types, languages and contexts +// GetScriptLanguages get script languages // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script-languages. type GetScriptLanguages func(o ...func(*GetScriptLanguagesRequest)) (*Response, error) // GetScriptLanguagesRequest configures the Get Script Languages API request. diff --git a/esapi/api.get_source.go b/esapi/api.get_source.go index 5241610232..774c961931 100644 --- a/esapi/api.get_source.go +++ b/esapi/api.get_source.go @@ -43,9 +43,9 @@ func newGetSourceFunc(t Transport) GetSource { // ----- API Definition ------------------------------------------------------- -// GetSource returns the source of a document. +// GetSource get a document's source // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get. type GetSource func(index string, id string, o ...func(*GetSourceRequest)) (*Response, error) // GetSourceRequest configures the Get Source API request. @@ -56,7 +56,7 @@ type GetSourceRequest struct { Preference string Realtime *bool Refresh *bool - Routing string + Routing []string Source []string SourceExcludes []string SourceIncludes []string @@ -123,8 +123,8 @@ func (r GetSourceRequest) Do(providedCtx context.Context, transport Transport) ( params["refresh"] = strconv.FormatBool(*r.Refresh) } - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if len(r.Source) > 0 { @@ -247,7 +247,7 @@ func (f GetSource) WithRefresh(v bool) func(*GetSourceRequest) { } // WithRouting - specific routing value. -func (f GetSource) WithRouting(v string) func(*GetSourceRequest) { +func (f GetSource) WithRouting(v ...string) func(*GetSourceRequest) { return func(r *GetSourceRequest) { r.Routing = v } diff --git a/esapi/api.health_report.go b/esapi/api.health_report.go index acf8ae7ff4..5f0e268cb1 100644 --- a/esapi/api.health_report.go +++ b/esapi/api.health_report.go @@ -44,9 +44,9 @@ func newHealthReportFunc(t Transport) HealthReport { // ----- API Definition ------------------------------------------------------- -// HealthReport returns the health of the cluster. +// HealthReport get the cluster health // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-health-report. type HealthReport func(o ...func(*HealthReportRequest)) (*Response, error) // HealthReportRequest configures the Health Report API request. diff --git a/esapi/api.index.go b/esapi/api.index.go index 54529ec543..25f607ff4d 100644 --- a/esapi/api.index.go +++ b/esapi/api.index.go @@ -45,9 +45,9 @@ func newIndexFunc(t Transport) Index { // ----- API Definition ------------------------------------------------------- -// Index creates or updates a document in an index. +// Index create or update a document in an index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-create. type Index func(index string, body io.Reader, o ...func(*IndexRequest)) (*Response, error) // IndexRequest configures the Index API request. @@ -65,7 +65,7 @@ type IndexRequest struct { Refresh string RequireAlias *bool RequireDataStream *bool - Routing string + Routing []string Timeout time.Duration Version *int VersionType string @@ -157,8 +157,8 @@ func (r IndexRequest) Do(providedCtx context.Context, transport Transport) (*Res params["require_data_stream"] = strconv.FormatBool(*r.RequireDataStream) } - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if r.Timeout != 0 { @@ -326,7 +326,7 @@ func (f Index) WithRequireDataStream(v bool) func(*IndexRequest) { } // WithRouting - specific routing value. -func (f Index) WithRouting(v string) func(*IndexRequest) { +func (f Index) WithRouting(v ...string) func(*IndexRequest) { return func(r *IndexRequest) { r.Routing = v } diff --git a/esapi/api.indices.add_block.go b/esapi/api.indices.add_block.go index 30cae1cda0..286ad65d54 100644 --- a/esapi/api.indices.add_block.go +++ b/esapi/api.indices.add_block.go @@ -45,9 +45,9 @@ func newIndicesAddBlockFunc(t Transport) IndicesAddBlock { // ----- API Definition ------------------------------------------------------- -// IndicesAddBlock adds a block to an index. +// IndicesAddBlock add an index block // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-add-block. type IndicesAddBlock func(index []string, block string, o ...func(*IndicesAddBlockRequest)) (*Response, error) // IndicesAddBlockRequest configures the Indices Add Block API request. @@ -57,7 +57,7 @@ type IndicesAddBlockRequest struct { Block string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool MasterTimeout time.Duration Timeout time.Duration @@ -118,8 +118,8 @@ func (r IndicesAddBlockRequest) Do(providedCtx context.Context, transport Transp params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -220,7 +220,7 @@ func (f IndicesAddBlock) WithAllowNoIndices(v bool) func(*IndicesAddBlockRequest } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesAddBlock) WithExpandWildcards(v string) func(*IndicesAddBlockRequest) { +func (f IndicesAddBlock) WithExpandWildcards(v ...string) func(*IndicesAddBlockRequest) { return func(r *IndicesAddBlockRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.analyze.go b/esapi/api.indices.analyze.go index 5362b939d2..5c29a55ce2 100644 --- a/esapi/api.indices.analyze.go +++ b/esapi/api.indices.analyze.go @@ -43,9 +43,9 @@ func newIndicesAnalyzeFunc(t Transport) IndicesAnalyze { // ----- API Definition ------------------------------------------------------- -// IndicesAnalyze performs the analysis process on a text and return the tokens breakdown of the text. +// IndicesAnalyze get tokens from text analysis // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-analyze. type IndicesAnalyze func(o ...func(*IndicesAnalyzeRequest)) (*Response, error) // IndicesAnalyzeRequest configures the Indices Analyze API request. diff --git a/esapi/api.indices.cancel_migrate_reindex.go b/esapi/api.indices.cancel_migrate_reindex.go index cb50796d5f..ad4b0fe597 100644 --- a/esapi/api.indices.cancel_migrate_reindex.go +++ b/esapi/api.indices.cancel_migrate_reindex.go @@ -42,11 +42,9 @@ func newIndicesCancelMigrateReindexFunc(t Transport) IndicesCancelMigrateReindex // ----- API Definition ------------------------------------------------------- -// IndicesCancelMigrateReindex this API returns the status of a migration reindex attempt for a data stream or index +// IndicesCancelMigrateReindex cancel a migration reindex operation // -// This API is experimental. -// -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-stream-reindex-cancel-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-cancel-migrate-reindex. type IndicesCancelMigrateReindex func(index string, o ...func(*IndicesCancelMigrateReindexRequest)) (*Response, error) // IndicesCancelMigrateReindexRequest configures the Indices Cancel Migrate Reindex API request. diff --git a/esapi/api.indices.clear_cache.go b/esapi/api.indices.clear_cache.go index 6b0e65f00e..179279beb1 100644 --- a/esapi/api.indices.clear_cache.go +++ b/esapi/api.indices.clear_cache.go @@ -43,9 +43,9 @@ func newIndicesClearCacheFunc(t Transport) IndicesClearCache { // ----- API Definition ------------------------------------------------------- -// IndicesClearCache clears all or specific caches for one or more indices. +// IndicesClearCache clear the cache // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-clear-cache. type IndicesClearCache func(o ...func(*IndicesClearCacheRequest)) (*Response, error) // IndicesClearCacheRequest configures the Indices Clear Cache API request. @@ -53,7 +53,7 @@ type IndicesClearCacheRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string Fielddata *bool Fields []string IgnoreUnavailable *bool @@ -111,8 +111,8 @@ func (r IndicesClearCacheRequest) Do(providedCtx context.Context, transport Tran params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.Fielddata != nil { @@ -232,7 +232,7 @@ func (f IndicesClearCache) WithAllowNoIndices(v bool) func(*IndicesClearCacheReq } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesClearCache) WithExpandWildcards(v string) func(*IndicesClearCacheRequest) { +func (f IndicesClearCache) WithExpandWildcards(v ...string) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.clone.go b/esapi/api.indices.clone.go index 4cd3959297..d3c356f72c 100644 --- a/esapi/api.indices.clone.go +++ b/esapi/api.indices.clone.go @@ -44,9 +44,9 @@ func newIndicesCloneFunc(t Transport) IndicesClone { // ----- API Definition ------------------------------------------------------- -// IndicesClone clones an index +// IndicesClone clone an index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-clone. type IndicesClone func(index string, target string, o ...func(*IndicesCloneRequest)) (*Response, error) // IndicesCloneRequest configures the Indices Clone API request. diff --git a/esapi/api.indices.close.go b/esapi/api.indices.close.go index fc944a069d..5b52f0cd97 100644 --- a/esapi/api.indices.close.go +++ b/esapi/api.indices.close.go @@ -45,9 +45,9 @@ func newIndicesCloseFunc(t Transport) IndicesClose { // ----- API Definition ------------------------------------------------------- -// IndicesClose closes an index. +// IndicesClose close an index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-close. type IndicesClose func(index []string, o ...func(*IndicesCloseRequest)) (*Response, error) // IndicesCloseRequest configures the Indices Close API request. @@ -55,7 +55,7 @@ type IndicesCloseRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool MasterTimeout time.Duration Timeout time.Duration @@ -112,8 +112,8 @@ func (r IndicesCloseRequest) Do(providedCtx context.Context, transport Transport params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -218,7 +218,7 @@ func (f IndicesClose) WithAllowNoIndices(v bool) func(*IndicesCloseRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesClose) WithExpandWildcards(v string) func(*IndicesCloseRequest) { +func (f IndicesClose) WithExpandWildcards(v ...string) func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.create.go b/esapi/api.indices.create.go index e6036ed6e1..ea612e183c 100644 --- a/esapi/api.indices.create.go +++ b/esapi/api.indices.create.go @@ -44,9 +44,9 @@ func newIndicesCreateFunc(t Transport) IndicesCreate { // ----- API Definition ------------------------------------------------------- -// IndicesCreate creates an index with optional settings and mappings. +// IndicesCreate create an index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-create. type IndicesCreate func(index string, o ...func(*IndicesCreateRequest)) (*Response, error) // IndicesCreateRequest configures the Indices Create API request. diff --git a/esapi/api.indices.create_from.go b/esapi/api.indices.create_from.go index 02ef4896e1..d45b2c174d 100644 --- a/esapi/api.indices.create_from.go +++ b/esapi/api.indices.create_from.go @@ -43,11 +43,9 @@ func newIndicesCreateFromFunc(t Transport) IndicesCreateFrom { // ----- API Definition ------------------------------------------------------- -// IndicesCreateFrom this API creates a destination from a source index. It copies the mappings and settings from the source index while allowing request settings and mappings to override the source values. +// IndicesCreateFrom create an index from a source index // -// This API is experimental. -// -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index-from-source.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-create-from. type IndicesCreateFrom func(dest string, source string, o ...func(*IndicesCreateFromRequest)) (*Response, error) // IndicesCreateFromRequest configures the Indices Create From API request. diff --git a/esapi/api.indices.delete.go b/esapi/api.indices.delete.go index 0cc6e27b05..de7ff7ee6f 100644 --- a/esapi/api.indices.delete.go +++ b/esapi/api.indices.delete.go @@ -45,9 +45,9 @@ func newIndicesDeleteFunc(t Transport) IndicesDelete { // ----- API Definition ------------------------------------------------------- -// IndicesDelete deletes an index. +// IndicesDelete delete indices // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete. type IndicesDelete func(index []string, o ...func(*IndicesDeleteRequest)) (*Response, error) // IndicesDeleteRequest configures the Indices Delete API request. @@ -55,7 +55,7 @@ type IndicesDeleteRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool MasterTimeout time.Duration Timeout time.Duration @@ -109,8 +109,8 @@ func (r IndicesDeleteRequest) Do(providedCtx context.Context, transport Transpor params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -211,7 +211,7 @@ func (f IndicesDelete) WithAllowNoIndices(v bool) func(*IndicesDeleteRequest) { } // WithExpandWildcards - whether wildcard expressions should get expanded to open, closed, or hidden indices. -func (f IndicesDelete) WithExpandWildcards(v string) func(*IndicesDeleteRequest) { +func (f IndicesDelete) WithExpandWildcards(v ...string) func(*IndicesDeleteRequest) { return func(r *IndicesDeleteRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.delete_alias.go b/esapi/api.indices.delete_alias.go index 28be6f0386..6d0ee9c9df 100644 --- a/esapi/api.indices.delete_alias.go +++ b/esapi/api.indices.delete_alias.go @@ -44,9 +44,9 @@ func newIndicesDeleteAliasFunc(t Transport) IndicesDeleteAlias { // ----- API Definition ------------------------------------------------------- -// IndicesDeleteAlias deletes an alias. +// IndicesDeleteAlias delete an alias // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-alias. type IndicesDeleteAlias func(index []string, name []string, o ...func(*IndicesDeleteAliasRequest)) (*Response, error) // IndicesDeleteAliasRequest configures the Indices Delete Alias API request. diff --git a/esapi/api.indices.delete_data_lifecycle.go b/esapi/api.indices.delete_data_lifecycle.go index f91c78c5ca..c8c59c4706 100644 --- a/esapi/api.indices.delete_data_lifecycle.go +++ b/esapi/api.indices.delete_data_lifecycle.go @@ -44,16 +44,16 @@ func newIndicesDeleteDataLifecycleFunc(t Transport) IndicesDeleteDataLifecycle { // ----- API Definition ------------------------------------------------------- -// IndicesDeleteDataLifecycle deletes the data stream lifecycle of the selected data streams. +// IndicesDeleteDataLifecycle delete data stream lifecycles // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-delete-lifecycle.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-data-lifecycle. type IndicesDeleteDataLifecycle func(name []string, o ...func(*IndicesDeleteDataLifecycleRequest)) (*Response, error) // IndicesDeleteDataLifecycleRequest configures the Indices Delete Data Lifecycle API request. type IndicesDeleteDataLifecycleRequest struct { Name []string - ExpandWildcards string + ExpandWildcards []string MasterTimeout time.Duration Timeout time.Duration @@ -106,8 +106,8 @@ func (r IndicesDeleteDataLifecycleRequest) Do(providedCtx context.Context, trans params = make(map[string]string) - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.MasterTimeout != 0 { @@ -197,7 +197,7 @@ func (f IndicesDeleteDataLifecycle) WithContext(v context.Context) func(*Indices } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). -func (f IndicesDeleteDataLifecycle) WithExpandWildcards(v string) func(*IndicesDeleteDataLifecycleRequest) { +func (f IndicesDeleteDataLifecycle) WithExpandWildcards(v ...string) func(*IndicesDeleteDataLifecycleRequest) { return func(r *IndicesDeleteDataLifecycleRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.delete_index_template.go b/esapi/api.indices.delete_index_template.go index 0c756f79ad..0845913027 100644 --- a/esapi/api.indices.delete_index_template.go +++ b/esapi/api.indices.delete_index_template.go @@ -43,9 +43,9 @@ func newIndicesDeleteIndexTemplateFunc(t Transport) IndicesDeleteIndexTemplate { // ----- API Definition ------------------------------------------------------- -// IndicesDeleteIndexTemplate deletes an index template. +// IndicesDeleteIndexTemplate delete an index template // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-template.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-index-template. type IndicesDeleteIndexTemplate func(name string, o ...func(*IndicesDeleteIndexTemplateRequest)) (*Response, error) // IndicesDeleteIndexTemplateRequest configures the Indices Delete Index Template API request. diff --git a/esapi/api.indices.delete_template.go b/esapi/api.indices.delete_template.go index fd353af0f7..9b922597b7 100644 --- a/esapi/api.indices.delete_template.go +++ b/esapi/api.indices.delete_template.go @@ -43,9 +43,9 @@ func newIndicesDeleteTemplateFunc(t Transport) IndicesDeleteTemplate { // ----- API Definition ------------------------------------------------------- -// IndicesDeleteTemplate deletes an index template. +// IndicesDeleteTemplate delete a legacy index template // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-template-v1.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-template. type IndicesDeleteTemplate func(name string, o ...func(*IndicesDeleteTemplateRequest)) (*Response, error) // IndicesDeleteTemplateRequest configures the Indices Delete Template API request. diff --git a/esapi/api.indices.disk_usage.go b/esapi/api.indices.disk_usage.go index c1efafcf0d..f89c066887 100644 --- a/esapi/api.indices.disk_usage.go +++ b/esapi/api.indices.disk_usage.go @@ -43,11 +43,11 @@ func newIndicesDiskUsageFunc(t Transport) IndicesDiskUsage { // ----- API Definition ------------------------------------------------------- -// IndicesDiskUsage analyzes the disk usage of each field of an index or data stream +// IndicesDiskUsage analyze the index disk usage // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-disk-usage.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-disk-usage. type IndicesDiskUsage func(index string, o ...func(*IndicesDiskUsageRequest)) (*Response, error) // IndicesDiskUsageRequest configures the Indices Disk Usage API request. @@ -55,7 +55,7 @@ type IndicesDiskUsageRequest struct { Index string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string Flush *bool IgnoreUnavailable *bool RunExpensiveTasks *bool @@ -107,8 +107,8 @@ func (r IndicesDiskUsageRequest) Do(providedCtx context.Context, transport Trans params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.Flush != nil { @@ -209,7 +209,7 @@ func (f IndicesDiskUsage) WithAllowNoIndices(v bool) func(*IndicesDiskUsageReque } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesDiskUsage) WithExpandWildcards(v string) func(*IndicesDiskUsageRequest) { +func (f IndicesDiskUsage) WithExpandWildcards(v ...string) func(*IndicesDiskUsageRequest) { return func(r *IndicesDiskUsageRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.downsample.go b/esapi/api.indices.downsample.go index 76bff9ef85..363240b008 100644 --- a/esapi/api.indices.downsample.go +++ b/esapi/api.indices.downsample.go @@ -47,7 +47,7 @@ func newIndicesDownsampleFunc(t Transport) IndicesDownsample { // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-rollup.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-downsample. type IndicesDownsample func(index string, body io.Reader, target_index string, o ...func(*IndicesDownsampleRequest)) (*Response, error) // IndicesDownsampleRequest configures the Indices Downsample API request. diff --git a/esapi/api.indices.exists.go b/esapi/api.indices.exists.go index 3b1488a4aa..b7f0e9ef9e 100644 --- a/esapi/api.indices.exists.go +++ b/esapi/api.indices.exists.go @@ -44,9 +44,9 @@ func newIndicesExistsFunc(t Transport) IndicesExists { // ----- API Definition ------------------------------------------------------- -// IndicesExists returns information about whether a particular index exists. +// IndicesExists check indices // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-exists. type IndicesExists func(index []string, o ...func(*IndicesExistsRequest)) (*Response, error) // IndicesExistsRequest configures the Indices Exists API request. @@ -54,7 +54,7 @@ type IndicesExistsRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string FlatSettings *bool IgnoreUnavailable *bool IncludeDefaults *bool @@ -109,8 +109,8 @@ func (r IndicesExistsRequest) Do(providedCtx context.Context, transport Transpor params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.FlatSettings != nil { @@ -215,7 +215,7 @@ func (f IndicesExists) WithAllowNoIndices(v bool) func(*IndicesExistsRequest) { } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). -func (f IndicesExists) WithExpandWildcards(v string) func(*IndicesExistsRequest) { +func (f IndicesExists) WithExpandWildcards(v ...string) func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.exists_alias.go b/esapi/api.indices.exists_alias.go index 600e195cdb..1e35c65e31 100644 --- a/esapi/api.indices.exists_alias.go +++ b/esapi/api.indices.exists_alias.go @@ -45,9 +45,9 @@ func newIndicesExistsAliasFunc(t Transport) IndicesExistsAlias { // ----- API Definition ------------------------------------------------------- -// IndicesExistsAlias returns information about whether a particular alias exists. +// IndicesExistsAlias check aliases // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-exists-alias. type IndicesExistsAlias func(name []string, o ...func(*IndicesExistsAliasRequest)) (*Response, error) // IndicesExistsAliasRequest configures the Indices Exists Alias API request. @@ -57,7 +57,7 @@ type IndicesExistsAliasRequest struct { Name []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool MasterTimeout time.Duration @@ -119,8 +119,8 @@ func (r IndicesExistsAliasRequest) Do(providedCtx context.Context, transport Tra params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -224,7 +224,7 @@ func (f IndicesExistsAlias) WithAllowNoIndices(v bool) func(*IndicesExistsAliasR } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesExistsAlias) WithExpandWildcards(v string) func(*IndicesExistsAliasRequest) { +func (f IndicesExistsAlias) WithExpandWildcards(v ...string) func(*IndicesExistsAliasRequest) { return func(r *IndicesExistsAliasRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.exists_index_template.go b/esapi/api.indices.exists_index_template.go index a37812da72..da82ec2674 100644 --- a/esapi/api.indices.exists_index_template.go +++ b/esapi/api.indices.exists_index_template.go @@ -44,9 +44,9 @@ func newIndicesExistsIndexTemplateFunc(t Transport) IndicesExistsIndexTemplate { // ----- API Definition ------------------------------------------------------- -// IndicesExistsIndexTemplate returns information about whether a particular index template exists. +// IndicesExistsIndexTemplate check index templates // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/index-templates.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-exists-index-template. type IndicesExistsIndexTemplate func(name string, o ...func(*IndicesExistsIndexTemplateRequest)) (*Response, error) // IndicesExistsIndexTemplateRequest configures the Indices Exists Index Template API request. diff --git a/esapi/api.indices.exists_template.go b/esapi/api.indices.exists_template.go index 9c8cc9ed54..119c020eb6 100644 --- a/esapi/api.indices.exists_template.go +++ b/esapi/api.indices.exists_template.go @@ -45,9 +45,9 @@ func newIndicesExistsTemplateFunc(t Transport) IndicesExistsTemplate { // ----- API Definition ------------------------------------------------------- -// IndicesExistsTemplate returns information about whether a particular index template exists. +// IndicesExistsTemplate check existence of index templates // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-template-exists-v1.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-exists-template. type IndicesExistsTemplate func(name []string, o ...func(*IndicesExistsTemplateRequest)) (*Response, error) // IndicesExistsTemplateRequest configures the Indices Exists Template API request. diff --git a/esapi/api.indices.explain_data_lifecycle.go b/esapi/api.indices.explain_data_lifecycle.go index e77b633935..5d0f81bc33 100644 --- a/esapi/api.indices.explain_data_lifecycle.go +++ b/esapi/api.indices.explain_data_lifecycle.go @@ -44,9 +44,9 @@ func newIndicesExplainDataLifecycleFunc(t Transport) IndicesExplainDataLifecycle // ----- API Definition ------------------------------------------------------- -// IndicesExplainDataLifecycle retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. +// IndicesExplainDataLifecycle get the status for a data stream lifecycle // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams-explain-lifecycle.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-explain-data-lifecycle. type IndicesExplainDataLifecycle func(index string, o ...func(*IndicesExplainDataLifecycleRequest)) (*Response, error) // IndicesExplainDataLifecycleRequest configures the Indices Explain Data Lifecycle API request. diff --git a/esapi/api.indices.field_usage_stats.go b/esapi/api.indices.field_usage_stats.go index c8944d3c58..79a0b56ac3 100644 --- a/esapi/api.indices.field_usage_stats.go +++ b/esapi/api.indices.field_usage_stats.go @@ -43,11 +43,11 @@ func newIndicesFieldUsageStatsFunc(t Transport) IndicesFieldUsageStats { // ----- API Definition ------------------------------------------------------- -// IndicesFieldUsageStats returns the field usage stats for each field of an index +// IndicesFieldUsageStats get field usage stats // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/field-usage-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-field-usage-stats. type IndicesFieldUsageStats func(index string, o ...func(*IndicesFieldUsageStatsRequest)) (*Response, error) // IndicesFieldUsageStatsRequest configures the Indices Field Usage Stats API request. @@ -55,7 +55,7 @@ type IndicesFieldUsageStatsRequest struct { Index string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string Fields []string IgnoreUnavailable *bool @@ -106,8 +106,8 @@ func (r IndicesFieldUsageStatsRequest) Do(providedCtx context.Context, transport params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if len(r.Fields) > 0 { @@ -204,7 +204,7 @@ func (f IndicesFieldUsageStats) WithAllowNoIndices(v bool) func(*IndicesFieldUsa } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesFieldUsageStats) WithExpandWildcards(v string) func(*IndicesFieldUsageStatsRequest) { +func (f IndicesFieldUsageStats) WithExpandWildcards(v ...string) func(*IndicesFieldUsageStatsRequest) { return func(r *IndicesFieldUsageStatsRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.flush.go b/esapi/api.indices.flush.go index 546476bb8a..7f3008371a 100644 --- a/esapi/api.indices.flush.go +++ b/esapi/api.indices.flush.go @@ -43,9 +43,9 @@ func newIndicesFlushFunc(t Transport) IndicesFlush { // ----- API Definition ------------------------------------------------------- -// IndicesFlush performs the flush operation on one or more indices. +// IndicesFlush flush data streams or indices // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-flush. type IndicesFlush func(o ...func(*IndicesFlushRequest)) (*Response, error) // IndicesFlushRequest configures the Indices Flush API request. @@ -53,7 +53,7 @@ type IndicesFlushRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string Force *bool IgnoreUnavailable *bool WaitIfOngoing *bool @@ -107,8 +107,8 @@ func (r IndicesFlushRequest) Do(providedCtx context.Context, transport Transport params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.Force != nil { @@ -216,7 +216,7 @@ func (f IndicesFlush) WithAllowNoIndices(v bool) func(*IndicesFlushRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesFlush) WithExpandWildcards(v string) func(*IndicesFlushRequest) { +func (f IndicesFlush) WithExpandWildcards(v ...string) func(*IndicesFlushRequest) { return func(r *IndicesFlushRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.forcemerge.go b/esapi/api.indices.forcemerge.go index 36e4a3b819..98954d970f 100644 --- a/esapi/api.indices.forcemerge.go +++ b/esapi/api.indices.forcemerge.go @@ -43,9 +43,9 @@ func newIndicesForcemergeFunc(t Transport) IndicesForcemerge { // ----- API Definition ------------------------------------------------------- -// IndicesForcemerge performs the force merge operation on one or more indices. +// IndicesForcemerge force a merge // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-forcemerge. type IndicesForcemerge func(o ...func(*IndicesForcemergeRequest)) (*Response, error) // IndicesForcemergeRequest configures the Indices Forcemerge API request. @@ -53,7 +53,7 @@ type IndicesForcemergeRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string Flush *bool IgnoreUnavailable *bool MaxNumSegments *int @@ -109,8 +109,8 @@ func (r IndicesForcemergeRequest) Do(providedCtx context.Context, transport Tran params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.Flush != nil { @@ -226,7 +226,7 @@ func (f IndicesForcemerge) WithAllowNoIndices(v bool) func(*IndicesForcemergeReq } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesForcemerge) WithExpandWildcards(v string) func(*IndicesForcemergeRequest) { +func (f IndicesForcemerge) WithExpandWildcards(v ...string) func(*IndicesForcemergeRequest) { return func(r *IndicesForcemergeRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.get.go b/esapi/api.indices.get.go index 1a62666332..0409de3a13 100644 --- a/esapi/api.indices.get.go +++ b/esapi/api.indices.get.go @@ -45,9 +45,9 @@ func newIndicesGetFunc(t Transport) IndicesGet { // ----- API Definition ------------------------------------------------------- -// IndicesGet returns information about one or more indices. +// IndicesGet get index information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get. type IndicesGet func(index []string, o ...func(*IndicesGetRequest)) (*Response, error) // IndicesGetRequest configures the Indices Get API request. @@ -55,8 +55,8 @@ type IndicesGetRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string - Features string + ExpandWildcards []string + Features []string FlatSettings *bool IgnoreUnavailable *bool IncludeDefaults *bool @@ -112,12 +112,12 @@ func (r IndicesGetRequest) Do(providedCtx context.Context, transport Transport) params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } - if r.Features != "" { - params["features"] = r.Features + if len(r.Features) > 0 { + params["features"] = strings.Join(r.Features, ",") } if r.FlatSettings != nil { @@ -226,14 +226,14 @@ func (f IndicesGet) WithAllowNoIndices(v bool) func(*IndicesGetRequest) { } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). -func (f IndicesGet) WithExpandWildcards(v string) func(*IndicesGetRequest) { +func (f IndicesGet) WithExpandWildcards(v ...string) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.ExpandWildcards = v } } // WithFeatures - return only information on specified index features. -func (f IndicesGet) WithFeatures(v string) func(*IndicesGetRequest) { +func (f IndicesGet) WithFeatures(v ...string) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { r.Features = v } diff --git a/esapi/api.indices.get_alias.go b/esapi/api.indices.get_alias.go index 656d2ce0c3..641c67f43d 100644 --- a/esapi/api.indices.get_alias.go +++ b/esapi/api.indices.get_alias.go @@ -44,9 +44,9 @@ func newIndicesGetAliasFunc(t Transport) IndicesGetAlias { // ----- API Definition ------------------------------------------------------- -// IndicesGetAlias returns an alias. +// IndicesGetAlias get aliases // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-alias. type IndicesGetAlias func(o ...func(*IndicesGetAliasRequest)) (*Response, error) // IndicesGetAliasRequest configures the Indices Get Alias API request. @@ -56,7 +56,7 @@ type IndicesGetAliasRequest struct { Name []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool MasterTimeout time.Duration @@ -116,8 +116,8 @@ func (r IndicesGetAliasRequest) Do(providedCtx context.Context, transport Transp params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -228,7 +228,7 @@ func (f IndicesGetAlias) WithAllowNoIndices(v bool) func(*IndicesGetAliasRequest } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesGetAlias) WithExpandWildcards(v string) func(*IndicesGetAliasRequest) { +func (f IndicesGetAlias) WithExpandWildcards(v ...string) func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.get_data_lifecycle.go b/esapi/api.indices.get_data_lifecycle.go index b5bf410f54..17d33cda1e 100644 --- a/esapi/api.indices.get_data_lifecycle.go +++ b/esapi/api.indices.get_data_lifecycle.go @@ -45,16 +45,16 @@ func newIndicesGetDataLifecycleFunc(t Transport) IndicesGetDataLifecycle { // ----- API Definition ------------------------------------------------------- -// IndicesGetDataLifecycle returns the data stream lifecycle of the selected data streams. +// IndicesGetDataLifecycle get data stream lifecycles // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-get-lifecycle.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-lifecycle. type IndicesGetDataLifecycle func(name []string, o ...func(*IndicesGetDataLifecycleRequest)) (*Response, error) // IndicesGetDataLifecycleRequest configures the Indices Get Data Lifecycle API request. type IndicesGetDataLifecycleRequest struct { Name []string - ExpandWildcards string + ExpandWildcards []string IncludeDefaults *bool MasterTimeout time.Duration @@ -107,8 +107,8 @@ func (r IndicesGetDataLifecycleRequest) Do(providedCtx context.Context, transpor params = make(map[string]string) - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IncludeDefaults != nil { @@ -198,7 +198,7 @@ func (f IndicesGetDataLifecycle) WithContext(v context.Context) func(*IndicesGet } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). -func (f IndicesGetDataLifecycle) WithExpandWildcards(v string) func(*IndicesGetDataLifecycleRequest) { +func (f IndicesGetDataLifecycle) WithExpandWildcards(v ...string) func(*IndicesGetDataLifecycleRequest) { return func(r *IndicesGetDataLifecycleRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.get_data_lifecycle_stats.go b/esapi/api.indices.get_data_lifecycle_stats.go index 76a9ed2ed7..2cfb279320 100644 --- a/esapi/api.indices.get_data_lifecycle_stats.go +++ b/esapi/api.indices.get_data_lifecycle_stats.go @@ -42,9 +42,9 @@ func newIndicesGetDataLifecycleStatsFunc(t Transport) IndicesGetDataLifecycleSta // ----- API Definition ------------------------------------------------------- -// IndicesGetDataLifecycleStats get data stream lifecycle statistics. +// IndicesGetDataLifecycleStats get data stream lifecycle stats // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-get-lifecycle-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-lifecycle-stats. type IndicesGetDataLifecycleStats func(o ...func(*IndicesGetDataLifecycleStatsRequest)) (*Response, error) // IndicesGetDataLifecycleStatsRequest configures the Indices Get Data Lifecycle Stats API request. diff --git a/esapi/api.indices.get_field_mapping.go b/esapi/api.indices.get_field_mapping.go index 72ae95edcb..deb581ab88 100644 --- a/esapi/api.indices.get_field_mapping.go +++ b/esapi/api.indices.get_field_mapping.go @@ -44,9 +44,9 @@ func newIndicesGetFieldMappingFunc(t Transport) IndicesGetFieldMapping { // ----- API Definition ------------------------------------------------------- -// IndicesGetFieldMapping returns mapping for one or more fields. +// IndicesGetFieldMapping get mapping definitions // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping. type IndicesGetFieldMapping func(fields []string, o ...func(*IndicesGetFieldMappingRequest)) (*Response, error) // IndicesGetFieldMappingRequest configures the Indices Get Field Mapping API request. @@ -56,7 +56,7 @@ type IndicesGetFieldMappingRequest struct { Fields []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool IncludeDefaults *bool @@ -120,8 +120,8 @@ func (r IndicesGetFieldMappingRequest) Do(providedCtx context.Context, transport params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -225,7 +225,7 @@ func (f IndicesGetFieldMapping) WithAllowNoIndices(v bool) func(*IndicesGetField } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesGetFieldMapping) WithExpandWildcards(v string) func(*IndicesGetFieldMappingRequest) { +func (f IndicesGetFieldMapping) WithExpandWildcards(v ...string) func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.get_index_template.go b/esapi/api.indices.get_index_template.go index 58c8773b87..fb6ade97d7 100644 --- a/esapi/api.indices.get_index_template.go +++ b/esapi/api.indices.get_index_template.go @@ -44,9 +44,9 @@ func newIndicesGetIndexTemplateFunc(t Transport) IndicesGetIndexTemplate { // ----- API Definition ------------------------------------------------------- -// IndicesGetIndexTemplate returns an index template. +// IndicesGetIndexTemplate get index templates // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-index-template. type IndicesGetIndexTemplate func(o ...func(*IndicesGetIndexTemplateRequest)) (*Response, error) // IndicesGetIndexTemplateRequest configures the Indices Get Index Template API request. diff --git a/esapi/api.indices.get_mapping.go b/esapi/api.indices.get_mapping.go index af256a1085..c93cfbafa9 100644 --- a/esapi/api.indices.get_mapping.go +++ b/esapi/api.indices.get_mapping.go @@ -44,9 +44,9 @@ func newIndicesGetMappingFunc(t Transport) IndicesGetMapping { // ----- API Definition ------------------------------------------------------- -// IndicesGetMapping returns mappings for one or more indices. +// IndicesGetMapping get mapping definitions // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping. type IndicesGetMapping func(o ...func(*IndicesGetMappingRequest)) (*Response, error) // IndicesGetMappingRequest configures the Indices Get Mapping API request. @@ -54,7 +54,7 @@ type IndicesGetMappingRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool Local *bool MasterTimeout time.Duration @@ -108,8 +108,8 @@ func (r IndicesGetMappingRequest) Do(providedCtx context.Context, transport Tran params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -217,7 +217,7 @@ func (f IndicesGetMapping) WithAllowNoIndices(v bool) func(*IndicesGetMappingReq } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesGetMapping) WithExpandWildcards(v string) func(*IndicesGetMappingRequest) { +func (f IndicesGetMapping) WithExpandWildcards(v ...string) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.get_migrate_reindex_status.go b/esapi/api.indices.get_migrate_reindex_status.go index 459a37c3fc..af7a1b21c0 100644 --- a/esapi/api.indices.get_migrate_reindex_status.go +++ b/esapi/api.indices.get_migrate_reindex_status.go @@ -42,11 +42,9 @@ func newIndicesGetMigrateReindexStatusFunc(t Transport) IndicesGetMigrateReindex // ----- API Definition ------------------------------------------------------- -// IndicesGetMigrateReindexStatus this API returns the status of a migration reindex attempt for a data stream or index +// IndicesGetMigrateReindexStatus get the migration reindexing status // -// This API is experimental. -// -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-stream-reindex-status-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-migration. type IndicesGetMigrateReindexStatus func(index string, o ...func(*IndicesGetMigrateReindexStatusRequest)) (*Response, error) // IndicesGetMigrateReindexStatusRequest configures the Indices Get Migrate Reindex Status API request. diff --git a/esapi/api.indices.get_settings.go b/esapi/api.indices.get_settings.go index 3b69abff7b..43c2d3919b 100644 --- a/esapi/api.indices.get_settings.go +++ b/esapi/api.indices.get_settings.go @@ -44,9 +44,9 @@ func newIndicesGetSettingsFunc(t Transport) IndicesGetSettings { // ----- API Definition ------------------------------------------------------- -// IndicesGetSettings returns settings for one or more indices. +// IndicesGetSettings get index settings // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-settings. type IndicesGetSettings func(o ...func(*IndicesGetSettingsRequest)) (*Response, error) // IndicesGetSettingsRequest configures the Indices Get Settings API request. @@ -56,7 +56,7 @@ type IndicesGetSettingsRequest struct { Name []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string FlatSettings *bool IgnoreUnavailable *bool IncludeDefaults *bool @@ -119,8 +119,8 @@ func (r IndicesGetSettingsRequest) Do(providedCtx context.Context, transport Tra params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.FlatSettings != nil { @@ -243,7 +243,7 @@ func (f IndicesGetSettings) WithAllowNoIndices(v bool) func(*IndicesGetSettingsR } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesGetSettings) WithExpandWildcards(v string) func(*IndicesGetSettingsRequest) { +func (f IndicesGetSettings) WithExpandWildcards(v ...string) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.get_template.go b/esapi/api.indices.get_template.go index 73f9e72091..a43d2e9dd5 100644 --- a/esapi/api.indices.get_template.go +++ b/esapi/api.indices.get_template.go @@ -44,9 +44,9 @@ func newIndicesGetTemplateFunc(t Transport) IndicesGetTemplate { // ----- API Definition ------------------------------------------------------- -// IndicesGetTemplate returns an index template. +// IndicesGetTemplate get legacy index templates // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template-v1.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-template. type IndicesGetTemplate func(o ...func(*IndicesGetTemplateRequest)) (*Response, error) // IndicesGetTemplateRequest configures the Indices Get Template API request. diff --git a/esapi/api.indices.migrate_reindex.go b/esapi/api.indices.migrate_reindex.go index caaaa9a6c8..ca75f949e2 100644 --- a/esapi/api.indices.migrate_reindex.go +++ b/esapi/api.indices.migrate_reindex.go @@ -43,11 +43,9 @@ func newIndicesMigrateReindexFunc(t Transport) IndicesMigrateReindex { // ----- API Definition ------------------------------------------------------- -// IndicesMigrateReindex this API reindexes all legacy backing indices for a data stream. It does this in a persistent task. The persistent task id is returned immediately, and the reindexing work is completed in that task +// IndicesMigrateReindex reindex legacy backing indices // -// This API is experimental. -// -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-stream-reindex-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-migrate-reindex. type IndicesMigrateReindex func(body io.Reader, o ...func(*IndicesMigrateReindexRequest)) (*Response, error) // IndicesMigrateReindexRequest configures the Indices Migrate Reindex API request. diff --git a/esapi/api.indices.modify_data_stream.go b/esapi/api.indices.modify_data_stream.go index 0777d22b21..9d3eb112ad 100644 --- a/esapi/api.indices.modify_data_stream.go +++ b/esapi/api.indices.modify_data_stream.go @@ -43,9 +43,9 @@ func newIndicesModifyDataStreamFunc(t Transport) IndicesModifyDataStream { // ----- API Definition ------------------------------------------------------- -// IndicesModifyDataStream modifies a data stream +// IndicesModifyDataStream update data streams // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-modify-data-stream. type IndicesModifyDataStream func(body io.Reader, o ...func(*IndicesModifyDataStreamRequest)) (*Response, error) // IndicesModifyDataStreamRequest configures the Indices Modify Data Stream API request. diff --git a/esapi/api.indices.open.go b/esapi/api.indices.open.go index 85251e1ffa..a3eeda7556 100644 --- a/esapi/api.indices.open.go +++ b/esapi/api.indices.open.go @@ -45,9 +45,9 @@ func newIndicesOpenFunc(t Transport) IndicesOpen { // ----- API Definition ------------------------------------------------------- -// IndicesOpen opens an index. +// IndicesOpen open a closed index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-open. type IndicesOpen func(index []string, o ...func(*IndicesOpenRequest)) (*Response, error) // IndicesOpenRequest configures the Indices Open API request. @@ -55,7 +55,7 @@ type IndicesOpenRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool MasterTimeout time.Duration Timeout time.Duration @@ -112,8 +112,8 @@ func (r IndicesOpenRequest) Do(providedCtx context.Context, transport Transport) params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -218,7 +218,7 @@ func (f IndicesOpen) WithAllowNoIndices(v bool) func(*IndicesOpenRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesOpen) WithExpandWildcards(v string) func(*IndicesOpenRequest) { +func (f IndicesOpen) WithExpandWildcards(v ...string) func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.put_alias.go b/esapi/api.indices.put_alias.go index 49f31875fb..2b2a61ee0b 100644 --- a/esapi/api.indices.put_alias.go +++ b/esapi/api.indices.put_alias.go @@ -45,9 +45,9 @@ func newIndicesPutAliasFunc(t Transport) IndicesPutAlias { // ----- API Definition ------------------------------------------------------- -// IndicesPutAlias creates or updates an alias. +// IndicesPutAlias create or update an alias // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-alias. type IndicesPutAlias func(index []string, name string, o ...func(*IndicesPutAliasRequest)) (*Response, error) // IndicesPutAliasRequest configures the Indices Put Alias API request. diff --git a/esapi/api.indices.put_data_lifecycle.go b/esapi/api.indices.put_data_lifecycle.go index bb1ad59e59..b63d665c03 100644 --- a/esapi/api.indices.put_data_lifecycle.go +++ b/esapi/api.indices.put_data_lifecycle.go @@ -45,9 +45,9 @@ func newIndicesPutDataLifecycleFunc(t Transport) IndicesPutDataLifecycle { // ----- API Definition ------------------------------------------------------- -// IndicesPutDataLifecycle updates the data stream lifecycle of the selected data streams. +// IndicesPutDataLifecycle update data stream lifecycles // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-put-lifecycle.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-lifecycle. type IndicesPutDataLifecycle func(name []string, o ...func(*IndicesPutDataLifecycleRequest)) (*Response, error) // IndicesPutDataLifecycleRequest configures the Indices Put Data Lifecycle API request. @@ -56,7 +56,7 @@ type IndicesPutDataLifecycleRequest struct { Name []string - ExpandWildcards string + ExpandWildcards []string MasterTimeout time.Duration Timeout time.Duration @@ -109,8 +109,8 @@ func (r IndicesPutDataLifecycleRequest) Do(providedCtx context.Context, transpor params = make(map[string]string) - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.MasterTimeout != 0 { @@ -214,7 +214,7 @@ func (f IndicesPutDataLifecycle) WithBody(v io.Reader) func(*IndicesPutDataLifec } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). -func (f IndicesPutDataLifecycle) WithExpandWildcards(v string) func(*IndicesPutDataLifecycleRequest) { +func (f IndicesPutDataLifecycle) WithExpandWildcards(v ...string) func(*IndicesPutDataLifecycleRequest) { return func(r *IndicesPutDataLifecycleRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.put_data_stream_options.go b/esapi/api.indices.put_data_stream_options.go index 5214a3160c..e6df0b76ed 100644 --- a/esapi/api.indices.put_data_stream_options.go +++ b/esapi/api.indices.put_data_stream_options.go @@ -45,9 +45,9 @@ func newIndicesPutDataStreamOptionsFunc(t Transport) IndicesPutDataStreamOptions // ----- API Definition ------------------------------------------------------- -// IndicesPutDataStreamOptions updates the data stream options of the selected data streams. +// IndicesPutDataStreamOptions update data stream options // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-stream-options. type IndicesPutDataStreamOptions func(name []string, o ...func(*IndicesPutDataStreamOptionsRequest)) (*Response, error) // IndicesPutDataStreamOptionsRequest configures the Indices Put Data Stream Options API request. @@ -56,7 +56,7 @@ type IndicesPutDataStreamOptionsRequest struct { Name []string - ExpandWildcards string + ExpandWildcards []string MasterTimeout time.Duration Timeout time.Duration @@ -109,8 +109,8 @@ func (r IndicesPutDataStreamOptionsRequest) Do(providedCtx context.Context, tran params = make(map[string]string) - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.MasterTimeout != 0 { @@ -214,7 +214,7 @@ func (f IndicesPutDataStreamOptions) WithBody(v io.Reader) func(*IndicesPutDataS } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). -func (f IndicesPutDataStreamOptions) WithExpandWildcards(v string) func(*IndicesPutDataStreamOptionsRequest) { +func (f IndicesPutDataStreamOptions) WithExpandWildcards(v ...string) func(*IndicesPutDataStreamOptionsRequest) { return func(r *IndicesPutDataStreamOptionsRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.put_data_stream_settings.go b/esapi/api.indices.put_data_stream_settings.go index 7fd81804a5..46ee0008d3 100644 --- a/esapi/api.indices.put_data_stream_settings.go +++ b/esapi/api.indices.put_data_stream_settings.go @@ -45,9 +45,9 @@ func newIndicesPutDataStreamSettingsFunc(t Transport) IndicesPutDataStreamSettin // ----- API Definition ------------------------------------------------------- -// IndicesPutDataStreamSettings updates a data stream's settings +// IndicesPutDataStreamSettings update data stream settings // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-stream-settings. type IndicesPutDataStreamSettings func(name string, body io.Reader, o ...func(*IndicesPutDataStreamSettingsRequest)) (*Response, error) // IndicesPutDataStreamSettingsRequest configures the Indices Put Data Stream Settings API request. diff --git a/esapi/api.indices.put_index_template.go b/esapi/api.indices.put_index_template.go index 722dfe0b91..8fc8db9597 100644 --- a/esapi/api.indices.put_index_template.go +++ b/esapi/api.indices.put_index_template.go @@ -45,9 +45,9 @@ func newIndicesPutIndexTemplateFunc(t Transport) IndicesPutIndexTemplate { // ----- API Definition ------------------------------------------------------- -// IndicesPutIndexTemplate creates or updates an index template. +// IndicesPutIndexTemplate create or update an index template // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-template.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template. type IndicesPutIndexTemplate func(name string, body io.Reader, o ...func(*IndicesPutIndexTemplateRequest)) (*Response, error) // IndicesPutIndexTemplateRequest configures the Indices Put Index Template API request. diff --git a/esapi/api.indices.put_mapping.go b/esapi/api.indices.put_mapping.go index 0478686384..c35832a8cd 100644 --- a/esapi/api.indices.put_mapping.go +++ b/esapi/api.indices.put_mapping.go @@ -45,9 +45,9 @@ func newIndicesPutMappingFunc(t Transport) IndicesPutMapping { // ----- API Definition ------------------------------------------------------- -// IndicesPutMapping updates the index mappings. +// IndicesPutMapping update field mappings // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-mapping. type IndicesPutMapping func(index []string, body io.Reader, o ...func(*IndicesPutMappingRequest)) (*Response, error) // IndicesPutMappingRequest configures the Indices Put Mapping API request. @@ -57,7 +57,7 @@ type IndicesPutMappingRequest struct { Body io.Reader AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool MasterTimeout time.Duration Timeout time.Duration @@ -108,8 +108,8 @@ func (r IndicesPutMappingRequest) Do(providedCtx context.Context, transport Tran params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -221,7 +221,7 @@ func (f IndicesPutMapping) WithAllowNoIndices(v bool) func(*IndicesPutMappingReq } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesPutMapping) WithExpandWildcards(v string) func(*IndicesPutMappingRequest) { +func (f IndicesPutMapping) WithExpandWildcards(v ...string) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.put_settings.go b/esapi/api.indices.put_settings.go index c604a6ffc7..939df30596 100644 --- a/esapi/api.indices.put_settings.go +++ b/esapi/api.indices.put_settings.go @@ -45,9 +45,9 @@ func newIndicesPutSettingsFunc(t Transport) IndicesPutSettings { // ----- API Definition ------------------------------------------------------- -// IndicesPutSettings updates the index settings. +// IndicesPutSettings update index settings // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-settings. type IndicesPutSettings func(body io.Reader, o ...func(*IndicesPutSettingsRequest)) (*Response, error) // IndicesPutSettingsRequest configures the Indices Put Settings API request. @@ -57,7 +57,7 @@ type IndicesPutSettingsRequest struct { Body io.Reader AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string FlatSettings *bool IgnoreUnavailable *bool MasterTimeout time.Duration @@ -114,8 +114,8 @@ func (r IndicesPutSettingsRequest) Do(providedCtx context.Context, transport Tra params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.FlatSettings != nil { @@ -242,7 +242,7 @@ func (f IndicesPutSettings) WithAllowNoIndices(v bool) func(*IndicesPutSettingsR } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesPutSettings) WithExpandWildcards(v string) func(*IndicesPutSettingsRequest) { +func (f IndicesPutSettings) WithExpandWildcards(v ...string) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.put_template.go b/esapi/api.indices.put_template.go index 875b0896e7..3f4de5be57 100644 --- a/esapi/api.indices.put_template.go +++ b/esapi/api.indices.put_template.go @@ -45,9 +45,9 @@ func newIndicesPutTemplateFunc(t Transport) IndicesPutTemplate { // ----- API Definition ------------------------------------------------------- -// IndicesPutTemplate creates or updates an index template. +// IndicesPutTemplate create or update a legacy index template // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates-v1.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-template. type IndicesPutTemplate func(name string, body io.Reader, o ...func(*IndicesPutTemplateRequest)) (*Response, error) // IndicesPutTemplateRequest configures the Indices Put Template API request. diff --git a/esapi/api.indices.recovery.go b/esapi/api.indices.recovery.go index f87008e9d7..477dad839c 100644 --- a/esapi/api.indices.recovery.go +++ b/esapi/api.indices.recovery.go @@ -43,9 +43,9 @@ func newIndicesRecoveryFunc(t Transport) IndicesRecovery { // ----- API Definition ------------------------------------------------------- -// IndicesRecovery returns information about ongoing index shard recoveries. +// IndicesRecovery get index recovery information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-recovery. type IndicesRecovery func(o ...func(*IndicesRecoveryRequest)) (*Response, error) // IndicesRecoveryRequest configures the Indices Recovery API request. @@ -55,7 +55,7 @@ type IndicesRecoveryRequest struct { ActiveOnly *bool AllowNoIndices *bool Detailed *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool Pretty bool @@ -115,8 +115,8 @@ func (r IndicesRecoveryRequest) Do(providedCtx context.Context, transport Transp params["detailed"] = strconv.FormatBool(*r.Detailed) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -230,7 +230,7 @@ func (f IndicesRecovery) WithDetailed(v bool) func(*IndicesRecoveryRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesRecovery) WithExpandWildcards(v string) func(*IndicesRecoveryRequest) { +func (f IndicesRecovery) WithExpandWildcards(v ...string) func(*IndicesRecoveryRequest) { return func(r *IndicesRecoveryRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.refresh.go b/esapi/api.indices.refresh.go index be6e230382..6e48cd3c30 100644 --- a/esapi/api.indices.refresh.go +++ b/esapi/api.indices.refresh.go @@ -43,9 +43,9 @@ func newIndicesRefreshFunc(t Transport) IndicesRefresh { // ----- API Definition ------------------------------------------------------- -// IndicesRefresh performs the refresh operation in one or more indices. +// IndicesRefresh refresh an index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-refresh. type IndicesRefresh func(o ...func(*IndicesRefreshRequest)) (*Response, error) // IndicesRefreshRequest configures the Indices Refresh API request. @@ -53,7 +53,7 @@ type IndicesRefreshRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool Pretty bool @@ -105,8 +105,8 @@ func (r IndicesRefreshRequest) Do(providedCtx context.Context, transport Transpo params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -206,7 +206,7 @@ func (f IndicesRefresh) WithAllowNoIndices(v bool) func(*IndicesRefreshRequest) } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesRefresh) WithExpandWildcards(v string) func(*IndicesRefreshRequest) { +func (f IndicesRefresh) WithExpandWildcards(v ...string) func(*IndicesRefreshRequest) { return func(r *IndicesRefreshRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.remove_block.go b/esapi/api.indices.remove_block.go index e348d8ef7d..1cc6a0ae43 100644 --- a/esapi/api.indices.remove_block.go +++ b/esapi/api.indices.remove_block.go @@ -45,9 +45,9 @@ func newIndicesRemoveBlockFunc(t Transport) IndicesRemoveBlock { // ----- API Definition ------------------------------------------------------- -// IndicesRemoveBlock removes a block from an index. +// IndicesRemoveBlock remove an index block // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-remove-block. type IndicesRemoveBlock func(index []string, block string, o ...func(*IndicesRemoveBlockRequest)) (*Response, error) // IndicesRemoveBlockRequest configures the Indices Remove Block API request. @@ -57,7 +57,7 @@ type IndicesRemoveBlockRequest struct { Block string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool MasterTimeout time.Duration Timeout time.Duration @@ -118,8 +118,8 @@ func (r IndicesRemoveBlockRequest) Do(providedCtx context.Context, transport Tra params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -220,7 +220,7 @@ func (f IndicesRemoveBlock) WithAllowNoIndices(v bool) func(*IndicesRemoveBlockR } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesRemoveBlock) WithExpandWildcards(v string) func(*IndicesRemoveBlockRequest) { +func (f IndicesRemoveBlock) WithExpandWildcards(v ...string) func(*IndicesRemoveBlockRequest) { return func(r *IndicesRemoveBlockRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.resolve_cluster.go b/esapi/api.indices.resolve_cluster.go index 3ead8fc06f..f5860e3ab8 100644 --- a/esapi/api.indices.resolve_cluster.go +++ b/esapi/api.indices.resolve_cluster.go @@ -44,9 +44,9 @@ func newIndicesResolveClusterFunc(t Transport) IndicesResolveCluster { // ----- API Definition ------------------------------------------------------- -// IndicesResolveCluster resolves the specified index expressions to return information about each cluster. If no index expression is provided, this endpoint will return information about all the remote clusters that are configured on the local cluster. +// IndicesResolveCluster resolve the cluster // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-cluster-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-resolve-cluster. type IndicesResolveCluster func(o ...func(*IndicesResolveClusterRequest)) (*Response, error) // IndicesResolveClusterRequest configures the Indices Resolve Cluster API request. @@ -54,7 +54,7 @@ type IndicesResolveClusterRequest struct { Name []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreThrottled *bool IgnoreUnavailable *bool Timeout time.Duration @@ -110,8 +110,8 @@ func (r IndicesResolveClusterRequest) Do(providedCtx context.Context, transport params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreThrottled != nil { @@ -219,7 +219,7 @@ func (f IndicesResolveCluster) WithAllowNoIndices(v bool) func(*IndicesResolveCl } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). only allowed when providing an index expression.. -func (f IndicesResolveCluster) WithExpandWildcards(v string) func(*IndicesResolveClusterRequest) { +func (f IndicesResolveCluster) WithExpandWildcards(v ...string) func(*IndicesResolveClusterRequest) { return func(r *IndicesResolveClusterRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.resolve_index.go b/esapi/api.indices.resolve_index.go index 6cb0be31d6..91cbb22e6b 100644 --- a/esapi/api.indices.resolve_index.go +++ b/esapi/api.indices.resolve_index.go @@ -44,9 +44,9 @@ func newIndicesResolveIndexFunc(t Transport) IndicesResolveIndex { // ----- API Definition ------------------------------------------------------- -// IndicesResolveIndex returns information about any matching indices, aliases, and data streams +// IndicesResolveIndex resolve indices // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-resolve-index. type IndicesResolveIndex func(name []string, o ...func(*IndicesResolveIndexRequest)) (*Response, error) // IndicesResolveIndexRequest configures the Indices Resolve Index API request. @@ -54,7 +54,7 @@ type IndicesResolveIndexRequest struct { Name []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool Pretty bool @@ -110,8 +110,8 @@ func (r IndicesResolveIndexRequest) Do(providedCtx context.Context, transport Tr params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -204,7 +204,7 @@ func (f IndicesResolveIndex) WithAllowNoIndices(v bool) func(*IndicesResolveInde } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). -func (f IndicesResolveIndex) WithExpandWildcards(v string) func(*IndicesResolveIndexRequest) { +func (f IndicesResolveIndex) WithExpandWildcards(v ...string) func(*IndicesResolveIndexRequest) { return func(r *IndicesResolveIndexRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.rollover.go b/esapi/api.indices.rollover.go index 21bb0c2bc4..1570ca4895 100644 --- a/esapi/api.indices.rollover.go +++ b/esapi/api.indices.rollover.go @@ -45,10 +45,9 @@ func newIndicesRolloverFunc(t Transport) IndicesRollover { // ----- API Definition ------------------------------------------------------- -// IndicesRollover updates an alias to point to a new index when the existing index -// is considered to be too large or too old. +// IndicesRollover roll over to a new index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-rollover. type IndicesRollover func(alias string, o ...func(*IndicesRolloverRequest)) (*Response, error) // IndicesRolloverRequest configures the Indices Rollover API request. diff --git a/esapi/api.indices.segments.go b/esapi/api.indices.segments.go index b1c3b4a3be..9a6b6d2711 100644 --- a/esapi/api.indices.segments.go +++ b/esapi/api.indices.segments.go @@ -43,9 +43,9 @@ func newIndicesSegmentsFunc(t Transport) IndicesSegments { // ----- API Definition ------------------------------------------------------- -// IndicesSegments provides low-level information about segments in a Lucene index. +// IndicesSegments get index segments // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-segments. type IndicesSegments func(o ...func(*IndicesSegmentsRequest)) (*Response, error) // IndicesSegmentsRequest configures the Indices Segments API request. @@ -53,7 +53,7 @@ type IndicesSegmentsRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool Pretty bool @@ -105,8 +105,8 @@ func (r IndicesSegmentsRequest) Do(providedCtx context.Context, transport Transp params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -206,7 +206,7 @@ func (f IndicesSegments) WithAllowNoIndices(v bool) func(*IndicesSegmentsRequest } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesSegments) WithExpandWildcards(v string) func(*IndicesSegmentsRequest) { +func (f IndicesSegments) WithExpandWildcards(v ...string) func(*IndicesSegmentsRequest) { return func(r *IndicesSegmentsRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.shard_stores.go b/esapi/api.indices.shard_stores.go index a44e92cd25..8b701d2a94 100644 --- a/esapi/api.indices.shard_stores.go +++ b/esapi/api.indices.shard_stores.go @@ -43,9 +43,9 @@ func newIndicesShardStoresFunc(t Transport) IndicesShardStores { // ----- API Definition ------------------------------------------------------- -// IndicesShardStores provides store information for shard copies of indices. +// IndicesShardStores get index shard stores // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-shard-stores. type IndicesShardStores func(o ...func(*IndicesShardStoresRequest)) (*Response, error) // IndicesShardStoresRequest configures the Indices Shard Stores API request. @@ -53,7 +53,7 @@ type IndicesShardStoresRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool Status []string @@ -106,8 +106,8 @@ func (r IndicesShardStoresRequest) Do(providedCtx context.Context, transport Tra params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -211,7 +211,7 @@ func (f IndicesShardStores) WithAllowNoIndices(v bool) func(*IndicesShardStoresR } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesShardStores) WithExpandWildcards(v string) func(*IndicesShardStoresRequest) { +func (f IndicesShardStores) WithExpandWildcards(v ...string) func(*IndicesShardStoresRequest) { return func(r *IndicesShardStoresRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.shrink.go b/esapi/api.indices.shrink.go index 40acbfce5a..bb750c6824 100644 --- a/esapi/api.indices.shrink.go +++ b/esapi/api.indices.shrink.go @@ -44,9 +44,9 @@ func newIndicesShrinkFunc(t Transport) IndicesShrink { // ----- API Definition ------------------------------------------------------- -// IndicesShrink allow to shrink an existing index into a new index with fewer primary shards. +// IndicesShrink shrink an index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-shrink. type IndicesShrink func(index string, target string, o ...func(*IndicesShrinkRequest)) (*Response, error) // IndicesShrinkRequest configures the Indices Shrink API request. diff --git a/esapi/api.indices.simulate_index_template.go b/esapi/api.indices.simulate_index_template.go index 139d6fc5db..5f5d298b5d 100644 --- a/esapi/api.indices.simulate_index_template.go +++ b/esapi/api.indices.simulate_index_template.go @@ -45,9 +45,9 @@ func newIndicesSimulateIndexTemplateFunc(t Transport) IndicesSimulateIndexTempla // ----- API Definition ------------------------------------------------------- -// IndicesSimulateIndexTemplate simulate matching the given index name against the index templates in the system +// IndicesSimulateIndexTemplate simulate an index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-index.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-simulate-index-template. type IndicesSimulateIndexTemplate func(name string, o ...func(*IndicesSimulateIndexTemplateRequest)) (*Response, error) // IndicesSimulateIndexTemplateRequest configures the Indices Simulate Index Template API request. diff --git a/esapi/api.indices.simulate_template.go b/esapi/api.indices.simulate_template.go index 3c48d17ea8..950132f46d 100644 --- a/esapi/api.indices.simulate_template.go +++ b/esapi/api.indices.simulate_template.go @@ -45,9 +45,9 @@ func newIndicesSimulateTemplateFunc(t Transport) IndicesSimulateTemplate { // ----- API Definition ------------------------------------------------------- -// IndicesSimulateTemplate simulate resolving the given template name or body +// IndicesSimulateTemplate simulate an index template // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-template.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-simulate-template. type IndicesSimulateTemplate func(o ...func(*IndicesSimulateTemplateRequest)) (*Response, error) // IndicesSimulateTemplateRequest configures the Indices Simulate Template API request. diff --git a/esapi/api.indices.split.go b/esapi/api.indices.split.go index 64b71b9b7a..3b6599c4ca 100644 --- a/esapi/api.indices.split.go +++ b/esapi/api.indices.split.go @@ -44,9 +44,9 @@ func newIndicesSplitFunc(t Transport) IndicesSplit { // ----- API Definition ------------------------------------------------------- -// IndicesSplit allows you to split an existing index into a new index with more primary shards. +// IndicesSplit split an index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-split. type IndicesSplit func(index string, target string, o ...func(*IndicesSplitRequest)) (*Response, error) // IndicesSplitRequest configures the Indices Split API request. diff --git a/esapi/api.indices.stats.go b/esapi/api.indices.stats.go index 89fb373361..2a2162d611 100644 --- a/esapi/api.indices.stats.go +++ b/esapi/api.indices.stats.go @@ -43,9 +43,9 @@ func newIndicesStatsFunc(t Transport) IndicesStats { // ----- API Definition ------------------------------------------------------- -// IndicesStats provides statistics on operations happening in an index. +// IndicesStats get index statistics // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-stats. type IndicesStats func(o ...func(*IndicesStatsRequest)) (*Response, error) // IndicesStatsRequest configures the Indices Stats API request. @@ -55,7 +55,7 @@ type IndicesStatsRequest struct { Metric []string CompletionFields []string - ExpandWildcards string + ExpandWildcards []string FielddataFields []string Fields []string ForbidClosedIndices *bool @@ -120,8 +120,8 @@ func (r IndicesStatsRequest) Do(providedCtx context.Context, transport Transport params["completion_fields"] = strings.Join(r.CompletionFields, ",") } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if len(r.FielddataFields) > 0 { @@ -252,7 +252,7 @@ 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) { +func (f IndicesStats) WithExpandWildcards(v ...string) func(*IndicesStatsRequest) { return func(r *IndicesStatsRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.indices.update_aliases.go b/esapi/api.indices.update_aliases.go index 61cb935385..2cb7100e1f 100644 --- a/esapi/api.indices.update_aliases.go +++ b/esapi/api.indices.update_aliases.go @@ -44,9 +44,9 @@ func newIndicesUpdateAliasesFunc(t Transport) IndicesUpdateAliases { // ----- API Definition ------------------------------------------------------- -// IndicesUpdateAliases updates index aliases. +// IndicesUpdateAliases create or update an alias // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-update-aliases. type IndicesUpdateAliases func(body io.Reader, o ...func(*IndicesUpdateAliasesRequest)) (*Response, error) // IndicesUpdateAliasesRequest configures the Indices Update Aliases API request. diff --git a/esapi/api.indices.validate_query.go b/esapi/api.indices.validate_query.go index 82f163cd89..3ca26744d0 100644 --- a/esapi/api.indices.validate_query.go +++ b/esapi/api.indices.validate_query.go @@ -44,9 +44,9 @@ func newIndicesValidateQueryFunc(t Transport) IndicesValidateQuery { // ----- API Definition ------------------------------------------------------- -// IndicesValidateQuery allows a user to validate a potentially expensive query without executing it. +// IndicesValidateQuery validate a query // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-validate-query. type IndicesValidateQuery func(o ...func(*IndicesValidateQueryRequest)) (*Response, error) // IndicesValidateQueryRequest configures the Indices Validate Query API request. @@ -61,7 +61,7 @@ type IndicesValidateQueryRequest struct { AnalyzeWildcard *bool DefaultOperator string Df string - ExpandWildcards string + ExpandWildcards []string Explain *bool IgnoreUnavailable *bool Lenient *bool @@ -139,8 +139,8 @@ func (r IndicesValidateQueryRequest) Do(providedCtx context.Context, transport T params["df"] = r.Df } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.Explain != nil { @@ -305,7 +305,7 @@ func (f IndicesValidateQuery) WithDf(v string) func(*IndicesValidateQueryRequest } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesValidateQuery) WithExpandWildcards(v string) func(*IndicesValidateQueryRequest) { +func (f IndicesValidateQuery) WithExpandWildcards(v ...string) func(*IndicesValidateQueryRequest) { return func(r *IndicesValidateQueryRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.inference.chat_completion_unified.go b/esapi/api.inference.chat_completion_unified.go index f7c25a3b8d..41a6d2cb2a 100644 --- a/esapi/api.inference.chat_completion_unified.go +++ b/esapi/api.inference.chat_completion_unified.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferenceChatCompletionUnifiedFunc(t Transport) InferenceChatCompletionUnified { @@ -45,7 +46,7 @@ func newInferenceChatCompletionUnifiedFunc(t Transport) InferenceChatCompletionU // InferenceChatCompletionUnified perform chat completion inference // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/chat-completion-inference.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-unified-inference. type InferenceChatCompletionUnified func(inference_id string, o ...func(*InferenceChatCompletionUnifiedRequest)) (*Response, error) // InferenceChatCompletionUnifiedRequest configures the Inference Chat Completion Unified API request. @@ -54,6 +55,8 @@ type InferenceChatCompletionUnifiedRequest struct { InferenceID string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -101,6 +104,10 @@ func (r InferenceChatCompletionUnifiedRequest) Do(providedCtx context.Context, t params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -193,6 +200,13 @@ func (f InferenceChatCompletionUnified) WithBody(v io.Reader) func(*InferenceCha } } +// WithTimeout - specifies the amount of time to wait for the inference request to complete.. +func (f InferenceChatCompletionUnified) WithTimeout(v time.Duration) func(*InferenceChatCompletionUnifiedRequest) { + return func(r *InferenceChatCompletionUnifiedRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferenceChatCompletionUnified) WithPretty() func(*InferenceChatCompletionUnifiedRequest) { return func(r *InferenceChatCompletionUnifiedRequest) { diff --git a/esapi/api.inference.completion.go b/esapi/api.inference.completion.go index 86f289ee39..2e6e137cb8 100644 --- a/esapi/api.inference.completion.go +++ b/esapi/api.inference.completion.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferenceCompletionFunc(t Transport) InferenceCompletion { @@ -43,9 +44,9 @@ func newInferenceCompletionFunc(t Transport) InferenceCompletion { // ----- API Definition ------------------------------------------------------- -// InferenceCompletion perform completion inference +// InferenceCompletion perform completion inference on the service // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference. type InferenceCompletion func(inference_id string, o ...func(*InferenceCompletionRequest)) (*Response, error) // InferenceCompletionRequest configures the Inference Completion API request. @@ -54,6 +55,8 @@ type InferenceCompletionRequest struct { InferenceID string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -99,6 +102,10 @@ func (r InferenceCompletionRequest) Do(providedCtx context.Context, transport Tr params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -191,6 +198,13 @@ func (f InferenceCompletion) WithBody(v io.Reader) func(*InferenceCompletionRequ } } +// WithTimeout - specifies the amount of time to wait for the inference request to complete.. +func (f InferenceCompletion) WithTimeout(v time.Duration) func(*InferenceCompletionRequest) { + return func(r *InferenceCompletionRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferenceCompletion) WithPretty() func(*InferenceCompletionRequest) { return func(r *InferenceCompletionRequest) { diff --git a/esapi/api.inference.delete.go b/esapi/api.inference.delete.go index a1b92adc40..684d263731 100644 --- a/esapi/api.inference.delete.go +++ b/esapi/api.inference.delete.go @@ -45,7 +45,7 @@ func newInferenceDeleteFunc(t Transport) InferenceDelete { // InferenceDelete delete an inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-inference-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-delete. type InferenceDelete func(inference_id string, o ...func(*InferenceDeleteRequest)) (*Response, error) // InferenceDeleteRequest configures the Inference Delete API request. diff --git a/esapi/api.inference.get.go b/esapi/api.inference.get.go index 4750bf64b6..c8f7f3712b 100644 --- a/esapi/api.inference.get.go +++ b/esapi/api.inference.get.go @@ -44,7 +44,7 @@ func newInferenceGetFunc(t Transport) InferenceGet { // InferenceGet get an inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-inference-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-get. type InferenceGet func(o ...func(*InferenceGetRequest)) (*Response, error) // InferenceGetRequest configures the Inference Get API request. diff --git a/esapi/api.inference.inference.go b/esapi/api.inference.inference.go index ad9205669b..1cac8a6bec 100644 --- a/esapi/api.inference.inference.go +++ b/esapi/api.inference.inference.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferenceInferenceFunc(t Transport) InferenceInference { @@ -43,9 +44,9 @@ func newInferenceInferenceFunc(t Transport) InferenceInference { // ----- API Definition ------------------------------------------------------- -// InferenceInference perform inference +// InferenceInference perform inference on the service // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference. type InferenceInference func(inference_id string, o ...func(*InferenceInferenceRequest)) (*Response, error) // InferenceInferenceRequest configures the Inference Inference API request. @@ -55,6 +56,8 @@ type InferenceInferenceRequest struct { InferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -105,6 +108,10 @@ func (r InferenceInferenceRequest) Do(providedCtx context.Context, transport Tra params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -204,6 +211,13 @@ func (f InferenceInference) WithTaskType(v string) func(*InferenceInferenceReque } } +// WithTimeout - the amount of time to wait for the inference request to complete.. +func (f InferenceInference) WithTimeout(v time.Duration) func(*InferenceInferenceRequest) { + return func(r *InferenceInferenceRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferenceInference) WithPretty() func(*InferenceInferenceRequest) { return func(r *InferenceInferenceRequest) { diff --git a/esapi/api.inference.put.go b/esapi/api.inference.put.go index 8146f46d0d..7d69ee7d33 100644 --- a/esapi/api.inference.put.go +++ b/esapi/api.inference.put.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutFunc(t Transport) InferencePut { @@ -43,9 +44,9 @@ func newInferencePutFunc(t Transport) InferencePut { // ----- API Definition ------------------------------------------------------- -// InferencePut configure an inference endpoint for use in the Inference API +// InferencePut create an inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put. type InferencePut func(inference_id string, o ...func(*InferencePutRequest)) (*Response, error) // InferencePutRequest configures the Inference Put API request. @@ -55,6 +56,8 @@ type InferencePutRequest struct { InferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -105,6 +108,10 @@ func (r InferencePutRequest) Do(providedCtx context.Context, transport Transport params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -204,6 +211,13 @@ func (f InferencePut) WithTaskType(v string) func(*InferencePutRequest) { } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePut) WithTimeout(v time.Duration) func(*InferencePutRequest) { + return func(r *InferencePutRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePut) WithPretty() func(*InferencePutRequest) { return func(r *InferencePutRequest) { diff --git a/esapi/api.inference.put_alibabacloud.go b/esapi/api.inference.put_alibabacloud.go index 79daa0b4d2..60a1cbd39a 100644 --- a/esapi/api.inference.put_alibabacloud.go +++ b/esapi/api.inference.put_alibabacloud.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutAlibabacloudFunc(t Transport) InferencePutAlibabacloud { @@ -43,9 +44,9 @@ func newInferencePutAlibabacloudFunc(t Transport) InferencePutAlibabacloud { // ----- API Definition ------------------------------------------------------- -// InferencePutAlibabacloud configure an AlibabaCloud AI Search inference endpoint +// InferencePutAlibabacloud create an AlibabaCloud AI Search inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-alibabacloud-ai-search.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-alibabacloud. type InferencePutAlibabacloud func(alibabacloud_inference_id string, task_type string, o ...func(*InferencePutAlibabacloudRequest)) (*Response, error) // InferencePutAlibabacloudRequest configures the Inference Put Alibabacloud API request. @@ -55,6 +56,8 @@ type InferencePutAlibabacloudRequest struct { AlibabacloudInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutAlibabacloudRequest) Do(providedCtx context.Context, transpo params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutAlibabacloud) WithBody(v io.Reader) func(*InferencePutAlibab } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutAlibabacloud) WithTimeout(v time.Duration) func(*InferencePutAlibabacloudRequest) { + return func(r *InferencePutAlibabacloudRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutAlibabacloud) WithPretty() func(*InferencePutAlibabacloudRequest) { return func(r *InferencePutAlibabacloudRequest) { diff --git a/esapi/api.inference.put_amazonbedrock.go b/esapi/api.inference.put_amazonbedrock.go index 5fc7822598..43c9d3e60a 100644 --- a/esapi/api.inference.put_amazonbedrock.go +++ b/esapi/api.inference.put_amazonbedrock.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutAmazonbedrockFunc(t Transport) InferencePutAmazonbedrock { @@ -43,9 +44,9 @@ func newInferencePutAmazonbedrockFunc(t Transport) InferencePutAmazonbedrock { // ----- API Definition ------------------------------------------------------- -// InferencePutAmazonbedrock configure an Amazon Bedrock inference endpoint +// InferencePutAmazonbedrock create an Amazon Bedrock inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-amazon-bedrock.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-amazonbedrock. type InferencePutAmazonbedrock func(amazonbedrock_inference_id string, task_type string, o ...func(*InferencePutAmazonbedrockRequest)) (*Response, error) // InferencePutAmazonbedrockRequest configures the Inference Put Amazonbedrock API request. @@ -55,6 +56,8 @@ type InferencePutAmazonbedrockRequest struct { AmazonbedrockInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutAmazonbedrockRequest) Do(providedCtx context.Context, transp params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutAmazonbedrock) WithBody(v io.Reader) func(*InferencePutAmazo } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutAmazonbedrock) WithTimeout(v time.Duration) func(*InferencePutAmazonbedrockRequest) { + return func(r *InferencePutAmazonbedrockRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutAmazonbedrock) WithPretty() func(*InferencePutAmazonbedrockRequest) { return func(r *InferencePutAmazonbedrockRequest) { diff --git a/esapi/api.inference.put_amazonsagemaker.go b/esapi/api.inference.put_amazonsagemaker.go index 4dc2eb09ca..72c55355a8 100644 --- a/esapi/api.inference.put_amazonsagemaker.go +++ b/esapi/api.inference.put_amazonsagemaker.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutAmazonsagemakerFunc(t Transport) InferencePutAmazonsagemaker { @@ -43,9 +44,9 @@ func newInferencePutAmazonsagemakerFunc(t Transport) InferencePutAmazonsagemaker // ----- API Definition ------------------------------------------------------- -// InferencePutAmazonsagemaker configure a Amazon SageMaker inference endpoint +// InferencePutAmazonsagemaker create an Amazon SageMaker inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-amazon-sagemaker.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-amazonsagemaker. type InferencePutAmazonsagemaker func(amazonsagemaker_inference_id string, task_type string, o ...func(*InferencePutAmazonsagemakerRequest)) (*Response, error) // InferencePutAmazonsagemakerRequest configures the Inference Put Amazonsagemaker API request. @@ -55,6 +56,8 @@ type InferencePutAmazonsagemakerRequest struct { AmazonsagemakerInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutAmazonsagemakerRequest) Do(providedCtx context.Context, tran params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutAmazonsagemaker) WithBody(v io.Reader) func(*InferencePutAma } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutAmazonsagemaker) WithTimeout(v time.Duration) func(*InferencePutAmazonsagemakerRequest) { + return func(r *InferencePutAmazonsagemakerRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutAmazonsagemaker) WithPretty() func(*InferencePutAmazonsagemakerRequest) { return func(r *InferencePutAmazonsagemakerRequest) { diff --git a/esapi/api.inference.put_anthropic.go b/esapi/api.inference.put_anthropic.go index 427ae680b3..397ae4656a 100644 --- a/esapi/api.inference.put_anthropic.go +++ b/esapi/api.inference.put_anthropic.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutAnthropicFunc(t Transport) InferencePutAnthropic { @@ -43,9 +44,9 @@ func newInferencePutAnthropicFunc(t Transport) InferencePutAnthropic { // ----- API Definition ------------------------------------------------------- -// InferencePutAnthropic configure an Anthropic inference endpoint +// InferencePutAnthropic create an Anthropic inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-anthropic.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-anthropic. type InferencePutAnthropic func(anthropic_inference_id string, task_type string, o ...func(*InferencePutAnthropicRequest)) (*Response, error) // InferencePutAnthropicRequest configures the Inference Put Anthropic API request. @@ -55,6 +56,8 @@ type InferencePutAnthropicRequest struct { AnthropicInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutAnthropicRequest) Do(providedCtx context.Context, transport params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutAnthropic) WithBody(v io.Reader) func(*InferencePutAnthropic } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutAnthropic) WithTimeout(v time.Duration) func(*InferencePutAnthropicRequest) { + return func(r *InferencePutAnthropicRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutAnthropic) WithPretty() func(*InferencePutAnthropicRequest) { return func(r *InferencePutAnthropicRequest) { diff --git a/esapi/api.inference.put_azureaistudio.go b/esapi/api.inference.put_azureaistudio.go index 187125862a..96ca6be23d 100644 --- a/esapi/api.inference.put_azureaistudio.go +++ b/esapi/api.inference.put_azureaistudio.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutAzureaistudioFunc(t Transport) InferencePutAzureaistudio { @@ -43,9 +44,9 @@ func newInferencePutAzureaistudioFunc(t Transport) InferencePutAzureaistudio { // ----- API Definition ------------------------------------------------------- -// InferencePutAzureaistudio configure an Azure AI Studio inference endpoint +// InferencePutAzureaistudio create an Azure AI studio inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-azure-ai-studio.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-azureaistudio. type InferencePutAzureaistudio func(azureaistudio_inference_id string, task_type string, o ...func(*InferencePutAzureaistudioRequest)) (*Response, error) // InferencePutAzureaistudioRequest configures the Inference Put Azureaistudio API request. @@ -55,6 +56,8 @@ type InferencePutAzureaistudioRequest struct { AzureaistudioInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutAzureaistudioRequest) Do(providedCtx context.Context, transp params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutAzureaistudio) WithBody(v io.Reader) func(*InferencePutAzure } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutAzureaistudio) WithTimeout(v time.Duration) func(*InferencePutAzureaistudioRequest) { + return func(r *InferencePutAzureaistudioRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutAzureaistudio) WithPretty() func(*InferencePutAzureaistudioRequest) { return func(r *InferencePutAzureaistudioRequest) { diff --git a/esapi/api.inference.put_azureopenai.go b/esapi/api.inference.put_azureopenai.go index 7b370c1240..91827860fc 100644 --- a/esapi/api.inference.put_azureopenai.go +++ b/esapi/api.inference.put_azureopenai.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutAzureopenaiFunc(t Transport) InferencePutAzureopenai { @@ -43,9 +44,9 @@ func newInferencePutAzureopenaiFunc(t Transport) InferencePutAzureopenai { // ----- API Definition ------------------------------------------------------- -// InferencePutAzureopenai configure an Azure OpenAI inference endpoint +// InferencePutAzureopenai create an Azure OpenAI inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-azure-openai.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-azureopenai. type InferencePutAzureopenai func(azureopenai_inference_id string, task_type string, o ...func(*InferencePutAzureopenaiRequest)) (*Response, error) // InferencePutAzureopenaiRequest configures the Inference Put Azureopenai API request. @@ -55,6 +56,8 @@ type InferencePutAzureopenaiRequest struct { AzureopenaiInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutAzureopenaiRequest) Do(providedCtx context.Context, transpor params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutAzureopenai) WithBody(v io.Reader) func(*InferencePutAzureop } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutAzureopenai) WithTimeout(v time.Duration) func(*InferencePutAzureopenaiRequest) { + return func(r *InferencePutAzureopenaiRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutAzureopenai) WithPretty() func(*InferencePutAzureopenaiRequest) { return func(r *InferencePutAzureopenaiRequest) { diff --git a/esapi/api.inference.put_cohere.go b/esapi/api.inference.put_cohere.go index 732509ee55..98bff3ff45 100644 --- a/esapi/api.inference.put_cohere.go +++ b/esapi/api.inference.put_cohere.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutCohereFunc(t Transport) InferencePutCohere { @@ -43,9 +44,9 @@ func newInferencePutCohereFunc(t Transport) InferencePutCohere { // ----- API Definition ------------------------------------------------------- -// InferencePutCohere configure a Cohere inference endpoint +// InferencePutCohere create a Cohere inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-cohere.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-cohere. type InferencePutCohere func(cohere_inference_id string, task_type string, o ...func(*InferencePutCohereRequest)) (*Response, error) // InferencePutCohereRequest configures the Inference Put Cohere API request. @@ -55,6 +56,8 @@ type InferencePutCohereRequest struct { CohereInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutCohereRequest) Do(providedCtx context.Context, transport Tra params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutCohere) WithBody(v io.Reader) func(*InferencePutCohereReques } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutCohere) WithTimeout(v time.Duration) func(*InferencePutCohereRequest) { + return func(r *InferencePutCohereRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutCohere) WithPretty() func(*InferencePutCohereRequest) { return func(r *InferencePutCohereRequest) { diff --git a/esapi/api.inference.put_custom.go b/esapi/api.inference.put_custom.go index 46cc733578..15cf0e29ce 100644 --- a/esapi/api.inference.put_custom.go +++ b/esapi/api.inference.put_custom.go @@ -43,7 +43,7 @@ func newInferencePutCustomFunc(t Transport) InferencePutCustom { // ----- API Definition ------------------------------------------------------- -// InferencePutCustom configure a custom inference endpoint +// InferencePutCustom create a custom inference endpoint // // See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-custom. type InferencePutCustom func(custom_inference_id string, task_type string, o ...func(*InferencePutCustomRequest)) (*Response, error) diff --git a/esapi/api.inference.put_deepseek.go b/esapi/api.inference.put_deepseek.go index dc1c458572..2d2e7fcc9d 100644 --- a/esapi/api.inference.put_deepseek.go +++ b/esapi/api.inference.put_deepseek.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutDeepseekFunc(t Transport) InferencePutDeepseek { @@ -43,9 +44,9 @@ func newInferencePutDeepseekFunc(t Transport) InferencePutDeepseek { // ----- API Definition ------------------------------------------------------- -// InferencePutDeepseek configure a DeepSeek inference endpoint +// InferencePutDeepseek create a DeepSeek inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-deepseek.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-deepseek. type InferencePutDeepseek func(deepseek_inference_id string, task_type string, o ...func(*InferencePutDeepseekRequest)) (*Response, error) // InferencePutDeepseekRequest configures the Inference Put Deepseek API request. @@ -55,6 +56,8 @@ type InferencePutDeepseekRequest struct { DeepseekInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutDeepseekRequest) Do(providedCtx context.Context, transport T params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutDeepseek) WithBody(v io.Reader) func(*InferencePutDeepseekRe } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutDeepseek) WithTimeout(v time.Duration) func(*InferencePutDeepseekRequest) { + return func(r *InferencePutDeepseekRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutDeepseek) WithPretty() func(*InferencePutDeepseekRequest) { return func(r *InferencePutDeepseekRequest) { diff --git a/esapi/api.inference.put_elasticsearch.go b/esapi/api.inference.put_elasticsearch.go index 9acf9bb4dc..9575a0ddbd 100644 --- a/esapi/api.inference.put_elasticsearch.go +++ b/esapi/api.inference.put_elasticsearch.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutElasticsearchFunc(t Transport) InferencePutElasticsearch { @@ -43,9 +44,9 @@ func newInferencePutElasticsearchFunc(t Transport) InferencePutElasticsearch { // ----- API Definition ------------------------------------------------------- -// InferencePutElasticsearch configure an Elasticsearch inference endpoint +// InferencePutElasticsearch create an Elasticsearch inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-elasticsearch.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-elasticsearch. type InferencePutElasticsearch func(elasticsearch_inference_id string, task_type string, o ...func(*InferencePutElasticsearchRequest)) (*Response, error) // InferencePutElasticsearchRequest configures the Inference Put Elasticsearch API request. @@ -55,6 +56,8 @@ type InferencePutElasticsearchRequest struct { ElasticsearchInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutElasticsearchRequest) Do(providedCtx context.Context, transp params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutElasticsearch) WithBody(v io.Reader) func(*InferencePutElast } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutElasticsearch) WithTimeout(v time.Duration) func(*InferencePutElasticsearchRequest) { + return func(r *InferencePutElasticsearchRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutElasticsearch) WithPretty() func(*InferencePutElasticsearchRequest) { return func(r *InferencePutElasticsearchRequest) { diff --git a/esapi/api.inference.put_elser.go b/esapi/api.inference.put_elser.go index 6536e3a173..ecfcb8cc04 100644 --- a/esapi/api.inference.put_elser.go +++ b/esapi/api.inference.put_elser.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutElserFunc(t Transport) InferencePutElser { @@ -43,9 +44,9 @@ func newInferencePutElserFunc(t Transport) InferencePutElser { // ----- API Definition ------------------------------------------------------- -// InferencePutElser configure an ELSER inference endpoint +// InferencePutElser create an ELSER inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-elser.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-elser. type InferencePutElser func(elser_inference_id string, task_type string, o ...func(*InferencePutElserRequest)) (*Response, error) // InferencePutElserRequest configures the Inference Put Elser API request. @@ -55,6 +56,8 @@ type InferencePutElserRequest struct { ElserInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutElserRequest) Do(providedCtx context.Context, transport Tran params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutElser) WithBody(v io.Reader) func(*InferencePutElserRequest) } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutElser) WithTimeout(v time.Duration) func(*InferencePutElserRequest) { + return func(r *InferencePutElserRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutElser) WithPretty() func(*InferencePutElserRequest) { return func(r *InferencePutElserRequest) { diff --git a/esapi/api.inference.put_googleaistudio.go b/esapi/api.inference.put_googleaistudio.go index 05c849b143..91b07444a7 100644 --- a/esapi/api.inference.put_googleaistudio.go +++ b/esapi/api.inference.put_googleaistudio.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutGoogleaistudioFunc(t Transport) InferencePutGoogleaistudio { @@ -43,9 +44,9 @@ func newInferencePutGoogleaistudioFunc(t Transport) InferencePutGoogleaistudio { // ----- API Definition ------------------------------------------------------- -// InferencePutGoogleaistudio configure a Google AI Studio inference endpoint +// InferencePutGoogleaistudio create an Google AI Studio inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-google-ai-studio.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-googleaistudio. type InferencePutGoogleaistudio func(googleaistudio_inference_id string, task_type string, o ...func(*InferencePutGoogleaistudioRequest)) (*Response, error) // InferencePutGoogleaistudioRequest configures the Inference Put Googleaistudio API request. @@ -55,6 +56,8 @@ type InferencePutGoogleaistudioRequest struct { GoogleaistudioInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutGoogleaistudioRequest) Do(providedCtx context.Context, trans params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutGoogleaistudio) WithBody(v io.Reader) func(*InferencePutGoog } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutGoogleaistudio) WithTimeout(v time.Duration) func(*InferencePutGoogleaistudioRequest) { + return func(r *InferencePutGoogleaistudioRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutGoogleaistudio) WithPretty() func(*InferencePutGoogleaistudioRequest) { return func(r *InferencePutGoogleaistudioRequest) { diff --git a/esapi/api.inference.put_googlevertexai.go b/esapi/api.inference.put_googlevertexai.go index a34714a4d4..4947402be0 100644 --- a/esapi/api.inference.put_googlevertexai.go +++ b/esapi/api.inference.put_googlevertexai.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutGooglevertexaiFunc(t Transport) InferencePutGooglevertexai { @@ -43,9 +44,9 @@ func newInferencePutGooglevertexaiFunc(t Transport) InferencePutGooglevertexai { // ----- API Definition ------------------------------------------------------- -// InferencePutGooglevertexai configure a Google Vertex AI inference endpoint +// InferencePutGooglevertexai create a Google Vertex AI inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-google-vertex-ai.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-googlevertexai. type InferencePutGooglevertexai func(googlevertexai_inference_id string, task_type string, o ...func(*InferencePutGooglevertexaiRequest)) (*Response, error) // InferencePutGooglevertexaiRequest configures the Inference Put Googlevertexai API request. @@ -55,6 +56,8 @@ type InferencePutGooglevertexaiRequest struct { GooglevertexaiInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutGooglevertexaiRequest) Do(providedCtx context.Context, trans params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutGooglevertexai) WithBody(v io.Reader) func(*InferencePutGoog } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutGooglevertexai) WithTimeout(v time.Duration) func(*InferencePutGooglevertexaiRequest) { + return func(r *InferencePutGooglevertexaiRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutGooglevertexai) WithPretty() func(*InferencePutGooglevertexaiRequest) { return func(r *InferencePutGooglevertexaiRequest) { diff --git a/esapi/api.inference.put_hugging_face.go b/esapi/api.inference.put_hugging_face.go index 5cc5ff1a12..3ba85631fb 100644 --- a/esapi/api.inference.put_hugging_face.go +++ b/esapi/api.inference.put_hugging_face.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutHuggingFaceFunc(t Transport) InferencePutHuggingFace { @@ -43,9 +44,9 @@ func newInferencePutHuggingFaceFunc(t Transport) InferencePutHuggingFace { // ----- API Definition ------------------------------------------------------- -// InferencePutHuggingFace configure a HuggingFace inference endpoint +// InferencePutHuggingFace create a Hugging Face inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-hugging-face.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-hugging-face. type InferencePutHuggingFace func(huggingface_inference_id string, task_type string, o ...func(*InferencePutHuggingFaceRequest)) (*Response, error) // InferencePutHuggingFaceRequest configures the Inference Put Hugging Face API request. @@ -55,6 +56,8 @@ type InferencePutHuggingFaceRequest struct { HuggingfaceInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutHuggingFaceRequest) Do(providedCtx context.Context, transpor params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutHuggingFace) WithBody(v io.Reader) func(*InferencePutHugging } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutHuggingFace) WithTimeout(v time.Duration) func(*InferencePutHuggingFaceRequest) { + return func(r *InferencePutHuggingFaceRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutHuggingFace) WithPretty() func(*InferencePutHuggingFaceRequest) { return func(r *InferencePutHuggingFaceRequest) { diff --git a/esapi/api.inference.put_jinaai.go b/esapi/api.inference.put_jinaai.go index 8c25e3f5a0..6c45423ea8 100644 --- a/esapi/api.inference.put_jinaai.go +++ b/esapi/api.inference.put_jinaai.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutJinaaiFunc(t Transport) InferencePutJinaai { @@ -43,9 +44,9 @@ func newInferencePutJinaaiFunc(t Transport) InferencePutJinaai { // ----- API Definition ------------------------------------------------------- -// InferencePutJinaai configure a JinaAI inference endpoint +// InferencePutJinaai create an JinaAI inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-jinaai.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-jinaai. type InferencePutJinaai func(jinaai_inference_id string, task_type string, o ...func(*InferencePutJinaaiRequest)) (*Response, error) // InferencePutJinaaiRequest configures the Inference Put Jinaai API request. @@ -55,6 +56,8 @@ type InferencePutJinaaiRequest struct { JinaaiInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutJinaaiRequest) Do(providedCtx context.Context, transport Tra params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutJinaai) WithBody(v io.Reader) func(*InferencePutJinaaiReques } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutJinaai) WithTimeout(v time.Duration) func(*InferencePutJinaaiRequest) { + return func(r *InferencePutJinaaiRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutJinaai) WithPretty() func(*InferencePutJinaaiRequest) { return func(r *InferencePutJinaaiRequest) { diff --git a/esapi/api.inference.put_mistral.go b/esapi/api.inference.put_mistral.go index 2e3c452d82..1003983af7 100644 --- a/esapi/api.inference.put_mistral.go +++ b/esapi/api.inference.put_mistral.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutMistralFunc(t Transport) InferencePutMistral { @@ -43,9 +44,9 @@ func newInferencePutMistralFunc(t Transport) InferencePutMistral { // ----- API Definition ------------------------------------------------------- -// InferencePutMistral configure a Mistral inference endpoint +// InferencePutMistral create a Mistral inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-mistral.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-mistral. type InferencePutMistral func(mistral_inference_id string, task_type string, o ...func(*InferencePutMistralRequest)) (*Response, error) // InferencePutMistralRequest configures the Inference Put Mistral API request. @@ -55,6 +56,8 @@ type InferencePutMistralRequest struct { MistralInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutMistralRequest) Do(providedCtx context.Context, transport Tr params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutMistral) WithBody(v io.Reader) func(*InferencePutMistralRequ } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutMistral) WithTimeout(v time.Duration) func(*InferencePutMistralRequest) { + return func(r *InferencePutMistralRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutMistral) WithPretty() func(*InferencePutMistralRequest) { return func(r *InferencePutMistralRequest) { diff --git a/esapi/api.inference.put_openai.go b/esapi/api.inference.put_openai.go index b74f0b4f1f..43c10529d9 100644 --- a/esapi/api.inference.put_openai.go +++ b/esapi/api.inference.put_openai.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutOpenaiFunc(t Transport) InferencePutOpenai { @@ -43,9 +44,9 @@ func newInferencePutOpenaiFunc(t Transport) InferencePutOpenai { // ----- API Definition ------------------------------------------------------- -// InferencePutOpenai configure an OpenAI inference endpoint +// InferencePutOpenai create an OpenAI inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-openai.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-openai. type InferencePutOpenai func(openai_inference_id string, task_type string, o ...func(*InferencePutOpenaiRequest)) (*Response, error) // InferencePutOpenaiRequest configures the Inference Put Openai API request. @@ -55,6 +56,8 @@ type InferencePutOpenaiRequest struct { OpenaiInferenceID string TaskType string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutOpenaiRequest) Do(providedCtx context.Context, transport Tra params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutOpenai) WithBody(v io.Reader) func(*InferencePutOpenaiReques } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutOpenai) WithTimeout(v time.Duration) func(*InferencePutOpenaiRequest) { + return func(r *InferencePutOpenaiRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutOpenai) WithPretty() func(*InferencePutOpenaiRequest) { return func(r *InferencePutOpenaiRequest) { diff --git a/esapi/api.inference.put_voyageai.go b/esapi/api.inference.put_voyageai.go index 66f4e7f367..b15db65d96 100644 --- a/esapi/api.inference.put_voyageai.go +++ b/esapi/api.inference.put_voyageai.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutVoyageaiFunc(t Transport) InferencePutVoyageai { @@ -43,9 +44,9 @@ func newInferencePutVoyageaiFunc(t Transport) InferencePutVoyageai { // ----- API Definition ------------------------------------------------------- -// InferencePutVoyageai configure a VoyageAI inference endpoint +// InferencePutVoyageai create a VoyageAI inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/inference-apis.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-voyageai. type InferencePutVoyageai func(task_type string, voyageai_inference_id string, o ...func(*InferencePutVoyageaiRequest)) (*Response, error) // InferencePutVoyageaiRequest configures the Inference Put Voyageai API request. @@ -55,6 +56,8 @@ type InferencePutVoyageaiRequest struct { TaskType string VoyageaiInferenceID string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutVoyageaiRequest) Do(providedCtx context.Context, transport T params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutVoyageai) WithBody(v io.Reader) func(*InferencePutVoyageaiRe } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutVoyageai) WithTimeout(v time.Duration) func(*InferencePutVoyageaiRequest) { + return func(r *InferencePutVoyageaiRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutVoyageai) WithPretty() func(*InferencePutVoyageaiRequest) { return func(r *InferencePutVoyageaiRequest) { diff --git a/esapi/api.inference.put_watsonx.go b/esapi/api.inference.put_watsonx.go index 3c2a75422f..e8bc49fd41 100644 --- a/esapi/api.inference.put_watsonx.go +++ b/esapi/api.inference.put_watsonx.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferencePutWatsonxFunc(t Transport) InferencePutWatsonx { @@ -43,9 +44,9 @@ func newInferencePutWatsonxFunc(t Transport) InferencePutWatsonx { // ----- API Definition ------------------------------------------------------- -// InferencePutWatsonx configure a Watsonx inference endpoint +// InferencePutWatsonx create a Watsonx inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-watsonx-ai.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-watsonx. type InferencePutWatsonx func(task_type string, watsonx_inference_id string, o ...func(*InferencePutWatsonxRequest)) (*Response, error) // InferencePutWatsonxRequest configures the Inference Put Watsonx API request. @@ -55,6 +56,8 @@ type InferencePutWatsonxRequest struct { TaskType string WatsonxInferenceID string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -103,6 +106,10 @@ func (r InferencePutWatsonxRequest) Do(providedCtx context.Context, transport Tr params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -195,6 +202,13 @@ func (f InferencePutWatsonx) WithBody(v io.Reader) func(*InferencePutWatsonxRequ } } +// WithTimeout - specifies the amount of time to wait for the inference endpoint to be created.. +func (f InferencePutWatsonx) WithTimeout(v time.Duration) func(*InferencePutWatsonxRequest) { + return func(r *InferencePutWatsonxRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferencePutWatsonx) WithPretty() func(*InferencePutWatsonxRequest) { return func(r *InferencePutWatsonxRequest) { diff --git a/esapi/api.inference.rerank.go b/esapi/api.inference.rerank.go index 5c516a85c7..048b2e4613 100644 --- a/esapi/api.inference.rerank.go +++ b/esapi/api.inference.rerank.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferenceRerankFunc(t Transport) InferenceRerank { @@ -43,9 +44,9 @@ func newInferenceRerankFunc(t Transport) InferenceRerank { // ----- API Definition ------------------------------------------------------- -// InferenceRerank perform reranking inference +// InferenceRerank perform reranking inference on the service // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference. type InferenceRerank func(inference_id string, o ...func(*InferenceRerankRequest)) (*Response, error) // InferenceRerankRequest configures the Inference Rerank API request. @@ -54,6 +55,8 @@ type InferenceRerankRequest struct { InferenceID string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -99,6 +102,10 @@ func (r InferenceRerankRequest) Do(providedCtx context.Context, transport Transp params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -191,6 +198,13 @@ func (f InferenceRerank) WithBody(v io.Reader) func(*InferenceRerankRequest) { } } +// WithTimeout - the amount of time to wait for the inference request to complete.. +func (f InferenceRerank) WithTimeout(v time.Duration) func(*InferenceRerankRequest) { + return func(r *InferenceRerankRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferenceRerank) WithPretty() func(*InferenceRerankRequest) { return func(r *InferenceRerankRequest) { diff --git a/esapi/api.inference.sparse_embedding.go b/esapi/api.inference.sparse_embedding.go index fd258eef90..982be4f4f1 100644 --- a/esapi/api.inference.sparse_embedding.go +++ b/esapi/api.inference.sparse_embedding.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferenceSparseEmbeddingFunc(t Transport) InferenceSparseEmbedding { @@ -43,9 +44,9 @@ func newInferenceSparseEmbeddingFunc(t Transport) InferenceSparseEmbedding { // ----- API Definition ------------------------------------------------------- -// InferenceSparseEmbedding perform sparse embedding inference +// InferenceSparseEmbedding perform sparse embedding inference on the service // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference. type InferenceSparseEmbedding func(inference_id string, o ...func(*InferenceSparseEmbeddingRequest)) (*Response, error) // InferenceSparseEmbeddingRequest configures the Inference Sparse Embedding API request. @@ -54,6 +55,8 @@ type InferenceSparseEmbeddingRequest struct { InferenceID string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -99,6 +102,10 @@ func (r InferenceSparseEmbeddingRequest) Do(providedCtx context.Context, transpo params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -191,6 +198,13 @@ func (f InferenceSparseEmbedding) WithBody(v io.Reader) func(*InferenceSparseEmb } } +// WithTimeout - specifies the amount of time to wait for the inference request to complete.. +func (f InferenceSparseEmbedding) WithTimeout(v time.Duration) func(*InferenceSparseEmbeddingRequest) { + return func(r *InferenceSparseEmbeddingRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferenceSparseEmbedding) WithPretty() func(*InferenceSparseEmbeddingRequest) { return func(r *InferenceSparseEmbeddingRequest) { diff --git a/esapi/api.inference.stream_completion.go b/esapi/api.inference.stream_completion.go index a5f7c2490c..cc5f2e9902 100644 --- a/esapi/api.inference.stream_completion.go +++ b/esapi/api.inference.stream_completion.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferenceStreamCompletionFunc(t Transport) InferenceStreamCompletion { @@ -43,9 +44,9 @@ func newInferenceStreamCompletionFunc(t Transport) InferenceStreamCompletion { // ----- API Definition ------------------------------------------------------- -// InferenceStreamCompletion perform streaming completion inference +// InferenceStreamCompletion perform streaming inference // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/post-stream-inference-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-stream-inference. type InferenceStreamCompletion func(inference_id string, o ...func(*InferenceStreamCompletionRequest)) (*Response, error) // InferenceStreamCompletionRequest configures the Inference Stream Completion API request. @@ -54,6 +55,8 @@ type InferenceStreamCompletionRequest struct { InferenceID string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -101,6 +104,10 @@ func (r InferenceStreamCompletionRequest) Do(providedCtx context.Context, transp params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -193,6 +200,13 @@ func (f InferenceStreamCompletion) WithBody(v io.Reader) func(*InferenceStreamCo } } +// WithTimeout - the amount of time to wait for the inference request to complete.. +func (f InferenceStreamCompletion) WithTimeout(v time.Duration) func(*InferenceStreamCompletionRequest) { + return func(r *InferenceStreamCompletionRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferenceStreamCompletion) WithPretty() func(*InferenceStreamCompletionRequest) { return func(r *InferenceStreamCompletionRequest) { diff --git a/esapi/api.inference.text_embedding.go b/esapi/api.inference.text_embedding.go index 3de2cf3597..15a8edc8ca 100644 --- a/esapi/api.inference.text_embedding.go +++ b/esapi/api.inference.text_embedding.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "strings" + "time" ) func newInferenceTextEmbeddingFunc(t Transport) InferenceTextEmbedding { @@ -43,9 +44,9 @@ func newInferenceTextEmbeddingFunc(t Transport) InferenceTextEmbedding { // ----- API Definition ------------------------------------------------------- -// InferenceTextEmbedding perform text embedding inference +// InferenceTextEmbedding perform text embedding inference on the service // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference. type InferenceTextEmbedding func(inference_id string, o ...func(*InferenceTextEmbeddingRequest)) (*Response, error) // InferenceTextEmbeddingRequest configures the Inference Text Embedding API request. @@ -54,6 +55,8 @@ type InferenceTextEmbeddingRequest struct { InferenceID string + Timeout time.Duration + Pretty bool Human bool ErrorTrace bool @@ -99,6 +102,10 @@ func (r InferenceTextEmbeddingRequest) Do(providedCtx context.Context, transport params = make(map[string]string) + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -191,6 +198,13 @@ func (f InferenceTextEmbedding) WithBody(v io.Reader) func(*InferenceTextEmbeddi } } +// WithTimeout - specifies the amount of time to wait for the inference request to complete.. +func (f InferenceTextEmbedding) WithTimeout(v time.Duration) func(*InferenceTextEmbeddingRequest) { + return func(r *InferenceTextEmbeddingRequest) { + r.Timeout = v + } +} + // WithPretty makes the response body pretty-printed. func (f InferenceTextEmbedding) WithPretty() func(*InferenceTextEmbeddingRequest) { return func(r *InferenceTextEmbeddingRequest) { diff --git a/esapi/api.inference.update.go b/esapi/api.inference.update.go index 98e4e4dc6e..6dc486973d 100644 --- a/esapi/api.inference.update.go +++ b/esapi/api.inference.update.go @@ -43,9 +43,9 @@ func newInferenceUpdateFunc(t Transport) InferenceUpdate { // ----- API Definition ------------------------------------------------------- -// InferenceUpdate update inference +// InferenceUpdate update an inference endpoint // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-inference-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-update. type InferenceUpdate func(inference_id string, o ...func(*InferenceUpdateRequest)) (*Response, error) // InferenceUpdateRequest configures the Inference Update API request. diff --git a/esapi/api.info.go b/esapi/api.info.go index 6f4cc9ad19..4677c440f2 100644 --- a/esapi/api.info.go +++ b/esapi/api.info.go @@ -42,9 +42,9 @@ func newInfoFunc(t Transport) Info { // ----- API Definition ------------------------------------------------------- -// Info returns basic information about the cluster. +// Info get cluster info // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-info. type Info func(o ...func(*InfoRequest)) (*Response, error) // InfoRequest configures the Info API request. diff --git a/esapi/api.ingest.delete_geoip_database.go b/esapi/api.ingest.delete_geoip_database.go index 07af96fad3..2ce1aaeaf4 100644 --- a/esapi/api.ingest.delete_geoip_database.go +++ b/esapi/api.ingest.delete_geoip_database.go @@ -44,9 +44,9 @@ func newIngestDeleteGeoipDatabaseFunc(t Transport) IngestDeleteGeoipDatabase { // ----- API Definition ------------------------------------------------------- -// IngestDeleteGeoipDatabase deletes a geoip database configuration +// IngestDeleteGeoipDatabase delete GeoIP database configurations // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-geoip-database-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-delete-geoip-database. type IngestDeleteGeoipDatabase func(id []string, o ...func(*IngestDeleteGeoipDatabaseRequest)) (*Response, error) // IngestDeleteGeoipDatabaseRequest configures the Ingest Delete Geoip Database API request. diff --git a/esapi/api.ingest.delete_ip_location_database.go b/esapi/api.ingest.delete_ip_location_database.go index 8986e23ed0..546e6f406a 100644 --- a/esapi/api.ingest.delete_ip_location_database.go +++ b/esapi/api.ingest.delete_ip_location_database.go @@ -44,9 +44,9 @@ func newIngestDeleteIPLocationDatabaseFunc(t Transport) IngestDeleteIPLocationDa // ----- API Definition ------------------------------------------------------- -// IngestDeleteIPLocationDatabase deletes an ip location database configuration +// IngestDeleteIPLocationDatabase delete IP geolocation database configurations // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-ip-location-database-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-delete-ip-location-database. type IngestDeleteIPLocationDatabase func(id []string, o ...func(*IngestDeleteIPLocationDatabaseRequest)) (*Response, error) // IngestDeleteIPLocationDatabaseRequest configures the Ingest DeleteIP Location Database API request. diff --git a/esapi/api.ingest.delete_pipeline.go b/esapi/api.ingest.delete_pipeline.go index 6e90d29b29..49b20e46a3 100644 --- a/esapi/api.ingest.delete_pipeline.go +++ b/esapi/api.ingest.delete_pipeline.go @@ -43,9 +43,9 @@ func newIngestDeletePipelineFunc(t Transport) IngestDeletePipeline { // ----- API Definition ------------------------------------------------------- -// IngestDeletePipeline deletes a pipeline. +// IngestDeletePipeline delete pipelines // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-delete-pipeline. type IngestDeletePipeline func(id string, o ...func(*IngestDeletePipelineRequest)) (*Response, error) // IngestDeletePipelineRequest configures the Ingest Delete Pipeline API request. diff --git a/esapi/api.ingest.geo_ip_stats.go b/esapi/api.ingest.geo_ip_stats.go index 847d7953ab..800517dab9 100644 --- a/esapi/api.ingest.geo_ip_stats.go +++ b/esapi/api.ingest.geo_ip_stats.go @@ -42,9 +42,9 @@ func newIngestGeoIPStatsFunc(t Transport) IngestGeoIPStats { // ----- API Definition ------------------------------------------------------- -// IngestGeoIPStats returns statistical information about geoip databases +// IngestGeoIPStats get GeoIP statistics // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/geoip-stats-api.html. +// See full documentation at https://www.elastic.co/docs/reference/enrich-processor/geoip-processor. type IngestGeoIPStats func(o ...func(*IngestGeoIPStatsRequest)) (*Response, error) // IngestGeoIPStatsRequest configures the Ingest GeoIP Stats API request. diff --git a/esapi/api.ingest.get_geoip_database.go b/esapi/api.ingest.get_geoip_database.go index fc6ed06f1d..c689e7f4c1 100644 --- a/esapi/api.ingest.get_geoip_database.go +++ b/esapi/api.ingest.get_geoip_database.go @@ -42,9 +42,9 @@ func newIngestGetGeoipDatabaseFunc(t Transport) IngestGetGeoipDatabase { // ----- API Definition ------------------------------------------------------- -// IngestGetGeoipDatabase returns geoip database configuration. +// IngestGetGeoipDatabase get GeoIP database configurations // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-geoip-database-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-get-geoip-database. type IngestGetGeoipDatabase func(o ...func(*IngestGetGeoipDatabaseRequest)) (*Response, error) // IngestGetGeoipDatabaseRequest configures the Ingest Get Geoip Database API request. diff --git a/esapi/api.ingest.get_ip_location_database.go b/esapi/api.ingest.get_ip_location_database.go index b42300cf80..29ef7f2bf8 100644 --- a/esapi/api.ingest.get_ip_location_database.go +++ b/esapi/api.ingest.get_ip_location_database.go @@ -42,9 +42,9 @@ func newIngestGetIPLocationDatabaseFunc(t Transport) IngestGetIPLocationDatabase // ----- API Definition ------------------------------------------------------- -// IngestGetIPLocationDatabase returns the specified ip location database configuration +// IngestGetIPLocationDatabase get IP geolocation database configurations // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-ip-location-database-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-get-ip-location-database. type IngestGetIPLocationDatabase func(o ...func(*IngestGetIPLocationDatabaseRequest)) (*Response, error) // IngestGetIPLocationDatabaseRequest configures the Ingest GetIP Location Database API request. diff --git a/esapi/api.ingest.get_pipeline.go b/esapi/api.ingest.get_pipeline.go index 17faf7282e..ea23bff38d 100644 --- a/esapi/api.ingest.get_pipeline.go +++ b/esapi/api.ingest.get_pipeline.go @@ -44,9 +44,9 @@ func newIngestGetPipelineFunc(t Transport) IngestGetPipeline { // ----- API Definition ------------------------------------------------------- -// IngestGetPipeline returns a pipeline. +// IngestGetPipeline get pipelines // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-get-pipeline. type IngestGetPipeline func(o ...func(*IngestGetPipelineRequest)) (*Response, error) // IngestGetPipelineRequest configures the Ingest Get Pipeline API request. diff --git a/esapi/api.ingest.processor_grok.go b/esapi/api.ingest.processor_grok.go index b5eabd9155..c86a9e9304 100644 --- a/esapi/api.ingest.processor_grok.go +++ b/esapi/api.ingest.processor_grok.go @@ -42,9 +42,9 @@ func newIngestProcessorGrokFunc(t Transport) IngestProcessorGrok { // ----- API Definition ------------------------------------------------------- -// IngestProcessorGrok returns a list of the built-in patterns. +// IngestProcessorGrok run a grok processor // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get. +// See full documentation at https://www.elastic.co/docs/reference/enrich-processor/grok-processor. type IngestProcessorGrok func(o ...func(*IngestProcessorGrokRequest)) (*Response, error) // IngestProcessorGrokRequest configures the Ingest Processor Grok API request. diff --git a/esapi/api.ingest.put_geoip_database.go b/esapi/api.ingest.put_geoip_database.go index 234ca48a96..b515083013 100644 --- a/esapi/api.ingest.put_geoip_database.go +++ b/esapi/api.ingest.put_geoip_database.go @@ -44,9 +44,9 @@ func newIngestPutGeoipDatabaseFunc(t Transport) IngestPutGeoipDatabase { // ----- API Definition ------------------------------------------------------- -// IngestPutGeoipDatabase puts the configuration for a geoip database to be downloaded +// IngestPutGeoipDatabase create or update a GeoIP database configuration // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/put-geoip-database-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-put-geoip-database. type IngestPutGeoipDatabase func(id string, body io.Reader, o ...func(*IngestPutGeoipDatabaseRequest)) (*Response, error) // IngestPutGeoipDatabaseRequest configures the Ingest Put Geoip Database API request. diff --git a/esapi/api.ingest.put_ip_location_database.go b/esapi/api.ingest.put_ip_location_database.go index 4c2ae516dd..51f1e9404c 100644 --- a/esapi/api.ingest.put_ip_location_database.go +++ b/esapi/api.ingest.put_ip_location_database.go @@ -44,9 +44,9 @@ func newIngestPutIPLocationDatabaseFunc(t Transport) IngestPutIPLocationDatabase // ----- API Definition ------------------------------------------------------- -// IngestPutIPLocationDatabase puts the configuration for a ip location database to be downloaded +// IngestPutIPLocationDatabase create or update an IP geolocation database configuration // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/put-ip-location-database-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-put-ip-location-database. type IngestPutIPLocationDatabase func(id string, body io.Reader, o ...func(*IngestPutIPLocationDatabaseRequest)) (*Response, error) // IngestPutIPLocationDatabaseRequest configures the Ingest PutIP Location Database API request. diff --git a/esapi/api.ingest.put_pipeline.go b/esapi/api.ingest.put_pipeline.go index 361c1517f6..fc6b38e74f 100644 --- a/esapi/api.ingest.put_pipeline.go +++ b/esapi/api.ingest.put_pipeline.go @@ -45,9 +45,9 @@ func newIngestPutPipelineFunc(t Transport) IngestPutPipeline { // ----- API Definition ------------------------------------------------------- -// IngestPutPipeline creates or updates a pipeline. +// IngestPutPipeline create or update a pipeline // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html. +// See full documentation at https://www.elastic.co/docs/manage-data/ingest/transform-enrich/ingest-pipelines. type IngestPutPipeline func(id string, body io.Reader, o ...func(*IngestPutPipelineRequest)) (*Response, error) // IngestPutPipelineRequest configures the Ingest Put Pipeline API request. diff --git a/esapi/api.ingest.simulate.go b/esapi/api.ingest.simulate.go index 890761c840..aadc01952a 100644 --- a/esapi/api.ingest.simulate.go +++ b/esapi/api.ingest.simulate.go @@ -44,9 +44,9 @@ func newIngestSimulateFunc(t Transport) IngestSimulate { // ----- API Definition ------------------------------------------------------- -// IngestSimulate allows to simulate a pipeline with example documents. +// IngestSimulate simulate a pipeline // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-simulate. type IngestSimulate func(body io.Reader, o ...func(*IngestSimulateRequest)) (*Response, error) // IngestSimulateRequest configures the Ingest Simulate API request. diff --git a/esapi/api.mget.go b/esapi/api.mget.go index 0c7c417133..12c40231b1 100644 --- a/esapi/api.mget.go +++ b/esapi/api.mget.go @@ -44,9 +44,9 @@ func newMgetFunc(t Transport) Mget { // ----- API Definition ------------------------------------------------------- -// Mget allows to get multiple documents in one request. +// Mget get multiple documents // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-mget. type Mget func(body io.Reader, o ...func(*MgetRequest)) (*Response, error) // MgetRequest configures the Mget API request. @@ -59,7 +59,7 @@ type MgetRequest struct { Preference string Realtime *bool Refresh *bool - Routing string + Routing []string Source []string SourceExcludes []string SourceIncludes []string @@ -126,8 +126,8 @@ func (r MgetRequest) Do(providedCtx context.Context, transport Transport) (*Resp params["refresh"] = strconv.FormatBool(*r.Refresh) } - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if len(r.Source) > 0 { @@ -267,7 +267,7 @@ func (f Mget) WithRefresh(v bool) func(*MgetRequest) { } // WithRouting - specific routing value. -func (f Mget) WithRouting(v string) func(*MgetRequest) { +func (f Mget) WithRouting(v ...string) func(*MgetRequest) { return func(r *MgetRequest) { r.Routing = v } diff --git a/esapi/api.msearch.go b/esapi/api.msearch.go index ddcafc932d..a2bfe9b27d 100644 --- a/esapi/api.msearch.go +++ b/esapi/api.msearch.go @@ -44,9 +44,9 @@ func newMsearchFunc(t Transport) Msearch { // ----- API Definition ------------------------------------------------------- -// Msearch allows to execute several search operations in one request. +// Msearch run multiple searches // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-msearch. type Msearch func(body io.Reader, o ...func(*MsearchRequest)) (*Response, error) // MsearchRequest configures the Msearch API request. @@ -57,7 +57,7 @@ type MsearchRequest struct { AllowNoIndices *bool CcsMinimizeRoundtrips *bool - ExpandWildcards string + ExpandWildcards []string IgnoreThrottled *bool IgnoreUnavailable *bool IncludeNamedQueriesScore *bool @@ -122,8 +122,8 @@ func (r MsearchRequest) Do(providedCtx context.Context, transport Transport) (*R params["ccs_minimize_roundtrips"] = strconv.FormatBool(*r.CcsMinimizeRoundtrips) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreThrottled != nil { @@ -277,7 +277,7 @@ func (f Msearch) WithCcsMinimizeRoundtrips(v bool) func(*MsearchRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f Msearch) WithExpandWildcards(v string) func(*MsearchRequest) { +func (f Msearch) WithExpandWildcards(v ...string) func(*MsearchRequest) { return func(r *MsearchRequest) { r.ExpandWildcards = v } @@ -318,7 +318,7 @@ func (f Msearch) WithMaxConcurrentShardRequests(v int) func(*MsearchRequest) { } } -// WithPreFilterShardSize - a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. this filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.. +// WithPreFilterShardSize - a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. this filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.. func (f Msearch) WithPreFilterShardSize(v int) func(*MsearchRequest) { return func(r *MsearchRequest) { r.PreFilterShardSize = &v diff --git a/esapi/api.msearch_template.go b/esapi/api.msearch_template.go index bbcd136408..60d685c6b4 100644 --- a/esapi/api.msearch_template.go +++ b/esapi/api.msearch_template.go @@ -44,9 +44,9 @@ func newMsearchTemplateFunc(t Transport) MsearchTemplate { // ----- API Definition ------------------------------------------------------- -// MsearchTemplate allows to execute several search template operations in one request. +// MsearchTemplate run multiple templated searches // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-msearch-template. type MsearchTemplate func(body io.Reader, o ...func(*MsearchTemplateRequest)) (*Response, error) // MsearchTemplateRequest configures the Msearch Template API request. diff --git a/esapi/api.mtermvectors.go b/esapi/api.mtermvectors.go index 7c4caa17c8..38778a415a 100644 --- a/esapi/api.mtermvectors.go +++ b/esapi/api.mtermvectors.go @@ -44,9 +44,9 @@ func newMtermvectorsFunc(t Transport) Mtermvectors { // ----- API Definition ------------------------------------------------------- -// Mtermvectors returns multiple termvectors in one request. +// Mtermvectors get multiple term vectors // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-mtermvectors. type Mtermvectors func(o ...func(*MtermvectorsRequest)) (*Response, error) // MtermvectorsRequest configures the Mtermvectors API request. @@ -63,7 +63,7 @@ type MtermvectorsRequest struct { Positions *bool Preference string Realtime *bool - Routing string + Routing []string TermStatistics *bool Version *int VersionType string @@ -145,8 +145,8 @@ func (r MtermvectorsRequest) Do(providedCtx context.Context, transport Transport params["realtime"] = strconv.FormatBool(*r.Realtime) } - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if r.TermStatistics != nil { @@ -317,7 +317,7 @@ func (f Mtermvectors) WithRealtime(v bool) func(*MtermvectorsRequest) { } // WithRouting - specific routing value. applies to all returned documents unless otherwise specified in body "params" or "docs".. -func (f Mtermvectors) WithRouting(v string) func(*MtermvectorsRequest) { +func (f Mtermvectors) WithRouting(v ...string) func(*MtermvectorsRequest) { return func(r *MtermvectorsRequest) { r.Routing = v } diff --git a/esapi/api.nodes.clear_repositories_metering_archive.go b/esapi/api.nodes.clear_repositories_metering_archive.go index 1b13fde661..afbf9c0acf 100644 --- a/esapi/api.nodes.clear_repositories_metering_archive.go +++ b/esapi/api.nodes.clear_repositories_metering_archive.go @@ -44,11 +44,11 @@ func newNodesClearRepositoriesMeteringArchiveFunc(t Transport) NodesClearReposit // ----- API Definition ------------------------------------------------------- -// NodesClearRepositoriesMeteringArchive removes the archived repositories metering information present in the cluster. +// NodesClearRepositoriesMeteringArchive clear the archived repositories metering // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-repositories-metering-archive-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-clear-repositories-metering-archive. type NodesClearRepositoriesMeteringArchive func(max_archive_version *int, node_id []string, o ...func(*NodesClearRepositoriesMeteringArchiveRequest)) (*Response, error) // NodesClearRepositoriesMeteringArchiveRequest configures the Nodes Clear Repositories Metering Archive API request. diff --git a/esapi/api.nodes.get_repositories_metering_info.go b/esapi/api.nodes.get_repositories_metering_info.go index 452ce675d5..39b303e8f8 100644 --- a/esapi/api.nodes.get_repositories_metering_info.go +++ b/esapi/api.nodes.get_repositories_metering_info.go @@ -43,11 +43,11 @@ func newNodesGetRepositoriesMeteringInfoFunc(t Transport) NodesGetRepositoriesMe // ----- API Definition ------------------------------------------------------- -// NodesGetRepositoriesMeteringInfo returns cluster repositories metering information. +// NodesGetRepositoriesMeteringInfo get cluster repositories metering // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-repositories-metering-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-get-repositories-metering-info. type NodesGetRepositoriesMeteringInfo func(node_id []string, o ...func(*NodesGetRepositoriesMeteringInfoRequest)) (*Response, error) // NodesGetRepositoriesMeteringInfoRequest configures the Nodes Get Repositories Metering Info API request. diff --git a/esapi/api.nodes.hot_threads.go b/esapi/api.nodes.hot_threads.go index a0f495b8a0..3fdc079c4c 100644 --- a/esapi/api.nodes.hot_threads.go +++ b/esapi/api.nodes.hot_threads.go @@ -44,9 +44,9 @@ func newNodesHotThreadsFunc(t Transport) NodesHotThreads { // ----- API Definition ------------------------------------------------------- -// NodesHotThreads returns information about hot threads on each node in the cluster. +// NodesHotThreads get the hot threads for nodes // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-hot-threads. type NodesHotThreads func(o ...func(*NodesHotThreadsRequest)) (*Response, error) // NodesHotThreadsRequest configures the Nodes Hot Threads API request. diff --git a/esapi/api.nodes.info.go b/esapi/api.nodes.info.go index e2cc0d0d13..486c96a0ee 100644 --- a/esapi/api.nodes.info.go +++ b/esapi/api.nodes.info.go @@ -44,9 +44,9 @@ func newNodesInfoFunc(t Transport) NodesInfo { // ----- API Definition ------------------------------------------------------- -// NodesInfo returns information about nodes in the cluster. +// NodesInfo get node information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-info. type NodesInfo func(o ...func(*NodesInfoRequest)) (*Response, error) // NodesInfoRequest configures the Nodes Info API request. diff --git a/esapi/api.nodes.reload_secure_settings.go b/esapi/api.nodes.reload_secure_settings.go index db4399828c..0fdc7d9a20 100644 --- a/esapi/api.nodes.reload_secure_settings.go +++ b/esapi/api.nodes.reload_secure_settings.go @@ -44,9 +44,9 @@ func newNodesReloadSecureSettingsFunc(t Transport) NodesReloadSecureSettings { // ----- API Definition ------------------------------------------------------- -// NodesReloadSecureSettings reloads secure settings. +// NodesReloadSecureSettings reload the keystore on nodes in the cluster // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-reload-secure-settings. type NodesReloadSecureSettings func(o ...func(*NodesReloadSecureSettingsRequest)) (*Response, error) // NodesReloadSecureSettingsRequest configures the Nodes Reload Secure Settings API request. diff --git a/esapi/api.nodes.stats.go b/esapi/api.nodes.stats.go index fffc7645a7..9f1d56e33d 100644 --- a/esapi/api.nodes.stats.go +++ b/esapi/api.nodes.stats.go @@ -44,9 +44,9 @@ func newNodesStatsFunc(t Transport) NodesStats { // ----- API Definition ------------------------------------------------------- -// NodesStats returns statistical information about nodes in the cluster. +// NodesStats get node statistics // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-stats. type NodesStats func(o ...func(*NodesStatsRequest)) (*Response, error) // NodesStatsRequest configures the Nodes Stats API request. diff --git a/esapi/api.nodes.usage.go b/esapi/api.nodes.usage.go index 9842b0868e..39d71bb2ab 100644 --- a/esapi/api.nodes.usage.go +++ b/esapi/api.nodes.usage.go @@ -43,9 +43,9 @@ func newNodesUsageFunc(t Transport) NodesUsage { // ----- API Definition ------------------------------------------------------- -// NodesUsage returns low-level information about REST actions usage on nodes. +// NodesUsage get feature usage information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-usage. type NodesUsage func(o ...func(*NodesUsageRequest)) (*Response, error) // NodesUsageRequest configures the Nodes Usage API request. diff --git a/esapi/api.ping.go b/esapi/api.ping.go index faa8fb02c1..c99b14b974 100644 --- a/esapi/api.ping.go +++ b/esapi/api.ping.go @@ -42,9 +42,9 @@ func newPingFunc(t Transport) Ping { // ----- API Definition ------------------------------------------------------- -// Ping returns whether the cluster is running. +// Ping ping the cluster // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-cluster. type Ping func(o ...func(*PingRequest)) (*Response, error) // PingRequest configures the Ping API request. diff --git a/esapi/api.profiling.stacktraces.go b/esapi/api.profiling.stacktraces.go index 4bc11a41b3..f068b84c68 100644 --- a/esapi/api.profiling.stacktraces.go +++ b/esapi/api.profiling.stacktraces.go @@ -43,7 +43,7 @@ func newProfilingStacktracesFunc(t Transport) ProfilingStacktraces { // ----- API Definition ------------------------------------------------------- -// ProfilingStacktraces extracts raw stacktrace information from Universal Profiling. +// ProfilingStacktraces extracts raw stacktrace information from Universal Profiling // // See full documentation at https://www.elastic.co/guide/en/observability/current/universal-profiling.html. type ProfilingStacktraces func(body io.Reader, o ...func(*ProfilingStacktracesRequest)) (*Response, error) diff --git a/esapi/api.profiling.status.go b/esapi/api.profiling.status.go index 40e212bea6..71fda2e01c 100644 --- a/esapi/api.profiling.status.go +++ b/esapi/api.profiling.status.go @@ -44,7 +44,7 @@ func newProfilingStatusFunc(t Transport) ProfilingStatus { // ----- API Definition ------------------------------------------------------- -// ProfilingStatus returns basic information about the status of Universal Profiling. +// ProfilingStatus returns basic information about the status of Universal Profiling // // See full documentation at https://www.elastic.co/guide/en/observability/current/universal-profiling.html. type ProfilingStatus func(o ...func(*ProfilingStatusRequest)) (*Response, error) diff --git a/esapi/api.profiling.topn_functions.go b/esapi/api.profiling.topn_functions.go index 1b9562e216..8a16e049bb 100644 --- a/esapi/api.profiling.topn_functions.go +++ b/esapi/api.profiling.topn_functions.go @@ -43,7 +43,7 @@ func newProfilingTopnFunctionsFunc(t Transport) ProfilingTopnFunctions { // ----- API Definition ------------------------------------------------------- -// ProfilingTopnFunctions extracts a list of topN functions from Universal Profiling. +// ProfilingTopnFunctions extracts a list of topN functions from Universal Profiling // // See full documentation at https://www.elastic.co/guide/en/observability/current/universal-profiling.html. type ProfilingTopnFunctions func(body io.Reader, o ...func(*ProfilingTopnFunctionsRequest)) (*Response, error) diff --git a/esapi/api.put_script.go b/esapi/api.put_script.go index e3722cb26a..c58a2a9645 100644 --- a/esapi/api.put_script.go +++ b/esapi/api.put_script.go @@ -44,9 +44,9 @@ func newPutScriptFunc(t Transport) PutScript { // ----- API Definition ------------------------------------------------------- -// PutScript creates or updates a script. +// PutScript create or update a script or search template // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-put-script. type PutScript func(id string, body io.Reader, o ...func(*PutScriptRequest)) (*Response, error) // PutScriptRequest configures the Put Script API request. diff --git a/esapi/api.query_rules.delete_rule.go b/esapi/api.query_rules.delete_rule.go index 622b34333d..942b9b2965 100644 --- a/esapi/api.query_rules.delete_rule.go +++ b/esapi/api.query_rules.delete_rule.go @@ -42,9 +42,9 @@ func newQueryRulesDeleteRuleFunc(t Transport) QueryRulesDeleteRule { // ----- API Definition ------------------------------------------------------- -// QueryRulesDeleteRule deletes an individual query rule within a ruleset. +// QueryRulesDeleteRule delete a query rule // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-rule.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-delete-rule. type QueryRulesDeleteRule func(rule_id string, ruleset_id string, o ...func(*QueryRulesDeleteRuleRequest)) (*Response, error) // QueryRulesDeleteRuleRequest configures the Query Rules Delete Rule API request. diff --git a/esapi/api.query_rules.delete_ruleset.go b/esapi/api.query_rules.delete_ruleset.go index 6b76bfedca..2ec1a2826b 100644 --- a/esapi/api.query_rules.delete_ruleset.go +++ b/esapi/api.query_rules.delete_ruleset.go @@ -42,9 +42,9 @@ func newQueryRulesDeleteRulesetFunc(t Transport) QueryRulesDeleteRuleset { // ----- API Definition ------------------------------------------------------- -// QueryRulesDeleteRuleset deletes a query ruleset. +// QueryRulesDeleteRuleset delete a query ruleset // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-delete-ruleset. type QueryRulesDeleteRuleset func(ruleset_id string, o ...func(*QueryRulesDeleteRulesetRequest)) (*Response, error) // QueryRulesDeleteRulesetRequest configures the Query Rules Delete Ruleset API request. diff --git a/esapi/api.query_rules.get_rule.go b/esapi/api.query_rules.get_rule.go index 1da4aa03bb..4b7b12fda1 100644 --- a/esapi/api.query_rules.get_rule.go +++ b/esapi/api.query_rules.get_rule.go @@ -42,9 +42,9 @@ func newQueryRulesGetRuleFunc(t Transport) QueryRulesGetRule { // ----- API Definition ------------------------------------------------------- -// QueryRulesGetRule returns the details about an individual query rule within a ruleset. +// QueryRulesGetRule get a query rule // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-rule.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-get-rule. type QueryRulesGetRule func(rule_id string, ruleset_id string, o ...func(*QueryRulesGetRuleRequest)) (*Response, error) // QueryRulesGetRuleRequest configures the Query Rules Get Rule API request. diff --git a/esapi/api.query_rules.get_ruleset.go b/esapi/api.query_rules.get_ruleset.go index 9624967dad..415bdcc204 100644 --- a/esapi/api.query_rules.get_ruleset.go +++ b/esapi/api.query_rules.get_ruleset.go @@ -42,9 +42,9 @@ func newQueryRulesGetRulesetFunc(t Transport) QueryRulesGetRuleset { // ----- API Definition ------------------------------------------------------- -// QueryRulesGetRuleset returns the details about a query ruleset. +// QueryRulesGetRuleset get a query ruleset // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-get-ruleset. type QueryRulesGetRuleset func(ruleset_id string, o ...func(*QueryRulesGetRulesetRequest)) (*Response, error) // QueryRulesGetRulesetRequest configures the Query Rules Get Ruleset API request. diff --git a/esapi/api.query_rules.list_rulesets.go b/esapi/api.query_rules.list_rulesets.go index 12eb99cd82..03823629ea 100644 --- a/esapi/api.query_rules.list_rulesets.go +++ b/esapi/api.query_rules.list_rulesets.go @@ -43,9 +43,9 @@ func newQueryRulesListRulesetsFunc(t Transport) QueryRulesListRulesets { // ----- API Definition ------------------------------------------------------- -// QueryRulesListRulesets lists query rulesets. +// QueryRulesListRulesets get all query rulesets // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-list-rulesets. type QueryRulesListRulesets func(o ...func(*QueryRulesListRulesetsRequest)) (*Response, error) // QueryRulesListRulesetsRequest configures the Query Rules List Rulesets API request. diff --git a/esapi/api.query_rules.put_rule.go b/esapi/api.query_rules.put_rule.go index 74d4b8c1b6..053ed382f9 100644 --- a/esapi/api.query_rules.put_rule.go +++ b/esapi/api.query_rules.put_rule.go @@ -43,9 +43,9 @@ func newQueryRulesPutRuleFunc(t Transport) QueryRulesPutRule { // ----- API Definition ------------------------------------------------------- -// QueryRulesPutRule creates or updates a query rule within a ruleset. +// QueryRulesPutRule create or update a query rule // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-rule.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-put-rule. type QueryRulesPutRule func(body io.Reader, rule_id string, ruleset_id string, o ...func(*QueryRulesPutRuleRequest)) (*Response, error) // QueryRulesPutRuleRequest configures the Query Rules Put Rule API request. diff --git a/esapi/api.query_rules.put_ruleset.go b/esapi/api.query_rules.put_ruleset.go index 29f53f0e87..591756235c 100644 --- a/esapi/api.query_rules.put_ruleset.go +++ b/esapi/api.query_rules.put_ruleset.go @@ -43,9 +43,9 @@ func newQueryRulesPutRulesetFunc(t Transport) QueryRulesPutRuleset { // ----- API Definition ------------------------------------------------------- -// QueryRulesPutRuleset creates or updates a query ruleset. +// QueryRulesPutRuleset create or update a query ruleset // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-put-ruleset. type QueryRulesPutRuleset func(body io.Reader, ruleset_id string, o ...func(*QueryRulesPutRulesetRequest)) (*Response, error) // QueryRulesPutRulesetRequest configures the Query Rules Put Ruleset API request. diff --git a/esapi/api.query_rules.test.go b/esapi/api.query_rules.test.go index 8d7bf9f284..6e799c6d91 100644 --- a/esapi/api.query_rules.test.go +++ b/esapi/api.query_rules.test.go @@ -43,11 +43,9 @@ func newQueryRulesTestFunc(t Transport) QueryRulesTest { // ----- API Definition ------------------------------------------------------- -// QueryRulesTest tests a query ruleset to identify the rules that would match input criteria +// QueryRulesTest test a query ruleset // -// This API is experimental. -// -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/test-query-ruleset.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-test. type QueryRulesTest func(body io.Reader, ruleset_id string, o ...func(*QueryRulesTestRequest)) (*Response, error) // QueryRulesTestRequest configures the Query Rules Test API request. diff --git a/esapi/api.rank_eval.go b/esapi/api.rank_eval.go index 25e99041d6..a5df284054 100644 --- a/esapi/api.rank_eval.go +++ b/esapi/api.rank_eval.go @@ -44,9 +44,9 @@ func newRankEvalFunc(t Transport) RankEval { // ----- API Definition ------------------------------------------------------- -// RankEval allows to evaluate the quality of ranked search results over a set of typical search queries +// RankEval evaluate ranked search results // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rank-eval. type RankEval func(body io.Reader, o ...func(*RankEvalRequest)) (*Response, error) // RankEvalRequest configures the Rank Eval API request. @@ -56,7 +56,7 @@ type RankEvalRequest struct { Body io.Reader AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool SearchType string @@ -109,8 +109,8 @@ func (r RankEvalRequest) Do(providedCtx context.Context, transport Transport) (* params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -221,7 +221,7 @@ func (f RankEval) WithAllowNoIndices(v bool) func(*RankEvalRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f RankEval) WithExpandWildcards(v string) func(*RankEvalRequest) { +func (f RankEval) WithExpandWildcards(v ...string) func(*RankEvalRequest) { return func(r *RankEvalRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.reindex.go b/esapi/api.reindex.go index ebea311a54..86cc611d7c 100644 --- a/esapi/api.reindex.go +++ b/esapi/api.reindex.go @@ -46,11 +46,9 @@ func newReindexFunc(t Transport) Reindex { // ----- API Definition ------------------------------------------------------- -// Reindex allows to copy documents from one index to another, optionally filtering the source -// documents by a query, changing the destination index settings, or fetching the -// documents from a remote cluster. +// Reindex reindex documents // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-reindex. type Reindex func(body io.Reader, o ...func(*ReindexRequest)) (*Response, error) // ReindexRequest configures the Reindex API request. diff --git a/esapi/api.reindex_rethrottle.go b/esapi/api.reindex_rethrottle.go index db5275f667..6e33921b77 100644 --- a/esapi/api.reindex_rethrottle.go +++ b/esapi/api.reindex_rethrottle.go @@ -43,9 +43,9 @@ func newReindexRethrottleFunc(t Transport) ReindexRethrottle { // ----- API Definition ------------------------------------------------------- -// ReindexRethrottle changes the number of requests per second for a particular Reindex operation. +// ReindexRethrottle throttle a reindex operation // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-reindex. type ReindexRethrottle func(task_id string, requests_per_second *int, o ...func(*ReindexRethrottleRequest)) (*Response, error) // ReindexRethrottleRequest configures the Reindex Rethrottle API request. diff --git a/esapi/api.render_search_template.go b/esapi/api.render_search_template.go index 15a6f4fe32..eeb338cd8c 100644 --- a/esapi/api.render_search_template.go +++ b/esapi/api.render_search_template.go @@ -43,9 +43,9 @@ func newRenderSearchTemplateFunc(t Transport) RenderSearchTemplate { // ----- API Definition ------------------------------------------------------- -// RenderSearchTemplate allows to use the Mustache language to pre-render a search definition. +// RenderSearchTemplate render a search template // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/render-search-template-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-render-search-template. type RenderSearchTemplate func(o ...func(*RenderSearchTemplateRequest)) (*Response, error) // RenderSearchTemplateRequest configures the Render Search Template API request. diff --git a/esapi/api.scripts_painless_execute.go b/esapi/api.scripts_painless_execute.go index aed66e300f..9125dde6b2 100644 --- a/esapi/api.scripts_painless_execute.go +++ b/esapi/api.scripts_painless_execute.go @@ -43,11 +43,11 @@ func newScriptsPainlessExecuteFunc(t Transport) ScriptsPainlessExecute { // ----- API Definition ------------------------------------------------------- -// ScriptsPainlessExecute allows an arbitrary script to be executed and a result to be returned +// ScriptsPainlessExecute run a script // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html. +// See full documentation at https://www.elastic.co/docs/reference/scripting-languages/painless/painless-api-examples. type ScriptsPainlessExecute func(o ...func(*ScriptsPainlessExecuteRequest)) (*Response, error) // ScriptsPainlessExecuteRequest configures the Scripts Painless Execute API request. diff --git a/esapi/api.scroll.go b/esapi/api.scroll.go index f13365eaa9..5623eedd57 100644 --- a/esapi/api.scroll.go +++ b/esapi/api.scroll.go @@ -45,9 +45,9 @@ func newScrollFunc(t Transport) Scroll { // ----- API Definition ------------------------------------------------------- -// Scroll allows to retrieve a large numbers of results from a single search request. +// Scroll run a scrolling search // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-scroll. type Scroll func(o ...func(*ScrollRequest)) (*Response, error) // ScrollRequest configures the Scroll API request. diff --git a/esapi/api.search.go b/esapi/api.search.go index 9d943a4a6f..d02bdff982 100644 --- a/esapi/api.search.go +++ b/esapi/api.search.go @@ -46,9 +46,9 @@ func newSearchFunc(t Transport) Search { // ----- API Definition ------------------------------------------------------- -// Search returns results matching a query. +// Search run a search // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search. type Search func(o ...func(*SearchRequest)) (*Response, error) // SearchRequest configures the Search API request. @@ -66,7 +66,7 @@ type SearchRequest struct { DefaultOperator string Df string DocvalueFields []string - ExpandWildcards string + ExpandWildcards []string Explain *bool ForceSyntheticSource *bool From *int @@ -183,8 +183,8 @@ func (r SearchRequest) Do(providedCtx context.Context, transport Transport) (*Re params["docvalue_fields"] = strings.Join(r.DocvalueFields, ",") } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.Explain != nil { @@ -486,7 +486,7 @@ func (f Search) WithDocvalueFields(v ...string) func(*SearchRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f Search) WithExpandWildcards(v string) func(*SearchRequest) { +func (f Search) WithExpandWildcards(v ...string) func(*SearchRequest) { return func(r *SearchRequest) { r.ExpandWildcards = v } @@ -555,7 +555,7 @@ func (f Search) WithPreference(v string) func(*SearchRequest) { } } -// WithPreFilterShardSize - a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. this filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.. +// WithPreFilterShardSize - a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. this filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.. func (f Search) WithPreFilterShardSize(v int) func(*SearchRequest) { return func(r *SearchRequest) { r.PreFilterShardSize = &v diff --git a/esapi/api.search_application.delete.go b/esapi/api.search_application.delete.go index 15c58d20c7..862b64ffed 100644 --- a/esapi/api.search_application.delete.go +++ b/esapi/api.search_application.delete.go @@ -42,11 +42,11 @@ func newSearchApplicationDeleteFunc(t Transport) SearchApplicationDelete { // ----- API Definition ------------------------------------------------------- -// SearchApplicationDelete deletes a search application. +// SearchApplicationDelete delete a search application // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-search-application.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-delete. type SearchApplicationDelete func(name string, o ...func(*SearchApplicationDeleteRequest)) (*Response, error) // SearchApplicationDeleteRequest configures the Search Application Delete API request. diff --git a/esapi/api.search_application.delete_behavioral_analytics.go b/esapi/api.search_application.delete_behavioral_analytics.go index c825547e4b..3011da9ac6 100644 --- a/esapi/api.search_application.delete_behavioral_analytics.go +++ b/esapi/api.search_application.delete_behavioral_analytics.go @@ -42,11 +42,11 @@ func newSearchApplicationDeleteBehavioralAnalyticsFunc(t Transport) SearchApplic // ----- API Definition ------------------------------------------------------- -// SearchApplicationDeleteBehavioralAnalytics delete a behavioral analytics collection. +// SearchApplicationDeleteBehavioralAnalytics delete a behavioral analytics collection // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-analytics-collection.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-delete-behavioral-analytics. type SearchApplicationDeleteBehavioralAnalytics func(name string, o ...func(*SearchApplicationDeleteBehavioralAnalyticsRequest)) (*Response, error) // SearchApplicationDeleteBehavioralAnalyticsRequest configures the Search Application Delete Behavioral Analytics API request. diff --git a/esapi/api.search_application.get.go b/esapi/api.search_application.get.go index fc2c96c5ab..c77dff31df 100644 --- a/esapi/api.search_application.get.go +++ b/esapi/api.search_application.get.go @@ -42,11 +42,11 @@ func newSearchApplicationGetFunc(t Transport) SearchApplicationGet { // ----- API Definition ------------------------------------------------------- -// SearchApplicationGet returns the details about a search application. +// SearchApplicationGet get search application details // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-search-application.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get. type SearchApplicationGet func(name string, o ...func(*SearchApplicationGetRequest)) (*Response, error) // SearchApplicationGetRequest configures the Search Application Get API request. diff --git a/esapi/api.search_application.get_behavioral_analytics.go b/esapi/api.search_application.get_behavioral_analytics.go index 0e522025f2..3aed081b79 100644 --- a/esapi/api.search_application.get_behavioral_analytics.go +++ b/esapi/api.search_application.get_behavioral_analytics.go @@ -42,11 +42,11 @@ func newSearchApplicationGetBehavioralAnalyticsFunc(t Transport) SearchApplicati // ----- API Definition ------------------------------------------------------- -// SearchApplicationGetBehavioralAnalytics returns the existing behavioral analytics collections. +// SearchApplicationGetBehavioralAnalytics get behavioral analytics collections // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/list-analytics-collection.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get-behavioral-analytics. type SearchApplicationGetBehavioralAnalytics func(o ...func(*SearchApplicationGetBehavioralAnalyticsRequest)) (*Response, error) // SearchApplicationGetBehavioralAnalyticsRequest configures the Search Application Get Behavioral Analytics API request. diff --git a/esapi/api.search_application.list.go b/esapi/api.search_application.list.go index 820bcd1f5f..853e5360f9 100644 --- a/esapi/api.search_application.list.go +++ b/esapi/api.search_application.list.go @@ -43,11 +43,11 @@ func newSearchApplicationListFunc(t Transport) SearchApplicationList { // ----- API Definition ------------------------------------------------------- -// SearchApplicationList returns the existing search applications. +// SearchApplicationList get search applications // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/list-search-applications.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get-behavioral-analytics. type SearchApplicationList func(o ...func(*SearchApplicationListRequest)) (*Response, error) // SearchApplicationListRequest configures the Search Application List API request. diff --git a/esapi/api.search_application.post_behavioral_analytics_event.go b/esapi/api.search_application.post_behavioral_analytics_event.go index e78491b27d..fe6ee8356f 100644 --- a/esapi/api.search_application.post_behavioral_analytics_event.go +++ b/esapi/api.search_application.post_behavioral_analytics_event.go @@ -44,11 +44,11 @@ func newSearchApplicationPostBehavioralAnalyticsEventFunc(t Transport) SearchApp // ----- API Definition ------------------------------------------------------- -// SearchApplicationPostBehavioralAnalyticsEvent creates a behavioral analytics event for existing collection. +// SearchApplicationPostBehavioralAnalyticsEvent create a behavioral analytics collection event // // This API is experimental. // -// See full documentation at http://todo.com/tbd. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-post-behavioral-analytics-event. type SearchApplicationPostBehavioralAnalyticsEvent func(body io.Reader, collection_name string, event_type string, o ...func(*SearchApplicationPostBehavioralAnalyticsEventRequest)) (*Response, error) // SearchApplicationPostBehavioralAnalyticsEventRequest configures the Search Application Post Behavioral Analytics Event API request. diff --git a/esapi/api.search_application.put.go b/esapi/api.search_application.put.go index a8bedc92f9..04d6b6966c 100644 --- a/esapi/api.search_application.put.go +++ b/esapi/api.search_application.put.go @@ -44,11 +44,11 @@ func newSearchApplicationPutFunc(t Transport) SearchApplicationPut { // ----- API Definition ------------------------------------------------------- -// SearchApplicationPut creates or updates a search application. +// SearchApplicationPut create or update a search application // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/put-search-application.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-put. type SearchApplicationPut func(name string, body io.Reader, o ...func(*SearchApplicationPutRequest)) (*Response, error) // SearchApplicationPutRequest configures the Search Application Put API request. diff --git a/esapi/api.search_application.put_behavioral_analytics.go b/esapi/api.search_application.put_behavioral_analytics.go index 4db751f7c4..c08f5738f3 100644 --- a/esapi/api.search_application.put_behavioral_analytics.go +++ b/esapi/api.search_application.put_behavioral_analytics.go @@ -42,11 +42,11 @@ func newSearchApplicationPutBehavioralAnalyticsFunc(t Transport) SearchApplicati // ----- API Definition ------------------------------------------------------- -// SearchApplicationPutBehavioralAnalytics creates a behavioral analytics collection. +// SearchApplicationPutBehavioralAnalytics create a behavioral analytics collection // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/put-analytics-collection.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-put-behavioral-analytics. type SearchApplicationPutBehavioralAnalytics func(name string, o ...func(*SearchApplicationPutBehavioralAnalyticsRequest)) (*Response, error) // SearchApplicationPutBehavioralAnalyticsRequest configures the Search Application Put Behavioral Analytics API request. diff --git a/esapi/api.search_application.render_query.go b/esapi/api.search_application.render_query.go index 13e6590217..d7ad847003 100644 --- a/esapi/api.search_application.render_query.go +++ b/esapi/api.search_application.render_query.go @@ -43,11 +43,11 @@ func newSearchApplicationRenderQueryFunc(t Transport) SearchApplicationRenderQue // ----- API Definition ------------------------------------------------------- -// SearchApplicationRenderQuery renders a query for given search application search parameters +// SearchApplicationRenderQuery render a search application query // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-application-render-query.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-render-query. type SearchApplicationRenderQuery func(name string, o ...func(*SearchApplicationRenderQueryRequest)) (*Response, error) // SearchApplicationRenderQueryRequest configures the Search Application Render Query API request. diff --git a/esapi/api.search_application.search.go b/esapi/api.search_application.search.go index 549df9b53d..4d9982c917 100644 --- a/esapi/api.search_application.search.go +++ b/esapi/api.search_application.search.go @@ -44,11 +44,11 @@ func newSearchApplicationSearchFunc(t Transport) SearchApplicationSearch { // ----- API Definition ------------------------------------------------------- -// SearchApplicationSearch perform a search against a search application +// SearchApplicationSearch run a search application search // -// This API is experimental. +// This API is beta. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-application-search.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-search. type SearchApplicationSearch func(name string, o ...func(*SearchApplicationSearchRequest)) (*Response, error) // SearchApplicationSearchRequest configures the Search Application Search API request. diff --git a/esapi/api.search_mvt.go b/esapi/api.search_mvt.go index 84b72dbcbb..bfb35b6702 100644 --- a/esapi/api.search_mvt.go +++ b/esapi/api.search_mvt.go @@ -46,11 +46,9 @@ func newSearchMvtFunc(t Transport) SearchMvt { // ----- API Definition ------------------------------------------------------- -// SearchMvt searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. +// SearchMvt search a vector tile // -// This API is experimental. -// -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-mvt. type SearchMvt func(index []string, field string, x *int, y *int, zoom *int, o ...func(*SearchMvtRequest)) (*Response, error) // SearchMvtRequest configures the Search Mvt API request. diff --git a/esapi/api.search_shards.go b/esapi/api.search_shards.go index 993021b168..b45cd69176 100644 --- a/esapi/api.search_shards.go +++ b/esapi/api.search_shards.go @@ -44,9 +44,9 @@ func newSearchShardsFunc(t Transport) SearchShards { // ----- API Definition ------------------------------------------------------- -// SearchShards returns information about the indices and shards that a search request would be executed against. +// SearchShards get the search shards // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-shards. type SearchShards func(o ...func(*SearchShardsRequest)) (*Response, error) // SearchShardsRequest configures the Search Shards API request. @@ -54,12 +54,12 @@ type SearchShardsRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool Local *bool MasterTimeout time.Duration Preference string - Routing string + Routing []string Pretty bool Human bool @@ -110,8 +110,8 @@ func (r SearchShardsRequest) Do(providedCtx context.Context, transport Transport params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -130,8 +130,8 @@ func (r SearchShardsRequest) Do(providedCtx context.Context, transport Transport params["preference"] = r.Preference } - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if r.Pretty { @@ -227,7 +227,7 @@ func (f SearchShards) WithAllowNoIndices(v bool) func(*SearchShardsRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f SearchShards) WithExpandWildcards(v string) func(*SearchShardsRequest) { +func (f SearchShards) WithExpandWildcards(v ...string) func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { r.ExpandWildcards = v } @@ -262,7 +262,7 @@ func (f SearchShards) WithPreference(v string) func(*SearchShardsRequest) { } // WithRouting - specific routing value. -func (f SearchShards) WithRouting(v string) func(*SearchShardsRequest) { +func (f SearchShards) WithRouting(v ...string) func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { r.Routing = v } diff --git a/esapi/api.search_template.go b/esapi/api.search_template.go index 78d8a5857d..fa51d5ce6c 100644 --- a/esapi/api.search_template.go +++ b/esapi/api.search_template.go @@ -45,9 +45,9 @@ func newSearchTemplateFunc(t Transport) SearchTemplate { // ----- API Definition ------------------------------------------------------- -// SearchTemplate allows to use the Mustache language to pre-render a search definition. +// SearchTemplate run a search with a search template // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-template. type SearchTemplate func(body io.Reader, o ...func(*SearchTemplateRequest)) (*Response, error) // SearchTemplateRequest configures the Search Template API request. @@ -58,7 +58,7 @@ type SearchTemplateRequest struct { AllowNoIndices *bool CcsMinimizeRoundtrips *bool - ExpandWildcards string + ExpandWildcards []string Explain *bool IgnoreThrottled *bool IgnoreUnavailable *bool @@ -125,8 +125,8 @@ func (r SearchTemplateRequest) Do(providedCtx context.Context, transport Transpo params["ccs_minimize_roundtrips"] = strconv.FormatBool(*r.CcsMinimizeRoundtrips) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.Explain != nil { @@ -276,7 +276,7 @@ func (f SearchTemplate) WithCcsMinimizeRoundtrips(v bool) func(*SearchTemplateRe } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f SearchTemplate) WithExpandWildcards(v string) func(*SearchTemplateRequest) { +func (f SearchTemplate) WithExpandWildcards(v ...string) func(*SearchTemplateRequest) { return func(r *SearchTemplateRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.shutdown.delete_node.go b/esapi/api.shutdown.delete_node.go index 3d257910a7..35dbd241e3 100644 --- a/esapi/api.shutdown.delete_node.go +++ b/esapi/api.shutdown.delete_node.go @@ -43,9 +43,9 @@ func newShutdownDeleteNodeFunc(t Transport) ShutdownDeleteNode { // ----- API Definition ------------------------------------------------------- -// ShutdownDeleteNode removes a node from the shutdown list. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. +// ShutdownDeleteNode cancel node shutdown preparations // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-shutdown-delete-node. type ShutdownDeleteNode func(node_id string, o ...func(*ShutdownDeleteNodeRequest)) (*Response, error) // ShutdownDeleteNodeRequest configures the Shutdown Delete Node API request. diff --git a/esapi/api.shutdown.get_node.go b/esapi/api.shutdown.get_node.go index 63a09d2cb1..0cb32fb483 100644 --- a/esapi/api.shutdown.get_node.go +++ b/esapi/api.shutdown.get_node.go @@ -43,9 +43,9 @@ func newShutdownGetNodeFunc(t Transport) ShutdownGetNode { // ----- API Definition ------------------------------------------------------- -// ShutdownGetNode retrieve status of a node or nodes that are currently marked as shutting down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. +// ShutdownGetNode get the shutdown status // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-shutdown-get-node. type ShutdownGetNode func(o ...func(*ShutdownGetNodeRequest)) (*Response, error) // ShutdownGetNodeRequest configures the Shutdown Get Node API request. diff --git a/esapi/api.shutdown.put_node.go b/esapi/api.shutdown.put_node.go index b32f9fd1e4..cc748aa122 100644 --- a/esapi/api.shutdown.put_node.go +++ b/esapi/api.shutdown.put_node.go @@ -44,9 +44,9 @@ func newShutdownPutNodeFunc(t Transport) ShutdownPutNode { // ----- API Definition ------------------------------------------------------- -// ShutdownPutNode adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. +// ShutdownPutNode prepare a node to be shut down // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-shutdown-put-node. type ShutdownPutNode func(body io.Reader, node_id string, o ...func(*ShutdownPutNodeRequest)) (*Response, error) // ShutdownPutNodeRequest configures the Shutdown Put Node API request. diff --git a/esapi/api.simulate.ingest.go b/esapi/api.simulate.ingest.go index 4835d0f0de..d455606991 100644 --- a/esapi/api.simulate.ingest.go +++ b/esapi/api.simulate.ingest.go @@ -43,11 +43,11 @@ func newSimulateIngestFunc(t Transport) SimulateIngest { // ----- API Definition ------------------------------------------------------- -// SimulateIngest simulates running ingest with example documents. +// SimulateIngest simulate data ingestion // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-ingest-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-simulate-ingest. type SimulateIngest func(body io.Reader, o ...func(*SimulateIngestRequest)) (*Response, error) // SimulateIngestRequest configures the Simulate Ingest API request. diff --git a/esapi/api.snapshot.cleanup_repository.go b/esapi/api.snapshot.cleanup_repository.go index b842939970..ad614c5797 100644 --- a/esapi/api.snapshot.cleanup_repository.go +++ b/esapi/api.snapshot.cleanup_repository.go @@ -43,9 +43,9 @@ func newSnapshotCleanupRepositoryFunc(t Transport) SnapshotCleanupRepository { // ----- API Definition ------------------------------------------------------- -// SnapshotCleanupRepository removes stale data from repository. +// SnapshotCleanupRepository clean up the snapshot repository // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/clean-up-snapshot-repo-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-cleanup-repository. type SnapshotCleanupRepository func(repository string, o ...func(*SnapshotCleanupRepositoryRequest)) (*Response, error) // SnapshotCleanupRepositoryRequest configures the Snapshot Cleanup Repository API request. diff --git a/esapi/api.snapshot.clone.go b/esapi/api.snapshot.clone.go index 905ac1622b..c90658680d 100644 --- a/esapi/api.snapshot.clone.go +++ b/esapi/api.snapshot.clone.go @@ -44,9 +44,9 @@ func newSnapshotCloneFunc(t Transport) SnapshotClone { // ----- API Definition ------------------------------------------------------- -// SnapshotClone clones indices from one snapshot into another snapshot in the same repository. +// SnapshotClone clone a snapshot // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-clone. type SnapshotClone func(repository string, snapshot string, body io.Reader, target_snapshot string, o ...func(*SnapshotCloneRequest)) (*Response, error) // SnapshotCloneRequest configures the Snapshot Clone API request. diff --git a/esapi/api.snapshot.create.go b/esapi/api.snapshot.create.go index 32a8f93178..e01333df72 100644 --- a/esapi/api.snapshot.create.go +++ b/esapi/api.snapshot.create.go @@ -45,9 +45,9 @@ func newSnapshotCreateFunc(t Transport) SnapshotCreate { // ----- API Definition ------------------------------------------------------- -// SnapshotCreate creates a snapshot in a repository. +// SnapshotCreate create a snapshot // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-create. type SnapshotCreate func(repository string, snapshot string, o ...func(*SnapshotCreateRequest)) (*Response, error) // SnapshotCreateRequest configures the Snapshot Create API request. diff --git a/esapi/api.snapshot.create_repository.go b/esapi/api.snapshot.create_repository.go index 38f89b06e9..76b96af1b3 100644 --- a/esapi/api.snapshot.create_repository.go +++ b/esapi/api.snapshot.create_repository.go @@ -45,9 +45,9 @@ func newSnapshotCreateRepositoryFunc(t Transport) SnapshotCreateRepository { // ----- API Definition ------------------------------------------------------- -// SnapshotCreateRepository creates a repository. +// SnapshotCreateRepository create or update a snapshot repository // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-create-repository. type SnapshotCreateRepository func(repository string, body io.Reader, o ...func(*SnapshotCreateRepositoryRequest)) (*Response, error) // SnapshotCreateRepositoryRequest configures the Snapshot Create Repository API request. diff --git a/esapi/api.snapshot.delete.go b/esapi/api.snapshot.delete.go index 78a1374d05..fa1e148652 100644 --- a/esapi/api.snapshot.delete.go +++ b/esapi/api.snapshot.delete.go @@ -45,9 +45,9 @@ func newSnapshotDeleteFunc(t Transport) SnapshotDelete { // ----- API Definition ------------------------------------------------------- -// SnapshotDelete deletes one or more snapshots. +// SnapshotDelete delete snapshots // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-delete. type SnapshotDelete func(repository string, snapshot []string, o ...func(*SnapshotDeleteRequest)) (*Response, error) // SnapshotDeleteRequest configures the Snapshot Delete API request. diff --git a/esapi/api.snapshot.delete_repository.go b/esapi/api.snapshot.delete_repository.go index a886af9867..6145d57a86 100644 --- a/esapi/api.snapshot.delete_repository.go +++ b/esapi/api.snapshot.delete_repository.go @@ -44,9 +44,9 @@ func newSnapshotDeleteRepositoryFunc(t Transport) SnapshotDeleteRepository { // ----- API Definition ------------------------------------------------------- -// SnapshotDeleteRepository deletes a repository. +// SnapshotDeleteRepository delete snapshot repositories // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-delete-repository. type SnapshotDeleteRepository func(repository []string, o ...func(*SnapshotDeleteRepositoryRequest)) (*Response, error) // SnapshotDeleteRepositoryRequest configures the Snapshot Delete Repository API request. diff --git a/esapi/api.snapshot.get.go b/esapi/api.snapshot.get.go index 0a66843fd3..badfe0a9c2 100644 --- a/esapi/api.snapshot.get.go +++ b/esapi/api.snapshot.get.go @@ -45,9 +45,9 @@ func newSnapshotGetFunc(t Transport) SnapshotGet { // ----- API Definition ------------------------------------------------------- -// SnapshotGet returns information about a snapshot. +// SnapshotGet get snapshot information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-get. type SnapshotGet func(repository string, snapshot []string, o ...func(*SnapshotGetRequest)) (*Response, error) // SnapshotGetRequest configures the Snapshot Get API request. diff --git a/esapi/api.snapshot.get_repository.go b/esapi/api.snapshot.get_repository.go index 282c1b722c..9d58fc1431 100644 --- a/esapi/api.snapshot.get_repository.go +++ b/esapi/api.snapshot.get_repository.go @@ -44,9 +44,9 @@ func newSnapshotGetRepositoryFunc(t Transport) SnapshotGetRepository { // ----- API Definition ------------------------------------------------------- -// SnapshotGetRepository returns information about a repository. +// SnapshotGetRepository get snapshot repository information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-get-repository. type SnapshotGetRepository func(o ...func(*SnapshotGetRepositoryRequest)) (*Response, error) // SnapshotGetRepositoryRequest configures the Snapshot Get Repository API request. diff --git a/esapi/api.snapshot.repository_analyze.go b/esapi/api.snapshot.repository_analyze.go index 672c0bb8d9..e9bbbec97c 100644 --- a/esapi/api.snapshot.repository_analyze.go +++ b/esapi/api.snapshot.repository_analyze.go @@ -44,9 +44,9 @@ func newSnapshotRepositoryAnalyzeFunc(t Transport) SnapshotRepositoryAnalyze { // ----- API Definition ------------------------------------------------------- -// SnapshotRepositoryAnalyze analyzes a repository for correctness and performance +// SnapshotRepositoryAnalyze analyze a snapshot repository // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-repository-analyze. type SnapshotRepositoryAnalyze func(repository string, o ...func(*SnapshotRepositoryAnalyzeRequest)) (*Response, error) // SnapshotRepositoryAnalyzeRequest configures the Snapshot Repository Analyze API request. diff --git a/esapi/api.snapshot.repository_verify_integrity.go b/esapi/api.snapshot.repository_verify_integrity.go index 815e82a864..2c5d65c631 100644 --- a/esapi/api.snapshot.repository_verify_integrity.go +++ b/esapi/api.snapshot.repository_verify_integrity.go @@ -43,11 +43,11 @@ func newSnapshotRepositoryVerifyIntegrityFunc(t Transport) SnapshotRepositoryVer // ----- API Definition ------------------------------------------------------- -// SnapshotRepositoryVerifyIntegrity verifies the integrity of the contents of a snapshot repository +// SnapshotRepositoryVerifyIntegrity verify the repository integrity // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-repository-verify-integrity. type SnapshotRepositoryVerifyIntegrity func(repository string, o ...func(*SnapshotRepositoryVerifyIntegrityRequest)) (*Response, error) // SnapshotRepositoryVerifyIntegrityRequest configures the Snapshot Repository Verify Integrity API request. diff --git a/esapi/api.snapshot.restore.go b/esapi/api.snapshot.restore.go index fef2df59d8..687f577fde 100644 --- a/esapi/api.snapshot.restore.go +++ b/esapi/api.snapshot.restore.go @@ -45,9 +45,9 @@ func newSnapshotRestoreFunc(t Transport) SnapshotRestore { // ----- API Definition ------------------------------------------------------- -// SnapshotRestore restores a snapshot. +// SnapshotRestore restore a snapshot // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-restore. type SnapshotRestore func(repository string, snapshot string, o ...func(*SnapshotRestoreRequest)) (*Response, error) // SnapshotRestoreRequest configures the Snapshot Restore API request. diff --git a/esapi/api.snapshot.status.go b/esapi/api.snapshot.status.go index 8e1ea3aa16..5e0a67bf87 100644 --- a/esapi/api.snapshot.status.go +++ b/esapi/api.snapshot.status.go @@ -44,9 +44,9 @@ func newSnapshotStatusFunc(t Transport) SnapshotStatus { // ----- API Definition ------------------------------------------------------- -// SnapshotStatus returns information about the status of a snapshot. +// SnapshotStatus get the snapshot status // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-status. type SnapshotStatus func(o ...func(*SnapshotStatusRequest)) (*Response, error) // SnapshotStatusRequest configures the Snapshot Status API request. diff --git a/esapi/api.snapshot.verify_repository.go b/esapi/api.snapshot.verify_repository.go index cbe1dbdd42..60f32b7bce 100644 --- a/esapi/api.snapshot.verify_repository.go +++ b/esapi/api.snapshot.verify_repository.go @@ -43,9 +43,9 @@ func newSnapshotVerifyRepositoryFunc(t Transport) SnapshotVerifyRepository { // ----- API Definition ------------------------------------------------------- -// SnapshotVerifyRepository verifies a repository. +// SnapshotVerifyRepository verify a snapshot repository // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-verify-repository. type SnapshotVerifyRepository func(repository string, o ...func(*SnapshotVerifyRepositoryRequest)) (*Response, error) // SnapshotVerifyRepositoryRequest configures the Snapshot Verify Repository API request. diff --git a/esapi/api.streams.status.go b/esapi/api.streams.status.go index 91ddf87a9f..55a5dcebb9 100644 --- a/esapi/api.streams.status.go +++ b/esapi/api.streams.status.go @@ -50,7 +50,7 @@ type StreamsStatus func(o ...func(*StreamsStatusRequest)) (*Response, error) // StreamsStatusRequest configures the Streams Status API request. type StreamsStatusRequest struct { - MaterTimeout time.Duration + MasterTimeout time.Duration Pretty bool Human bool @@ -89,8 +89,8 @@ func (r StreamsStatusRequest) Do(providedCtx context.Context, transport Transpor params = make(map[string]string) - if r.MaterTimeout != 0 { - params["mater_timeout"] = formatDuration(r.MaterTimeout) + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) } if r.Pretty { @@ -171,10 +171,10 @@ func (f StreamsStatus) WithContext(v context.Context) func(*StreamsStatusRequest } } -// WithMaterTimeout - period to wait for a response. if no response is received before the timeout expires, the request fails and returns an error.. -func (f StreamsStatus) WithMaterTimeout(v time.Duration) func(*StreamsStatusRequest) { +// WithMasterTimeout - period to wait for a response. if no response is received before the timeout expires, the request fails and returns an error.. +func (f StreamsStatus) WithMasterTimeout(v time.Duration) func(*StreamsStatusRequest) { return func(r *StreamsStatusRequest) { - r.MaterTimeout = v + r.MasterTimeout = v } } diff --git a/esapi/api.synonyms.delete_synonym.go b/esapi/api.synonyms.delete_synonym.go index 9f4ba9ef88..49aa697508 100644 --- a/esapi/api.synonyms.delete_synonym.go +++ b/esapi/api.synonyms.delete_synonym.go @@ -42,9 +42,9 @@ func newSynonymsDeleteSynonymFunc(t Transport) SynonymsDeleteSynonym { // ----- API Definition ------------------------------------------------------- -// SynonymsDeleteSynonym deletes a synonym set +// SynonymsDeleteSynonym delete a synonym set // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-synonyms-set.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-delete-synonym. type SynonymsDeleteSynonym func(id string, o ...func(*SynonymsDeleteSynonymRequest)) (*Response, error) // SynonymsDeleteSynonymRequest configures the Synonyms Delete Synonym API request. diff --git a/esapi/api.synonyms.delete_synonym_rule.go b/esapi/api.synonyms.delete_synonym_rule.go index b2c79cd9cf..c9a5776019 100644 --- a/esapi/api.synonyms.delete_synonym_rule.go +++ b/esapi/api.synonyms.delete_synonym_rule.go @@ -43,9 +43,9 @@ func newSynonymsDeleteSynonymRuleFunc(t Transport) SynonymsDeleteSynonymRule { // ----- API Definition ------------------------------------------------------- -// SynonymsDeleteSynonymRule deletes a synonym rule in a synonym set +// SynonymsDeleteSynonymRule delete a synonym rule // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-synonym-rule.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-delete-synonym-rule. type SynonymsDeleteSynonymRule func(rule_id string, set_id string, o ...func(*SynonymsDeleteSynonymRuleRequest)) (*Response, error) // SynonymsDeleteSynonymRuleRequest configures the Synonyms Delete Synonym Rule API request. diff --git a/esapi/api.synonyms.get_synonym.go b/esapi/api.synonyms.get_synonym.go index e180aff552..1ca899c43c 100644 --- a/esapi/api.synonyms.get_synonym.go +++ b/esapi/api.synonyms.get_synonym.go @@ -43,9 +43,9 @@ func newSynonymsGetSynonymFunc(t Transport) SynonymsGetSynonym { // ----- API Definition ------------------------------------------------------- -// SynonymsGetSynonym retrieves a synonym set +// SynonymsGetSynonym get a synonym set // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-synonyms-set.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-get-synonym. type SynonymsGetSynonym func(id string, o ...func(*SynonymsGetSynonymRequest)) (*Response, error) // SynonymsGetSynonymRequest configures the Synonyms Get Synonym API request. diff --git a/esapi/api.synonyms.get_synonym_rule.go b/esapi/api.synonyms.get_synonym_rule.go index 28807bc925..41fa2ffedd 100644 --- a/esapi/api.synonyms.get_synonym_rule.go +++ b/esapi/api.synonyms.get_synonym_rule.go @@ -42,9 +42,9 @@ func newSynonymsGetSynonymRuleFunc(t Transport) SynonymsGetSynonymRule { // ----- API Definition ------------------------------------------------------- -// SynonymsGetSynonymRule retrieves a synonym rule from a synonym set +// SynonymsGetSynonymRule get a synonym rule // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-synonym-rule.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-get-synonym-rule. type SynonymsGetSynonymRule func(rule_id string, set_id string, o ...func(*SynonymsGetSynonymRuleRequest)) (*Response, error) // SynonymsGetSynonymRuleRequest configures the Synonyms Get Synonym Rule API request. diff --git a/esapi/api.synonyms.get_synonyms_sets.go b/esapi/api.synonyms.get_synonyms_sets.go index b90a153754..da06dbfae9 100644 --- a/esapi/api.synonyms.get_synonyms_sets.go +++ b/esapi/api.synonyms.get_synonyms_sets.go @@ -43,9 +43,9 @@ func newSynonymsGetSynonymsSetsFunc(t Transport) SynonymsGetSynonymsSets { // ----- API Definition ------------------------------------------------------- -// SynonymsGetSynonymsSets retrieves a summary of all defined synonym sets +// SynonymsGetSynonymsSets get all synonym sets // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/list-synonyms-sets.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-get-synonym. type SynonymsGetSynonymsSets func(o ...func(*SynonymsGetSynonymsSetsRequest)) (*Response, error) // SynonymsGetSynonymsSetsRequest configures the Synonyms Get Synonyms Sets API request. diff --git a/esapi/api.synonyms.put_synonym.go b/esapi/api.synonyms.put_synonym.go index 00bf711b14..1a4a675c7f 100644 --- a/esapi/api.synonyms.put_synonym.go +++ b/esapi/api.synonyms.put_synonym.go @@ -44,9 +44,9 @@ func newSynonymsPutSynonymFunc(t Transport) SynonymsPutSynonym { // ----- API Definition ------------------------------------------------------- -// SynonymsPutSynonym creates or updates a synonyms set +// SynonymsPutSynonym create or update a synonym set // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonyms-set.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-put-synonym. type SynonymsPutSynonym func(id string, body io.Reader, o ...func(*SynonymsPutSynonymRequest)) (*Response, error) // SynonymsPutSynonymRequest configures the Synonyms Put Synonym API request. diff --git a/esapi/api.synonyms.put_synonym_rule.go b/esapi/api.synonyms.put_synonym_rule.go index eb28efc524..0b35ffe8a8 100644 --- a/esapi/api.synonyms.put_synonym_rule.go +++ b/esapi/api.synonyms.put_synonym_rule.go @@ -44,9 +44,9 @@ func newSynonymsPutSynonymRuleFunc(t Transport) SynonymsPutSynonymRule { // ----- API Definition ------------------------------------------------------- -// SynonymsPutSynonymRule creates or updates a synonym rule in a synonym set +// SynonymsPutSynonymRule create or update a synonym rule // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonym-rule.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-put-synonym-rule. type SynonymsPutSynonymRule func(body io.Reader, rule_id string, set_id string, o ...func(*SynonymsPutSynonymRuleRequest)) (*Response, error) // SynonymsPutSynonymRuleRequest configures the Synonyms Put Synonym Rule API request. diff --git a/esapi/api.tasks.cancel.go b/esapi/api.tasks.cancel.go index ab08e54565..ba323275d1 100644 --- a/esapi/api.tasks.cancel.go +++ b/esapi/api.tasks.cancel.go @@ -43,11 +43,11 @@ func newTasksCancelFunc(t Transport) TasksCancel { // ----- API Definition ------------------------------------------------------- -// TasksCancel cancels a task, if it can be cancelled through an API. +// TasksCancel cancel a task // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-tasks. type TasksCancel func(o ...func(*TasksCancelRequest)) (*Response, error) // TasksCancelRequest configures the Tasks Cancel API request. diff --git a/esapi/api.tasks.get.go b/esapi/api.tasks.get.go index f75bb13a3e..07da78d943 100644 --- a/esapi/api.tasks.get.go +++ b/esapi/api.tasks.get.go @@ -44,11 +44,11 @@ func newTasksGetFunc(t Transport) TasksGet { // ----- API Definition ------------------------------------------------------- -// TasksGet returns information about a task. +// TasksGet get task information // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-tasks. type TasksGet func(task_id string, o ...func(*TasksGetRequest)) (*Response, error) // TasksGetRequest configures the Tasks Get API request. diff --git a/esapi/api.tasks.list.go b/esapi/api.tasks.list.go index 87d367586a..be43f5c768 100644 --- a/esapi/api.tasks.list.go +++ b/esapi/api.tasks.list.go @@ -44,11 +44,11 @@ func newTasksListFunc(t Transport) TasksList { // ----- API Definition ------------------------------------------------------- -// TasksList returns a list of tasks. +// TasksList get all tasks // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-tasks. type TasksList func(o ...func(*TasksListRequest)) (*Response, error) // TasksListRequest configures the Tasks List API request. diff --git a/esapi/api.terms_enum.go b/esapi/api.terms_enum.go index b3c9ebc87d..3646af78d0 100644 --- a/esapi/api.terms_enum.go +++ b/esapi/api.terms_enum.go @@ -44,9 +44,9 @@ func newTermsEnumFunc(t Transport) TermsEnum { // ----- API Definition ------------------------------------------------------- -// TermsEnum the terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. +// TermsEnum get terms in an index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/search-terms-enum.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-terms-enum. type TermsEnum func(index []string, o ...func(*TermsEnumRequest)) (*Response, error) // TermsEnumRequest configures the Terms Enum API request. diff --git a/esapi/api.termvectors.go b/esapi/api.termvectors.go index 0bf9263197..bb40ea6813 100644 --- a/esapi/api.termvectors.go +++ b/esapi/api.termvectors.go @@ -44,9 +44,9 @@ func newTermvectorsFunc(t Transport) Termvectors { // ----- API Definition ------------------------------------------------------- -// Termvectors returns information and statistics about terms in the fields of a particular document. +// Termvectors get term vector information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-termvectors. type Termvectors func(index string, o ...func(*TermvectorsRequest)) (*Response, error) // TermvectorsRequest configures the Termvectors API request. @@ -63,7 +63,7 @@ type TermvectorsRequest struct { Positions *bool Preference string Realtime *bool - Routing string + Routing []string TermStatistics *bool Version *int VersionType string @@ -146,8 +146,8 @@ func (r TermvectorsRequest) Do(providedCtx context.Context, transport Transport) params["realtime"] = strconv.FormatBool(*r.Realtime) } - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if r.TermStatistics != nil { @@ -311,7 +311,7 @@ func (f Termvectors) WithRealtime(v bool) func(*TermvectorsRequest) { } // WithRouting - specific routing value.. -func (f Termvectors) WithRouting(v string) func(*TermvectorsRequest) { +func (f Termvectors) WithRouting(v ...string) func(*TermvectorsRequest) { return func(r *TermvectorsRequest) { r.Routing = v } diff --git a/esapi/api.update.go b/esapi/api.update.go index 3adf1df184..365a60580d 100644 --- a/esapi/api.update.go +++ b/esapi/api.update.go @@ -45,9 +45,9 @@ func newUpdateFunc(t Transport) Update { // ----- API Definition ------------------------------------------------------- -// Update updates a document with a script or partial document. +// Update update a document // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update. type Update func(index string, id string, body io.Reader, o ...func(*UpdateRequest)) (*Response, error) // UpdateRequest configures the Update API request. @@ -64,7 +64,7 @@ type UpdateRequest struct { Refresh string RequireAlias *bool RetryOnConflict *int - Routing string + Routing []string Source []string SourceExcludes []string SourceIncludes []string @@ -147,8 +147,8 @@ func (r UpdateRequest) Do(providedCtx context.Context, transport Transport) (*Re params["retry_on_conflict"] = strconv.FormatInt(int64(*r.RetryOnConflict), 10) } - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if len(r.Source) > 0 { @@ -306,7 +306,7 @@ func (f Update) WithRetryOnConflict(v int) func(*UpdateRequest) { } // WithRouting - specific routing value. -func (f Update) WithRouting(v string) func(*UpdateRequest) { +func (f Update) WithRouting(v ...string) func(*UpdateRequest) { return func(r *UpdateRequest) { r.Routing = v } diff --git a/esapi/api.update_by_query.go b/esapi/api.update_by_query.go index c61b42c8a3..3991fec13f 100644 --- a/esapi/api.update_by_query.go +++ b/esapi/api.update_by_query.go @@ -47,10 +47,9 @@ func newUpdateByQueryFunc(t Transport) UpdateByQuery { // ----- API Definition ------------------------------------------------------- -// UpdateByQuery performs an update on every document in the index without changing the source, -// for example to pick up a mapping change. +// UpdateByQuery update documents // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update-by-query. type UpdateByQuery func(index []string, o ...func(*UpdateByQueryRequest)) (*Response, error) // UpdateByQueryRequest configures the Update By Query API request. @@ -65,7 +64,7 @@ type UpdateByQueryRequest struct { Conflicts string DefaultOperator string Df string - ExpandWildcards string + ExpandWildcards []string From *int IgnoreUnavailable *bool Lenient *bool @@ -162,8 +161,8 @@ func (r UpdateByQueryRequest) Do(providedCtx context.Context, transport Transpor params["df"] = r.Df } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.From != nil { @@ -397,7 +396,7 @@ func (f UpdateByQuery) WithDf(v string) func(*UpdateByQueryRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f UpdateByQuery) WithExpandWildcards(v string) func(*UpdateByQueryRequest) { +func (f UpdateByQuery) WithExpandWildcards(v ...string) func(*UpdateByQueryRequest) { return func(r *UpdateByQueryRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.update_by_query_rethrottle.go b/esapi/api.update_by_query_rethrottle.go index 299d0e13c6..dedde01bb9 100644 --- a/esapi/api.update_by_query_rethrottle.go +++ b/esapi/api.update_by_query_rethrottle.go @@ -43,9 +43,9 @@ func newUpdateByQueryRethrottleFunc(t Transport) UpdateByQueryRethrottle { // ----- API Definition ------------------------------------------------------- -// UpdateByQueryRethrottle changes the number of requests per second for a particular Update By Query operation. +// UpdateByQueryRethrottle throttle an update by query operation // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update-by-query-rethrottle. type UpdateByQueryRethrottle func(task_id string, requests_per_second *int, o ...func(*UpdateByQueryRethrottleRequest)) (*Response, error) // UpdateByQueryRethrottleRequest configures the Update By Query Rethrottle API request. diff --git a/esapi/api.xpack.async_search.delete.go b/esapi/api.xpack.async_search.delete.go index 362e9a5124..bf304a4edb 100644 --- a/esapi/api.xpack.async_search.delete.go +++ b/esapi/api.xpack.async_search.delete.go @@ -42,9 +42,9 @@ func newAsyncSearchDeleteFunc(t Transport) AsyncSearchDelete { // ----- API Definition ------------------------------------------------------- -// AsyncSearchDelete - Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. +// AsyncSearchDelete - Delete an async search // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit. type AsyncSearchDelete func(id string, o ...func(*AsyncSearchDeleteRequest)) (*Response, error) // AsyncSearchDeleteRequest configures the Async Search Delete API request. diff --git a/esapi/api.xpack.async_search.get.go b/esapi/api.xpack.async_search.get.go index 0c28944e4f..cb8835067d 100644 --- a/esapi/api.xpack.async_search.get.go +++ b/esapi/api.xpack.async_search.get.go @@ -44,9 +44,9 @@ func newAsyncSearchGetFunc(t Transport) AsyncSearchGet { // ----- API Definition ------------------------------------------------------- -// AsyncSearchGet - Retrieves the results of a previously submitted async search request given its ID. +// AsyncSearchGet - Get async search results // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit. type AsyncSearchGet func(id string, o ...func(*AsyncSearchGetRequest)) (*Response, error) // AsyncSearchGetRequest configures the Async Search Get API request. diff --git a/esapi/api.xpack.async_search.status.go b/esapi/api.xpack.async_search.status.go index 964a4d7069..08a44417ac 100644 --- a/esapi/api.xpack.async_search.status.go +++ b/esapi/api.xpack.async_search.status.go @@ -43,9 +43,9 @@ func newAsyncSearchStatusFunc(t Transport) AsyncSearchStatus { // ----- API Definition ------------------------------------------------------- -// AsyncSearchStatus - Retrieves the status of a previously submitted async search request given its ID. +// AsyncSearchStatus - Get the async search status // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit. type AsyncSearchStatus func(id string, o ...func(*AsyncSearchStatusRequest)) (*Response, error) // AsyncSearchStatusRequest configures the Async Search Status API request. diff --git a/esapi/api.xpack.async_search.submit.go b/esapi/api.xpack.async_search.submit.go index 5efc99c4ad..cf46098846 100644 --- a/esapi/api.xpack.async_search.submit.go +++ b/esapi/api.xpack.async_search.submit.go @@ -46,9 +46,9 @@ func newAsyncSearchSubmitFunc(t Transport) AsyncSearchSubmit { // ----- API Definition ------------------------------------------------------- -// AsyncSearchSubmit - Executes a search request asynchronously. +// AsyncSearchSubmit - Run an async search // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit. type AsyncSearchSubmit func(o ...func(*AsyncSearchSubmitRequest)) (*Response, error) // AsyncSearchSubmitRequest configures the Async Search Submit API request. @@ -66,7 +66,7 @@ type AsyncSearchSubmitRequest struct { DefaultOperator string Df string DocvalueFields []string - ExpandWildcards string + ExpandWildcards []string Explain *bool From *int IgnoreThrottled *bool @@ -182,8 +182,8 @@ func (r AsyncSearchSubmitRequest) Do(providedCtx context.Context, transport Tran params["docvalue_fields"] = strings.Join(r.DocvalueFields, ",") } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.Explain != nil { @@ -481,7 +481,7 @@ func (f AsyncSearchSubmit) WithDocvalueFields(v ...string) func(*AsyncSearchSubm } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f AsyncSearchSubmit) WithExpandWildcards(v string) func(*AsyncSearchSubmitRequest) { +func (f AsyncSearchSubmit) WithExpandWildcards(v ...string) func(*AsyncSearchSubmitRequest) { return func(r *AsyncSearchSubmitRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.xpack.autoscaling.delete_autoscaling_policy.go b/esapi/api.xpack.autoscaling.delete_autoscaling_policy.go index 805e7c9ba6..7dab33bc49 100644 --- a/esapi/api.xpack.autoscaling.delete_autoscaling_policy.go +++ b/esapi/api.xpack.autoscaling.delete_autoscaling_policy.go @@ -43,9 +43,9 @@ func newAutoscalingDeleteAutoscalingPolicyFunc(t Transport) AutoscalingDeleteAut // ----- API Definition ------------------------------------------------------- -// AutoscalingDeleteAutoscalingPolicy - Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. +// AutoscalingDeleteAutoscalingPolicy - Delete an autoscaling policy // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-delete-autoscaling-policy. type AutoscalingDeleteAutoscalingPolicy func(name string, o ...func(*AutoscalingDeleteAutoscalingPolicyRequest)) (*Response, error) // AutoscalingDeleteAutoscalingPolicyRequest configures the Autoscaling Delete Autoscaling Policy API request. diff --git a/esapi/api.xpack.autoscaling.get_autoscaling_capacity.go b/esapi/api.xpack.autoscaling.get_autoscaling_capacity.go index f0d0f25092..da84f4454b 100644 --- a/esapi/api.xpack.autoscaling.get_autoscaling_capacity.go +++ b/esapi/api.xpack.autoscaling.get_autoscaling_capacity.go @@ -43,9 +43,9 @@ func newAutoscalingGetAutoscalingCapacityFunc(t Transport) AutoscalingGetAutosca // ----- API Definition ------------------------------------------------------- -// AutoscalingGetAutoscalingCapacity - Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. +// AutoscalingGetAutoscalingCapacity - Get the autoscaling capacity // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-capacity.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-get-autoscaling-capacity. type AutoscalingGetAutoscalingCapacity func(o ...func(*AutoscalingGetAutoscalingCapacityRequest)) (*Response, error) // AutoscalingGetAutoscalingCapacityRequest configures the Autoscaling Get Autoscaling Capacity API request. diff --git a/esapi/api.xpack.autoscaling.get_autoscaling_policy.go b/esapi/api.xpack.autoscaling.get_autoscaling_policy.go index 7484e20c97..fa395980f0 100644 --- a/esapi/api.xpack.autoscaling.get_autoscaling_policy.go +++ b/esapi/api.xpack.autoscaling.get_autoscaling_policy.go @@ -43,9 +43,9 @@ func newAutoscalingGetAutoscalingPolicyFunc(t Transport) AutoscalingGetAutoscali // ----- API Definition ------------------------------------------------------- -// AutoscalingGetAutoscalingPolicy - Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. +// AutoscalingGetAutoscalingPolicy - Get an autoscaling policy // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-get-autoscaling-capacity. type AutoscalingGetAutoscalingPolicy func(name string, o ...func(*AutoscalingGetAutoscalingPolicyRequest)) (*Response, error) // AutoscalingGetAutoscalingPolicyRequest configures the Autoscaling Get Autoscaling Policy API request. diff --git a/esapi/api.xpack.autoscaling.put_autoscaling_policy.go b/esapi/api.xpack.autoscaling.put_autoscaling_policy.go index da8f366bdd..a89fb64b01 100644 --- a/esapi/api.xpack.autoscaling.put_autoscaling_policy.go +++ b/esapi/api.xpack.autoscaling.put_autoscaling_policy.go @@ -44,9 +44,9 @@ func newAutoscalingPutAutoscalingPolicyFunc(t Transport) AutoscalingPutAutoscali // ----- API Definition ------------------------------------------------------- -// AutoscalingPutAutoscalingPolicy - Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. +// AutoscalingPutAutoscalingPolicy - Create or update an autoscaling policy // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-put-autoscaling-policy.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-put-autoscaling-policy. type AutoscalingPutAutoscalingPolicy func(name string, body io.Reader, o ...func(*AutoscalingPutAutoscalingPolicyRequest)) (*Response, error) // AutoscalingPutAutoscalingPolicyRequest configures the Autoscaling Put Autoscaling Policy API request. diff --git a/esapi/api.xpack.cat.ml_data_frame_analytics.go b/esapi/api.xpack.cat.ml_data_frame_analytics.go index 703d6f49cb..cbdea29004 100644 --- a/esapi/api.xpack.cat.ml_data_frame_analytics.go +++ b/esapi/api.xpack.cat.ml_data_frame_analytics.go @@ -43,9 +43,9 @@ func newCatMLDataFrameAnalyticsFunc(t Transport) CatMLDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// CatMLDataFrameAnalytics - Gets configuration and usage information about data frame analytics jobs. +// CatMLDataFrameAnalytics - Get data frame analytics jobs // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-dfanalytics.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-data-frame-analytics. type CatMLDataFrameAnalytics func(o ...func(*CatMLDataFrameAnalyticsRequest)) (*Response, error) // CatMLDataFrameAnalyticsRequest configures the CatML Data Frame Analytics API request. diff --git a/esapi/api.xpack.cat.ml_datafeeds.go b/esapi/api.xpack.cat.ml_datafeeds.go index 41e689e03c..bb4da32477 100644 --- a/esapi/api.xpack.cat.ml_datafeeds.go +++ b/esapi/api.xpack.cat.ml_datafeeds.go @@ -43,9 +43,9 @@ func newCatMLDatafeedsFunc(t Transport) CatMLDatafeeds { // ----- API Definition ------------------------------------------------------- -// CatMLDatafeeds - Gets configuration and usage information about datafeeds. +// CatMLDatafeeds - Get datafeeds // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-datafeeds. type CatMLDatafeeds func(o ...func(*CatMLDatafeedsRequest)) (*Response, error) // CatMLDatafeedsRequest configures the CatML Datafeeds API request. @@ -53,6 +53,7 @@ type CatMLDatafeedsRequest struct { DatafeedID string AllowNoMatch *bool + Bytes string Format string H []string Help *bool @@ -113,6 +114,10 @@ func (r CatMLDatafeedsRequest) Do(providedCtx context.Context, transport Transpo params["allow_no_match"] = strconv.FormatBool(*r.AllowNoMatch) } + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Format != "" { params["format"] = r.Format } @@ -229,6 +234,13 @@ func (f CatMLDatafeeds) WithAllowNoMatch(v bool) func(*CatMLDatafeedsRequest) { } } +// WithBytes - the unit in which to display byte values. +func (f CatMLDatafeeds) WithBytes(v string) func(*CatMLDatafeedsRequest) { + return func(r *CatMLDatafeedsRequest) { + r.Bytes = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. func (f CatMLDatafeeds) WithFormat(v string) func(*CatMLDatafeedsRequest) { return func(r *CatMLDatafeedsRequest) { diff --git a/esapi/api.xpack.cat.ml_jobs.go b/esapi/api.xpack.cat.ml_jobs.go index 4933b449af..7cce1625e7 100644 --- a/esapi/api.xpack.cat.ml_jobs.go +++ b/esapi/api.xpack.cat.ml_jobs.go @@ -43,9 +43,9 @@ func newCatMLJobsFunc(t Transport) CatMLJobs { // ----- API Definition ------------------------------------------------------- -// CatMLJobs - Gets configuration and usage information about anomaly detection jobs. +// CatMLJobs - Get anomaly detection jobs // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-anomaly-detectors.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-jobs. type CatMLJobs func(o ...func(*CatMLJobsRequest)) (*Response, error) // CatMLJobsRequest configures the CatML Jobs API request. diff --git a/esapi/api.xpack.cat.ml_trained_models.go b/esapi/api.xpack.cat.ml_trained_models.go index aa97b55e9c..c714340ba7 100644 --- a/esapi/api.xpack.cat.ml_trained_models.go +++ b/esapi/api.xpack.cat.ml_trained_models.go @@ -43,9 +43,9 @@ func newCatMLTrainedModelsFunc(t Transport) CatMLTrainedModels { // ----- API Definition ------------------------------------------------------- -// CatMLTrainedModels - Gets configuration and usage information about inference trained models. +// CatMLTrainedModels - Get trained models // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-trained-model.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-trained-models. type CatMLTrainedModels func(o ...func(*CatMLTrainedModelsRequest)) (*Response, error) // CatMLTrainedModelsRequest configures the CatML Trained Models API request. diff --git a/esapi/api.xpack.cat.transforms.go b/esapi/api.xpack.cat.transforms.go index bcaac8734b..9b0636f714 100644 --- a/esapi/api.xpack.cat.transforms.go +++ b/esapi/api.xpack.cat.transforms.go @@ -43,9 +43,9 @@ func newCatTransformsFunc(t Transport) CatTransforms { // ----- API Definition ------------------------------------------------------- -// CatTransforms - Gets configuration and usage information about transforms. +// CatTransforms - Get transform information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-transforms.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-transforms. type CatTransforms func(o ...func(*CatTransformsRequest)) (*Response, error) // CatTransformsRequest configures the Cat Transforms API request. @@ -53,6 +53,7 @@ type CatTransformsRequest struct { TransformID string AllowNoMatch *bool + Bytes string Format string From *int H []string @@ -113,6 +114,10 @@ func (r CatTransformsRequest) Do(providedCtx context.Context, transport Transpor params["allow_no_match"] = strconv.FormatBool(*r.AllowNoMatch) } + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + if r.Format != "" { params["format"] = r.Format } @@ -237,6 +242,13 @@ func (f CatTransforms) WithAllowNoMatch(v bool) func(*CatTransformsRequest) { } } +// WithBytes - the unit in which to display byte values. +func (f CatTransforms) WithBytes(v string) func(*CatTransformsRequest) { + return func(r *CatTransformsRequest) { + r.Bytes = v + } +} + // WithFormat - a short version of the accept header, e.g. json, yaml. func (f CatTransforms) WithFormat(v string) func(*CatTransformsRequest) { return func(r *CatTransformsRequest) { diff --git a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go index 72e4dcf2d6..3f65b2fd7a 100644 --- a/esapi/api.xpack.ccr.delete_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.delete_auto_follow_pattern.go @@ -43,9 +43,9 @@ func newCCRDeleteAutoFollowPatternFunc(t Transport) CCRDeleteAutoFollowPattern { // ----- API Definition ------------------------------------------------------- -// CCRDeleteAutoFollowPattern - Deletes auto-follow patterns. +// CCRDeleteAutoFollowPattern - Delete auto-follow patterns // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-delete-auto-follow-pattern. type CCRDeleteAutoFollowPattern func(name string, o ...func(*CCRDeleteAutoFollowPatternRequest)) (*Response, error) // CCRDeleteAutoFollowPatternRequest configures the CCR Delete Auto Follow Pattern API request. diff --git a/esapi/api.xpack.ccr.follow.go b/esapi/api.xpack.ccr.follow.go index f1717bca7b..6e67952047 100644 --- a/esapi/api.xpack.ccr.follow.go +++ b/esapi/api.xpack.ccr.follow.go @@ -44,9 +44,9 @@ func newCCRFollowFunc(t Transport) CCRFollow { // ----- API Definition ------------------------------------------------------- -// CCRFollow - Creates a new follower index configured to follow the referenced leader index. +// CCRFollow - Create a follower // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow. type CCRFollow func(index string, body io.Reader, o ...func(*CCRFollowRequest)) (*Response, error) // CCRFollowRequest configures the CCR Follow API request. diff --git a/esapi/api.xpack.ccr.follow_info.go b/esapi/api.xpack.ccr.follow_info.go index e7df5f8de6..bee4d96f6a 100644 --- a/esapi/api.xpack.ccr.follow_info.go +++ b/esapi/api.xpack.ccr.follow_info.go @@ -44,9 +44,9 @@ func newCCRFollowInfoFunc(t Transport) CCRFollowInfo { // ----- API Definition ------------------------------------------------------- -// CCRFollowInfo - Retrieves information about all follower indices, including parameters and status for each follower index +// CCRFollowInfo - Get follower information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow-info. type CCRFollowInfo func(index []string, o ...func(*CCRFollowInfoRequest)) (*Response, error) // CCRFollowInfoRequest configures the CCR Follow Info API request. diff --git a/esapi/api.xpack.ccr.follow_stats.go b/esapi/api.xpack.ccr.follow_stats.go index c06d77bfbe..f9abfc6fd3 100644 --- a/esapi/api.xpack.ccr.follow_stats.go +++ b/esapi/api.xpack.ccr.follow_stats.go @@ -44,9 +44,9 @@ func newCCRFollowStatsFunc(t Transport) CCRFollowStats { // ----- API Definition ------------------------------------------------------- -// CCRFollowStats - Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. +// CCRFollowStats - Get follower stats // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow-stats. type CCRFollowStats func(index []string, o ...func(*CCRFollowStatsRequest)) (*Response, error) // CCRFollowStatsRequest configures the CCR Follow Stats API request. diff --git a/esapi/api.xpack.ccr.forget_follower.go b/esapi/api.xpack.ccr.forget_follower.go index 5511c686c9..4abba7b32e 100644 --- a/esapi/api.xpack.ccr.forget_follower.go +++ b/esapi/api.xpack.ccr.forget_follower.go @@ -44,9 +44,9 @@ func newCCRForgetFollowerFunc(t Transport) CCRForgetFollower { // ----- API Definition ------------------------------------------------------- -// CCRForgetFollower - Removes the follower retention leases from the leader. +// CCRForgetFollower - Forget a follower // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-forget-follower. type CCRForgetFollower func(index string, body io.Reader, o ...func(*CCRForgetFollowerRequest)) (*Response, error) // CCRForgetFollowerRequest configures the CCR Forget Follower API request. diff --git a/esapi/api.xpack.ccr.get_auto_follow_pattern.go b/esapi/api.xpack.ccr.get_auto_follow_pattern.go index 6645b337a1..00eece0576 100644 --- a/esapi/api.xpack.ccr.get_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.get_auto_follow_pattern.go @@ -43,9 +43,9 @@ func newCCRGetAutoFollowPatternFunc(t Transport) CCRGetAutoFollowPattern { // ----- API Definition ------------------------------------------------------- -// CCRGetAutoFollowPattern - Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. +// CCRGetAutoFollowPattern - Get auto-follow patterns // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-get-auto-follow-pattern-1. type CCRGetAutoFollowPattern func(o ...func(*CCRGetAutoFollowPatternRequest)) (*Response, error) // CCRGetAutoFollowPatternRequest configures the CCR Get Auto Follow Pattern API request. diff --git a/esapi/api.xpack.ccr.pause_auto_follow_pattern.go b/esapi/api.xpack.ccr.pause_auto_follow_pattern.go index 7028ffb7e4..5ef46fc2ac 100644 --- a/esapi/api.xpack.ccr.pause_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.pause_auto_follow_pattern.go @@ -43,9 +43,9 @@ func newCCRPauseAutoFollowPatternFunc(t Transport) CCRPauseAutoFollowPattern { // ----- API Definition ------------------------------------------------------- -// CCRPauseAutoFollowPattern - Pauses an auto-follow pattern +// CCRPauseAutoFollowPattern - Pause an auto-follow pattern // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-pause-auto-follow-pattern. type CCRPauseAutoFollowPattern func(name string, o ...func(*CCRPauseAutoFollowPatternRequest)) (*Response, error) // CCRPauseAutoFollowPatternRequest configures the CCR Pause Auto Follow Pattern API request. diff --git a/esapi/api.xpack.ccr.pause_follow.go b/esapi/api.xpack.ccr.pause_follow.go index 23e5c469eb..6ed597e47a 100644 --- a/esapi/api.xpack.ccr.pause_follow.go +++ b/esapi/api.xpack.ccr.pause_follow.go @@ -43,9 +43,9 @@ func newCCRPauseFollowFunc(t Transport) CCRPauseFollow { // ----- API Definition ------------------------------------------------------- -// CCRPauseFollow - Pauses a follower index. The follower index will not fetch any additional operations from the leader index. +// CCRPauseFollow - Pause a follower // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-pause-follow. type CCRPauseFollow func(index string, o ...func(*CCRPauseFollowRequest)) (*Response, error) // CCRPauseFollowRequest configures the CCR Pause Follow API request. diff --git a/esapi/api.xpack.ccr.put_auto_follow_pattern.go b/esapi/api.xpack.ccr.put_auto_follow_pattern.go index 08e1453568..a89710b3a4 100644 --- a/esapi/api.xpack.ccr.put_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.put_auto_follow_pattern.go @@ -44,9 +44,9 @@ func newCCRPutAutoFollowPatternFunc(t Transport) CCRPutAutoFollowPattern { // ----- API Definition ------------------------------------------------------- -// CCRPutAutoFollowPattern - Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. +// CCRPutAutoFollowPattern - Create or update auto-follow patterns // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-put-auto-follow-pattern. type CCRPutAutoFollowPattern func(name string, body io.Reader, o ...func(*CCRPutAutoFollowPatternRequest)) (*Response, error) // CCRPutAutoFollowPatternRequest configures the CCR Put Auto Follow Pattern API request. diff --git a/esapi/api.xpack.ccr.resume_auto_follow_pattern.go b/esapi/api.xpack.ccr.resume_auto_follow_pattern.go index 0142645052..680d632fb8 100644 --- a/esapi/api.xpack.ccr.resume_auto_follow_pattern.go +++ b/esapi/api.xpack.ccr.resume_auto_follow_pattern.go @@ -43,9 +43,9 @@ func newCCRResumeAutoFollowPatternFunc(t Transport) CCRResumeAutoFollowPattern { // ----- API Definition ------------------------------------------------------- -// CCRResumeAutoFollowPattern - Resumes an auto-follow pattern that has been paused +// CCRResumeAutoFollowPattern - Resume an auto-follow pattern // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-resume-auto-follow-pattern. type CCRResumeAutoFollowPattern func(name string, o ...func(*CCRResumeAutoFollowPatternRequest)) (*Response, error) // CCRResumeAutoFollowPatternRequest configures the CCR Resume Auto Follow Pattern API request. diff --git a/esapi/api.xpack.ccr.resume_follow.go b/esapi/api.xpack.ccr.resume_follow.go index 4c9a2b18c3..fb9d9a1206 100644 --- a/esapi/api.xpack.ccr.resume_follow.go +++ b/esapi/api.xpack.ccr.resume_follow.go @@ -44,9 +44,9 @@ func newCCRResumeFollowFunc(t Transport) CCRResumeFollow { // ----- API Definition ------------------------------------------------------- -// CCRResumeFollow - Resumes a follower index that has been paused +// CCRResumeFollow - Resume a follower // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-resume-follow. type CCRResumeFollow func(index string, o ...func(*CCRResumeFollowRequest)) (*Response, error) // CCRResumeFollowRequest configures the CCR Resume Follow API request. diff --git a/esapi/api.xpack.ccr.stats.go b/esapi/api.xpack.ccr.stats.go index 27dcea2f70..42220252c9 100644 --- a/esapi/api.xpack.ccr.stats.go +++ b/esapi/api.xpack.ccr.stats.go @@ -43,9 +43,9 @@ func newCCRStatsFunc(t Transport) CCRStats { // ----- API Definition ------------------------------------------------------- -// CCRStats - Gets all stats related to cross-cluster replication. +// CCRStats - Get cross-cluster replication stats // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-stats. type CCRStats func(o ...func(*CCRStatsRequest)) (*Response, error) // CCRStatsRequest configures the CCR Stats API request. diff --git a/esapi/api.xpack.ccr.unfollow.go b/esapi/api.xpack.ccr.unfollow.go index ea133d4a34..76f9883641 100644 --- a/esapi/api.xpack.ccr.unfollow.go +++ b/esapi/api.xpack.ccr.unfollow.go @@ -43,9 +43,9 @@ func newCCRUnfollowFunc(t Transport) CCRUnfollow { // ----- API Definition ------------------------------------------------------- -// CCRUnfollow - Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. +// CCRUnfollow - Unfollow an index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-unfollow. type CCRUnfollow func(index string, o ...func(*CCRUnfollowRequest)) (*Response, error) // CCRUnfollowRequest configures the CCR Unfollow API request. diff --git a/esapi/api.xpack.close_point_in_time.go b/esapi/api.xpack.close_point_in_time.go index dcb6a948cf..82956cef92 100644 --- a/esapi/api.xpack.close_point_in_time.go +++ b/esapi/api.xpack.close_point_in_time.go @@ -45,7 +45,7 @@ func newClosePointInTimeFunc(t Transport) ClosePointInTime { // ClosePointInTime - Close a point in time // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-open-point-in-time. type ClosePointInTime func(o ...func(*ClosePointInTimeRequest)) (*Response, error) // ClosePointInTimeRequest configures the Close Point In Time API request. diff --git a/esapi/api.xpack.enrich.delete_policy.go b/esapi/api.xpack.enrich.delete_policy.go index 978bb78073..cb1ec1527e 100644 --- a/esapi/api.xpack.enrich.delete_policy.go +++ b/esapi/api.xpack.enrich.delete_policy.go @@ -43,9 +43,9 @@ func newEnrichDeletePolicyFunc(t Transport) EnrichDeletePolicy { // ----- API Definition ------------------------------------------------------- -// EnrichDeletePolicy - Deletes an existing enrich policy and its enrich index. +// EnrichDeletePolicy - Delete an enrich policy // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-delete-policy. type EnrichDeletePolicy func(name string, o ...func(*EnrichDeletePolicyRequest)) (*Response, error) // EnrichDeletePolicyRequest configures the Enrich Delete Policy API request. diff --git a/esapi/api.xpack.enrich.execute_policy.go b/esapi/api.xpack.enrich.execute_policy.go index 185237a554..cbcedc3703 100644 --- a/esapi/api.xpack.enrich.execute_policy.go +++ b/esapi/api.xpack.enrich.execute_policy.go @@ -44,9 +44,9 @@ func newEnrichExecutePolicyFunc(t Transport) EnrichExecutePolicy { // ----- API Definition ------------------------------------------------------- -// EnrichExecutePolicy - Creates the enrich index for an existing enrich policy. +// EnrichExecutePolicy - Run an enrich policy // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-execute-policy. type EnrichExecutePolicy func(name string, o ...func(*EnrichExecutePolicyRequest)) (*Response, error) // EnrichExecutePolicyRequest configures the Enrich Execute Policy API request. diff --git a/esapi/api.xpack.enrich.get_policy.go b/esapi/api.xpack.enrich.get_policy.go index afbf3820ad..a19eb1230e 100644 --- a/esapi/api.xpack.enrich.get_policy.go +++ b/esapi/api.xpack.enrich.get_policy.go @@ -43,9 +43,9 @@ func newEnrichGetPolicyFunc(t Transport) EnrichGetPolicy { // ----- API Definition ------------------------------------------------------- -// EnrichGetPolicy - Gets information about an enrich policy. +// EnrichGetPolicy - Get an enrich policy // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-get-policy. type EnrichGetPolicy func(o ...func(*EnrichGetPolicyRequest)) (*Response, error) // EnrichGetPolicyRequest configures the Enrich Get Policy API request. diff --git a/esapi/api.xpack.enrich.put_policy.go b/esapi/api.xpack.enrich.put_policy.go index 52ca1d7d30..3992156ea7 100644 --- a/esapi/api.xpack.enrich.put_policy.go +++ b/esapi/api.xpack.enrich.put_policy.go @@ -44,9 +44,9 @@ func newEnrichPutPolicyFunc(t Transport) EnrichPutPolicy { // ----- API Definition ------------------------------------------------------- -// EnrichPutPolicy - Creates a new enrich policy. +// EnrichPutPolicy - Create an enrich policy // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-put-policy. type EnrichPutPolicy func(name string, body io.Reader, o ...func(*EnrichPutPolicyRequest)) (*Response, error) // EnrichPutPolicyRequest configures the Enrich Put Policy API request. diff --git a/esapi/api.xpack.enrich.stats.go b/esapi/api.xpack.enrich.stats.go index 950dbc6d2d..6fa0342ed9 100644 --- a/esapi/api.xpack.enrich.stats.go +++ b/esapi/api.xpack.enrich.stats.go @@ -43,9 +43,9 @@ func newEnrichStatsFunc(t Transport) EnrichStats { // ----- API Definition ------------------------------------------------------- -// EnrichStats - Gets enrich coordinator statistics and information about enrich policies that are currently executing. +// EnrichStats - Get enrich stats // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-stats. type EnrichStats func(o ...func(*EnrichStatsRequest)) (*Response, error) // EnrichStatsRequest configures the Enrich Stats API request. diff --git a/esapi/api.xpack.eql.delete.go b/esapi/api.xpack.eql.delete.go index 8c815611ec..03c08f659f 100644 --- a/esapi/api.xpack.eql.delete.go +++ b/esapi/api.xpack.eql.delete.go @@ -42,9 +42,9 @@ func newEqlDeleteFunc(t Transport) EqlDelete { // ----- API Definition ------------------------------------------------------- -// EqlDelete - Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. +// EqlDelete - Delete an async EQL search // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-delete. type EqlDelete func(id string, o ...func(*EqlDeleteRequest)) (*Response, error) // EqlDeleteRequest configures the Eql Delete API request. diff --git a/esapi/api.xpack.eql.get.go b/esapi/api.xpack.eql.get.go index 1f2c854a4e..aaedb97367 100644 --- a/esapi/api.xpack.eql.get.go +++ b/esapi/api.xpack.eql.get.go @@ -43,9 +43,9 @@ func newEqlGetFunc(t Transport) EqlGet { // ----- API Definition ------------------------------------------------------- -// EqlGet - Returns async results from previously executed Event Query Language (EQL) search +// EqlGet - Get async EQL search results // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-get. type EqlGet func(id string, o ...func(*EqlGetRequest)) (*Response, error) // EqlGetRequest configures the Eql Get API request. diff --git a/esapi/api.xpack.eql.get_status.go b/esapi/api.xpack.eql.get_status.go index 303d982bdb..f6af8075fb 100644 --- a/esapi/api.xpack.eql.get_status.go +++ b/esapi/api.xpack.eql.get_status.go @@ -42,9 +42,9 @@ func newEqlGetStatusFunc(t Transport) EqlGetStatus { // ----- API Definition ------------------------------------------------------- -// EqlGetStatus - Returns the status of a previously submitted async or stored Event Query Language (EQL) search +// EqlGetStatus - Get the async EQL status // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-get-status. type EqlGetStatus func(id string, o ...func(*EqlGetStatusRequest)) (*Response, error) // EqlGetStatusRequest configures the Eql Get Status API request. diff --git a/esapi/api.xpack.eql.search.go b/esapi/api.xpack.eql.search.go index c467e17d8a..ef58e09586 100644 --- a/esapi/api.xpack.eql.search.go +++ b/esapi/api.xpack.eql.search.go @@ -45,9 +45,9 @@ func newEqlSearchFunc(t Transport) EqlSearch { // ----- API Definition ------------------------------------------------------- -// EqlSearch - Returns results matching a query expressed in Event Query Language (EQL) +// EqlSearch - Get EQL search results // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-search. type EqlSearch func(index string, body io.Reader, o ...func(*EqlSearchRequest)) (*Response, error) // EqlSearchRequest configures the Eql Search API request. @@ -60,7 +60,7 @@ type EqlSearchRequest struct { AllowPartialSearchResults *bool AllowPartialSequenceResults *bool CcsMinimizeRoundtrips *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool KeepAlive time.Duration KeepOnCompletion *bool @@ -127,8 +127,8 @@ func (r EqlSearchRequest) Do(providedCtx context.Context, transport Transport) ( params["ccs_minimize_roundtrips"] = strconv.FormatBool(*r.CcsMinimizeRoundtrips) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -261,7 +261,7 @@ func (f EqlSearch) WithCcsMinimizeRoundtrips(v bool) func(*EqlSearchRequest) { } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f EqlSearch) WithExpandWildcards(v string) func(*EqlSearchRequest) { +func (f EqlSearch) WithExpandWildcards(v ...string) func(*EqlSearchRequest) { return func(r *EqlSearchRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.xpack.esql.async_query.go b/esapi/api.xpack.esql.async_query.go index 57787a0ff2..7baae81d91 100644 --- a/esapi/api.xpack.esql.async_query.go +++ b/esapi/api.xpack.esql.async_query.go @@ -44,9 +44,9 @@ func newEsqlAsyncQueryFunc(t Transport) EsqlAsyncQuery { // ----- API Definition ------------------------------------------------------- -// EsqlAsyncQuery - Executes an ESQL request asynchronously +// EsqlAsyncQuery - Run an async ES|QL query // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query. type EsqlAsyncQuery func(body io.Reader, o ...func(*EsqlAsyncQueryRequest)) (*Response, error) // EsqlAsyncQueryRequest configures the Esql Async Query API request. @@ -217,7 +217,7 @@ func (f EsqlAsyncQuery) WithDropNullColumns(v bool) func(*EsqlAsyncQueryRequest) } } -// WithFormat - a short version of the accept header, e.g. json, yaml. +// WithFormat - a short version of the accept header, e.g. json, yaml.`csv`, `tsv`, and `txt` formats will return results in a tabular format, excluding other metadata fields from the response.for async requests, nothing will be returned if the async query doesn't finish within the timeout.the query ID and running status are available in the `x-elasticsearch-async-ID` and `x-elasticsearch-async-is-running` http headers of the response, respectively.. func (f EsqlAsyncQuery) WithFormat(v string) func(*EsqlAsyncQueryRequest) { return func(r *EsqlAsyncQueryRequest) { r.Format = v diff --git a/esapi/api.xpack.esql.async_query_delete.go b/esapi/api.xpack.esql.async_query_delete.go index 19c77c978e..b04cba9c1c 100644 --- a/esapi/api.xpack.esql.async_query_delete.go +++ b/esapi/api.xpack.esql.async_query_delete.go @@ -42,9 +42,9 @@ func newEsqlAsyncQueryDeleteFunc(t Transport) EsqlAsyncQueryDelete { // ----- API Definition ------------------------------------------------------- -// EsqlAsyncQueryDelete - Delete an async query request given its ID. +// EsqlAsyncQueryDelete - Delete an async ES|QL query // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-delete-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query-delete. type EsqlAsyncQueryDelete func(id string, o ...func(*EsqlAsyncQueryDeleteRequest)) (*Response, error) // EsqlAsyncQueryDeleteRequest configures the Esql Async Query Delete API request. diff --git a/esapi/api.xpack.esql.async_query_get.go b/esapi/api.xpack.esql.async_query_get.go index 69c2ec8cc1..d8a9343371 100644 --- a/esapi/api.xpack.esql.async_query_get.go +++ b/esapi/api.xpack.esql.async_query_get.go @@ -44,9 +44,9 @@ func newEsqlAsyncQueryGetFunc(t Transport) EsqlAsyncQueryGet { // ----- API Definition ------------------------------------------------------- -// EsqlAsyncQueryGet - Retrieves the results of a previously submitted async query request given its ID. +// EsqlAsyncQueryGet - Get async ES|QL query results // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-get-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query-get. type EsqlAsyncQueryGet func(id string, o ...func(*EsqlAsyncQueryGetRequest)) (*Response, error) // EsqlAsyncQueryGetRequest configures the Esql Async Query Get API request. @@ -204,7 +204,7 @@ func (f EsqlAsyncQueryGet) WithDropNullColumns(v bool) func(*EsqlAsyncQueryGetRe } } -// WithFormat - a short version of the accept header, e.g. json, yaml. +// WithFormat - a short version of the accept header, for example `json` or `yaml`.. func (f EsqlAsyncQueryGet) WithFormat(v string) func(*EsqlAsyncQueryGetRequest) { return func(r *EsqlAsyncQueryGetRequest) { r.Format = v diff --git a/esapi/api.xpack.esql.async_query_stop.go b/esapi/api.xpack.esql.async_query_stop.go index 2482148b9e..c28d895166 100644 --- a/esapi/api.xpack.esql.async_query_stop.go +++ b/esapi/api.xpack.esql.async_query_stop.go @@ -22,6 +22,7 @@ package esapi import ( "context" "net/http" + "strconv" "strings" ) @@ -42,15 +43,17 @@ func newEsqlAsyncQueryStopFunc(t Transport) EsqlAsyncQueryStop { // ----- API Definition ------------------------------------------------------- -// EsqlAsyncQueryStop - Stops a previously submitted async query request given its ID and collects the results. +// EsqlAsyncQueryStop - Stop async ES|QL query // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-stop-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query-stop. type EsqlAsyncQueryStop func(id string, o ...func(*EsqlAsyncQueryStopRequest)) (*Response, error) // EsqlAsyncQueryStopRequest configures the Esql Async Query Stop API request. type EsqlAsyncQueryStopRequest struct { DocumentID string + DropNullColumns *bool + Pretty bool Human bool ErrorTrace bool @@ -98,6 +101,10 @@ func (r EsqlAsyncQueryStopRequest) Do(providedCtx context.Context, transport Tra params = make(map[string]string) + if r.DropNullColumns != nil { + params["drop_null_columns"] = strconv.FormatBool(*r.DropNullColumns) + } + if r.Pretty { params["pretty"] = "true" } @@ -176,6 +183,13 @@ func (f EsqlAsyncQueryStop) WithContext(v context.Context) func(*EsqlAsyncQueryS } } +// WithDropNullColumns - indicates whether columns that are entirely `null` will be removed from the `columns` and `values` portion of the results.. +func (f EsqlAsyncQueryStop) WithDropNullColumns(v bool) func(*EsqlAsyncQueryStopRequest) { + return func(r *EsqlAsyncQueryStopRequest) { + r.DropNullColumns = &v + } +} + // WithPretty makes the response body pretty-printed. func (f EsqlAsyncQueryStop) WithPretty() func(*EsqlAsyncQueryStopRequest) { return func(r *EsqlAsyncQueryStopRequest) { diff --git a/esapi/api.xpack.esql.get_query.go b/esapi/api.xpack.esql.get_query.go index 4616e78a1d..f21604aac2 100644 --- a/esapi/api.xpack.esql.get_query.go +++ b/esapi/api.xpack.esql.get_query.go @@ -42,9 +42,11 @@ func newEsqlGetQueryFunc(t Transport) EsqlGetQuery { // ----- API Definition ------------------------------------------------------- -// EsqlGetQuery - Executes a get ESQL query request +// EsqlGetQuery - Get a specific running ES|QL query information // // This API is experimental. +// +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-get-query. type EsqlGetQuery func(id string, o ...func(*EsqlGetQueryRequest)) (*Response, error) // EsqlGetQueryRequest configures the Esql Get Query API request. diff --git a/esapi/api.xpack.esql.list_queries.go b/esapi/api.xpack.esql.list_queries.go index 2b94eb0c03..ffca8004eb 100644 --- a/esapi/api.xpack.esql.list_queries.go +++ b/esapi/api.xpack.esql.list_queries.go @@ -42,9 +42,11 @@ func newEsqlListQueriesFunc(t Transport) EsqlListQueries { // ----- API Definition ------------------------------------------------------- -// EsqlListQueries - Executes a list ESQL queries request +// EsqlListQueries - Get running ES|QL queries information // // This API is experimental. +// +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-list-queries. type EsqlListQueries func(o ...func(*EsqlListQueriesRequest)) (*Response, error) // EsqlListQueriesRequest configures the Esql List Queries API request. diff --git a/esapi/api.xpack.esql.query.go b/esapi/api.xpack.esql.query.go index e0b1869bc6..029e76b643 100644 --- a/esapi/api.xpack.esql.query.go +++ b/esapi/api.xpack.esql.query.go @@ -44,9 +44,9 @@ func newEsqlQueryFunc(t Transport) EsqlQuery { // ----- API Definition ------------------------------------------------------- -// EsqlQuery - Executes an ESQL request +// EsqlQuery - Run an ES|QL query // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-query-api.html. +// See full documentation at https://www.elastic.co/docs/explore-analyze/query-filter/languages/esql-rest. type EsqlQuery func(body io.Reader, o ...func(*EsqlQueryRequest)) (*Response, error) // EsqlQueryRequest configures the Esql Query API request. @@ -217,7 +217,7 @@ func (f EsqlQuery) WithDropNullColumns(v bool) func(*EsqlQueryRequest) { } } -// WithFormat - a short version of the accept header, e.g. json, yaml. +// WithFormat - a short version of the accept header, e.g. json, yaml.`csv`, `tsv`, and `txt` formats will return results in a tabular format, excluding other metadata fields from the response.. func (f EsqlQuery) WithFormat(v string) func(*EsqlQueryRequest) { return func(r *EsqlQueryRequest) { r.Format = v diff --git a/esapi/api.xpack.graph.explore.go b/esapi/api.xpack.graph.explore.go index 36b5b2cd1f..0f5f542b50 100644 --- a/esapi/api.xpack.graph.explore.go +++ b/esapi/api.xpack.graph.explore.go @@ -45,9 +45,9 @@ func newGraphExploreFunc(t Transport) GraphExplore { // ----- API Definition ------------------------------------------------------- -// GraphExplore - Explore extracted and summarized information about the documents and terms in an index. +// GraphExplore - Explore graph analytics // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-graph. type GraphExplore func(index []string, o ...func(*GraphExploreRequest)) (*Response, error) // GraphExploreRequest configures the Graph Explore API request. @@ -56,7 +56,7 @@ type GraphExploreRequest struct { Body io.Reader - Routing string + Routing []string Timeout time.Duration Pretty bool @@ -108,8 +108,8 @@ func (r GraphExploreRequest) Do(providedCtx context.Context, transport Transport params = make(map[string]string) - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if r.Timeout != 0 { @@ -209,7 +209,7 @@ func (f GraphExplore) WithBody(v io.Reader) func(*GraphExploreRequest) { } // WithRouting - specific routing value. -func (f GraphExplore) WithRouting(v string) func(*GraphExploreRequest) { +func (f GraphExplore) WithRouting(v ...string) func(*GraphExploreRequest) { return func(r *GraphExploreRequest) { r.Routing = v } diff --git a/esapi/api.xpack.ilm.delete_lifecycle.go b/esapi/api.xpack.ilm.delete_lifecycle.go index 0198983f86..f8e22cd97b 100644 --- a/esapi/api.xpack.ilm.delete_lifecycle.go +++ b/esapi/api.xpack.ilm.delete_lifecycle.go @@ -43,9 +43,9 @@ func newILMDeleteLifecycleFunc(t Transport) ILMDeleteLifecycle { // ----- API Definition ------------------------------------------------------- -// ILMDeleteLifecycle - Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. +// ILMDeleteLifecycle - Delete a lifecycle policy // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-delete-lifecycle. type ILMDeleteLifecycle func(policy string, o ...func(*ILMDeleteLifecycleRequest)) (*Response, error) // ILMDeleteLifecycleRequest configures the ILM Delete Lifecycle API request. diff --git a/esapi/api.xpack.ilm.explain_lifecycle.go b/esapi/api.xpack.ilm.explain_lifecycle.go index 16fba1eabb..1cf44d53db 100644 --- a/esapi/api.xpack.ilm.explain_lifecycle.go +++ b/esapi/api.xpack.ilm.explain_lifecycle.go @@ -44,9 +44,9 @@ func newILMExplainLifecycleFunc(t Transport) ILMExplainLifecycle { // ----- API Definition ------------------------------------------------------- -// ILMExplainLifecycle - Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step. +// ILMExplainLifecycle - Explain the lifecycle state // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-explain-lifecycle. type ILMExplainLifecycle func(index string, o ...func(*ILMExplainLifecycleRequest)) (*Response, error) // ILMExplainLifecycleRequest configures the ILM Explain Lifecycle API request. diff --git a/esapi/api.xpack.ilm.get_lifecycle.go b/esapi/api.xpack.ilm.get_lifecycle.go index 5f0177d653..0d370e0d32 100644 --- a/esapi/api.xpack.ilm.get_lifecycle.go +++ b/esapi/api.xpack.ilm.get_lifecycle.go @@ -43,9 +43,9 @@ func newILMGetLifecycleFunc(t Transport) ILMGetLifecycle { // ----- API Definition ------------------------------------------------------- -// ILMGetLifecycle - Returns the specified policy definition. Includes the policy version and last modified date. +// ILMGetLifecycle - Get lifecycle policies // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-get-lifecycle. type ILMGetLifecycle func(o ...func(*ILMGetLifecycleRequest)) (*Response, error) // ILMGetLifecycleRequest configures the ILM Get Lifecycle API request. diff --git a/esapi/api.xpack.ilm.get_status.go b/esapi/api.xpack.ilm.get_status.go index f20c93b400..d735fa6062 100644 --- a/esapi/api.xpack.ilm.get_status.go +++ b/esapi/api.xpack.ilm.get_status.go @@ -42,9 +42,9 @@ func newILMGetStatusFunc(t Transport) ILMGetStatus { // ----- API Definition ------------------------------------------------------- -// ILMGetStatus - Retrieves the current index lifecycle management (ILM) status. +// ILMGetStatus - Get the ILM status // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-get-status. type ILMGetStatus func(o ...func(*ILMGetStatusRequest)) (*Response, error) // ILMGetStatusRequest configures the ILM Get Status API request. diff --git a/esapi/api.xpack.ilm.migrate_to_data_tiers.go b/esapi/api.xpack.ilm.migrate_to_data_tiers.go index e0912f4401..49f8d1426c 100644 --- a/esapi/api.xpack.ilm.migrate_to_data_tiers.go +++ b/esapi/api.xpack.ilm.migrate_to_data_tiers.go @@ -45,9 +45,9 @@ func newILMMigrateToDataTiersFunc(t Transport) ILMMigrateToDataTiers { // ----- API Definition ------------------------------------------------------- -// ILMMigrateToDataTiers - Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing +// ILMMigrateToDataTiers - Migrate to data tiers routing // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-migrate-to-data-tiers.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-migrate-to-data-tiers. type ILMMigrateToDataTiers func(o ...func(*ILMMigrateToDataTiersRequest)) (*Response, error) // ILMMigrateToDataTiersRequest configures the ILM Migrate To Data Tiers API request. diff --git a/esapi/api.xpack.ilm.move_to_step.go b/esapi/api.xpack.ilm.move_to_step.go index 7b6360ef4c..718527b818 100644 --- a/esapi/api.xpack.ilm.move_to_step.go +++ b/esapi/api.xpack.ilm.move_to_step.go @@ -43,9 +43,9 @@ func newILMMoveToStepFunc(t Transport) ILMMoveToStep { // ----- API Definition ------------------------------------------------------- -// ILMMoveToStep - Manually moves an index into the specified step and executes that step. +// ILMMoveToStep - Move to a lifecycle step // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-move-to-step. type ILMMoveToStep func(index string, o ...func(*ILMMoveToStepRequest)) (*Response, error) // ILMMoveToStepRequest configures the ILM Move To Step API request. diff --git a/esapi/api.xpack.ilm.put_lifecycle.go b/esapi/api.xpack.ilm.put_lifecycle.go index 058df7ebbc..a7caf62876 100644 --- a/esapi/api.xpack.ilm.put_lifecycle.go +++ b/esapi/api.xpack.ilm.put_lifecycle.go @@ -44,9 +44,9 @@ func newILMPutLifecycleFunc(t Transport) ILMPutLifecycle { // ----- API Definition ------------------------------------------------------- -// ILMPutLifecycle - Creates a lifecycle policy +// ILMPutLifecycle - Create or update a lifecycle policy // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-put-lifecycle. type ILMPutLifecycle func(policy string, o ...func(*ILMPutLifecycleRequest)) (*Response, error) // ILMPutLifecycleRequest configures the ILM Put Lifecycle API request. diff --git a/esapi/api.xpack.ilm.remove_policy.go b/esapi/api.xpack.ilm.remove_policy.go index 1f75ddf101..6c6a033c0e 100644 --- a/esapi/api.xpack.ilm.remove_policy.go +++ b/esapi/api.xpack.ilm.remove_policy.go @@ -42,9 +42,9 @@ func newILMRemovePolicyFunc(t Transport) ILMRemovePolicy { // ----- API Definition ------------------------------------------------------- -// ILMRemovePolicy - Removes the assigned lifecycle policy and stops managing the specified index +// ILMRemovePolicy - Remove policies from an index // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-remove-policy. type ILMRemovePolicy func(index string, o ...func(*ILMRemovePolicyRequest)) (*Response, error) // ILMRemovePolicyRequest configures the ILM Remove Policy API request. diff --git a/esapi/api.xpack.ilm.retry.go b/esapi/api.xpack.ilm.retry.go index ceda7e10e1..e49c3436c5 100644 --- a/esapi/api.xpack.ilm.retry.go +++ b/esapi/api.xpack.ilm.retry.go @@ -42,9 +42,9 @@ func newILMRetryFunc(t Transport) ILMRetry { // ----- API Definition ------------------------------------------------------- -// ILMRetry - Retries executing the policy for an index that is in the ERROR step. +// ILMRetry - Retry a policy // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-retry. type ILMRetry func(index string, o ...func(*ILMRetryRequest)) (*Response, error) // ILMRetryRequest configures the ILM Retry API request. diff --git a/esapi/api.xpack.ilm.start.go b/esapi/api.xpack.ilm.start.go index 51e33f96f3..55a9e22900 100644 --- a/esapi/api.xpack.ilm.start.go +++ b/esapi/api.xpack.ilm.start.go @@ -43,9 +43,9 @@ func newILMStartFunc(t Transport) ILMStart { // ----- API Definition ------------------------------------------------------- -// ILMStart - Start the index lifecycle management (ILM) plugin. +// ILMStart - Start the ILM plugin // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-start. type ILMStart func(o ...func(*ILMStartRequest)) (*Response, error) // ILMStartRequest configures the ILM Start API request. diff --git a/esapi/api.xpack.ilm.stop.go b/esapi/api.xpack.ilm.stop.go index 3d6f11e200..8ed61763ca 100644 --- a/esapi/api.xpack.ilm.stop.go +++ b/esapi/api.xpack.ilm.stop.go @@ -43,9 +43,9 @@ func newILMStopFunc(t Transport) ILMStop { // ----- API Definition ------------------------------------------------------- -// ILMStop - Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin +// ILMStop - Stop the ILM plugin // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-stop. type ILMStop func(o ...func(*ILMStopRequest)) (*Response, error) // ILMStopRequest configures the ILM Stop API request. diff --git a/esapi/api.xpack.indices.create_data_stream.go b/esapi/api.xpack.indices.create_data_stream.go index 69787a0677..76ed386eba 100644 --- a/esapi/api.xpack.indices.create_data_stream.go +++ b/esapi/api.xpack.indices.create_data_stream.go @@ -43,9 +43,9 @@ func newIndicesCreateDataStreamFunc(t Transport) IndicesCreateDataStream { // ----- API Definition ------------------------------------------------------- -// IndicesCreateDataStream - Creates a data stream +// IndicesCreateDataStream - Create a data stream // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-create-data-stream. type IndicesCreateDataStream func(name string, o ...func(*IndicesCreateDataStreamRequest)) (*Response, error) // IndicesCreateDataStreamRequest configures the Indices Create Data Stream API request. diff --git a/esapi/api.xpack.indices.data_streams_stats.go b/esapi/api.xpack.indices.data_streams_stats.go index 6d0709121e..a0ec075f29 100644 --- a/esapi/api.xpack.indices.data_streams_stats.go +++ b/esapi/api.xpack.indices.data_streams_stats.go @@ -42,15 +42,17 @@ func newIndicesDataStreamsStatsFunc(t Transport) IndicesDataStreamsStats { // ----- API Definition ------------------------------------------------------- -// IndicesDataStreamsStats - Provides statistics on operations happening in a data stream. +// IndicesDataStreamsStats - Get data stream stats // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-data-streams-stats-1. type IndicesDataStreamsStats func(o ...func(*IndicesDataStreamsStatsRequest)) (*Response, error) // IndicesDataStreamsStatsRequest configures the Indices Data Streams Stats API request. type IndicesDataStreamsStatsRequest struct { Name []string + ExpandWildcards []string + Pretty bool Human bool ErrorTrace bool @@ -98,6 +100,10 @@ func (r IndicesDataStreamsStatsRequest) Do(providedCtx context.Context, transpor params = make(map[string]string) + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") + } + if r.Pretty { params["pretty"] = "true" } @@ -183,6 +189,13 @@ func (f IndicesDataStreamsStats) WithName(v ...string) func(*IndicesDataStreamsS } } +// WithExpandWildcards - whether to expand wildcard expressions to concrete data stream names that are open, closed or both.. +func (f IndicesDataStreamsStats) WithExpandWildcards(v ...string) func(*IndicesDataStreamsStatsRequest) { + return func(r *IndicesDataStreamsStatsRequest) { + r.ExpandWildcards = v + } +} + // WithPretty makes the response body pretty-printed. func (f IndicesDataStreamsStats) WithPretty() func(*IndicesDataStreamsStatsRequest) { return func(r *IndicesDataStreamsStatsRequest) { diff --git a/esapi/api.xpack.indices.delete_data_stream.go b/esapi/api.xpack.indices.delete_data_stream.go index 9005c88a9f..1fc3496408 100644 --- a/esapi/api.xpack.indices.delete_data_stream.go +++ b/esapi/api.xpack.indices.delete_data_stream.go @@ -44,16 +44,16 @@ func newIndicesDeleteDataStreamFunc(t Transport) IndicesDeleteDataStream { // ----- API Definition ------------------------------------------------------- -// IndicesDeleteDataStream - Deletes a data stream. +// IndicesDeleteDataStream - Delete data streams // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-data-stream. type IndicesDeleteDataStream func(name []string, o ...func(*IndicesDeleteDataStreamRequest)) (*Response, error) // IndicesDeleteDataStreamRequest configures the Indices Delete Data Stream API request. type IndicesDeleteDataStreamRequest struct { Name []string - ExpandWildcards string + ExpandWildcards []string MasterTimeout time.Duration Pretty bool @@ -103,8 +103,8 @@ func (r IndicesDeleteDataStreamRequest) Do(providedCtx context.Context, transpor params = make(map[string]string) - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.MasterTimeout != 0 { @@ -190,7 +190,7 @@ func (f IndicesDeleteDataStream) WithContext(v context.Context) func(*IndicesDel } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). -func (f IndicesDeleteDataStream) WithExpandWildcards(v string) func(*IndicesDeleteDataStreamRequest) { +func (f IndicesDeleteDataStream) WithExpandWildcards(v ...string) func(*IndicesDeleteDataStreamRequest) { return func(r *IndicesDeleteDataStreamRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.xpack.indices.delete_data_stream_options.go b/esapi/api.xpack.indices.delete_data_stream_options.go index eeb7035550..11615ef741 100644 --- a/esapi/api.xpack.indices.delete_data_stream_options.go +++ b/esapi/api.xpack.indices.delete_data_stream_options.go @@ -44,16 +44,16 @@ func newIndicesDeleteDataStreamOptionsFunc(t Transport) IndicesDeleteDataStreamO // ----- API Definition ------------------------------------------------------- -// IndicesDeleteDataStreamOptions - Deletes the data stream options of the selected data streams. +// IndicesDeleteDataStreamOptions - Delete data stream options // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-data-stream-options. type IndicesDeleteDataStreamOptions func(name []string, o ...func(*IndicesDeleteDataStreamOptionsRequest)) (*Response, error) // IndicesDeleteDataStreamOptionsRequest configures the Indices Delete Data Stream Options API request. type IndicesDeleteDataStreamOptionsRequest struct { Name []string - ExpandWildcards string + ExpandWildcards []string MasterTimeout time.Duration Timeout time.Duration @@ -106,8 +106,8 @@ func (r IndicesDeleteDataStreamOptionsRequest) Do(providedCtx context.Context, t params = make(map[string]string) - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.MasterTimeout != 0 { @@ -197,7 +197,7 @@ func (f IndicesDeleteDataStreamOptions) WithContext(v context.Context) func(*Ind } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). -func (f IndicesDeleteDataStreamOptions) WithExpandWildcards(v string) func(*IndicesDeleteDataStreamOptionsRequest) { +func (f IndicesDeleteDataStreamOptions) WithExpandWildcards(v ...string) func(*IndicesDeleteDataStreamOptionsRequest) { return func(r *IndicesDeleteDataStreamOptionsRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.xpack.indices.get_data_stream.go b/esapi/api.xpack.indices.get_data_stream.go index 9ccb279675..4694088246 100644 --- a/esapi/api.xpack.indices.get_data_stream.go +++ b/esapi/api.xpack.indices.get_data_stream.go @@ -44,16 +44,16 @@ func newIndicesGetDataStreamFunc(t Transport) IndicesGetDataStream { // ----- API Definition ------------------------------------------------------- -// IndicesGetDataStream - Returns data streams. +// IndicesGetDataStream - Get data streams // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream. type IndicesGetDataStream func(o ...func(*IndicesGetDataStreamRequest)) (*Response, error) // IndicesGetDataStreamRequest configures the Indices Get Data Stream API request. type IndicesGetDataStreamRequest struct { Name []string - ExpandWildcards string + ExpandWildcards []string IncludeDefaults *bool MasterTimeout time.Duration Verbose *bool @@ -103,8 +103,8 @@ func (r IndicesGetDataStreamRequest) Do(providedCtx context.Context, transport T params = make(map[string]string) - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IncludeDefaults != nil { @@ -205,7 +205,7 @@ func (f IndicesGetDataStream) WithName(v ...string) func(*IndicesGetDataStreamRe } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). -func (f IndicesGetDataStream) WithExpandWildcards(v string) func(*IndicesGetDataStreamRequest) { +func (f IndicesGetDataStream) WithExpandWildcards(v ...string) func(*IndicesGetDataStreamRequest) { return func(r *IndicesGetDataStreamRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.xpack.indices.get_data_stream_options.go b/esapi/api.xpack.indices.get_data_stream_options.go index 8cc68ce2ec..a1f5c7a847 100644 --- a/esapi/api.xpack.indices.get_data_stream_options.go +++ b/esapi/api.xpack.indices.get_data_stream_options.go @@ -44,16 +44,16 @@ func newIndicesGetDataStreamOptionsFunc(t Transport) IndicesGetDataStreamOptions // ----- API Definition ------------------------------------------------------- -// IndicesGetDataStreamOptions - Returns the data stream options of the selected data streams. +// IndicesGetDataStreamOptions - Get data stream options // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream-options. type IndicesGetDataStreamOptions func(name []string, o ...func(*IndicesGetDataStreamOptionsRequest)) (*Response, error) // IndicesGetDataStreamOptionsRequest configures the Indices Get Data Stream Options API request. type IndicesGetDataStreamOptionsRequest struct { Name []string - ExpandWildcards string + ExpandWildcards []string MasterTimeout time.Duration Pretty bool @@ -105,8 +105,8 @@ func (r IndicesGetDataStreamOptionsRequest) Do(providedCtx context.Context, tran params = make(map[string]string) - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.MasterTimeout != 0 { @@ -192,7 +192,7 @@ func (f IndicesGetDataStreamOptions) WithContext(v context.Context) func(*Indice } // WithExpandWildcards - whether wildcard expressions should get expanded to open or closed indices (default: open). -func (f IndicesGetDataStreamOptions) WithExpandWildcards(v string) func(*IndicesGetDataStreamOptionsRequest) { +func (f IndicesGetDataStreamOptions) WithExpandWildcards(v ...string) func(*IndicesGetDataStreamOptionsRequest) { return func(r *IndicesGetDataStreamOptionsRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.xpack.indices.get_data_stream_settings.go b/esapi/api.xpack.indices.get_data_stream_settings.go index 931399b06a..fd8e7d603c 100644 --- a/esapi/api.xpack.indices.get_data_stream_settings.go +++ b/esapi/api.xpack.indices.get_data_stream_settings.go @@ -43,9 +43,9 @@ func newIndicesGetDataStreamSettingsFunc(t Transport) IndicesGetDataStreamSettin // ----- API Definition ------------------------------------------------------- -// IndicesGetDataStreamSettings - Gets a data stream's settings +// IndicesGetDataStreamSettings - Get data stream settings // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream-settings. type IndicesGetDataStreamSettings func(name string, o ...func(*IndicesGetDataStreamSettingsRequest)) (*Response, error) // IndicesGetDataStreamSettingsRequest configures the Indices Get Data Stream Settings API request. diff --git a/esapi/api.xpack.indices.migrate_to_data_stream.go b/esapi/api.xpack.indices.migrate_to_data_stream.go index 7743e39219..cfc606291e 100644 --- a/esapi/api.xpack.indices.migrate_to_data_stream.go +++ b/esapi/api.xpack.indices.migrate_to_data_stream.go @@ -43,9 +43,9 @@ func newIndicesMigrateToDataStreamFunc(t Transport) IndicesMigrateToDataStream { // ----- API Definition ------------------------------------------------------- -// IndicesMigrateToDataStream - Migrates an alias to a data stream +// IndicesMigrateToDataStream - Convert an index alias to a data stream // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-migrate-to-data-stream. type IndicesMigrateToDataStream func(name string, o ...func(*IndicesMigrateToDataStreamRequest)) (*Response, error) // IndicesMigrateToDataStreamRequest configures the Indices Migrate To Data Stream API request. diff --git a/esapi/api.xpack.indices.promote_data_stream.go b/esapi/api.xpack.indices.promote_data_stream.go index 516841a8ed..1f29315559 100644 --- a/esapi/api.xpack.indices.promote_data_stream.go +++ b/esapi/api.xpack.indices.promote_data_stream.go @@ -43,9 +43,9 @@ func newIndicesPromoteDataStreamFunc(t Transport) IndicesPromoteDataStream { // ----- API Definition ------------------------------------------------------- -// IndicesPromoteDataStream - Promotes a data stream from a replicated data stream managed by CCR to a regular data stream +// IndicesPromoteDataStream - Promote a data stream // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-promote-data-stream. type IndicesPromoteDataStream func(name string, o ...func(*IndicesPromoteDataStreamRequest)) (*Response, error) // IndicesPromoteDataStreamRequest configures the Indices Promote Data Stream API request. diff --git a/esapi/api.xpack.indices.reload_search_analyzers.go b/esapi/api.xpack.indices.reload_search_analyzers.go index 59b057f37a..e787f74c43 100644 --- a/esapi/api.xpack.indices.reload_search_analyzers.go +++ b/esapi/api.xpack.indices.reload_search_analyzers.go @@ -44,9 +44,9 @@ func newIndicesReloadSearchAnalyzersFunc(t Transport) IndicesReloadSearchAnalyze // ----- API Definition ------------------------------------------------------- -// IndicesReloadSearchAnalyzers - Reloads an index's search analyzers and their resources. +// IndicesReloadSearchAnalyzers - Reload search analyzers // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-reload-search-analyzers. type IndicesReloadSearchAnalyzers func(index []string, o ...func(*IndicesReloadSearchAnalyzersRequest)) (*Response, error) // IndicesReloadSearchAnalyzersRequest configures the Indices Reload Search Analyzers API request. @@ -54,7 +54,7 @@ type IndicesReloadSearchAnalyzersRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool Resource string @@ -109,8 +109,8 @@ func (r IndicesReloadSearchAnalyzersRequest) Do(providedCtx context.Context, tra params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -207,7 +207,7 @@ func (f IndicesReloadSearchAnalyzers) WithAllowNoIndices(v bool) func(*IndicesRe } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f IndicesReloadSearchAnalyzers) WithExpandWildcards(v string) func(*IndicesReloadSearchAnalyzersRequest) { +func (f IndicesReloadSearchAnalyzers) WithExpandWildcards(v ...string) func(*IndicesReloadSearchAnalyzersRequest) { return func(r *IndicesReloadSearchAnalyzersRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.xpack.license.delete.go b/esapi/api.xpack.license.delete.go index b862a5aa98..fb02cea50e 100644 --- a/esapi/api.xpack.license.delete.go +++ b/esapi/api.xpack.license.delete.go @@ -43,9 +43,9 @@ func newLicenseDeleteFunc(t Transport) LicenseDelete { // ----- API Definition ------------------------------------------------------- -// LicenseDelete - Deletes licensing information for the cluster +// LicenseDelete - Delete the license // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-delete. type LicenseDelete func(o ...func(*LicenseDeleteRequest)) (*Response, error) // LicenseDeleteRequest configures the License Delete API request. diff --git a/esapi/api.xpack.license.get.go b/esapi/api.xpack.license.get.go index 03c037464f..6ded343b33 100644 --- a/esapi/api.xpack.license.get.go +++ b/esapi/api.xpack.license.get.go @@ -43,9 +43,9 @@ func newLicenseGetFunc(t Transport) LicenseGet { // ----- API Definition ------------------------------------------------------- -// LicenseGet - Retrieves licensing information for the cluster +// LicenseGet - Get license information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-get. type LicenseGet func(o ...func(*LicenseGetRequest)) (*Response, error) // LicenseGetRequest configures the License Get API request. diff --git a/esapi/api.xpack.license.get_basic_status.go b/esapi/api.xpack.license.get_basic_status.go index 8179486b29..5f98bd8677 100644 --- a/esapi/api.xpack.license.get_basic_status.go +++ b/esapi/api.xpack.license.get_basic_status.go @@ -42,9 +42,9 @@ func newLicenseGetBasicStatusFunc(t Transport) LicenseGetBasicStatus { // ----- API Definition ------------------------------------------------------- -// LicenseGetBasicStatus - Retrieves information about the status of the basic license. +// LicenseGetBasicStatus - Get the basic license status // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-get-basic-status. type LicenseGetBasicStatus func(o ...func(*LicenseGetBasicStatusRequest)) (*Response, error) // LicenseGetBasicStatusRequest configures the License Get Basic Status API request. diff --git a/esapi/api.xpack.license.get_trial_status.go b/esapi/api.xpack.license.get_trial_status.go index 7983dbf296..0930bb00f5 100644 --- a/esapi/api.xpack.license.get_trial_status.go +++ b/esapi/api.xpack.license.get_trial_status.go @@ -42,9 +42,9 @@ func newLicenseGetTrialStatusFunc(t Transport) LicenseGetTrialStatus { // ----- API Definition ------------------------------------------------------- -// LicenseGetTrialStatus - Retrieves information about the status of the trial license. +// LicenseGetTrialStatus - Get the trial status // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-get-trial-status. type LicenseGetTrialStatus func(o ...func(*LicenseGetTrialStatusRequest)) (*Response, error) // LicenseGetTrialStatusRequest configures the License Get Trial Status API request. diff --git a/esapi/api.xpack.license.post.go b/esapi/api.xpack.license.post.go index dbb13face8..170d91d52b 100644 --- a/esapi/api.xpack.license.post.go +++ b/esapi/api.xpack.license.post.go @@ -45,9 +45,9 @@ func newLicensePostFunc(t Transport) LicensePost { // ----- API Definition ------------------------------------------------------- -// LicensePost - Updates the license for the cluster. +// LicensePost - Update the license // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-post. type LicensePost func(o ...func(*LicensePostRequest)) (*Response, error) // LicensePostRequest configures the License Post API request. diff --git a/esapi/api.xpack.license.post_start_basic.go b/esapi/api.xpack.license.post_start_basic.go index fda37250e9..b97ad75da8 100644 --- a/esapi/api.xpack.license.post_start_basic.go +++ b/esapi/api.xpack.license.post_start_basic.go @@ -44,9 +44,9 @@ func newLicensePostStartBasicFunc(t Transport) LicensePostStartBasic { // ----- API Definition ------------------------------------------------------- -// LicensePostStartBasic - Starts an indefinite basic license. +// LicensePostStartBasic - Start a basic license // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-post-start-basic. type LicensePostStartBasic func(o ...func(*LicensePostStartBasicRequest)) (*Response, error) // LicensePostStartBasicRequest configures the License Post Start Basic API request. diff --git a/esapi/api.xpack.license.post_start_trial.go b/esapi/api.xpack.license.post_start_trial.go index af68a61a29..70768e3775 100644 --- a/esapi/api.xpack.license.post_start_trial.go +++ b/esapi/api.xpack.license.post_start_trial.go @@ -44,9 +44,9 @@ func newLicensePostStartTrialFunc(t Transport) LicensePostStartTrial { // ----- API Definition ------------------------------------------------------- -// LicensePostStartTrial - starts a limited time trial license. +// LicensePostStartTrial - Start a trial // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-post-start-trial. type LicensePostStartTrial func(o ...func(*LicensePostStartTrialRequest)) (*Response, error) // LicensePostStartTrialRequest configures the License Post Start Trial API request. diff --git a/esapi/api.xpack.logstash.delete_pipeline.go b/esapi/api.xpack.logstash.delete_pipeline.go index a635069593..3b2722bc3b 100644 --- a/esapi/api.xpack.logstash.delete_pipeline.go +++ b/esapi/api.xpack.logstash.delete_pipeline.go @@ -42,9 +42,9 @@ func newLogstashDeletePipelineFunc(t Transport) LogstashDeletePipeline { // ----- API Definition ------------------------------------------------------- -// LogstashDeletePipeline - Deletes Logstash Pipelines used by Central Management +// LogstashDeletePipeline - Delete a Logstash pipeline // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-delete-pipeline.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-logstash-delete-pipeline. type LogstashDeletePipeline func(id string, o ...func(*LogstashDeletePipelineRequest)) (*Response, error) // LogstashDeletePipelineRequest configures the Logstash Delete Pipeline API request. diff --git a/esapi/api.xpack.logstash.get_pipeline.go b/esapi/api.xpack.logstash.get_pipeline.go index 20b69e6adf..e1c32c66b5 100644 --- a/esapi/api.xpack.logstash.get_pipeline.go +++ b/esapi/api.xpack.logstash.get_pipeline.go @@ -42,9 +42,9 @@ func newLogstashGetPipelineFunc(t Transport) LogstashGetPipeline { // ----- API Definition ------------------------------------------------------- -// LogstashGetPipeline - Retrieves Logstash Pipelines used by Central Management +// LogstashGetPipeline - Get Logstash pipelines // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-get-pipeline.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-logstash-get-pipeline. type LogstashGetPipeline func(o ...func(*LogstashGetPipelineRequest)) (*Response, error) // LogstashGetPipelineRequest configures the Logstash Get Pipeline API request. diff --git a/esapi/api.xpack.logstash.put_pipeline.go b/esapi/api.xpack.logstash.put_pipeline.go index 520097b3ee..45c2a4be9e 100644 --- a/esapi/api.xpack.logstash.put_pipeline.go +++ b/esapi/api.xpack.logstash.put_pipeline.go @@ -43,9 +43,9 @@ func newLogstashPutPipelineFunc(t Transport) LogstashPutPipeline { // ----- API Definition ------------------------------------------------------- -// LogstashPutPipeline - Adds and updates Logstash Pipelines used for Central Management +// LogstashPutPipeline - Create or update a Logstash pipeline // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-put-pipeline.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-logstash-put-pipeline. type LogstashPutPipeline func(id string, body io.Reader, o ...func(*LogstashPutPipelineRequest)) (*Response, error) // LogstashPutPipelineRequest configures the Logstash Put Pipeline API request. diff --git a/esapi/api.xpack.migration.deprecations.go b/esapi/api.xpack.migration.deprecations.go index 2db7de447c..d8d684fff8 100644 --- a/esapi/api.xpack.migration.deprecations.go +++ b/esapi/api.xpack.migration.deprecations.go @@ -42,9 +42,9 @@ func newMigrationDeprecationsFunc(t Transport) MigrationDeprecations { // ----- API Definition ------------------------------------------------------- -// MigrationDeprecations - Retrieves information about different cluster, node, and index level settings that use deprecated features that will be removed or changed in the next major version. +// MigrationDeprecations - Get deprecation information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-migration-deprecations. type MigrationDeprecations func(o ...func(*MigrationDeprecationsRequest)) (*Response, error) // MigrationDeprecationsRequest configures the Migration Deprecations API request. diff --git a/esapi/api.xpack.migration.get_feature_upgrade_status.go b/esapi/api.xpack.migration.get_feature_upgrade_status.go index 6115f7a55b..6d6265966a 100644 --- a/esapi/api.xpack.migration.get_feature_upgrade_status.go +++ b/esapi/api.xpack.migration.get_feature_upgrade_status.go @@ -42,9 +42,9 @@ func newMigrationGetFeatureUpgradeStatusFunc(t Transport) MigrationGetFeatureUpg // ----- API Definition ------------------------------------------------------- -// MigrationGetFeatureUpgradeStatus - Find out whether system features need to be upgraded or not +// MigrationGetFeatureUpgradeStatus - Get feature migration information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-migration-get-feature-upgrade-status. type MigrationGetFeatureUpgradeStatus func(o ...func(*MigrationGetFeatureUpgradeStatusRequest)) (*Response, error) // MigrationGetFeatureUpgradeStatusRequest configures the Migration Get Feature Upgrade Status API request. diff --git a/esapi/api.xpack.migration.post_feature_upgrade.go b/esapi/api.xpack.migration.post_feature_upgrade.go index 5fcc613757..507c629789 100644 --- a/esapi/api.xpack.migration.post_feature_upgrade.go +++ b/esapi/api.xpack.migration.post_feature_upgrade.go @@ -42,9 +42,9 @@ func newMigrationPostFeatureUpgradeFunc(t Transport) MigrationPostFeatureUpgrade // ----- API Definition ------------------------------------------------------- -// MigrationPostFeatureUpgrade - Begin upgrades for system features +// MigrationPostFeatureUpgrade - Start the feature migration // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-migration-get-feature-upgrade-status. type MigrationPostFeatureUpgrade func(o ...func(*MigrationPostFeatureUpgradeRequest)) (*Response, error) // MigrationPostFeatureUpgradeRequest configures the Migration Post Feature Upgrade API request. diff --git a/esapi/api.xpack.ml.clear_trained_model_deployment_cache.go b/esapi/api.xpack.ml.clear_trained_model_deployment_cache.go index 82fec86054..7693c6a7f0 100644 --- a/esapi/api.xpack.ml.clear_trained_model_deployment_cache.go +++ b/esapi/api.xpack.ml.clear_trained_model_deployment_cache.go @@ -42,9 +42,9 @@ func newMLClearTrainedModelDeploymentCacheFunc(t Transport) MLClearTrainedModelD // ----- API Definition ------------------------------------------------------- -// MLClearTrainedModelDeploymentCache - Clear the cached results from a trained model deployment +// MLClearTrainedModelDeploymentCache - Clear trained model deployment cache // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-trained-model-deployment-cache.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-clear-trained-model-deployment-cache. type MLClearTrainedModelDeploymentCache func(model_id string, o ...func(*MLClearTrainedModelDeploymentCacheRequest)) (*Response, error) // MLClearTrainedModelDeploymentCacheRequest configures the ML Clear Trained Model Deployment Cache API request. diff --git a/esapi/api.xpack.ml.close_job.go b/esapi/api.xpack.ml.close_job.go index e61cb64377..63a492e566 100644 --- a/esapi/api.xpack.ml.close_job.go +++ b/esapi/api.xpack.ml.close_job.go @@ -45,9 +45,9 @@ func newMLCloseJobFunc(t Transport) MLCloseJob { // ----- API Definition ------------------------------------------------------- -// MLCloseJob - Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. +// MLCloseJob - Close anomaly detection jobs // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-close-job. type MLCloseJob func(job_id string, o ...func(*MLCloseJobRequest)) (*Response, error) // MLCloseJobRequest configures the ML Close Job API request. diff --git a/esapi/api.xpack.ml.delete_calendar.go b/esapi/api.xpack.ml.delete_calendar.go index 7e50e6b3fe..a06aedd8ef 100644 --- a/esapi/api.xpack.ml.delete_calendar.go +++ b/esapi/api.xpack.ml.delete_calendar.go @@ -42,9 +42,9 @@ func newMLDeleteCalendarFunc(t Transport) MLDeleteCalendar { // ----- API Definition ------------------------------------------------------- -// MLDeleteCalendar - Deletes a calendar. +// MLDeleteCalendar - Delete a calendar // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-calendar. type MLDeleteCalendar func(calendar_id string, o ...func(*MLDeleteCalendarRequest)) (*Response, error) // MLDeleteCalendarRequest configures the ML Delete Calendar API request. diff --git a/esapi/api.xpack.ml.delete_calendar_event.go b/esapi/api.xpack.ml.delete_calendar_event.go index 99bbb77046..7d0fb90661 100644 --- a/esapi/api.xpack.ml.delete_calendar_event.go +++ b/esapi/api.xpack.ml.delete_calendar_event.go @@ -42,9 +42,9 @@ func newMLDeleteCalendarEventFunc(t Transport) MLDeleteCalendarEvent { // ----- API Definition ------------------------------------------------------- -// MLDeleteCalendarEvent - Deletes scheduled events from a calendar. +// MLDeleteCalendarEvent - Delete events from a calendar // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-event.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-calendar-event. type MLDeleteCalendarEvent func(calendar_id string, event_id string, o ...func(*MLDeleteCalendarEventRequest)) (*Response, error) // MLDeleteCalendarEventRequest configures the ML Delete Calendar Event API request. diff --git a/esapi/api.xpack.ml.delete_calendar_job.go b/esapi/api.xpack.ml.delete_calendar_job.go index 6aa8d1f7f8..a7336acade 100644 --- a/esapi/api.xpack.ml.delete_calendar_job.go +++ b/esapi/api.xpack.ml.delete_calendar_job.go @@ -42,9 +42,9 @@ func newMLDeleteCalendarJobFunc(t Transport) MLDeleteCalendarJob { // ----- API Definition ------------------------------------------------------- -// MLDeleteCalendarJob - Deletes anomaly detection jobs from a calendar. +// MLDeleteCalendarJob - Delete anomaly jobs from a calendar // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-calendar-job. type MLDeleteCalendarJob func(calendar_id string, job_id string, o ...func(*MLDeleteCalendarJobRequest)) (*Response, error) // MLDeleteCalendarJobRequest configures the ML Delete Calendar Job API request. diff --git a/esapi/api.xpack.ml.delete_data_frame_analytics.go b/esapi/api.xpack.ml.delete_data_frame_analytics.go index 931ecf2808..40ba044a66 100644 --- a/esapi/api.xpack.ml.delete_data_frame_analytics.go +++ b/esapi/api.xpack.ml.delete_data_frame_analytics.go @@ -44,9 +44,9 @@ func newMLDeleteDataFrameAnalyticsFunc(t Transport) MLDeleteDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLDeleteDataFrameAnalytics - Deletes an existing data frame analytics job. +// MLDeleteDataFrameAnalytics - Delete a data frame analytics job // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-data-frame-analytics. type MLDeleteDataFrameAnalytics func(id string, o ...func(*MLDeleteDataFrameAnalyticsRequest)) (*Response, error) // MLDeleteDataFrameAnalyticsRequest configures the ML Delete Data Frame Analytics API request. diff --git a/esapi/api.xpack.ml.delete_datafeed.go b/esapi/api.xpack.ml.delete_datafeed.go index 1d33eab05a..4217e663bf 100644 --- a/esapi/api.xpack.ml.delete_datafeed.go +++ b/esapi/api.xpack.ml.delete_datafeed.go @@ -43,9 +43,9 @@ func newMLDeleteDatafeedFunc(t Transport) MLDeleteDatafeed { // ----- API Definition ------------------------------------------------------- -// MLDeleteDatafeed - Deletes an existing datafeed. +// MLDeleteDatafeed - Delete a datafeed // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-datafeed. type MLDeleteDatafeed func(datafeed_id string, o ...func(*MLDeleteDatafeedRequest)) (*Response, error) // MLDeleteDatafeedRequest configures the ML Delete Datafeed API request. diff --git a/esapi/api.xpack.ml.delete_expired_data.go b/esapi/api.xpack.ml.delete_expired_data.go index 1873af3625..2bfa2e0bc3 100644 --- a/esapi/api.xpack.ml.delete_expired_data.go +++ b/esapi/api.xpack.ml.delete_expired_data.go @@ -45,9 +45,9 @@ func newMLDeleteExpiredDataFunc(t Transport) MLDeleteExpiredData { // ----- API Definition ------------------------------------------------------- -// MLDeleteExpiredData - Deletes expired and unused machine learning data. +// MLDeleteExpiredData - Delete expired ML data // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-expired-data.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-expired-data. type MLDeleteExpiredData func(o ...func(*MLDeleteExpiredDataRequest)) (*Response, error) // MLDeleteExpiredDataRequest configures the ML Delete Expired Data API request. diff --git a/esapi/api.xpack.ml.delete_filter.go b/esapi/api.xpack.ml.delete_filter.go index b4329fc360..4267bcbaec 100644 --- a/esapi/api.xpack.ml.delete_filter.go +++ b/esapi/api.xpack.ml.delete_filter.go @@ -42,9 +42,9 @@ func newMLDeleteFilterFunc(t Transport) MLDeleteFilter { // ----- API Definition ------------------------------------------------------- -// MLDeleteFilter - Deletes a filter. +// MLDeleteFilter - Delete a filter // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-filter.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-filter. type MLDeleteFilter func(filter_id string, o ...func(*MLDeleteFilterRequest)) (*Response, error) // MLDeleteFilterRequest configures the ML Delete Filter API request. diff --git a/esapi/api.xpack.ml.delete_forecast.go b/esapi/api.xpack.ml.delete_forecast.go index 8f6c342f5a..d7b5445492 100644 --- a/esapi/api.xpack.ml.delete_forecast.go +++ b/esapi/api.xpack.ml.delete_forecast.go @@ -44,9 +44,9 @@ func newMLDeleteForecastFunc(t Transport) MLDeleteForecast { // ----- API Definition ------------------------------------------------------- -// MLDeleteForecast - Deletes forecasts from a machine learning job. +// MLDeleteForecast - Delete forecasts from a job // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-forecast. type MLDeleteForecast func(job_id string, o ...func(*MLDeleteForecastRequest)) (*Response, error) // MLDeleteForecastRequest configures the ML Delete Forecast API request. diff --git a/esapi/api.xpack.ml.delete_job.go b/esapi/api.xpack.ml.delete_job.go index 7284cdf47d..a496e2a2d7 100644 --- a/esapi/api.xpack.ml.delete_job.go +++ b/esapi/api.xpack.ml.delete_job.go @@ -43,9 +43,9 @@ func newMLDeleteJobFunc(t Transport) MLDeleteJob { // ----- API Definition ------------------------------------------------------- -// MLDeleteJob - Deletes an existing anomaly detection job. +// MLDeleteJob - Delete an anomaly detection job // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-job. type MLDeleteJob func(job_id string, o ...func(*MLDeleteJobRequest)) (*Response, error) // MLDeleteJobRequest configures the ML Delete Job API request. diff --git a/esapi/api.xpack.ml.delete_model_snapshot.go b/esapi/api.xpack.ml.delete_model_snapshot.go index 22389abbb2..829dd8df59 100644 --- a/esapi/api.xpack.ml.delete_model_snapshot.go +++ b/esapi/api.xpack.ml.delete_model_snapshot.go @@ -42,9 +42,9 @@ func newMLDeleteModelSnapshotFunc(t Transport) MLDeleteModelSnapshot { // ----- API Definition ------------------------------------------------------- -// MLDeleteModelSnapshot - Deletes an existing model snapshot. +// MLDeleteModelSnapshot - Delete a model snapshot // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-model-snapshot. type MLDeleteModelSnapshot func(snapshot_id string, job_id string, o ...func(*MLDeleteModelSnapshotRequest)) (*Response, error) // MLDeleteModelSnapshotRequest configures the ML Delete Model Snapshot API request. diff --git a/esapi/api.xpack.ml.delete_trained_model.go b/esapi/api.xpack.ml.delete_trained_model.go index 7895f36b50..86c77f7232 100644 --- a/esapi/api.xpack.ml.delete_trained_model.go +++ b/esapi/api.xpack.ml.delete_trained_model.go @@ -44,9 +44,9 @@ func newMLDeleteTrainedModelFunc(t Transport) MLDeleteTrainedModel { // ----- API Definition ------------------------------------------------------- -// MLDeleteTrainedModel - Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. +// MLDeleteTrainedModel - Delete an unreferenced trained model // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-trained-model. type MLDeleteTrainedModel func(model_id string, o ...func(*MLDeleteTrainedModelRequest)) (*Response, error) // MLDeleteTrainedModelRequest configures the ML Delete Trained Model API request. diff --git a/esapi/api.xpack.ml.delete_trained_model_alias.go b/esapi/api.xpack.ml.delete_trained_model_alias.go index e6bc84f28b..902f8778c2 100644 --- a/esapi/api.xpack.ml.delete_trained_model_alias.go +++ b/esapi/api.xpack.ml.delete_trained_model_alias.go @@ -42,9 +42,9 @@ func newMLDeleteTrainedModelAliasFunc(t Transport) MLDeleteTrainedModelAlias { // ----- API Definition ------------------------------------------------------- -// MLDeleteTrainedModelAlias - Deletes a model alias that refers to the trained model +// MLDeleteTrainedModelAlias - Delete a trained model alias // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models-aliases.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-trained-model-alias. type MLDeleteTrainedModelAlias func(model_alias string, model_id string, o ...func(*MLDeleteTrainedModelAliasRequest)) (*Response, error) // MLDeleteTrainedModelAliasRequest configures the ML Delete Trained Model Alias API request. diff --git a/esapi/api.xpack.ml.estimate_model_memory.go b/esapi/api.xpack.ml.estimate_model_memory.go index 5c77a487fc..3fa133e6b5 100644 --- a/esapi/api.xpack.ml.estimate_model_memory.go +++ b/esapi/api.xpack.ml.estimate_model_memory.go @@ -43,9 +43,9 @@ func newMLEstimateModelMemoryFunc(t Transport) MLEstimateModelMemory { // ----- API Definition ------------------------------------------------------- -// MLEstimateModelMemory - Estimates the model memory +// MLEstimateModelMemory - Estimate job model memory usage // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-apis.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-estimate-model-memory. type MLEstimateModelMemory func(body io.Reader, o ...func(*MLEstimateModelMemoryRequest)) (*Response, error) // MLEstimateModelMemoryRequest configures the ML Estimate Model Memory API request. diff --git a/esapi/api.xpack.ml.evaluate_data_frame.go b/esapi/api.xpack.ml.evaluate_data_frame.go index f20c0eb72f..32f8d5f0d3 100644 --- a/esapi/api.xpack.ml.evaluate_data_frame.go +++ b/esapi/api.xpack.ml.evaluate_data_frame.go @@ -43,9 +43,9 @@ func newMLEvaluateDataFrameFunc(t Transport) MLEvaluateDataFrame { // ----- API Definition ------------------------------------------------------- -// MLEvaluateDataFrame - Evaluates the data frame analytics for an annotated index. +// MLEvaluateDataFrame - Evaluate data frame analytics // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-evaluate-data-frame. type MLEvaluateDataFrame func(body io.Reader, o ...func(*MLEvaluateDataFrameRequest)) (*Response, error) // MLEvaluateDataFrameRequest configures the ML Evaluate Data Frame API request. diff --git a/esapi/api.xpack.ml.explain_data_frame_analytics.go b/esapi/api.xpack.ml.explain_data_frame_analytics.go index 33e97e0086..555f01de50 100644 --- a/esapi/api.xpack.ml.explain_data_frame_analytics.go +++ b/esapi/api.xpack.ml.explain_data_frame_analytics.go @@ -43,9 +43,9 @@ func newMLExplainDataFrameAnalyticsFunc(t Transport) MLExplainDataFrameAnalytics // ----- API Definition ------------------------------------------------------- -// MLExplainDataFrameAnalytics - Explains a data frame analytics config. +// MLExplainDataFrameAnalytics - Explain data frame analytics config // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-explain-data-frame-analytics. type MLExplainDataFrameAnalytics func(o ...func(*MLExplainDataFrameAnalyticsRequest)) (*Response, error) // MLExplainDataFrameAnalyticsRequest configures the ML Explain Data Frame Analytics API request. diff --git a/esapi/api.xpack.ml.flush_job.go b/esapi/api.xpack.ml.flush_job.go index 391170a8ae..f1cda667fa 100644 --- a/esapi/api.xpack.ml.flush_job.go +++ b/esapi/api.xpack.ml.flush_job.go @@ -21,6 +21,7 @@ package esapi import ( "context" + "fmt" "io" "net/http" "strconv" @@ -44,9 +45,9 @@ func newMLFlushJobFunc(t Transport) MLFlushJob { // ----- API Definition ------------------------------------------------------- -// MLFlushJob - Forces any buffered data to be processed by the job. +// MLFlushJob - Force buffered data to be processed // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-flush-job. type MLFlushJob func(job_id string, o ...func(*MLFlushJobRequest)) (*Response, error) // MLFlushJobRequest configures the ML Flush Job API request. @@ -55,11 +56,11 @@ type MLFlushJobRequest struct { JobID string - AdvanceTime string + AdvanceTime interface{} CalcInterim *bool - End string - SkipTime string - Start string + End interface{} + SkipTime interface{} + Start interface{} Pretty bool Human bool @@ -108,24 +109,24 @@ func (r MLFlushJobRequest) Do(providedCtx context.Context, transport Transport) params = make(map[string]string) - if r.AdvanceTime != "" { - params["advance_time"] = r.AdvanceTime + if r.AdvanceTime != nil { + params["advance_time"] = fmt.Sprintf("%v", r.AdvanceTime) } if r.CalcInterim != nil { params["calc_interim"] = strconv.FormatBool(*r.CalcInterim) } - if r.End != "" { - params["end"] = r.End + if r.End != nil { + params["end"] = fmt.Sprintf("%v", r.End) } - if r.SkipTime != "" { - params["skip_time"] = r.SkipTime + if r.SkipTime != nil { + params["skip_time"] = fmt.Sprintf("%v", r.SkipTime) } - if r.Start != "" { - params["start"] = r.Start + if r.Start != nil { + params["start"] = fmt.Sprintf("%v", r.Start) } if r.Pretty { @@ -221,7 +222,7 @@ func (f MLFlushJob) WithBody(v io.Reader) func(*MLFlushJobRequest) { } // 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) { +func (f MLFlushJob) WithAdvanceTime(v interface{}) func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { r.AdvanceTime = v } @@ -235,21 +236,21 @@ func (f MLFlushJob) WithCalcInterim(v bool) func(*MLFlushJobRequest) { } // 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) { +func (f MLFlushJob) WithEnd(v interface{}) 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) { +func (f MLFlushJob) WithSkipTime(v interface{}) 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) { +func (f MLFlushJob) WithStart(v interface{}) func(*MLFlushJobRequest) { return func(r *MLFlushJobRequest) { r.Start = v } diff --git a/esapi/api.xpack.ml.forecast.go b/esapi/api.xpack.ml.forecast.go index 31bd37ecfe..ef5a07246a 100644 --- a/esapi/api.xpack.ml.forecast.go +++ b/esapi/api.xpack.ml.forecast.go @@ -44,9 +44,9 @@ func newMLForecastFunc(t Transport) MLForecast { // ----- API Definition ------------------------------------------------------- -// MLForecast - Predicts the future behavior of a time series by using its historical behavior. +// MLForecast - Predict future behavior of a time series // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-forecast. type MLForecast func(job_id string, o ...func(*MLForecastRequest)) (*Response, error) // MLForecastRequest configures the ML Forecast API request. diff --git a/esapi/api.xpack.ml.get_buckets.go b/esapi/api.xpack.ml.get_buckets.go index 74c1354de8..96eda22838 100644 --- a/esapi/api.xpack.ml.get_buckets.go +++ b/esapi/api.xpack.ml.get_buckets.go @@ -45,9 +45,9 @@ func newMLGetBucketsFunc(t Transport) MLGetBuckets { // ----- API Definition ------------------------------------------------------- -// MLGetBuckets - Retrieves anomaly detection job results for one or more buckets. +// MLGetBuckets - Get anomaly detection job results for buckets // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-buckets. type MLGetBuckets func(job_id string, o ...func(*MLGetBucketsRequest)) (*Response, error) // MLGetBucketsRequest configures the ML Get Buckets API request. @@ -59,13 +59,13 @@ type MLGetBucketsRequest struct { AnomalyScore interface{} Desc *bool - End string + End interface{} ExcludeInterim *bool Expand *bool From *int Size *int Sort string - Start string + Start interface{} Pretty bool Human bool @@ -131,8 +131,8 @@ func (r MLGetBucketsRequest) Do(providedCtx context.Context, transport Transport params["desc"] = strconv.FormatBool(*r.Desc) } - if r.End != "" { - params["end"] = r.End + if r.End != nil { + params["end"] = fmt.Sprintf("%v", r.End) } if r.ExcludeInterim != nil { @@ -155,8 +155,8 @@ func (r MLGetBucketsRequest) Do(providedCtx context.Context, transport Transport params["sort"] = r.Sort } - if r.Start != "" { - params["start"] = r.Start + if r.Start != nil { + params["start"] = fmt.Sprintf("%v", r.Start) } if r.Pretty { @@ -273,7 +273,7 @@ func (f MLGetBuckets) WithDesc(v bool) func(*MLGetBucketsRequest) { } // WithEnd - end time filter for buckets. -func (f MLGetBuckets) WithEnd(v string) func(*MLGetBucketsRequest) { +func (f MLGetBuckets) WithEnd(v interface{}) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.End = v } @@ -315,7 +315,7 @@ func (f MLGetBuckets) WithSort(v string) func(*MLGetBucketsRequest) { } // WithStart - start time filter for buckets. -func (f MLGetBuckets) WithStart(v string) func(*MLGetBucketsRequest) { +func (f MLGetBuckets) WithStart(v interface{}) func(*MLGetBucketsRequest) { return func(r *MLGetBucketsRequest) { r.Start = v } diff --git a/esapi/api.xpack.ml.get_calendar_events.go b/esapi/api.xpack.ml.get_calendar_events.go index f91a33a9ce..64570e5149 100644 --- a/esapi/api.xpack.ml.get_calendar_events.go +++ b/esapi/api.xpack.ml.get_calendar_events.go @@ -44,9 +44,9 @@ func newMLGetCalendarEventsFunc(t Transport) MLGetCalendarEvents { // ----- API Definition ------------------------------------------------------- -// MLGetCalendarEvents - Retrieves information about the scheduled events in calendars. +// MLGetCalendarEvents - Get info about events in calendars // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-calendar-events. type MLGetCalendarEvents func(calendar_id string, o ...func(*MLGetCalendarEventsRequest)) (*Response, error) // MLGetCalendarEventsRequest configures the ML Get Calendar Events API request. @@ -57,7 +57,7 @@ type MLGetCalendarEventsRequest struct { From *int JobID string Size *int - Start string + Start interface{} Pretty bool Human bool @@ -122,8 +122,8 @@ func (r MLGetCalendarEventsRequest) Do(providedCtx context.Context, transport Tr params["size"] = strconv.FormatInt(int64(*r.Size), 10) } - if r.Start != "" { - params["start"] = r.Start + if r.Start != nil { + params["start"] = fmt.Sprintf("%v", r.Start) } if r.Pretty { @@ -233,7 +233,7 @@ func (f MLGetCalendarEvents) WithSize(v int) func(*MLGetCalendarEventsRequest) { } // WithStart - get events after this time. -func (f MLGetCalendarEvents) WithStart(v string) func(*MLGetCalendarEventsRequest) { +func (f MLGetCalendarEvents) WithStart(v interface{}) func(*MLGetCalendarEventsRequest) { return func(r *MLGetCalendarEventsRequest) { r.Start = v } diff --git a/esapi/api.xpack.ml.get_calendars.go b/esapi/api.xpack.ml.get_calendars.go index cc651c17c3..e6d68c066c 100644 --- a/esapi/api.xpack.ml.get_calendars.go +++ b/esapi/api.xpack.ml.get_calendars.go @@ -44,9 +44,9 @@ func newMLGetCalendarsFunc(t Transport) MLGetCalendars { // ----- API Definition ------------------------------------------------------- -// MLGetCalendars - Retrieves configuration information for calendars. +// MLGetCalendars - Get calendar configuration info // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-calendars. type MLGetCalendars func(o ...func(*MLGetCalendarsRequest)) (*Response, error) // MLGetCalendarsRequest configures the ML Get Calendars API request. diff --git a/esapi/api.xpack.ml.get_categories.go b/esapi/api.xpack.ml.get_categories.go index 86a597f998..5d1c9a305f 100644 --- a/esapi/api.xpack.ml.get_categories.go +++ b/esapi/api.xpack.ml.get_categories.go @@ -44,9 +44,9 @@ func newMLGetCategoriesFunc(t Transport) MLGetCategories { // ----- API Definition ------------------------------------------------------- -// MLGetCategories - Retrieves anomaly detection job results for one or more categories. +// MLGetCategories - Get anomaly detection job results for categories // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-categories. type MLGetCategories func(job_id string, o ...func(*MLGetCategoriesRequest)) (*Response, error) // MLGetCategoriesRequest configures the ML Get Categories API request. diff --git a/esapi/api.xpack.ml.get_data_frame_analytics.go b/esapi/api.xpack.ml.get_data_frame_analytics.go index b1cd2be83d..50993d3083 100644 --- a/esapi/api.xpack.ml.get_data_frame_analytics.go +++ b/esapi/api.xpack.ml.get_data_frame_analytics.go @@ -43,9 +43,9 @@ func newMLGetDataFrameAnalyticsFunc(t Transport) MLGetDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLGetDataFrameAnalytics - Retrieves configuration information for data frame analytics jobs. +// MLGetDataFrameAnalytics - Get data frame analytics job configuration info // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-data-frame-analytics. type MLGetDataFrameAnalytics func(o ...func(*MLGetDataFrameAnalyticsRequest)) (*Response, error) // MLGetDataFrameAnalyticsRequest configures the ML Get Data Frame Analytics API request. 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 132011f98e..03f7333035 100644 --- a/esapi/api.xpack.ml.get_data_frame_analytics_stats.go +++ b/esapi/api.xpack.ml.get_data_frame_analytics_stats.go @@ -43,9 +43,9 @@ func newMLGetDataFrameAnalyticsStatsFunc(t Transport) MLGetDataFrameAnalyticsSta // ----- API Definition ------------------------------------------------------- -// MLGetDataFrameAnalyticsStats - Retrieves usage information for data frame analytics jobs. +// MLGetDataFrameAnalyticsStats - Get data frame analytics job stats // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-data-frame-analytics-stats. type MLGetDataFrameAnalyticsStats func(o ...func(*MLGetDataFrameAnalyticsStatsRequest)) (*Response, error) // MLGetDataFrameAnalyticsStatsRequest configures the ML Get Data Frame Analytics Stats API request. diff --git a/esapi/api.xpack.ml.get_datafeed_stats.go b/esapi/api.xpack.ml.get_datafeed_stats.go index 6516a1805a..9898b2f06c 100644 --- a/esapi/api.xpack.ml.get_datafeed_stats.go +++ b/esapi/api.xpack.ml.get_datafeed_stats.go @@ -43,9 +43,9 @@ func newMLGetDatafeedStatsFunc(t Transport) MLGetDatafeedStats { // ----- API Definition ------------------------------------------------------- -// MLGetDatafeedStats - Retrieves usage information for datafeeds. +// MLGetDatafeedStats - Get datafeed stats // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-datafeed-stats. type MLGetDatafeedStats func(o ...func(*MLGetDatafeedStatsRequest)) (*Response, error) // MLGetDatafeedStatsRequest configures the ML Get Datafeed Stats API request. diff --git a/esapi/api.xpack.ml.get_datafeeds.go b/esapi/api.xpack.ml.get_datafeeds.go index c4ad6d6af2..40e9603fe4 100644 --- a/esapi/api.xpack.ml.get_datafeeds.go +++ b/esapi/api.xpack.ml.get_datafeeds.go @@ -43,9 +43,9 @@ func newMLGetDatafeedsFunc(t Transport) MLGetDatafeeds { // ----- API Definition ------------------------------------------------------- -// MLGetDatafeeds - Retrieves configuration information for datafeeds. +// MLGetDatafeeds - Get datafeeds configuration info // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-datafeeds. type MLGetDatafeeds func(o ...func(*MLGetDatafeedsRequest)) (*Response, error) // MLGetDatafeedsRequest configures the ML Get Datafeeds API request. diff --git a/esapi/api.xpack.ml.get_filters.go b/esapi/api.xpack.ml.get_filters.go index a4f27d50aa..a265e92d1e 100644 --- a/esapi/api.xpack.ml.get_filters.go +++ b/esapi/api.xpack.ml.get_filters.go @@ -43,9 +43,9 @@ func newMLGetFiltersFunc(t Transport) MLGetFilters { // ----- API Definition ------------------------------------------------------- -// MLGetFilters - Retrieves filters. +// MLGetFilters - Get filters // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-filter.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-filters. type MLGetFilters func(o ...func(*MLGetFiltersRequest)) (*Response, error) // MLGetFiltersRequest configures the ML Get Filters API request. diff --git a/esapi/api.xpack.ml.get_influencers.go b/esapi/api.xpack.ml.get_influencers.go index 8923d87284..07e9b0122f 100644 --- a/esapi/api.xpack.ml.get_influencers.go +++ b/esapi/api.xpack.ml.get_influencers.go @@ -45,9 +45,9 @@ func newMLGetInfluencersFunc(t Transport) MLGetInfluencers { // ----- API Definition ------------------------------------------------------- -// MLGetInfluencers - Retrieves anomaly detection job results for one or more influencers. +// MLGetInfluencers - Get anomaly detection job results for influencers // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-influencers. type MLGetInfluencers func(job_id string, o ...func(*MLGetInfluencersRequest)) (*Response, error) // MLGetInfluencersRequest configures the ML Get Influencers API request. @@ -57,13 +57,13 @@ type MLGetInfluencersRequest struct { JobID string Desc *bool - End string + End interface{} ExcludeInterim *bool From *int InfluencerScore interface{} Size *int Sort string - Start string + Start interface{} Pretty bool Human bool @@ -118,8 +118,8 @@ func (r MLGetInfluencersRequest) Do(providedCtx context.Context, transport Trans params["desc"] = strconv.FormatBool(*r.Desc) } - if r.End != "" { - params["end"] = r.End + if r.End != nil { + params["end"] = fmt.Sprintf("%v", r.End) } if r.ExcludeInterim != nil { @@ -142,8 +142,8 @@ func (r MLGetInfluencersRequest) Do(providedCtx context.Context, transport Trans params["sort"] = r.Sort } - if r.Start != "" { - params["start"] = r.Start + if r.Start != nil { + params["start"] = fmt.Sprintf("%v", r.Start) } if r.Pretty { @@ -246,7 +246,7 @@ func (f MLGetInfluencers) WithDesc(v bool) func(*MLGetInfluencersRequest) { } // WithEnd - end timestamp for the requested influencers. -func (f MLGetInfluencers) WithEnd(v string) func(*MLGetInfluencersRequest) { +func (f MLGetInfluencers) WithEnd(v interface{}) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.End = v } @@ -288,7 +288,7 @@ func (f MLGetInfluencers) WithSort(v string) func(*MLGetInfluencersRequest) { } // WithStart - start timestamp for the requested influencers. -func (f MLGetInfluencers) WithStart(v string) func(*MLGetInfluencersRequest) { +func (f MLGetInfluencers) WithStart(v interface{}) func(*MLGetInfluencersRequest) { return func(r *MLGetInfluencersRequest) { r.Start = v } diff --git a/esapi/api.xpack.ml.get_job_stats.go b/esapi/api.xpack.ml.get_job_stats.go index f5f463a86d..3581aedeb5 100644 --- a/esapi/api.xpack.ml.get_job_stats.go +++ b/esapi/api.xpack.ml.get_job_stats.go @@ -43,9 +43,9 @@ func newMLGetJobStatsFunc(t Transport) MLGetJobStats { // ----- API Definition ------------------------------------------------------- -// MLGetJobStats - Retrieves usage information for anomaly detection jobs. +// MLGetJobStats - Get anomaly detection job stats // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-job-stats. type MLGetJobStats func(o ...func(*MLGetJobStatsRequest)) (*Response, error) // MLGetJobStatsRequest configures the ML Get Job Stats API request. diff --git a/esapi/api.xpack.ml.get_jobs.go b/esapi/api.xpack.ml.get_jobs.go index 09a4c7c8b3..7ae58925d2 100644 --- a/esapi/api.xpack.ml.get_jobs.go +++ b/esapi/api.xpack.ml.get_jobs.go @@ -43,9 +43,9 @@ func newMLGetJobsFunc(t Transport) MLGetJobs { // ----- API Definition ------------------------------------------------------- -// MLGetJobs - Retrieves configuration information for anomaly detection jobs. +// MLGetJobs - Get anomaly detection jobs configuration info // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-jobs. type MLGetJobs func(o ...func(*MLGetJobsRequest)) (*Response, error) // MLGetJobsRequest configures the ML Get Jobs API request. diff --git a/esapi/api.xpack.ml.get_memory_stats.go b/esapi/api.xpack.ml.get_memory_stats.go index da30b14715..6b3bcd5f45 100644 --- a/esapi/api.xpack.ml.get_memory_stats.go +++ b/esapi/api.xpack.ml.get_memory_stats.go @@ -43,9 +43,9 @@ func newMLGetMemoryStatsFunc(t Transport) MLGetMemoryStats { // ----- API Definition ------------------------------------------------------- -// MLGetMemoryStats - Returns information on how ML is using memory. +// MLGetMemoryStats - Get machine learning memory usage info // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-memory.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-memory-stats. type MLGetMemoryStats func(o ...func(*MLGetMemoryStatsRequest)) (*Response, error) // MLGetMemoryStatsRequest configures the ML Get Memory Stats API request. diff --git a/esapi/api.xpack.ml.get_model_snapshot_upgrade_stats.go b/esapi/api.xpack.ml.get_model_snapshot_upgrade_stats.go index 92e65dc6ff..6853ba4702 100644 --- a/esapi/api.xpack.ml.get_model_snapshot_upgrade_stats.go +++ b/esapi/api.xpack.ml.get_model_snapshot_upgrade_stats.go @@ -43,9 +43,9 @@ func newMLGetModelSnapshotUpgradeStatsFunc(t Transport) MLGetModelSnapshotUpgrad // ----- API Definition ------------------------------------------------------- -// MLGetModelSnapshotUpgradeStats - Gets stats for anomaly detection job model snapshot upgrades that are in progress. +// MLGetModelSnapshotUpgradeStats - Get anomaly detection job model snapshot upgrade usage info // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-model-snapshot-upgrade-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-model-snapshot-upgrade-stats. type MLGetModelSnapshotUpgradeStats func(snapshot_id string, job_id string, o ...func(*MLGetModelSnapshotUpgradeStatsRequest)) (*Response, error) // MLGetModelSnapshotUpgradeStatsRequest configures the ML Get Model Snapshot Upgrade Stats API request. diff --git a/esapi/api.xpack.ml.get_model_snapshots.go b/esapi/api.xpack.ml.get_model_snapshots.go index 435c71c3b1..2821fc1ab6 100644 --- a/esapi/api.xpack.ml.get_model_snapshots.go +++ b/esapi/api.xpack.ml.get_model_snapshots.go @@ -45,9 +45,9 @@ func newMLGetModelSnapshotsFunc(t Transport) MLGetModelSnapshots { // ----- API Definition ------------------------------------------------------- -// MLGetModelSnapshots - Retrieves information about model snapshots. +// MLGetModelSnapshots - Get model snapshots info // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-model-snapshots. type MLGetModelSnapshots func(job_id string, o ...func(*MLGetModelSnapshotsRequest)) (*Response, error) // MLGetModelSnapshotsRequest configures the ML Get Model Snapshots API request. diff --git a/esapi/api.xpack.ml.get_overall_buckets.go b/esapi/api.xpack.ml.get_overall_buckets.go index 4e70c65376..72117e424a 100644 --- a/esapi/api.xpack.ml.get_overall_buckets.go +++ b/esapi/api.xpack.ml.get_overall_buckets.go @@ -45,9 +45,9 @@ func newMLGetOverallBucketsFunc(t Transport) MLGetOverallBuckets { // ----- API Definition ------------------------------------------------------- -// MLGetOverallBuckets - Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. +// MLGetOverallBuckets - Get overall bucket results // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-overall-buckets. type MLGetOverallBuckets func(job_id string, o ...func(*MLGetOverallBucketsRequest)) (*Response, error) // MLGetOverallBucketsRequest configures the ML Get Overall Buckets API request. @@ -58,10 +58,10 @@ type MLGetOverallBucketsRequest struct { AllowNoMatch *bool BucketSpan string - End string + End interface{} ExcludeInterim *bool OverallScore interface{} - Start string + Start interface{} TopN *int Pretty bool @@ -121,8 +121,8 @@ func (r MLGetOverallBucketsRequest) Do(providedCtx context.Context, transport Tr params["bucket_span"] = r.BucketSpan } - if r.End != "" { - params["end"] = r.End + if r.End != nil { + params["end"] = fmt.Sprintf("%v", r.End) } if r.ExcludeInterim != nil { @@ -133,8 +133,8 @@ func (r MLGetOverallBucketsRequest) Do(providedCtx context.Context, transport Tr params["overall_score"] = fmt.Sprintf("%v", r.OverallScore) } - if r.Start != "" { - params["start"] = r.Start + if r.Start != nil { + params["start"] = fmt.Sprintf("%v", r.Start) } if r.TopN != nil { @@ -248,7 +248,7 @@ func (f MLGetOverallBuckets) WithBucketSpan(v string) func(*MLGetOverallBucketsR } // WithEnd - returns overall buckets with timestamps earlier than this time. -func (f MLGetOverallBuckets) WithEnd(v string) func(*MLGetOverallBucketsRequest) { +func (f MLGetOverallBuckets) WithEnd(v interface{}) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.End = v } @@ -269,7 +269,7 @@ func (f MLGetOverallBuckets) WithOverallScore(v interface{}) func(*MLGetOverallB } // WithStart - returns overall buckets with timestamps after this time. -func (f MLGetOverallBuckets) WithStart(v string) func(*MLGetOverallBucketsRequest) { +func (f MLGetOverallBuckets) WithStart(v interface{}) func(*MLGetOverallBucketsRequest) { return func(r *MLGetOverallBucketsRequest) { r.Start = v } diff --git a/esapi/api.xpack.ml.get_records.go b/esapi/api.xpack.ml.get_records.go index 63ae6e1506..dd227dbc68 100644 --- a/esapi/api.xpack.ml.get_records.go +++ b/esapi/api.xpack.ml.get_records.go @@ -45,9 +45,9 @@ func newMLGetRecordsFunc(t Transport) MLGetRecords { // ----- API Definition ------------------------------------------------------- -// MLGetRecords - Retrieves anomaly records for an anomaly detection job. +// MLGetRecords - Get anomaly records for an anomaly detection job // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-records. type MLGetRecords func(job_id string, o ...func(*MLGetRecordsRequest)) (*Response, error) // MLGetRecordsRequest configures the ML Get Records API request. @@ -57,13 +57,13 @@ type MLGetRecordsRequest struct { JobID string Desc *bool - End string + End interface{} ExcludeInterim *bool From *int RecordScore interface{} Size *int Sort string - Start string + Start interface{} Pretty bool Human bool @@ -118,8 +118,8 @@ func (r MLGetRecordsRequest) Do(providedCtx context.Context, transport Transport params["desc"] = strconv.FormatBool(*r.Desc) } - if r.End != "" { - params["end"] = r.End + if r.End != nil { + params["end"] = fmt.Sprintf("%v", r.End) } if r.ExcludeInterim != nil { @@ -142,8 +142,8 @@ func (r MLGetRecordsRequest) Do(providedCtx context.Context, transport Transport params["sort"] = r.Sort } - if r.Start != "" { - params["start"] = r.Start + if r.Start != nil { + params["start"] = fmt.Sprintf("%v", r.Start) } if r.Pretty { @@ -246,7 +246,7 @@ func (f MLGetRecords) WithDesc(v bool) func(*MLGetRecordsRequest) { } // WithEnd - end time filter for records. -func (f MLGetRecords) WithEnd(v string) func(*MLGetRecordsRequest) { +func (f MLGetRecords) WithEnd(v interface{}) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.End = v } @@ -288,7 +288,7 @@ func (f MLGetRecords) WithSort(v string) func(*MLGetRecordsRequest) { } // WithStart - start time filter for records. -func (f MLGetRecords) WithStart(v string) func(*MLGetRecordsRequest) { +func (f MLGetRecords) WithStart(v interface{}) func(*MLGetRecordsRequest) { return func(r *MLGetRecordsRequest) { r.Start = v } diff --git a/esapi/api.xpack.ml.get_trained_models.go b/esapi/api.xpack.ml.get_trained_models.go index 47a354ed4f..014c1f3d26 100644 --- a/esapi/api.xpack.ml.get_trained_models.go +++ b/esapi/api.xpack.ml.get_trained_models.go @@ -43,9 +43,9 @@ func newMLGetTrainedModelsFunc(t Transport) MLGetTrainedModels { // ----- API Definition ------------------------------------------------------- -// MLGetTrainedModels - Retrieves configuration information for a trained inference model. +// MLGetTrainedModels - Get trained model configuration info // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-trained-models. type MLGetTrainedModels func(o ...func(*MLGetTrainedModelsRequest)) (*Response, error) // MLGetTrainedModelsRequest configures the ML Get Trained Models API request. @@ -248,7 +248,7 @@ func (f MLGetTrainedModels) WithFrom(v int) func(*MLGetTrainedModelsRequest) { } } -// WithInclude - a comma-separate list of fields to optionally include. valid options are 'definition' and 'total_feature_importance'. default is none.. +// WithInclude - a comma delimited string of optional fields to include in the responsebody.. func (f MLGetTrainedModels) WithInclude(v string) func(*MLGetTrainedModelsRequest) { return func(r *MLGetTrainedModelsRequest) { r.Include = v diff --git a/esapi/api.xpack.ml.get_trained_models_stats.go b/esapi/api.xpack.ml.get_trained_models_stats.go index 345150efbc..18d6abdbe2 100644 --- a/esapi/api.xpack.ml.get_trained_models_stats.go +++ b/esapi/api.xpack.ml.get_trained_models_stats.go @@ -43,9 +43,9 @@ func newMLGetTrainedModelsStatsFunc(t Transport) MLGetTrainedModelsStats { // ----- API Definition ------------------------------------------------------- -// MLGetTrainedModelsStats - Retrieves usage information for trained inference models. +// MLGetTrainedModelsStats - Get trained models usage info // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-trained-models-stats. type MLGetTrainedModelsStats func(o ...func(*MLGetTrainedModelsStatsRequest)) (*Response, error) // MLGetTrainedModelsStatsRequest configures the ML Get Trained Models Stats API request. diff --git a/esapi/api.xpack.ml.infer_trained_model.go b/esapi/api.xpack.ml.infer_trained_model.go index 1eea98fa5c..a55e9b43be 100644 --- a/esapi/api.xpack.ml.infer_trained_model.go +++ b/esapi/api.xpack.ml.infer_trained_model.go @@ -44,9 +44,9 @@ func newMLInferTrainedModelFunc(t Transport) MLInferTrainedModel { // ----- API Definition ------------------------------------------------------- -// MLInferTrainedModel - Evaluate a trained model. +// MLInferTrainedModel - Evaluate a trained model // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-trained-model.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-infer-trained-model. type MLInferTrainedModel func(body io.Reader, model_id string, o ...func(*MLInferTrainedModelRequest)) (*Response, error) // MLInferTrainedModelRequest configures the ML Infer Trained Model API request. diff --git a/esapi/api.xpack.ml.info.go b/esapi/api.xpack.ml.info.go index 34dd4eed0c..d9695a7154 100644 --- a/esapi/api.xpack.ml.info.go +++ b/esapi/api.xpack.ml.info.go @@ -42,9 +42,9 @@ func newMLInfoFunc(t Transport) MLInfo { // ----- API Definition ------------------------------------------------------- -// MLInfo - Returns defaults and limits used by machine learning. +// MLInfo - Get machine learning information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-info.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-info. type MLInfo func(o ...func(*MLInfoRequest)) (*Response, error) // MLInfoRequest configures the ML Info API request. diff --git a/esapi/api.xpack.ml.open_job.go b/esapi/api.xpack.ml.open_job.go index b26b2c5fee..ddc05d7899 100644 --- a/esapi/api.xpack.ml.open_job.go +++ b/esapi/api.xpack.ml.open_job.go @@ -43,9 +43,9 @@ func newMLOpenJobFunc(t Transport) MLOpenJob { // ----- API Definition ------------------------------------------------------- -// MLOpenJob - Opens one or more anomaly detection jobs. +// MLOpenJob - Open anomaly detection jobs // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-open-job. type MLOpenJob func(job_id string, o ...func(*MLOpenJobRequest)) (*Response, error) // MLOpenJobRequest configures the ML Open Job API request. diff --git a/esapi/api.xpack.ml.post_calendar_events.go b/esapi/api.xpack.ml.post_calendar_events.go index 62ee608a2c..7318d916ff 100644 --- a/esapi/api.xpack.ml.post_calendar_events.go +++ b/esapi/api.xpack.ml.post_calendar_events.go @@ -43,9 +43,9 @@ func newMLPostCalendarEventsFunc(t Transport) MLPostCalendarEvents { // ----- API Definition ------------------------------------------------------- -// MLPostCalendarEvents - Posts scheduled events in a calendar. +// MLPostCalendarEvents - Add scheduled events to the calendar // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-event.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-post-calendar-events. type MLPostCalendarEvents func(calendar_id string, body io.Reader, o ...func(*MLPostCalendarEventsRequest)) (*Response, error) // MLPostCalendarEventsRequest configures the ML Post Calendar Events API request. diff --git a/esapi/api.xpack.ml.post_data.go b/esapi/api.xpack.ml.post_data.go index 84ebfbb6e1..f132573933 100644 --- a/esapi/api.xpack.ml.post_data.go +++ b/esapi/api.xpack.ml.post_data.go @@ -21,6 +21,7 @@ package esapi import ( "context" + "fmt" "io" "net/http" "strings" @@ -43,9 +44,9 @@ func newMLPostDataFunc(t Transport) MLPostData { // ----- API Definition ------------------------------------------------------- -// MLPostData - Sends data to an anomaly detection job for analysis. +// MLPostData - Send data to an anomaly detection job for analysis // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-post-data. type MLPostData func(job_id string, body io.Reader, o ...func(*MLPostDataRequest)) (*Response, error) // MLPostDataRequest configures the ML Post Data API request. @@ -54,8 +55,8 @@ type MLPostDataRequest struct { JobID string - ResetEnd string - ResetStart string + ResetEnd interface{} + ResetStart interface{} Pretty bool Human bool @@ -104,12 +105,12 @@ func (r MLPostDataRequest) Do(providedCtx context.Context, transport Transport) params = make(map[string]string) - if r.ResetEnd != "" { - params["reset_end"] = r.ResetEnd + if r.ResetEnd != nil { + params["reset_end"] = fmt.Sprintf("%v", r.ResetEnd) } - if r.ResetStart != "" { - params["reset_start"] = r.ResetStart + if r.ResetStart != nil { + params["reset_start"] = fmt.Sprintf("%v", r.ResetStart) } if r.Pretty { @@ -198,14 +199,14 @@ func (f MLPostData) WithContext(v context.Context) func(*MLPostDataRequest) { } // WithResetEnd - optional parameter to specify the end of the bucket resetting range. -func (f MLPostData) WithResetEnd(v string) func(*MLPostDataRequest) { +func (f MLPostData) WithResetEnd(v interface{}) 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) { +func (f MLPostData) WithResetStart(v interface{}) func(*MLPostDataRequest) { return func(r *MLPostDataRequest) { r.ResetStart = v } diff --git a/esapi/api.xpack.ml.preview_data_frame_analytics.go b/esapi/api.xpack.ml.preview_data_frame_analytics.go index 4d7a6467ad..1275ec652b 100644 --- a/esapi/api.xpack.ml.preview_data_frame_analytics.go +++ b/esapi/api.xpack.ml.preview_data_frame_analytics.go @@ -43,9 +43,9 @@ func newMLPreviewDataFrameAnalyticsFunc(t Transport) MLPreviewDataFrameAnalytics // ----- API Definition ------------------------------------------------------- -// MLPreviewDataFrameAnalytics - Previews that will be analyzed given a data frame analytics config. +// MLPreviewDataFrameAnalytics - Preview features used by data frame analytics // -// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/current/preview-dfanalytics.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-preview-data-frame-analytics. type MLPreviewDataFrameAnalytics func(o ...func(*MLPreviewDataFrameAnalyticsRequest)) (*Response, error) // MLPreviewDataFrameAnalyticsRequest configures the ML Preview Data Frame Analytics API request. diff --git a/esapi/api.xpack.ml.preview_datafeed.go b/esapi/api.xpack.ml.preview_datafeed.go index bf02350d78..15996ca6e0 100644 --- a/esapi/api.xpack.ml.preview_datafeed.go +++ b/esapi/api.xpack.ml.preview_datafeed.go @@ -21,6 +21,7 @@ package esapi import ( "context" + "fmt" "io" "net/http" "strings" @@ -43,9 +44,9 @@ func newMLPreviewDatafeedFunc(t Transport) MLPreviewDatafeed { // ----- API Definition ------------------------------------------------------- -// MLPreviewDatafeed - Previews a datafeed. +// MLPreviewDatafeed - Preview a datafeed // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-preview-datafeed. type MLPreviewDatafeed func(o ...func(*MLPreviewDatafeedRequest)) (*Response, error) // MLPreviewDatafeedRequest configures the ML Preview Datafeed API request. @@ -54,8 +55,8 @@ type MLPreviewDatafeedRequest struct { DatafeedID string - End string - Start string + End interface{} + Start interface{} Pretty bool Human bool @@ -106,12 +107,12 @@ func (r MLPreviewDatafeedRequest) Do(providedCtx context.Context, transport Tran params = make(map[string]string) - if r.End != "" { - params["end"] = r.End + if r.End != nil { + params["end"] = fmt.Sprintf("%v", r.End) } - if r.Start != "" { - params["start"] = r.Start + if r.Start != nil { + params["start"] = fmt.Sprintf("%v", r.Start) } if r.Pretty { @@ -214,14 +215,14 @@ func (f MLPreviewDatafeed) WithDatafeedID(v string) func(*MLPreviewDatafeedReque } // WithEnd - the end time when the datafeed preview should stop. -func (f MLPreviewDatafeed) WithEnd(v string) func(*MLPreviewDatafeedRequest) { +func (f MLPreviewDatafeed) WithEnd(v interface{}) func(*MLPreviewDatafeedRequest) { return func(r *MLPreviewDatafeedRequest) { r.End = v } } // WithStart - the start time from where the datafeed preview should begin. -func (f MLPreviewDatafeed) WithStart(v string) func(*MLPreviewDatafeedRequest) { +func (f MLPreviewDatafeed) WithStart(v interface{}) func(*MLPreviewDatafeedRequest) { return func(r *MLPreviewDatafeedRequest) { r.Start = v } diff --git a/esapi/api.xpack.ml.put_calendar.go b/esapi/api.xpack.ml.put_calendar.go index 9ac0f6f56e..c41e5d976d 100644 --- a/esapi/api.xpack.ml.put_calendar.go +++ b/esapi/api.xpack.ml.put_calendar.go @@ -43,9 +43,9 @@ func newMLPutCalendarFunc(t Transport) MLPutCalendar { // ----- API Definition ------------------------------------------------------- -// MLPutCalendar - Instantiates a calendar. +// MLPutCalendar - Create a calendar // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-calendar. type MLPutCalendar func(calendar_id string, o ...func(*MLPutCalendarRequest)) (*Response, error) // MLPutCalendarRequest configures the ML Put Calendar API request. diff --git a/esapi/api.xpack.ml.put_calendar_job.go b/esapi/api.xpack.ml.put_calendar_job.go index 5f6d727584..0cdf44f818 100644 --- a/esapi/api.xpack.ml.put_calendar_job.go +++ b/esapi/api.xpack.ml.put_calendar_job.go @@ -42,9 +42,9 @@ func newMLPutCalendarJobFunc(t Transport) MLPutCalendarJob { // ----- API Definition ------------------------------------------------------- -// MLPutCalendarJob - Adds an anomaly detection job to a calendar. +// MLPutCalendarJob - Add anomaly detection job to calendar // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-calendar-job. type MLPutCalendarJob func(calendar_id string, job_id string, o ...func(*MLPutCalendarJobRequest)) (*Response, error) // MLPutCalendarJobRequest configures the ML Put Calendar Job API request. diff --git a/esapi/api.xpack.ml.put_data_frame_analytics.go b/esapi/api.xpack.ml.put_data_frame_analytics.go index 668e084eaa..8412c55201 100644 --- a/esapi/api.xpack.ml.put_data_frame_analytics.go +++ b/esapi/api.xpack.ml.put_data_frame_analytics.go @@ -43,9 +43,9 @@ func newMLPutDataFrameAnalyticsFunc(t Transport) MLPutDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLPutDataFrameAnalytics - Instantiates a data frame analytics job. +// MLPutDataFrameAnalytics - Create a data frame analytics job // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-data-frame-analytics. type MLPutDataFrameAnalytics func(id string, body io.Reader, o ...func(*MLPutDataFrameAnalyticsRequest)) (*Response, error) // MLPutDataFrameAnalyticsRequest configures the ML Put Data Frame Analytics API request. diff --git a/esapi/api.xpack.ml.put_datafeed.go b/esapi/api.xpack.ml.put_datafeed.go index 13b255f603..e050327463 100644 --- a/esapi/api.xpack.ml.put_datafeed.go +++ b/esapi/api.xpack.ml.put_datafeed.go @@ -44,9 +44,9 @@ func newMLPutDatafeedFunc(t Transport) MLPutDatafeed { // ----- API Definition ------------------------------------------------------- -// MLPutDatafeed - Instantiates a datafeed. +// MLPutDatafeed - Create a datafeed // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-datafeed. type MLPutDatafeed func(body io.Reader, datafeed_id string, o ...func(*MLPutDatafeedRequest)) (*Response, error) // MLPutDatafeedRequest configures the ML Put Datafeed API request. @@ -56,7 +56,7 @@ type MLPutDatafeedRequest struct { DatafeedID string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreThrottled *bool IgnoreUnavailable *bool @@ -109,8 +109,8 @@ func (r MLPutDatafeedRequest) Do(providedCtx context.Context, transport Transpor params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreThrottled != nil { @@ -214,7 +214,7 @@ func (f MLPutDatafeed) WithAllowNoIndices(v bool) func(*MLPutDatafeedRequest) { } // WithExpandWildcards - whether source index expressions should get expanded to open or closed indices (default: open). -func (f MLPutDatafeed) WithExpandWildcards(v string) func(*MLPutDatafeedRequest) { +func (f MLPutDatafeed) WithExpandWildcards(v ...string) func(*MLPutDatafeedRequest) { return func(r *MLPutDatafeedRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.xpack.ml.put_filter.go b/esapi/api.xpack.ml.put_filter.go index 406e2fbfde..c11552460f 100644 --- a/esapi/api.xpack.ml.put_filter.go +++ b/esapi/api.xpack.ml.put_filter.go @@ -43,9 +43,9 @@ func newMLPutFilterFunc(t Transport) MLPutFilter { // ----- API Definition ------------------------------------------------------- -// MLPutFilter - Instantiates a filter. +// MLPutFilter - Create a filter // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-filter.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-filter. type MLPutFilter func(body io.Reader, filter_id string, o ...func(*MLPutFilterRequest)) (*Response, error) // MLPutFilterRequest configures the ML Put Filter API request. diff --git a/esapi/api.xpack.ml.put_job.go b/esapi/api.xpack.ml.put_job.go index 88452e0ae7..034c6c0cdf 100644 --- a/esapi/api.xpack.ml.put_job.go +++ b/esapi/api.xpack.ml.put_job.go @@ -44,9 +44,9 @@ func newMLPutJobFunc(t Transport) MLPutJob { // ----- API Definition ------------------------------------------------------- -// MLPutJob - Instantiates an anomaly detection job. +// MLPutJob - Create an anomaly detection job // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-job. type MLPutJob func(job_id string, body io.Reader, o ...func(*MLPutJobRequest)) (*Response, error) // MLPutJobRequest configures the ML Put Job API request. @@ -56,7 +56,7 @@ type MLPutJobRequest struct { JobID string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreThrottled *bool IgnoreUnavailable *bool @@ -109,8 +109,8 @@ func (r MLPutJobRequest) Do(providedCtx context.Context, transport Transport) (* params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreThrottled != nil { @@ -214,7 +214,7 @@ func (f MLPutJob) WithAllowNoIndices(v bool) func(*MLPutJobRequest) { } // WithExpandWildcards - whether source index expressions should get expanded to open or closed indices (default: open). only set if datafeed_config is provided.. -func (f MLPutJob) WithExpandWildcards(v string) func(*MLPutJobRequest) { +func (f MLPutJob) WithExpandWildcards(v ...string) func(*MLPutJobRequest) { return func(r *MLPutJobRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.xpack.ml.put_trained_model.go b/esapi/api.xpack.ml.put_trained_model.go index 4fd33e6df7..5f62f788c9 100644 --- a/esapi/api.xpack.ml.put_trained_model.go +++ b/esapi/api.xpack.ml.put_trained_model.go @@ -44,9 +44,9 @@ func newMLPutTrainedModelFunc(t Transport) MLPutTrainedModel { // ----- API Definition ------------------------------------------------------- -// MLPutTrainedModel - Creates an inference trained model. +// MLPutTrainedModel - Create a trained model // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-trained-model. type MLPutTrainedModel func(body io.Reader, model_id string, o ...func(*MLPutTrainedModelRequest)) (*Response, error) // MLPutTrainedModelRequest configures the ML Put Trained Model API request. diff --git a/esapi/api.xpack.ml.put_trained_model_alias.go b/esapi/api.xpack.ml.put_trained_model_alias.go index 6c9e588dfd..a00a8edc8d 100644 --- a/esapi/api.xpack.ml.put_trained_model_alias.go +++ b/esapi/api.xpack.ml.put_trained_model_alias.go @@ -43,9 +43,9 @@ func newMLPutTrainedModelAliasFunc(t Transport) MLPutTrainedModelAlias { // ----- API Definition ------------------------------------------------------- -// MLPutTrainedModelAlias - Creates a new model alias (or reassigns an existing one) to refer to the trained model +// MLPutTrainedModelAlias - Create or update a trained model alias // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models-aliases.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-trained-model-alias. type MLPutTrainedModelAlias func(model_alias string, model_id string, o ...func(*MLPutTrainedModelAliasRequest)) (*Response, error) // MLPutTrainedModelAliasRequest configures the ML Put Trained Model Alias API request. diff --git a/esapi/api.xpack.ml.put_trained_model_definition_part.go b/esapi/api.xpack.ml.put_trained_model_definition_part.go index 4c00133b22..0ead95f2dd 100644 --- a/esapi/api.xpack.ml.put_trained_model_definition_part.go +++ b/esapi/api.xpack.ml.put_trained_model_definition_part.go @@ -45,9 +45,9 @@ func newMLPutTrainedModelDefinitionPartFunc(t Transport) MLPutTrainedModelDefini // ----- API Definition ------------------------------------------------------- -// MLPutTrainedModelDefinitionPart - Creates part of a trained model definition +// MLPutTrainedModelDefinitionPart - Create part of a trained model definition // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-definition-part.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-trained-model-definition-part. type MLPutTrainedModelDefinitionPart func(body io.Reader, model_id string, part *int, o ...func(*MLPutTrainedModelDefinitionPartRequest)) (*Response, error) // MLPutTrainedModelDefinitionPartRequest configures the ML Put Trained Model Definition Part API request. diff --git a/esapi/api.xpack.ml.put_trained_model_vocabulary.go b/esapi/api.xpack.ml.put_trained_model_vocabulary.go index 666b935b52..f57ed45dfd 100644 --- a/esapi/api.xpack.ml.put_trained_model_vocabulary.go +++ b/esapi/api.xpack.ml.put_trained_model_vocabulary.go @@ -43,9 +43,9 @@ func newMLPutTrainedModelVocabularyFunc(t Transport) MLPutTrainedModelVocabulary // ----- API Definition ------------------------------------------------------- -// MLPutTrainedModelVocabulary - Creates a trained model vocabulary +// MLPutTrainedModelVocabulary - Create a trained model vocabulary // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-vocabulary.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-trained-model-vocabulary. type MLPutTrainedModelVocabulary func(body io.Reader, model_id string, o ...func(*MLPutTrainedModelVocabularyRequest)) (*Response, error) // MLPutTrainedModelVocabularyRequest configures the ML Put Trained Model Vocabulary API request. diff --git a/esapi/api.xpack.ml.reset_job.go b/esapi/api.xpack.ml.reset_job.go index 01fe904357..0e0fc782ad 100644 --- a/esapi/api.xpack.ml.reset_job.go +++ b/esapi/api.xpack.ml.reset_job.go @@ -43,9 +43,9 @@ func newMLResetJobFunc(t Transport) MLResetJob { // ----- API Definition ------------------------------------------------------- -// MLResetJob - Resets an existing anomaly detection job. +// MLResetJob - Reset an anomaly detection job // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-reset-job. type MLResetJob func(job_id string, o ...func(*MLResetJobRequest)) (*Response, error) // MLResetJobRequest configures the ML Reset Job API request. diff --git a/esapi/api.xpack.ml.revert_model_snapshot.go b/esapi/api.xpack.ml.revert_model_snapshot.go index 17654d6fc8..34c0e3c34d 100644 --- a/esapi/api.xpack.ml.revert_model_snapshot.go +++ b/esapi/api.xpack.ml.revert_model_snapshot.go @@ -44,9 +44,9 @@ func newMLRevertModelSnapshotFunc(t Transport) MLRevertModelSnapshot { // ----- API Definition ------------------------------------------------------- -// MLRevertModelSnapshot - Reverts to a specific snapshot. +// MLRevertModelSnapshot - Revert to a snapshot // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-revert-model-snapshot. type MLRevertModelSnapshot func(snapshot_id string, job_id string, o ...func(*MLRevertModelSnapshotRequest)) (*Response, error) // MLRevertModelSnapshotRequest configures the ML Revert Model Snapshot API request. diff --git a/esapi/api.xpack.ml.set_upgrade_mode.go b/esapi/api.xpack.ml.set_upgrade_mode.go index cc1b3626ab..6e31ddf56f 100644 --- a/esapi/api.xpack.ml.set_upgrade_mode.go +++ b/esapi/api.xpack.ml.set_upgrade_mode.go @@ -44,9 +44,9 @@ func newMLSetUpgradeModeFunc(t Transport) MLSetUpgradeMode { // ----- API Definition ------------------------------------------------------- -// MLSetUpgradeMode - Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. +// MLSetUpgradeMode - Set upgrade_mode for ML indices // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-set-upgrade-mode. type MLSetUpgradeMode func(o ...func(*MLSetUpgradeModeRequest)) (*Response, error) // MLSetUpgradeModeRequest configures the ML Set Upgrade Mode API request. diff --git a/esapi/api.xpack.ml.start_data_frame_analytics.go b/esapi/api.xpack.ml.start_data_frame_analytics.go index af981c5149..b40b03d234 100644 --- a/esapi/api.xpack.ml.start_data_frame_analytics.go +++ b/esapi/api.xpack.ml.start_data_frame_analytics.go @@ -44,9 +44,9 @@ func newMLStartDataFrameAnalyticsFunc(t Transport) MLStartDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLStartDataFrameAnalytics - Starts a data frame analytics job. +// MLStartDataFrameAnalytics - Start a data frame analytics job // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-start-data-frame-analytics. type MLStartDataFrameAnalytics func(id string, o ...func(*MLStartDataFrameAnalyticsRequest)) (*Response, error) // MLStartDataFrameAnalyticsRequest configures the ML Start Data Frame Analytics API request. diff --git a/esapi/api.xpack.ml.start_datafeed.go b/esapi/api.xpack.ml.start_datafeed.go index d4ecbfc82a..c8b580e88b 100644 --- a/esapi/api.xpack.ml.start_datafeed.go +++ b/esapi/api.xpack.ml.start_datafeed.go @@ -21,6 +21,7 @@ package esapi import ( "context" + "fmt" "io" "net/http" "strings" @@ -44,9 +45,9 @@ func newMLStartDatafeedFunc(t Transport) MLStartDatafeed { // ----- API Definition ------------------------------------------------------- -// MLStartDatafeed - Starts one or more datafeeds. +// MLStartDatafeed - Start datafeeds // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-start-datafeed. type MLStartDatafeed func(datafeed_id string, o ...func(*MLStartDatafeedRequest)) (*Response, error) // MLStartDatafeedRequest configures the ML Start Datafeed API request. @@ -55,8 +56,8 @@ type MLStartDatafeedRequest struct { DatafeedID string - End string - Start string + End interface{} + Start interface{} Timeout time.Duration Pretty bool @@ -106,12 +107,12 @@ func (r MLStartDatafeedRequest) Do(providedCtx context.Context, transport Transp params = make(map[string]string) - if r.End != "" { - params["end"] = r.End + if r.End != nil { + params["end"] = fmt.Sprintf("%v", r.End) } - if r.Start != "" { - params["start"] = r.Start + if r.Start != nil { + params["start"] = fmt.Sprintf("%v", r.Start) } if r.Timeout != 0 { @@ -211,14 +212,14 @@ func (f MLStartDatafeed) WithBody(v io.Reader) func(*MLStartDatafeedRequest) { } // 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) { +func (f MLStartDatafeed) WithEnd(v interface{}) 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) { +func (f MLStartDatafeed) WithStart(v interface{}) func(*MLStartDatafeedRequest) { return func(r *MLStartDatafeedRequest) { r.Start = v } diff --git a/esapi/api.xpack.ml.start_trained_model_deployment.go b/esapi/api.xpack.ml.start_trained_model_deployment.go index 707a9a3b96..1f4a12c9f3 100644 --- a/esapi/api.xpack.ml.start_trained_model_deployment.go +++ b/esapi/api.xpack.ml.start_trained_model_deployment.go @@ -45,9 +45,9 @@ func newMLStartTrainedModelDeploymentFunc(t Transport) MLStartTrainedModelDeploy // ----- API Definition ------------------------------------------------------- -// MLStartTrainedModelDeployment - Start a trained model deployment. +// MLStartTrainedModelDeployment - Start a trained model deployment // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trained-model-deployment.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-start-trained-model-deployment. type MLStartTrainedModelDeployment func(model_id string, o ...func(*MLStartTrainedModelDeploymentRequest)) (*Response, error) // MLStartTrainedModelDeploymentRequest configures the ML Start Trained Model Deployment API request. @@ -287,7 +287,7 @@ func (f MLStartTrainedModelDeployment) WithTimeout(v time.Duration) func(*MLStar } } -// WithWaitFor - the allocation status for which to wait. +// WithWaitFor - specifies the allocation status to wait for before returning.. func (f MLStartTrainedModelDeployment) WithWaitFor(v string) func(*MLStartTrainedModelDeploymentRequest) { return func(r *MLStartTrainedModelDeploymentRequest) { r.WaitFor = v diff --git a/esapi/api.xpack.ml.stop_data_frame_analytics.go b/esapi/api.xpack.ml.stop_data_frame_analytics.go index 6e70b0f88b..819967fee8 100644 --- a/esapi/api.xpack.ml.stop_data_frame_analytics.go +++ b/esapi/api.xpack.ml.stop_data_frame_analytics.go @@ -45,9 +45,9 @@ func newMLStopDataFrameAnalyticsFunc(t Transport) MLStopDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLStopDataFrameAnalytics - Stops one or more data frame analytics jobs. +// MLStopDataFrameAnalytics - Stop data frame analytics jobs // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-stop-data-frame-analytics. type MLStopDataFrameAnalytics func(id string, o ...func(*MLStopDataFrameAnalyticsRequest)) (*Response, error) // MLStopDataFrameAnalyticsRequest configures the ML Stop Data Frame Analytics API request. diff --git a/esapi/api.xpack.ml.stop_datafeed.go b/esapi/api.xpack.ml.stop_datafeed.go index 5196b700a3..1de22d021f 100644 --- a/esapi/api.xpack.ml.stop_datafeed.go +++ b/esapi/api.xpack.ml.stop_datafeed.go @@ -45,9 +45,9 @@ func newMLStopDatafeedFunc(t Transport) MLStopDatafeed { // ----- API Definition ------------------------------------------------------- -// MLStopDatafeed - Stops one or more datafeeds. +// MLStopDatafeed - Stop datafeeds // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-stop-datafeed. type MLStopDatafeed func(datafeed_id string, o ...func(*MLStopDatafeedRequest)) (*Response, error) // MLStopDatafeedRequest configures the ML Stop Datafeed API request. diff --git a/esapi/api.xpack.ml.stop_trained_model_deployment.go b/esapi/api.xpack.ml.stop_trained_model_deployment.go index baa49b0db5..d09ac073f9 100644 --- a/esapi/api.xpack.ml.stop_trained_model_deployment.go +++ b/esapi/api.xpack.ml.stop_trained_model_deployment.go @@ -44,9 +44,9 @@ func newMLStopTrainedModelDeploymentFunc(t Transport) MLStopTrainedModelDeployme // ----- API Definition ------------------------------------------------------- -// MLStopTrainedModelDeployment - Stop a trained model deployment. +// MLStopTrainedModelDeployment - Stop a trained model deployment // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-trained-model-deployment.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-stop-trained-model-deployment. type MLStopTrainedModelDeployment func(model_id string, o ...func(*MLStopTrainedModelDeploymentRequest)) (*Response, error) // MLStopTrainedModelDeploymentRequest configures the ML Stop Trained Model Deployment API request. diff --git a/esapi/api.xpack.ml.update_data_frame_analytics.go b/esapi/api.xpack.ml.update_data_frame_analytics.go index c03806ce99..4db0b5d8f7 100644 --- a/esapi/api.xpack.ml.update_data_frame_analytics.go +++ b/esapi/api.xpack.ml.update_data_frame_analytics.go @@ -43,9 +43,9 @@ func newMLUpdateDataFrameAnalyticsFunc(t Transport) MLUpdateDataFrameAnalytics { // ----- API Definition ------------------------------------------------------- -// MLUpdateDataFrameAnalytics - Updates certain properties of a data frame analytics job. +// MLUpdateDataFrameAnalytics - Update a data frame analytics job // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/update-dfanalytics.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-data-frame-analytics. type MLUpdateDataFrameAnalytics func(id string, body io.Reader, o ...func(*MLUpdateDataFrameAnalyticsRequest)) (*Response, error) // MLUpdateDataFrameAnalyticsRequest configures the ML Update Data Frame Analytics API request. diff --git a/esapi/api.xpack.ml.update_datafeed.go b/esapi/api.xpack.ml.update_datafeed.go index 5c6b7b5d81..af4e0b8921 100644 --- a/esapi/api.xpack.ml.update_datafeed.go +++ b/esapi/api.xpack.ml.update_datafeed.go @@ -44,9 +44,9 @@ func newMLUpdateDatafeedFunc(t Transport) MLUpdateDatafeed { // ----- API Definition ------------------------------------------------------- -// MLUpdateDatafeed - Updates certain properties of a datafeed. +// MLUpdateDatafeed - Update a datafeed // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-datafeed. type MLUpdateDatafeed func(body io.Reader, datafeed_id string, o ...func(*MLUpdateDatafeedRequest)) (*Response, error) // MLUpdateDatafeedRequest configures the ML Update Datafeed API request. @@ -56,7 +56,7 @@ type MLUpdateDatafeedRequest struct { DatafeedID string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreThrottled *bool IgnoreUnavailable *bool @@ -111,8 +111,8 @@ func (r MLUpdateDatafeedRequest) Do(providedCtx context.Context, transport Trans params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreThrottled != nil { @@ -216,7 +216,7 @@ func (f MLUpdateDatafeed) WithAllowNoIndices(v bool) func(*MLUpdateDatafeedReque } // WithExpandWildcards - whether source index expressions should get expanded to open or closed indices (default: open). -func (f MLUpdateDatafeed) WithExpandWildcards(v string) func(*MLUpdateDatafeedRequest) { +func (f MLUpdateDatafeed) WithExpandWildcards(v ...string) func(*MLUpdateDatafeedRequest) { return func(r *MLUpdateDatafeedRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.xpack.ml.update_filter.go b/esapi/api.xpack.ml.update_filter.go index 9c0974d0fb..764f9bad0a 100644 --- a/esapi/api.xpack.ml.update_filter.go +++ b/esapi/api.xpack.ml.update_filter.go @@ -43,9 +43,9 @@ func newMLUpdateFilterFunc(t Transport) MLUpdateFilter { // ----- API Definition ------------------------------------------------------- -// MLUpdateFilter - Updates the description of a filter, adds items, or removes items. +// MLUpdateFilter - Update a filter // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-filter.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-filter. type MLUpdateFilter func(body io.Reader, filter_id string, o ...func(*MLUpdateFilterRequest)) (*Response, error) // MLUpdateFilterRequest configures the ML Update Filter API request. diff --git a/esapi/api.xpack.ml.update_job.go b/esapi/api.xpack.ml.update_job.go index 4aaad15ff2..db39dc6534 100644 --- a/esapi/api.xpack.ml.update_job.go +++ b/esapi/api.xpack.ml.update_job.go @@ -43,9 +43,9 @@ func newMLUpdateJobFunc(t Transport) MLUpdateJob { // ----- API Definition ------------------------------------------------------- -// MLUpdateJob - Updates certain properties of an anomaly detection job. +// MLUpdateJob - Update an anomaly detection job // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-job. type MLUpdateJob func(job_id string, body io.Reader, o ...func(*MLUpdateJobRequest)) (*Response, error) // MLUpdateJobRequest configures the ML Update Job API request. diff --git a/esapi/api.xpack.ml.update_model_snapshot.go b/esapi/api.xpack.ml.update_model_snapshot.go index 6fc4f29c18..77ca2e2d1f 100644 --- a/esapi/api.xpack.ml.update_model_snapshot.go +++ b/esapi/api.xpack.ml.update_model_snapshot.go @@ -43,9 +43,9 @@ func newMLUpdateModelSnapshotFunc(t Transport) MLUpdateModelSnapshot { // ----- API Definition ------------------------------------------------------- -// MLUpdateModelSnapshot - Updates certain properties of a snapshot. +// MLUpdateModelSnapshot - Update a snapshot // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-model-snapshot. 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. diff --git a/esapi/api.xpack.ml.update_trained_model_deployment.go b/esapi/api.xpack.ml.update_trained_model_deployment.go index af0ec102b3..46fa88558c 100644 --- a/esapi/api.xpack.ml.update_trained_model_deployment.go +++ b/esapi/api.xpack.ml.update_trained_model_deployment.go @@ -44,9 +44,9 @@ func newMLUpdateTrainedModelDeploymentFunc(t Transport) MLUpdateTrainedModelDepl // ----- API Definition ------------------------------------------------------- -// MLUpdateTrainedModelDeployment - Updates certain properties of trained model deployment. +// MLUpdateTrainedModelDeployment - Update a trained model deployment // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/update-trained-model-deployment.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-trained-model-deployment. type MLUpdateTrainedModelDeployment func(model_id string, o ...func(*MLUpdateTrainedModelDeploymentRequest)) (*Response, error) // MLUpdateTrainedModelDeploymentRequest configures the ML Update Trained Model Deployment API request. diff --git a/esapi/api.xpack.ml.upgrade_job_snapshot.go b/esapi/api.xpack.ml.upgrade_job_snapshot.go index d7e4b91e73..bbf839274d 100644 --- a/esapi/api.xpack.ml.upgrade_job_snapshot.go +++ b/esapi/api.xpack.ml.upgrade_job_snapshot.go @@ -44,9 +44,9 @@ func newMLUpgradeJobSnapshotFunc(t Transport) MLUpgradeJobSnapshot { // ----- API Definition ------------------------------------------------------- -// MLUpgradeJobSnapshot - Upgrades a given job snapshot to the current major version. +// MLUpgradeJobSnapshot - Upgrade a snapshot // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-upgrade-job-model-snapshot.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-upgrade-job-snapshot. type MLUpgradeJobSnapshot func(snapshot_id string, job_id string, o ...func(*MLUpgradeJobSnapshotRequest)) (*Response, error) // MLUpgradeJobSnapshotRequest configures the ML Upgrade Job Snapshot API request. diff --git a/esapi/api.xpack.ml.validate.go b/esapi/api.xpack.ml.validate.go index 1b65cbdd7c..8d274b207b 100644 --- a/esapi/api.xpack.ml.validate.go +++ b/esapi/api.xpack.ml.validate.go @@ -43,7 +43,7 @@ func newMLValidateFunc(t Transport) MLValidate { // ----- API Definition ------------------------------------------------------- -// MLValidate - Validates an anomaly detection job. +// MLValidate - Validate an anomaly detection job // // See full documentation at https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html. type MLValidate func(body io.Reader, o ...func(*MLValidateRequest)) (*Response, error) diff --git a/esapi/api.xpack.ml.validate_detector.go b/esapi/api.xpack.ml.validate_detector.go index 8d3d403dc3..6d996d4402 100644 --- a/esapi/api.xpack.ml.validate_detector.go +++ b/esapi/api.xpack.ml.validate_detector.go @@ -43,9 +43,7 @@ func newMLValidateDetectorFunc(t Transport) MLValidateDetector { // ----- API Definition ------------------------------------------------------- -// MLValidateDetector - Validates an anomaly detection detector. -// -// See full documentation at https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html. +// MLValidateDetector - Validate an anomaly detection job type MLValidateDetector func(body io.Reader, o ...func(*MLValidateDetectorRequest)) (*Response, error) // MLValidateDetectorRequest configures the ML Validate Detector API request. diff --git a/esapi/api.xpack.monitoring.bulk.go b/esapi/api.xpack.monitoring.bulk.go index bca1492423..7992d86e18 100644 --- a/esapi/api.xpack.monitoring.bulk.go +++ b/esapi/api.xpack.monitoring.bulk.go @@ -43,17 +43,15 @@ func newMonitoringBulkFunc(t Transport) MonitoringBulk { // ----- API Definition ------------------------------------------------------- -// MonitoringBulk - Used by the monitoring features to send monitoring data. +// MonitoringBulk - Send monitoring data // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/monitor-elasticsearch-cluster.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch. type MonitoringBulk func(body io.Reader, o ...func(*MonitoringBulkRequest)) (*Response, error) // MonitoringBulkRequest configures the Monitoring Bulk API request. type MonitoringBulkRequest struct { Body io.Reader - DocumentType string - Interval string SystemAPIVersion string SystemID string @@ -89,19 +87,9 @@ func (r MonitoringBulkRequest) Do(providedCtx context.Context, transport Transpo method = "POST" - path.Grow(7 + 1 + len("_monitoring") + 1 + len(r.DocumentType) + 1 + len("bulk")) + path.Grow(7 + len("/_monitoring/bulk")) path.WriteString("http://") - path.WriteString("/") - path.WriteString("_monitoring") - if r.DocumentType != "" { - path.WriteString("/") - path.WriteString(r.DocumentType) - if instrument, ok := r.Instrument.(Instrumentation); ok { - instrument.RecordPathPart(ctx, "type", r.DocumentType) - } - } - path.WriteString("/") - path.WriteString("bulk") + path.WriteString("/_monitoring/bulk") params = make(map[string]string) @@ -202,13 +190,6 @@ func (f MonitoringBulk) WithContext(v context.Context) func(*MonitoringBulkReque } } -// 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) { diff --git a/esapi/api.xpack.open_point_in_time.go b/esapi/api.xpack.open_point_in_time.go index 83179b9e1f..33b34bc4d9 100644 --- a/esapi/api.xpack.open_point_in_time.go +++ b/esapi/api.xpack.open_point_in_time.go @@ -45,9 +45,9 @@ func newOpenPointInTimeFunc(t Transport) OpenPointInTime { // ----- API Definition ------------------------------------------------------- -// OpenPointInTime - Open a point in time that can be used in subsequent searches +// OpenPointInTime - Open a point in time // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-open-point-in-time. type OpenPointInTime func(index []string, keep_alive string, o ...func(*OpenPointInTimeRequest)) (*Response, error) // OpenPointInTimeRequest configures the Open Point In Time API request. @@ -57,12 +57,12 @@ type OpenPointInTimeRequest struct { Body io.Reader AllowPartialSearchResults *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool KeepAlive string MaxConcurrentShardRequests *int Preference string - Routing string + Routing []string Pretty bool Human bool @@ -115,8 +115,8 @@ func (r OpenPointInTimeRequest) Do(providedCtx context.Context, transport Transp params["allow_partial_search_results"] = strconv.FormatBool(*r.AllowPartialSearchResults) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -135,8 +135,8 @@ func (r OpenPointInTimeRequest) Do(providedCtx context.Context, transport Transp params["preference"] = r.Preference } - if r.Routing != "" { - params["routing"] = r.Routing + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") } if r.Pretty { @@ -239,7 +239,7 @@ func (f OpenPointInTime) WithAllowPartialSearchResults(v bool) func(*OpenPointIn } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f OpenPointInTime) WithExpandWildcards(v string) func(*OpenPointInTimeRequest) { +func (f OpenPointInTime) WithExpandWildcards(v ...string) func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { r.ExpandWildcards = v } @@ -274,7 +274,7 @@ func (f OpenPointInTime) WithPreference(v string) func(*OpenPointInTimeRequest) } // WithRouting - specific routing value. -func (f OpenPointInTime) WithRouting(v string) func(*OpenPointInTimeRequest) { +func (f OpenPointInTime) WithRouting(v ...string) func(*OpenPointInTimeRequest) { return func(r *OpenPointInTimeRequest) { r.Routing = v } diff --git a/esapi/api.xpack.profiling.flamegraph.go b/esapi/api.xpack.profiling.flamegraph.go index 7a350e8193..26827f2af6 100644 --- a/esapi/api.xpack.profiling.flamegraph.go +++ b/esapi/api.xpack.profiling.flamegraph.go @@ -43,7 +43,7 @@ func newProfilingFlamegraphFunc(t Transport) ProfilingFlamegraph { // ----- API Definition ------------------------------------------------------- -// ProfilingFlamegraph - Extracts a UI-optimized structure to render flamegraphs from Universal Profiling. +// ProfilingFlamegraph - Extracts a UI-optimized structure to render flamegraphs from Universal Profiling // // See full documentation at https://www.elastic.co/guide/en/observability/current/universal-profiling.html. type ProfilingFlamegraph func(body io.Reader, o ...func(*ProfilingFlamegraphRequest)) (*Response, error) diff --git a/esapi/api.xpack.rollup.delete_job.go b/esapi/api.xpack.rollup.delete_job.go index d1335eb910..039a916c46 100644 --- a/esapi/api.xpack.rollup.delete_job.go +++ b/esapi/api.xpack.rollup.delete_job.go @@ -42,11 +42,11 @@ func newRollupDeleteJobFunc(t Transport) RollupDeleteJob { // ----- API Definition ------------------------------------------------------- -// RollupDeleteJob - Deletes an existing rollup job. +// RollupDeleteJob - Delete a rollup job // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-delete-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-delete-job. type RollupDeleteJob func(id string, o ...func(*RollupDeleteJobRequest)) (*Response, error) // RollupDeleteJobRequest configures the Rollup Delete Job API request. diff --git a/esapi/api.xpack.rollup.get_jobs.go b/esapi/api.xpack.rollup.get_jobs.go index f55b3a3144..6c1ac21b00 100644 --- a/esapi/api.xpack.rollup.get_jobs.go +++ b/esapi/api.xpack.rollup.get_jobs.go @@ -42,11 +42,11 @@ func newRollupGetJobsFunc(t Transport) RollupGetJobs { // ----- API Definition ------------------------------------------------------- -// RollupGetJobs - Retrieves the configuration, stats, and status of rollup jobs. +// RollupGetJobs - Get rollup job information // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-get-jobs. type RollupGetJobs func(o ...func(*RollupGetJobsRequest)) (*Response, error) // RollupGetJobsRequest configures the Rollup Get Jobs API request. diff --git a/esapi/api.xpack.rollup.get_rollup_caps.go b/esapi/api.xpack.rollup.get_rollup_caps.go index 1073bcb593..72d8efe1de 100644 --- a/esapi/api.xpack.rollup.get_rollup_caps.go +++ b/esapi/api.xpack.rollup.get_rollup_caps.go @@ -42,11 +42,11 @@ func newRollupGetRollupCapsFunc(t Transport) RollupGetRollupCaps { // ----- API Definition ------------------------------------------------------- -// RollupGetRollupCaps - Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. +// RollupGetRollupCaps - Get the rollup job capabilities // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-caps.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-get-rollup-caps. type RollupGetRollupCaps func(o ...func(*RollupGetRollupCapsRequest)) (*Response, error) // RollupGetRollupCapsRequest configures the Rollup Get Rollup Caps API request. diff --git a/esapi/api.xpack.rollup.get_rollup_index_caps.go b/esapi/api.xpack.rollup.get_rollup_index_caps.go index 084dffc26d..0bb656ff01 100644 --- a/esapi/api.xpack.rollup.get_rollup_index_caps.go +++ b/esapi/api.xpack.rollup.get_rollup_index_caps.go @@ -42,11 +42,11 @@ func newRollupGetRollupIndexCapsFunc(t Transport) RollupGetRollupIndexCaps { // ----- API Definition ------------------------------------------------------- -// RollupGetRollupIndexCaps - Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). +// RollupGetRollupIndexCaps - Get the rollup index capabilities // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-index-caps.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-get-rollup-index-caps. type RollupGetRollupIndexCaps func(index string, o ...func(*RollupGetRollupIndexCapsRequest)) (*Response, error) // RollupGetRollupIndexCapsRequest configures the Rollup Get Rollup Index Caps API request. diff --git a/esapi/api.xpack.rollup.put_job.go b/esapi/api.xpack.rollup.put_job.go index 32a8419b29..1228ff0985 100644 --- a/esapi/api.xpack.rollup.put_job.go +++ b/esapi/api.xpack.rollup.put_job.go @@ -43,11 +43,11 @@ func newRollupPutJobFunc(t Transport) RollupPutJob { // ----- API Definition ------------------------------------------------------- -// RollupPutJob - Creates a rollup job. +// RollupPutJob - Create a rollup job // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-put-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-put-job. type RollupPutJob func(id string, body io.Reader, o ...func(*RollupPutJobRequest)) (*Response, error) // RollupPutJobRequest configures the Rollup Put Job API request. diff --git a/esapi/api.xpack.rollup.rollup_search.go b/esapi/api.xpack.rollup.rollup_search.go index 94b407dff4..95aa1bd239 100644 --- a/esapi/api.xpack.rollup.rollup_search.go +++ b/esapi/api.xpack.rollup.rollup_search.go @@ -45,11 +45,11 @@ func newRollupRollupSearchFunc(t Transport) RollupRollupSearch { // ----- API Definition ------------------------------------------------------- -// RollupRollupSearch - Enables searching rolled-up data using the standard query DSL. +// RollupRollupSearch - Search rolled-up data // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-search.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-rollup-search. type RollupRollupSearch func(index []string, body io.Reader, o ...func(*RollupRollupSearchRequest)) (*Response, error) // RollupRollupSearchRequest configures the Rollup Rollup Search API request. diff --git a/esapi/api.xpack.rollup.start_job.go b/esapi/api.xpack.rollup.start_job.go index a657c45b3f..6c2ea6401a 100644 --- a/esapi/api.xpack.rollup.start_job.go +++ b/esapi/api.xpack.rollup.start_job.go @@ -42,11 +42,11 @@ func newRollupStartJobFunc(t Transport) RollupStartJob { // ----- API Definition ------------------------------------------------------- -// RollupStartJob - Starts an existing, stopped rollup job. +// RollupStartJob - Start rollup jobs // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-start-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-start-job. type RollupStartJob func(id string, o ...func(*RollupStartJobRequest)) (*Response, error) // RollupStartJobRequest configures the Rollup Start Job API request. diff --git a/esapi/api.xpack.rollup.stop_job.go b/esapi/api.xpack.rollup.stop_job.go index bc107e0293..7879a603cd 100644 --- a/esapi/api.xpack.rollup.stop_job.go +++ b/esapi/api.xpack.rollup.stop_job.go @@ -44,11 +44,11 @@ func newRollupStopJobFunc(t Transport) RollupStopJob { // ----- API Definition ------------------------------------------------------- -// RollupStopJob - Stops an existing, started rollup job. +// RollupStopJob - Stop rollup jobs // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-stop-job.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-stop-job. type RollupStopJob func(id string, o ...func(*RollupStopJobRequest)) (*Response, error) // RollupStopJobRequest configures the Rollup Stop Job API request. diff --git a/esapi/api.xpack.searchable_snapshots.cache_stats.go b/esapi/api.xpack.searchable_snapshots.cache_stats.go index d0fa1cb141..088562e852 100644 --- a/esapi/api.xpack.searchable_snapshots.cache_stats.go +++ b/esapi/api.xpack.searchable_snapshots.cache_stats.go @@ -42,11 +42,11 @@ func newSearchableSnapshotsCacheStatsFunc(t Transport) SearchableSnapshotsCacheS // ----- API Definition ------------------------------------------------------- -// SearchableSnapshotsCacheStats - Retrieve node-level cache statistics about searchable snapshots. +// SearchableSnapshotsCacheStats - Get cache statistics // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-cache-stats. type SearchableSnapshotsCacheStats func(o ...func(*SearchableSnapshotsCacheStatsRequest)) (*Response, error) // SearchableSnapshotsCacheStatsRequest configures the Searchable Snapshots Cache Stats API request. diff --git a/esapi/api.xpack.searchable_snapshots.clear_cache.go b/esapi/api.xpack.searchable_snapshots.clear_cache.go index 6e59b486c0..bbe9f68fb6 100644 --- a/esapi/api.xpack.searchable_snapshots.clear_cache.go +++ b/esapi/api.xpack.searchable_snapshots.clear_cache.go @@ -47,7 +47,7 @@ func newSearchableSnapshotsClearCacheFunc(t Transport) SearchableSnapshotsClearC // // This API is experimental. // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-clear-cache. type SearchableSnapshotsClearCache func(o ...func(*SearchableSnapshotsClearCacheRequest)) (*Response, error) // SearchableSnapshotsClearCacheRequest configures the Searchable Snapshots Clear Cache API request. @@ -55,7 +55,7 @@ type SearchableSnapshotsClearCacheRequest struct { Index []string AllowNoIndices *bool - ExpandWildcards string + ExpandWildcards []string IgnoreUnavailable *bool Pretty bool @@ -111,8 +111,8 @@ func (r SearchableSnapshotsClearCacheRequest) Do(providedCtx context.Context, tr params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) } - if r.ExpandWildcards != "" { - params["expand_wildcards"] = r.ExpandWildcards + if len(r.ExpandWildcards) > 0 { + params["expand_wildcards"] = strings.Join(r.ExpandWildcards, ",") } if r.IgnoreUnavailable != nil { @@ -197,7 +197,7 @@ func (f SearchableSnapshotsClearCache) WithContext(v context.Context) func(*Sear } } -// WithIndex - a list of index names. +// WithIndex - clear the cache. func (f SearchableSnapshotsClearCache) WithIndex(v ...string) func(*SearchableSnapshotsClearCacheRequest) { return func(r *SearchableSnapshotsClearCacheRequest) { r.Index = v @@ -212,7 +212,7 @@ func (f SearchableSnapshotsClearCache) WithAllowNoIndices(v bool) func(*Searchab } // WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both.. -func (f SearchableSnapshotsClearCache) WithExpandWildcards(v string) func(*SearchableSnapshotsClearCacheRequest) { +func (f SearchableSnapshotsClearCache) WithExpandWildcards(v ...string) func(*SearchableSnapshotsClearCacheRequest) { return func(r *SearchableSnapshotsClearCacheRequest) { r.ExpandWildcards = v } diff --git a/esapi/api.xpack.searchable_snapshots.mount.go b/esapi/api.xpack.searchable_snapshots.mount.go index 632266beae..d9ae7254af 100644 --- a/esapi/api.xpack.searchable_snapshots.mount.go +++ b/esapi/api.xpack.searchable_snapshots.mount.go @@ -45,9 +45,9 @@ func newSearchableSnapshotsMountFunc(t Transport) SearchableSnapshotsMount { // ----- API Definition ------------------------------------------------------- -// SearchableSnapshotsMount - Mount a snapshot as a searchable index. +// SearchableSnapshotsMount - Mount a snapshot // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-mount-snapshot.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-mount. type SearchableSnapshotsMount func(repository string, snapshot string, body io.Reader, o ...func(*SearchableSnapshotsMountRequest)) (*Response, error) // SearchableSnapshotsMountRequest configures the Searchable Snapshots Mount API request. diff --git a/esapi/api.xpack.searchable_snapshots.stats.go b/esapi/api.xpack.searchable_snapshots.stats.go index 34a942ce68..a731344cfa 100644 --- a/esapi/api.xpack.searchable_snapshots.stats.go +++ b/esapi/api.xpack.searchable_snapshots.stats.go @@ -42,9 +42,9 @@ func newSearchableSnapshotsStatsFunc(t Transport) SearchableSnapshotsStats { // ----- API Definition ------------------------------------------------------- -// SearchableSnapshotsStats - Retrieve shard-level statistics about searchable snapshots. +// SearchableSnapshotsStats - Get searchable snapshot statistics // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-stats. type SearchableSnapshotsStats func(o ...func(*SearchableSnapshotsStatsRequest)) (*Response, error) // SearchableSnapshotsStatsRequest configures the Searchable Snapshots Stats API request. diff --git a/esapi/api.xpack.security.activate_user_profile.go b/esapi/api.xpack.security.activate_user_profile.go index f8c1ebf30b..0e0c2bdb00 100644 --- a/esapi/api.xpack.security.activate_user_profile.go +++ b/esapi/api.xpack.security.activate_user_profile.go @@ -43,9 +43,9 @@ func newSecurityActivateUserProfileFunc(t Transport) SecurityActivateUserProfile // ----- API Definition ------------------------------------------------------- -// SecurityActivateUserProfile - Creates or updates the user profile on behalf of another user. +// SecurityActivateUserProfile - Activate a user profile // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-activate-user-profile. type SecurityActivateUserProfile func(body io.Reader, o ...func(*SecurityActivateUserProfileRequest)) (*Response, error) // SecurityActivateUserProfileRequest configures the Security Activate User Profile API request. diff --git a/esapi/api.xpack.security.authenticate.go b/esapi/api.xpack.security.authenticate.go index 72bba6b8a4..d212deebc6 100644 --- a/esapi/api.xpack.security.authenticate.go +++ b/esapi/api.xpack.security.authenticate.go @@ -42,9 +42,9 @@ func newSecurityAuthenticateFunc(t Transport) SecurityAuthenticate { // ----- API Definition ------------------------------------------------------- -// SecurityAuthenticate - Enables authentication as a user and retrieve information about the authenticated user. +// SecurityAuthenticate - Authenticate a user // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-authenticate. type SecurityAuthenticate func(o ...func(*SecurityAuthenticateRequest)) (*Response, error) // SecurityAuthenticateRequest configures the Security Authenticate API request. diff --git a/esapi/api.xpack.security.bulk_delete_role.go b/esapi/api.xpack.security.bulk_delete_role.go index ff15c95e96..97e5c99a5d 100644 --- a/esapi/api.xpack.security.bulk_delete_role.go +++ b/esapi/api.xpack.security.bulk_delete_role.go @@ -43,9 +43,9 @@ func newSecurityBulkDeleteRoleFunc(t Transport) SecurityBulkDeleteRole { // ----- API Definition ------------------------------------------------------- -// SecurityBulkDeleteRole - Bulk delete roles in the native realm. +// SecurityBulkDeleteRole - Bulk delete roles // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-delete-role.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-bulk-delete-role. type SecurityBulkDeleteRole func(body io.Reader, o ...func(*SecurityBulkDeleteRoleRequest)) (*Response, error) // SecurityBulkDeleteRoleRequest configures the Security Bulk Delete Role API request. diff --git a/esapi/api.xpack.security.bulk_put_role.go b/esapi/api.xpack.security.bulk_put_role.go index f20c2d6b1d..e4dd8c82dd 100644 --- a/esapi/api.xpack.security.bulk_put_role.go +++ b/esapi/api.xpack.security.bulk_put_role.go @@ -43,9 +43,9 @@ func newSecurityBulkPutRoleFunc(t Transport) SecurityBulkPutRole { // ----- API Definition ------------------------------------------------------- -// SecurityBulkPutRole - Bulk adds and updates roles in the native realm. +// SecurityBulkPutRole - Bulk create or update roles // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-bulk-put-role. type SecurityBulkPutRole func(body io.Reader, o ...func(*SecurityBulkPutRoleRequest)) (*Response, error) // SecurityBulkPutRoleRequest configures the Security Bulk Put Role API request. diff --git a/esapi/api.xpack.security.bulk_update_api_keys.go b/esapi/api.xpack.security.bulk_update_api_keys.go index b9666a7281..3749e3aa97 100644 --- a/esapi/api.xpack.security.bulk_update_api_keys.go +++ b/esapi/api.xpack.security.bulk_update_api_keys.go @@ -43,9 +43,9 @@ func newSecurityBulkUpdateAPIKeysFunc(t Transport) SecurityBulkUpdateAPIKeys { // ----- API Definition ------------------------------------------------------- -// SecurityBulkUpdateAPIKeys - Updates the attributes of multiple existing API keys. +// SecurityBulkUpdateAPIKeys - Bulk update API keys // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-update-api-keys.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-bulk-update-api-keys. type SecurityBulkUpdateAPIKeys func(body io.Reader, o ...func(*SecurityBulkUpdateAPIKeysRequest)) (*Response, error) // SecurityBulkUpdateAPIKeysRequest configures the Security Bulk UpdateAPI Keys API request. diff --git a/esapi/api.xpack.security.change_password.go b/esapi/api.xpack.security.change_password.go index 1b71ccf93a..2f54cb4077 100644 --- a/esapi/api.xpack.security.change_password.go +++ b/esapi/api.xpack.security.change_password.go @@ -43,9 +43,9 @@ func newSecurityChangePasswordFunc(t Transport) SecurityChangePassword { // ----- API Definition ------------------------------------------------------- -// SecurityChangePassword - Changes the passwords of users in the native realm and built-in users. +// SecurityChangePassword - Change passwords // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-change-password. type SecurityChangePassword func(body io.Reader, o ...func(*SecurityChangePasswordRequest)) (*Response, error) // SecurityChangePasswordRequest configures the Security Change Password API request. diff --git a/esapi/api.xpack.security.clear_api_key_cache.go b/esapi/api.xpack.security.clear_api_key_cache.go index 6e55402360..11a977519c 100644 --- a/esapi/api.xpack.security.clear_api_key_cache.go +++ b/esapi/api.xpack.security.clear_api_key_cache.go @@ -43,9 +43,9 @@ func newSecurityClearAPIKeyCacheFunc(t Transport) SecurityClearAPIKeyCache { // ----- API Definition ------------------------------------------------------- -// SecurityClearAPIKeyCache - Clear a subset or all entries from the API key cache. +// SecurityClearAPIKeyCache - Clear the API key cache // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-api-key-cache. type SecurityClearAPIKeyCache func(ids []string, o ...func(*SecurityClearAPIKeyCacheRequest)) (*Response, error) // SecurityClearAPIKeyCacheRequest configures the Security ClearAPI Key Cache API request. diff --git a/esapi/api.xpack.security.clear_cached_privileges.go b/esapi/api.xpack.security.clear_cached_privileges.go index e9e4620af6..2a0ebef7ee 100644 --- a/esapi/api.xpack.security.clear_cached_privileges.go +++ b/esapi/api.xpack.security.clear_cached_privileges.go @@ -43,9 +43,9 @@ func newSecurityClearCachedPrivilegesFunc(t Transport) SecurityClearCachedPrivil // ----- API Definition ------------------------------------------------------- -// SecurityClearCachedPrivileges - Evicts application privileges from the native application privileges cache. +// SecurityClearCachedPrivileges - Clear the privileges cache // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-cached-privileges. type SecurityClearCachedPrivileges func(application []string, o ...func(*SecurityClearCachedPrivilegesRequest)) (*Response, error) // SecurityClearCachedPrivilegesRequest configures the Security Clear Cached Privileges API request. diff --git a/esapi/api.xpack.security.clear_cached_realms.go b/esapi/api.xpack.security.clear_cached_realms.go index b08ea21315..039ce6e672 100644 --- a/esapi/api.xpack.security.clear_cached_realms.go +++ b/esapi/api.xpack.security.clear_cached_realms.go @@ -43,9 +43,9 @@ func newSecurityClearCachedRealmsFunc(t Transport) SecurityClearCachedRealms { // ----- API Definition ------------------------------------------------------- -// SecurityClearCachedRealms - Evicts users from the user cache. Can completely clear the cache or evict specific users. +// SecurityClearCachedRealms - Clear the user cache // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-cached-realms. type SecurityClearCachedRealms func(realms []string, o ...func(*SecurityClearCachedRealmsRequest)) (*Response, error) // SecurityClearCachedRealmsRequest configures the Security Clear Cached Realms API request. diff --git a/esapi/api.xpack.security.clear_cached_roles.go b/esapi/api.xpack.security.clear_cached_roles.go index 333644ef2b..a57fa754bb 100644 --- a/esapi/api.xpack.security.clear_cached_roles.go +++ b/esapi/api.xpack.security.clear_cached_roles.go @@ -43,9 +43,9 @@ func newSecurityClearCachedRolesFunc(t Transport) SecurityClearCachedRoles { // ----- API Definition ------------------------------------------------------- -// SecurityClearCachedRoles - Evicts roles from the native role cache. +// SecurityClearCachedRoles - Clear the roles cache // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-cached-roles. type SecurityClearCachedRoles func(name []string, o ...func(*SecurityClearCachedRolesRequest)) (*Response, error) // SecurityClearCachedRolesRequest configures the Security Clear Cached Roles API request. diff --git a/esapi/api.xpack.security.clear_cached_service_tokens.go b/esapi/api.xpack.security.clear_cached_service_tokens.go index c1f12de944..45ad8a6ba9 100644 --- a/esapi/api.xpack.security.clear_cached_service_tokens.go +++ b/esapi/api.xpack.security.clear_cached_service_tokens.go @@ -43,9 +43,9 @@ func newSecurityClearCachedServiceTokensFunc(t Transport) SecurityClearCachedSer // ----- API Definition ------------------------------------------------------- -// SecurityClearCachedServiceTokens - Evicts tokens from the service account token caches. +// SecurityClearCachedServiceTokens - Clear service account token caches // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-cached-service-tokens. type SecurityClearCachedServiceTokens func(name []string, namespace string, service string, o ...func(*SecurityClearCachedServiceTokensRequest)) (*Response, error) // SecurityClearCachedServiceTokensRequest configures the Security Clear Cached Service Tokens API request. diff --git a/esapi/api.xpack.security.create_api_key.go b/esapi/api.xpack.security.create_api_key.go index 4ec392eddd..c6b9a75f32 100644 --- a/esapi/api.xpack.security.create_api_key.go +++ b/esapi/api.xpack.security.create_api_key.go @@ -43,9 +43,9 @@ func newSecurityCreateAPIKeyFunc(t Transport) SecurityCreateAPIKey { // ----- API Definition ------------------------------------------------------- -// SecurityCreateAPIKey - Creates an API key for access without requiring basic authentication. +// SecurityCreateAPIKey - Create an API key // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key. type SecurityCreateAPIKey func(body io.Reader, o ...func(*SecurityCreateAPIKeyRequest)) (*Response, error) // SecurityCreateAPIKeyRequest configures the Security CreateAPI Key API request. diff --git a/esapi/api.xpack.security.create_cross_cluster_api_key.go b/esapi/api.xpack.security.create_cross_cluster_api_key.go index e0bf480f46..473625fe7c 100644 --- a/esapi/api.xpack.security.create_cross_cluster_api_key.go +++ b/esapi/api.xpack.security.create_cross_cluster_api_key.go @@ -43,9 +43,9 @@ func newSecurityCreateCrossClusterAPIKeyFunc(t Transport) SecurityCreateCrossClu // ----- API Definition ------------------------------------------------------- -// SecurityCreateCrossClusterAPIKey - Creates a cross-cluster API key for API key based remote cluster access. +// SecurityCreateCrossClusterAPIKey - Create a cross-cluster API key // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-cross-cluster-api-key.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-cross-cluster-api-key. type SecurityCreateCrossClusterAPIKey func(body io.Reader, o ...func(*SecurityCreateCrossClusterAPIKeyRequest)) (*Response, error) // SecurityCreateCrossClusterAPIKeyRequest configures the Security Create Cross ClusterAPI Key API request. diff --git a/esapi/api.xpack.security.create_service_token.go b/esapi/api.xpack.security.create_service_token.go index b40a2fd930..13f1643171 100644 --- a/esapi/api.xpack.security.create_service_token.go +++ b/esapi/api.xpack.security.create_service_token.go @@ -42,9 +42,9 @@ func newSecurityCreateServiceTokenFunc(t Transport) SecurityCreateServiceToken { // ----- API Definition ------------------------------------------------------- -// SecurityCreateServiceToken - Creates a service account token for access without requiring basic authentication. +// SecurityCreateServiceToken - Create a service account token // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-service-token. type SecurityCreateServiceToken func(namespace string, service string, o ...func(*SecurityCreateServiceTokenRequest)) (*Response, error) // SecurityCreateServiceTokenRequest configures the Security Create Service Token API request. diff --git a/esapi/api.xpack.security.delegate_pki.go b/esapi/api.xpack.security.delegate_pki.go index 080bfdc0af..f5fc773d18 100644 --- a/esapi/api.xpack.security.delegate_pki.go +++ b/esapi/api.xpack.security.delegate_pki.go @@ -43,9 +43,9 @@ func newSecurityDelegatePkiFunc(t Transport) SecurityDelegatePki { // ----- API Definition ------------------------------------------------------- -// SecurityDelegatePki - Delegate PKI authentication. +// SecurityDelegatePki - Delegate PKI authentication // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-delegate-pki-authentication.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delegate-pki. type SecurityDelegatePki func(body io.Reader, o ...func(*SecurityDelegatePkiRequest)) (*Response, error) // SecurityDelegatePkiRequest configures the Security Delegate Pki API request. diff --git a/esapi/api.xpack.security.delete_privileges.go b/esapi/api.xpack.security.delete_privileges.go index 34b51523c8..180d0b33a3 100644 --- a/esapi/api.xpack.security.delete_privileges.go +++ b/esapi/api.xpack.security.delete_privileges.go @@ -42,9 +42,9 @@ func newSecurityDeletePrivilegesFunc(t Transport) SecurityDeletePrivileges { // ----- API Definition ------------------------------------------------------- -// SecurityDeletePrivileges - Removes application privileges. +// SecurityDeletePrivileges - Delete application privileges // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-privileges. type SecurityDeletePrivileges func(name string, application string, o ...func(*SecurityDeletePrivilegesRequest)) (*Response, error) // SecurityDeletePrivilegesRequest configures the Security Delete Privileges API request. diff --git a/esapi/api.xpack.security.delete_role.go b/esapi/api.xpack.security.delete_role.go index c5a9bdeca8..61cf628434 100644 --- a/esapi/api.xpack.security.delete_role.go +++ b/esapi/api.xpack.security.delete_role.go @@ -42,9 +42,9 @@ func newSecurityDeleteRoleFunc(t Transport) SecurityDeleteRole { // ----- API Definition ------------------------------------------------------- -// SecurityDeleteRole - Removes roles in the native realm. +// SecurityDeleteRole - Delete roles // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-role. type SecurityDeleteRole func(name string, o ...func(*SecurityDeleteRoleRequest)) (*Response, error) // SecurityDeleteRoleRequest configures the Security Delete Role API request. diff --git a/esapi/api.xpack.security.delete_role_mapping.go b/esapi/api.xpack.security.delete_role_mapping.go index 13f000a93d..9a9b25267e 100644 --- a/esapi/api.xpack.security.delete_role_mapping.go +++ b/esapi/api.xpack.security.delete_role_mapping.go @@ -42,9 +42,9 @@ func newSecurityDeleteRoleMappingFunc(t Transport) SecurityDeleteRoleMapping { // ----- API Definition ------------------------------------------------------- -// SecurityDeleteRoleMapping - Removes role mappings. +// SecurityDeleteRoleMapping - Delete role mappings // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-role-mapping. type SecurityDeleteRoleMapping func(name string, o ...func(*SecurityDeleteRoleMappingRequest)) (*Response, error) // SecurityDeleteRoleMappingRequest configures the Security Delete Role Mapping API request. diff --git a/esapi/api.xpack.security.delete_service_token.go b/esapi/api.xpack.security.delete_service_token.go index b08d37d5f7..ac19309135 100644 --- a/esapi/api.xpack.security.delete_service_token.go +++ b/esapi/api.xpack.security.delete_service_token.go @@ -42,9 +42,9 @@ func newSecurityDeleteServiceTokenFunc(t Transport) SecurityDeleteServiceToken { // ----- API Definition ------------------------------------------------------- -// SecurityDeleteServiceToken - Deletes a service account token. +// SecurityDeleteServiceToken - Delete service account tokens // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-service-token. type SecurityDeleteServiceToken func(name string, namespace string, service string, o ...func(*SecurityDeleteServiceTokenRequest)) (*Response, error) // SecurityDeleteServiceTokenRequest configures the Security Delete Service Token API request. diff --git a/esapi/api.xpack.security.delete_user.go b/esapi/api.xpack.security.delete_user.go index 3b61f66618..9712fa6fbd 100644 --- a/esapi/api.xpack.security.delete_user.go +++ b/esapi/api.xpack.security.delete_user.go @@ -42,9 +42,9 @@ func newSecurityDeleteUserFunc(t Transport) SecurityDeleteUser { // ----- API Definition ------------------------------------------------------- -// SecurityDeleteUser - Deletes users from the native realm. +// SecurityDeleteUser - Delete users // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-user. type SecurityDeleteUser func(username string, o ...func(*SecurityDeleteUserRequest)) (*Response, error) // SecurityDeleteUserRequest configures the Security Delete User API request. diff --git a/esapi/api.xpack.security.disable_user.go b/esapi/api.xpack.security.disable_user.go index 27d912d5ca..b7713cb7aa 100644 --- a/esapi/api.xpack.security.disable_user.go +++ b/esapi/api.xpack.security.disable_user.go @@ -42,9 +42,9 @@ func newSecurityDisableUserFunc(t Transport) SecurityDisableUser { // ----- API Definition ------------------------------------------------------- -// SecurityDisableUser - Disables users in the native realm. +// SecurityDisableUser - Disable users // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-disable-user. type SecurityDisableUser func(username string, o ...func(*SecurityDisableUserRequest)) (*Response, error) // SecurityDisableUserRequest configures the Security Disable User API request. diff --git a/esapi/api.xpack.security.disable_user_profile.go b/esapi/api.xpack.security.disable_user_profile.go index c1c23b507f..ab01f1a1cd 100644 --- a/esapi/api.xpack.security.disable_user_profile.go +++ b/esapi/api.xpack.security.disable_user_profile.go @@ -42,9 +42,9 @@ func newSecurityDisableUserProfileFunc(t Transport) SecurityDisableUserProfile { // ----- API Definition ------------------------------------------------------- -// SecurityDisableUserProfile - Disables a user profile so it's not visible in user profile searches. +// SecurityDisableUserProfile - Disable a user profile // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-disable-user-profile. type SecurityDisableUserProfile func(uid string, o ...func(*SecurityDisableUserProfileRequest)) (*Response, error) // SecurityDisableUserProfileRequest configures the Security Disable User Profile API request. diff --git a/esapi/api.xpack.security.enable_user.go b/esapi/api.xpack.security.enable_user.go index 11052e0abe..9c3fd1f72d 100644 --- a/esapi/api.xpack.security.enable_user.go +++ b/esapi/api.xpack.security.enable_user.go @@ -42,9 +42,9 @@ func newSecurityEnableUserFunc(t Transport) SecurityEnableUser { // ----- API Definition ------------------------------------------------------- -// SecurityEnableUser - Enables users in the native realm. +// SecurityEnableUser - Enable users // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-enable-user. type SecurityEnableUser func(username string, o ...func(*SecurityEnableUserRequest)) (*Response, error) // SecurityEnableUserRequest configures the Security Enable User API request. diff --git a/esapi/api.xpack.security.enable_user_profile.go b/esapi/api.xpack.security.enable_user_profile.go index 4404987886..c11a5d07ec 100644 --- a/esapi/api.xpack.security.enable_user_profile.go +++ b/esapi/api.xpack.security.enable_user_profile.go @@ -42,9 +42,9 @@ func newSecurityEnableUserProfileFunc(t Transport) SecurityEnableUserProfile { // ----- API Definition ------------------------------------------------------- -// SecurityEnableUserProfile - Enables a user profile so it's visible in user profile searches. +// SecurityEnableUserProfile - Enable a user profile // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-enable-user-profile. type SecurityEnableUserProfile func(uid string, o ...func(*SecurityEnableUserProfileRequest)) (*Response, error) // SecurityEnableUserProfileRequest configures the Security Enable User Profile API request. diff --git a/esapi/api.xpack.security.enroll_kibana.go b/esapi/api.xpack.security.enroll_kibana.go index 06ed386d7d..ea7e907462 100644 --- a/esapi/api.xpack.security.enroll_kibana.go +++ b/esapi/api.xpack.security.enroll_kibana.go @@ -42,9 +42,9 @@ func newSecurityEnrollKibanaFunc(t Transport) SecurityEnrollKibana { // ----- API Definition ------------------------------------------------------- -// SecurityEnrollKibana - Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster. +// SecurityEnrollKibana - Enroll Kibana // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-kibana-enrollment.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-enroll-kibana. type SecurityEnrollKibana func(o ...func(*SecurityEnrollKibanaRequest)) (*Response, error) // SecurityEnrollKibanaRequest configures the Security Enroll Kibana API request. diff --git a/esapi/api.xpack.security.enroll_node.go b/esapi/api.xpack.security.enroll_node.go index e7b9951e77..60fa7ca75e 100644 --- a/esapi/api.xpack.security.enroll_node.go +++ b/esapi/api.xpack.security.enroll_node.go @@ -42,9 +42,9 @@ func newSecurityEnrollNodeFunc(t Transport) SecurityEnrollNode { // ----- API Definition ------------------------------------------------------- -// SecurityEnrollNode - Allows a new node to enroll to an existing cluster with security enabled. +// SecurityEnrollNode - Enroll a node // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-node-enrollment.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-enroll-node. type SecurityEnrollNode func(o ...func(*SecurityEnrollNodeRequest)) (*Response, error) // SecurityEnrollNodeRequest configures the Security Enroll Node API request. diff --git a/esapi/api.xpack.security.get_api_key.go b/esapi/api.xpack.security.get_api_key.go index 2617633595..e011e420cb 100644 --- a/esapi/api.xpack.security.get_api_key.go +++ b/esapi/api.xpack.security.get_api_key.go @@ -43,9 +43,9 @@ func newSecurityGetAPIKeyFunc(t Transport) SecurityGetAPIKey { // ----- API Definition ------------------------------------------------------- -// SecurityGetAPIKey - Retrieves information for one or more API keys. +// SecurityGetAPIKey - Get API key information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-api-key. type SecurityGetAPIKey func(o ...func(*SecurityGetAPIKeyRequest)) (*Response, error) // SecurityGetAPIKeyRequest configures the Security GetAPI Key API request. diff --git a/esapi/api.xpack.security.get_builtin_privileges.go b/esapi/api.xpack.security.get_builtin_privileges.go index c0a8d59cba..0402af3385 100644 --- a/esapi/api.xpack.security.get_builtin_privileges.go +++ b/esapi/api.xpack.security.get_builtin_privileges.go @@ -42,9 +42,9 @@ func newSecurityGetBuiltinPrivilegesFunc(t Transport) SecurityGetBuiltinPrivileg // ----- API Definition ------------------------------------------------------- -// SecurityGetBuiltinPrivileges - Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch. +// SecurityGetBuiltinPrivileges - Get builtin privileges // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-builtin-privileges. type SecurityGetBuiltinPrivileges func(o ...func(*SecurityGetBuiltinPrivilegesRequest)) (*Response, error) // SecurityGetBuiltinPrivilegesRequest configures the Security Get Builtin Privileges API request. diff --git a/esapi/api.xpack.security.get_privileges.go b/esapi/api.xpack.security.get_privileges.go index 2c37365242..ceeb4570bc 100644 --- a/esapi/api.xpack.security.get_privileges.go +++ b/esapi/api.xpack.security.get_privileges.go @@ -42,9 +42,9 @@ func newSecurityGetPrivilegesFunc(t Transport) SecurityGetPrivileges { // ----- API Definition ------------------------------------------------------- -// SecurityGetPrivileges - Retrieves application privileges. +// SecurityGetPrivileges - Get application privileges // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-privileges. type SecurityGetPrivileges func(o ...func(*SecurityGetPrivilegesRequest)) (*Response, error) // SecurityGetPrivilegesRequest configures the Security Get Privileges API request. diff --git a/esapi/api.xpack.security.get_role.go b/esapi/api.xpack.security.get_role.go index 6ee1b8aca6..877e04ebde 100644 --- a/esapi/api.xpack.security.get_role.go +++ b/esapi/api.xpack.security.get_role.go @@ -42,9 +42,9 @@ func newSecurityGetRoleFunc(t Transport) SecurityGetRole { // ----- API Definition ------------------------------------------------------- -// SecurityGetRole - Retrieves roles in the native realm. +// SecurityGetRole - Get roles // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-role. type SecurityGetRole func(o ...func(*SecurityGetRoleRequest)) (*Response, error) // SecurityGetRoleRequest configures the Security Get Role API request. diff --git a/esapi/api.xpack.security.get_role_mapping.go b/esapi/api.xpack.security.get_role_mapping.go index 8a01d53420..69746cd8c1 100644 --- a/esapi/api.xpack.security.get_role_mapping.go +++ b/esapi/api.xpack.security.get_role_mapping.go @@ -42,9 +42,9 @@ func newSecurityGetRoleMappingFunc(t Transport) SecurityGetRoleMapping { // ----- API Definition ------------------------------------------------------- -// SecurityGetRoleMapping - Retrieves role mappings. +// SecurityGetRoleMapping - Get role mappings // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-role-mapping. type SecurityGetRoleMapping func(o ...func(*SecurityGetRoleMappingRequest)) (*Response, error) // SecurityGetRoleMappingRequest configures the Security Get Role Mapping API request. diff --git a/esapi/api.xpack.security.get_service_accounts.go b/esapi/api.xpack.security.get_service_accounts.go index 9f71851a51..f653ecac3b 100644 --- a/esapi/api.xpack.security.get_service_accounts.go +++ b/esapi/api.xpack.security.get_service_accounts.go @@ -42,9 +42,9 @@ func newSecurityGetServiceAccountsFunc(t Transport) SecurityGetServiceAccounts { // ----- API Definition ------------------------------------------------------- -// SecurityGetServiceAccounts - Retrieves information about service accounts. +// SecurityGetServiceAccounts - Get service accounts // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-service-accounts. type SecurityGetServiceAccounts func(o ...func(*SecurityGetServiceAccountsRequest)) (*Response, error) // SecurityGetServiceAccountsRequest configures the Security Get Service Accounts API request. diff --git a/esapi/api.xpack.security.get_service_credentials.go b/esapi/api.xpack.security.get_service_credentials.go index d70b51fcf9..6fd18d5c06 100644 --- a/esapi/api.xpack.security.get_service_credentials.go +++ b/esapi/api.xpack.security.get_service_credentials.go @@ -42,9 +42,9 @@ func newSecurityGetServiceCredentialsFunc(t Transport) SecurityGetServiceCredent // ----- API Definition ------------------------------------------------------- -// SecurityGetServiceCredentials - Retrieves information of all service credentials for a service account. +// SecurityGetServiceCredentials - Get service account credentials // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-service-credentials. type SecurityGetServiceCredentials func(namespace string, service string, o ...func(*SecurityGetServiceCredentialsRequest)) (*Response, error) // SecurityGetServiceCredentialsRequest configures the Security Get Service Credentials API request. diff --git a/esapi/api.xpack.security.get_settings.go b/esapi/api.xpack.security.get_settings.go index 55ea9d06b7..97e93f5dab 100644 --- a/esapi/api.xpack.security.get_settings.go +++ b/esapi/api.xpack.security.get_settings.go @@ -43,9 +43,9 @@ func newSecurityGetSettingsFunc(t Transport) SecurityGetSettings { // ----- API Definition ------------------------------------------------------- -// SecurityGetSettings - Retrieve settings for the security system indices +// SecurityGetSettings - Get security index settings // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-settings.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-settings. type SecurityGetSettings func(o ...func(*SecurityGetSettingsRequest)) (*Response, error) // SecurityGetSettingsRequest configures the Security Get Settings API request. diff --git a/esapi/api.xpack.security.get_token.go b/esapi/api.xpack.security.get_token.go index 008f03e0de..1df2f59740 100644 --- a/esapi/api.xpack.security.get_token.go +++ b/esapi/api.xpack.security.get_token.go @@ -43,9 +43,9 @@ func newSecurityGetTokenFunc(t Transport) SecurityGetToken { // ----- API Definition ------------------------------------------------------- -// SecurityGetToken - Creates a bearer token for access without requiring basic authentication. +// SecurityGetToken - Get a token // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-token. type SecurityGetToken func(body io.Reader, o ...func(*SecurityGetTokenRequest)) (*Response, error) // SecurityGetTokenRequest configures the Security Get Token API request. diff --git a/esapi/api.xpack.security.get_user.go b/esapi/api.xpack.security.get_user.go index 24f4cdc66c..b5c5d55d7d 100644 --- a/esapi/api.xpack.security.get_user.go +++ b/esapi/api.xpack.security.get_user.go @@ -43,9 +43,9 @@ func newSecurityGetUserFunc(t Transport) SecurityGetUser { // ----- API Definition ------------------------------------------------------- -// SecurityGetUser - Retrieves information about users in the native realm and built-in users. +// SecurityGetUser - Get users // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-user. type SecurityGetUser func(o ...func(*SecurityGetUserRequest)) (*Response, error) // SecurityGetUserRequest configures the Security Get User API request. diff --git a/esapi/api.xpack.security.get_user_privileges.go b/esapi/api.xpack.security.get_user_privileges.go index 977c4002ef..8b5d33fc07 100644 --- a/esapi/api.xpack.security.get_user_privileges.go +++ b/esapi/api.xpack.security.get_user_privileges.go @@ -42,9 +42,9 @@ func newSecurityGetUserPrivilegesFunc(t Transport) SecurityGetUserPrivileges { // ----- API Definition ------------------------------------------------------- -// SecurityGetUserPrivileges - Retrieves security privileges for the logged in user. +// SecurityGetUserPrivileges - Get user privileges // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-user-privileges. type SecurityGetUserPrivileges func(o ...func(*SecurityGetUserPrivilegesRequest)) (*Response, error) // SecurityGetUserPrivilegesRequest configures the Security Get User Privileges API request. diff --git a/esapi/api.xpack.security.get_user_profile.go b/esapi/api.xpack.security.get_user_profile.go index 4074a8bc4f..52b87b453f 100644 --- a/esapi/api.xpack.security.get_user_profile.go +++ b/esapi/api.xpack.security.get_user_profile.go @@ -43,9 +43,9 @@ func newSecurityGetUserProfileFunc(t Transport) SecurityGetUserProfile { // ----- API Definition ------------------------------------------------------- -// SecurityGetUserProfile - Retrieves user profiles for the given unique ID(s). +// SecurityGetUserProfile - Get a user profile // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-user-profile. type SecurityGetUserProfile func(uid []string, o ...func(*SecurityGetUserProfileRequest)) (*Response, error) // SecurityGetUserProfileRequest configures the Security Get User Profile API request. diff --git a/esapi/api.xpack.security.grant_api_key.go b/esapi/api.xpack.security.grant_api_key.go index ccab017289..32a921ec9f 100644 --- a/esapi/api.xpack.security.grant_api_key.go +++ b/esapi/api.xpack.security.grant_api_key.go @@ -43,9 +43,9 @@ func newSecurityGrantAPIKeyFunc(t Transport) SecurityGrantAPIKey { // ----- API Definition ------------------------------------------------------- -// SecurityGrantAPIKey - Creates an API key on behalf of another user. +// SecurityGrantAPIKey - Grant an API key // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-grant-api-key. type SecurityGrantAPIKey func(body io.Reader, o ...func(*SecurityGrantAPIKeyRequest)) (*Response, error) // SecurityGrantAPIKeyRequest configures the Security GrantAPI Key API request. diff --git a/esapi/api.xpack.security.has_privileges.go b/esapi/api.xpack.security.has_privileges.go index 31c79c08ca..c7ce88e8cc 100644 --- a/esapi/api.xpack.security.has_privileges.go +++ b/esapi/api.xpack.security.has_privileges.go @@ -43,9 +43,9 @@ func newSecurityHasPrivilegesFunc(t Transport) SecurityHasPrivileges { // ----- API Definition ------------------------------------------------------- -// SecurityHasPrivileges - Determines whether the specified user has a specified list of privileges. +// SecurityHasPrivileges - Check user privileges // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-has-privileges. type SecurityHasPrivileges func(body io.Reader, o ...func(*SecurityHasPrivilegesRequest)) (*Response, error) // SecurityHasPrivilegesRequest configures the Security Has Privileges API request. diff --git a/esapi/api.xpack.security.has_privileges_user_profile.go b/esapi/api.xpack.security.has_privileges_user_profile.go index a52ca13cec..dcf2bb52d0 100644 --- a/esapi/api.xpack.security.has_privileges_user_profile.go +++ b/esapi/api.xpack.security.has_privileges_user_profile.go @@ -43,9 +43,9 @@ func newSecurityHasPrivilegesUserProfileFunc(t Transport) SecurityHasPrivilegesU // ----- API Definition ------------------------------------------------------- -// SecurityHasPrivilegesUserProfile - Determines whether the users associated with the specified profile IDs have all the requested privileges. +// SecurityHasPrivilegesUserProfile - Check user profile privileges // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-has-privileges-user-profile. type SecurityHasPrivilegesUserProfile func(body io.Reader, o ...func(*SecurityHasPrivilegesUserProfileRequest)) (*Response, error) // SecurityHasPrivilegesUserProfileRequest configures the Security Has Privileges User Profile API request. diff --git a/esapi/api.xpack.security.invalidate_api_key.go b/esapi/api.xpack.security.invalidate_api_key.go index d8604b1eaf..6a521e7aa8 100644 --- a/esapi/api.xpack.security.invalidate_api_key.go +++ b/esapi/api.xpack.security.invalidate_api_key.go @@ -43,9 +43,9 @@ func newSecurityInvalidateAPIKeyFunc(t Transport) SecurityInvalidateAPIKey { // ----- API Definition ------------------------------------------------------- -// SecurityInvalidateAPIKey - Invalidates one or more API keys. +// SecurityInvalidateAPIKey - Invalidate API keys // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-invalidate-api-key. type SecurityInvalidateAPIKey func(body io.Reader, o ...func(*SecurityInvalidateAPIKeyRequest)) (*Response, error) // SecurityInvalidateAPIKeyRequest configures the Security InvalidateAPI Key API request. diff --git a/esapi/api.xpack.security.invalidate_token.go b/esapi/api.xpack.security.invalidate_token.go index dfc62203ae..66f74bcc65 100644 --- a/esapi/api.xpack.security.invalidate_token.go +++ b/esapi/api.xpack.security.invalidate_token.go @@ -43,9 +43,9 @@ func newSecurityInvalidateTokenFunc(t Transport) SecurityInvalidateToken { // ----- API Definition ------------------------------------------------------- -// SecurityInvalidateToken - Invalidates one or more access tokens or refresh tokens. +// SecurityInvalidateToken - Invalidate a token // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-invalidate-token. type SecurityInvalidateToken func(body io.Reader, o ...func(*SecurityInvalidateTokenRequest)) (*Response, error) // SecurityInvalidateTokenRequest configures the Security Invalidate Token API request. diff --git a/esapi/api.xpack.security.oidc_authenticate.go b/esapi/api.xpack.security.oidc_authenticate.go index 8031757e1f..8046962b1b 100644 --- a/esapi/api.xpack.security.oidc_authenticate.go +++ b/esapi/api.xpack.security.oidc_authenticate.go @@ -43,9 +43,9 @@ func newSecurityOidcAuthenticateFunc(t Transport) SecurityOidcAuthenticate { // ----- API Definition ------------------------------------------------------- -// SecurityOidcAuthenticate - Exchanges an OpenID Connection authentication response message for an Elasticsearch access token and refresh token pair +// SecurityOidcAuthenticate - Authenticate OpenID Connect // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-authenticate.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-oidc-authenticate. type SecurityOidcAuthenticate func(body io.Reader, o ...func(*SecurityOidcAuthenticateRequest)) (*Response, error) // SecurityOidcAuthenticateRequest configures the Security Oidc Authenticate API request. diff --git a/esapi/api.xpack.security.oidc_logout.go b/esapi/api.xpack.security.oidc_logout.go index 7852e82dde..e4e3c60d20 100644 --- a/esapi/api.xpack.security.oidc_logout.go +++ b/esapi/api.xpack.security.oidc_logout.go @@ -43,9 +43,9 @@ func newSecurityOidcLogoutFunc(t Transport) SecurityOidcLogout { // ----- API Definition ------------------------------------------------------- -// SecurityOidcLogout - Invalidates a refresh token and access token that was generated from the OpenID Connect Authenticate API +// SecurityOidcLogout - Logout of OpenID Connect // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-logout.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-oidc-logout. type SecurityOidcLogout func(body io.Reader, o ...func(*SecurityOidcLogoutRequest)) (*Response, error) // SecurityOidcLogoutRequest configures the Security Oidc Logout API request. diff --git a/esapi/api.xpack.security.oidc_prepare_authentication.go b/esapi/api.xpack.security.oidc_prepare_authentication.go index bbb4347044..89cca15399 100644 --- a/esapi/api.xpack.security.oidc_prepare_authentication.go +++ b/esapi/api.xpack.security.oidc_prepare_authentication.go @@ -43,9 +43,9 @@ func newSecurityOidcPrepareAuthenticationFunc(t Transport) SecurityOidcPrepareAu // ----- API Definition ------------------------------------------------------- -// SecurityOidcPrepareAuthentication - Creates an OAuth 2.0 authentication request as a URL string +// SecurityOidcPrepareAuthentication - Prepare OpenID connect authentication // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-prepare-authentication.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-oidc-prepare-authentication. type SecurityOidcPrepareAuthentication func(body io.Reader, o ...func(*SecurityOidcPrepareAuthenticationRequest)) (*Response, error) // SecurityOidcPrepareAuthenticationRequest configures the Security Oidc Prepare Authentication API request. diff --git a/esapi/api.xpack.security.put_privileges.go b/esapi/api.xpack.security.put_privileges.go index 6dd0f16929..e089d4c8df 100644 --- a/esapi/api.xpack.security.put_privileges.go +++ b/esapi/api.xpack.security.put_privileges.go @@ -43,9 +43,9 @@ func newSecurityPutPrivilegesFunc(t Transport) SecurityPutPrivileges { // ----- API Definition ------------------------------------------------------- -// SecurityPutPrivileges - Adds or updates application privileges. +// SecurityPutPrivileges - Create or update application privileges // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-privileges. type SecurityPutPrivileges func(body io.Reader, o ...func(*SecurityPutPrivilegesRequest)) (*Response, error) // SecurityPutPrivilegesRequest configures the Security Put Privileges API request. diff --git a/esapi/api.xpack.security.put_role.go b/esapi/api.xpack.security.put_role.go index c1515dc4c2..81793ea31b 100644 --- a/esapi/api.xpack.security.put_role.go +++ b/esapi/api.xpack.security.put_role.go @@ -43,9 +43,9 @@ func newSecurityPutRoleFunc(t Transport) SecurityPutRole { // ----- API Definition ------------------------------------------------------- -// SecurityPutRole - Adds and updates roles in the native realm. +// SecurityPutRole - Create or update roles // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-role. type SecurityPutRole func(name string, body io.Reader, o ...func(*SecurityPutRoleRequest)) (*Response, error) // SecurityPutRoleRequest configures the Security Put Role API request. diff --git a/esapi/api.xpack.security.put_role_mapping.go b/esapi/api.xpack.security.put_role_mapping.go index ee79ec53eb..5785d39544 100644 --- a/esapi/api.xpack.security.put_role_mapping.go +++ b/esapi/api.xpack.security.put_role_mapping.go @@ -43,9 +43,9 @@ func newSecurityPutRoleMappingFunc(t Transport) SecurityPutRoleMapping { // ----- API Definition ------------------------------------------------------- -// SecurityPutRoleMapping - Creates and updates role mappings. +// SecurityPutRoleMapping - Create or update role mappings // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-role-mapping. type SecurityPutRoleMapping func(name string, body io.Reader, o ...func(*SecurityPutRoleMappingRequest)) (*Response, error) // SecurityPutRoleMappingRequest configures the Security Put Role Mapping API request. diff --git a/esapi/api.xpack.security.put_user.go b/esapi/api.xpack.security.put_user.go index 24e424e9d4..3a1b6da83c 100644 --- a/esapi/api.xpack.security.put_user.go +++ b/esapi/api.xpack.security.put_user.go @@ -43,9 +43,9 @@ func newSecurityPutUserFunc(t Transport) SecurityPutUser { // ----- API Definition ------------------------------------------------------- -// SecurityPutUser - Adds and updates users in the native realm. These users are commonly referred to as native users. +// SecurityPutUser - Create or update users // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-user. type SecurityPutUser func(username string, body io.Reader, o ...func(*SecurityPutUserRequest)) (*Response, error) // SecurityPutUserRequest configures the Security Put User API request. diff --git a/esapi/api.xpack.security.query_api_keys.go b/esapi/api.xpack.security.query_api_keys.go index 33e4b2c247..4860dfd8df 100644 --- a/esapi/api.xpack.security.query_api_keys.go +++ b/esapi/api.xpack.security.query_api_keys.go @@ -44,9 +44,9 @@ func newSecurityQueryAPIKeysFunc(t Transport) SecurityQueryAPIKeys { // ----- API Definition ------------------------------------------------------- -// SecurityQueryAPIKeys - Retrieves information for API keys using a subset of query DSL +// SecurityQueryAPIKeys - Find API keys with a query // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-query-api-keys. type SecurityQueryAPIKeys func(o ...func(*SecurityQueryAPIKeysRequest)) (*Response, error) // SecurityQueryAPIKeysRequest configures the Security QueryAPI Keys API request. diff --git a/esapi/api.xpack.security.query_role.go b/esapi/api.xpack.security.query_role.go index 965195084d..e1d5085129 100644 --- a/esapi/api.xpack.security.query_role.go +++ b/esapi/api.xpack.security.query_role.go @@ -43,9 +43,9 @@ func newSecurityQueryRoleFunc(t Transport) SecurityQueryRole { // ----- API Definition ------------------------------------------------------- -// SecurityQueryRole - Retrieves information for Roles using a subset of query DSL +// SecurityQueryRole - Find roles with a query // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-role.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-query-role. type SecurityQueryRole func(o ...func(*SecurityQueryRoleRequest)) (*Response, error) // SecurityQueryRoleRequest configures the Security Query Role API request. diff --git a/esapi/api.xpack.security.query_user.go b/esapi/api.xpack.security.query_user.go index 8f1d60a9e5..9723466f64 100644 --- a/esapi/api.xpack.security.query_user.go +++ b/esapi/api.xpack.security.query_user.go @@ -44,9 +44,9 @@ func newSecurityQueryUserFunc(t Transport) SecurityQueryUser { // ----- API Definition ------------------------------------------------------- -// SecurityQueryUser - Retrieves information for Users using a subset of query DSL +// SecurityQueryUser - Find users with a query // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-query-user. type SecurityQueryUser func(o ...func(*SecurityQueryUserRequest)) (*Response, error) // SecurityQueryUserRequest configures the Security Query User API request. diff --git a/esapi/api.xpack.security.saml_authenticate.go b/esapi/api.xpack.security.saml_authenticate.go index 0effb869ed..0051adbf97 100644 --- a/esapi/api.xpack.security.saml_authenticate.go +++ b/esapi/api.xpack.security.saml_authenticate.go @@ -43,9 +43,9 @@ func newSecuritySamlAuthenticateFunc(t Transport) SecuritySamlAuthenticate { // ----- API Definition ------------------------------------------------------- -// SecuritySamlAuthenticate - Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair +// SecuritySamlAuthenticate - Authenticate SAML // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-authenticate. type SecuritySamlAuthenticate func(body io.Reader, o ...func(*SecuritySamlAuthenticateRequest)) (*Response, error) // SecuritySamlAuthenticateRequest configures the Security Saml Authenticate API request. diff --git a/esapi/api.xpack.security.saml_complete_logout.go b/esapi/api.xpack.security.saml_complete_logout.go index 041b13f723..665cd3fd1b 100644 --- a/esapi/api.xpack.security.saml_complete_logout.go +++ b/esapi/api.xpack.security.saml_complete_logout.go @@ -43,9 +43,9 @@ func newSecuritySamlCompleteLogoutFunc(t Transport) SecuritySamlCompleteLogout { // ----- API Definition ------------------------------------------------------- -// SecuritySamlCompleteLogout - Verifies the logout response sent from the SAML IdP +// SecuritySamlCompleteLogout - Logout of SAML completely // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-complete-logout. type SecuritySamlCompleteLogout func(body io.Reader, o ...func(*SecuritySamlCompleteLogoutRequest)) (*Response, error) // SecuritySamlCompleteLogoutRequest configures the Security Saml Complete Logout API request. diff --git a/esapi/api.xpack.security.saml_invalidate.go b/esapi/api.xpack.security.saml_invalidate.go index 95db4c69fa..b03ef75bb0 100644 --- a/esapi/api.xpack.security.saml_invalidate.go +++ b/esapi/api.xpack.security.saml_invalidate.go @@ -43,9 +43,9 @@ func newSecuritySamlInvalidateFunc(t Transport) SecuritySamlInvalidate { // ----- API Definition ------------------------------------------------------- -// SecuritySamlInvalidate - Consumes a SAML LogoutRequest +// SecuritySamlInvalidate - Invalidate SAML // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-invalidate. type SecuritySamlInvalidate func(body io.Reader, o ...func(*SecuritySamlInvalidateRequest)) (*Response, error) // SecuritySamlInvalidateRequest configures the Security Saml Invalidate API request. diff --git a/esapi/api.xpack.security.saml_logout.go b/esapi/api.xpack.security.saml_logout.go index 1b3f53b4b7..c8493a054a 100644 --- a/esapi/api.xpack.security.saml_logout.go +++ b/esapi/api.xpack.security.saml_logout.go @@ -43,9 +43,9 @@ func newSecuritySamlLogoutFunc(t Transport) SecuritySamlLogout { // ----- API Definition ------------------------------------------------------- -// SecuritySamlLogout - Invalidates an access token and a refresh token that were generated via the SAML Authenticate API +// SecuritySamlLogout - Logout of SAML // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-logout. type SecuritySamlLogout func(body io.Reader, o ...func(*SecuritySamlLogoutRequest)) (*Response, error) // SecuritySamlLogoutRequest configures the Security Saml Logout API request. diff --git a/esapi/api.xpack.security.saml_prepare_authentication.go b/esapi/api.xpack.security.saml_prepare_authentication.go index 8e26921084..8ee393d2af 100644 --- a/esapi/api.xpack.security.saml_prepare_authentication.go +++ b/esapi/api.xpack.security.saml_prepare_authentication.go @@ -43,9 +43,9 @@ func newSecuritySamlPrepareAuthenticationFunc(t Transport) SecuritySamlPrepareAu // ----- API Definition ------------------------------------------------------- -// SecuritySamlPrepareAuthentication - Creates a SAML authentication request +// SecuritySamlPrepareAuthentication - Prepare SAML authentication // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-prepare-authentication. type SecuritySamlPrepareAuthentication func(body io.Reader, o ...func(*SecuritySamlPrepareAuthenticationRequest)) (*Response, error) // SecuritySamlPrepareAuthenticationRequest configures the Security Saml Prepare Authentication API request. diff --git a/esapi/api.xpack.security.saml_service_provider_metadata.go b/esapi/api.xpack.security.saml_service_provider_metadata.go index 02651c2f05..7786d37fda 100644 --- a/esapi/api.xpack.security.saml_service_provider_metadata.go +++ b/esapi/api.xpack.security.saml_service_provider_metadata.go @@ -42,9 +42,9 @@ func newSecuritySamlServiceProviderMetadataFunc(t Transport) SecuritySamlService // ----- API Definition ------------------------------------------------------- -// SecuritySamlServiceProviderMetadata - Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider +// SecuritySamlServiceProviderMetadata - Create SAML service provider metadata // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-service-provider-metadata. type SecuritySamlServiceProviderMetadata func(realm_name string, o ...func(*SecuritySamlServiceProviderMetadataRequest)) (*Response, error) // SecuritySamlServiceProviderMetadataRequest configures the Security Saml Service Provider Metadata API request. diff --git a/esapi/api.xpack.security.suggest_user_profiles.go b/esapi/api.xpack.security.suggest_user_profiles.go index b218e109a9..6926af2319 100644 --- a/esapi/api.xpack.security.suggest_user_profiles.go +++ b/esapi/api.xpack.security.suggest_user_profiles.go @@ -43,9 +43,9 @@ func newSecuritySuggestUserProfilesFunc(t Transport) SecuritySuggestUserProfiles // ----- API Definition ------------------------------------------------------- -// SecuritySuggestUserProfiles - Get suggestions for user profiles that match specified search criteria. +// SecuritySuggestUserProfiles - Suggest a user profile // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-suggest-user-profiles. type SecuritySuggestUserProfiles func(o ...func(*SecuritySuggestUserProfilesRequest)) (*Response, error) // SecuritySuggestUserProfilesRequest configures the Security Suggest User Profiles API request. diff --git a/esapi/api.xpack.security.update_api_key.go b/esapi/api.xpack.security.update_api_key.go index 7cd57113b8..672418cbd9 100644 --- a/esapi/api.xpack.security.update_api_key.go +++ b/esapi/api.xpack.security.update_api_key.go @@ -43,9 +43,9 @@ func newSecurityUpdateAPIKeyFunc(t Transport) SecurityUpdateAPIKey { // ----- API Definition ------------------------------------------------------- -// SecurityUpdateAPIKey - Updates attributes of an existing API key. +// SecurityUpdateAPIKey - Update an API key // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-update-api-key. type SecurityUpdateAPIKey func(id string, o ...func(*SecurityUpdateAPIKeyRequest)) (*Response, error) // SecurityUpdateAPIKeyRequest configures the Security UpdateAPI Key API request. diff --git a/esapi/api.xpack.security.update_cross_cluster_api_key.go b/esapi/api.xpack.security.update_cross_cluster_api_key.go index 7caeb0e42b..83fa98b93b 100644 --- a/esapi/api.xpack.security.update_cross_cluster_api_key.go +++ b/esapi/api.xpack.security.update_cross_cluster_api_key.go @@ -43,9 +43,9 @@ func newSecurityUpdateCrossClusterAPIKeyFunc(t Transport) SecurityUpdateCrossClu // ----- API Definition ------------------------------------------------------- -// SecurityUpdateCrossClusterAPIKey - Updates attributes of an existing cross-cluster API key. +// SecurityUpdateCrossClusterAPIKey - Update a cross-cluster API key // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-cross-cluster-api-key.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-update-cross-cluster-api-key. type SecurityUpdateCrossClusterAPIKey func(id string, body io.Reader, o ...func(*SecurityUpdateCrossClusterAPIKeyRequest)) (*Response, error) // SecurityUpdateCrossClusterAPIKeyRequest configures the Security Update Cross ClusterAPI Key API request. diff --git a/esapi/api.xpack.security.update_settings.go b/esapi/api.xpack.security.update_settings.go index 9dbc2fc268..9b7a1797e0 100644 --- a/esapi/api.xpack.security.update_settings.go +++ b/esapi/api.xpack.security.update_settings.go @@ -44,9 +44,9 @@ func newSecurityUpdateSettingsFunc(t Transport) SecurityUpdateSettings { // ----- API Definition ------------------------------------------------------- -// SecurityUpdateSettings - Update settings for the security system index +// SecurityUpdateSettings - Update security index settings // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-settings.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-update-settings. type SecurityUpdateSettings func(body io.Reader, o ...func(*SecurityUpdateSettingsRequest)) (*Response, error) // SecurityUpdateSettingsRequest configures the Security Update Settings API request. diff --git a/esapi/api.xpack.security.update_user_profile_data.go b/esapi/api.xpack.security.update_user_profile_data.go index 9fa90c210f..96c42da28e 100644 --- a/esapi/api.xpack.security.update_user_profile_data.go +++ b/esapi/api.xpack.security.update_user_profile_data.go @@ -44,9 +44,9 @@ func newSecurityUpdateUserProfileDataFunc(t Transport) SecurityUpdateUserProfile // ----- API Definition ------------------------------------------------------- -// SecurityUpdateUserProfileData - Update application specific data for the user profile of the given unique ID. +// SecurityUpdateUserProfileData - Update user profile data // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-update-user-profile-data. type SecurityUpdateUserProfileData func(body io.Reader, uid string, o ...func(*SecurityUpdateUserProfileDataRequest)) (*Response, error) // SecurityUpdateUserProfileDataRequest configures the Security Update User Profile Data API request. diff --git a/esapi/api.xpack.slm.delete_lifecycle.go b/esapi/api.xpack.slm.delete_lifecycle.go index d53efec9bc..4e55013bef 100644 --- a/esapi/api.xpack.slm.delete_lifecycle.go +++ b/esapi/api.xpack.slm.delete_lifecycle.go @@ -43,9 +43,9 @@ func newSlmDeleteLifecycleFunc(t Transport) SlmDeleteLifecycle { // ----- API Definition ------------------------------------------------------- -// SlmDeleteLifecycle - Deletes an existing snapshot lifecycle policy. +// SlmDeleteLifecycle - Delete a policy // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-delete-lifecycle. type SlmDeleteLifecycle func(policy_id string, o ...func(*SlmDeleteLifecycleRequest)) (*Response, error) // SlmDeleteLifecycleRequest configures the Slm Delete Lifecycle API request. diff --git a/esapi/api.xpack.slm.execute_lifecycle.go b/esapi/api.xpack.slm.execute_lifecycle.go index ce99684501..b12d24f2a9 100644 --- a/esapi/api.xpack.slm.execute_lifecycle.go +++ b/esapi/api.xpack.slm.execute_lifecycle.go @@ -43,9 +43,9 @@ func newSlmExecuteLifecycleFunc(t Transport) SlmExecuteLifecycle { // ----- API Definition ------------------------------------------------------- -// SlmExecuteLifecycle - Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. +// SlmExecuteLifecycle - Run a policy // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-execute-lifecycle. type SlmExecuteLifecycle func(policy_id string, o ...func(*SlmExecuteLifecycleRequest)) (*Response, error) // SlmExecuteLifecycleRequest configures the Slm Execute Lifecycle API request. diff --git a/esapi/api.xpack.slm.execute_retention.go b/esapi/api.xpack.slm.execute_retention.go index 753d04bbe6..50c2648ed4 100644 --- a/esapi/api.xpack.slm.execute_retention.go +++ b/esapi/api.xpack.slm.execute_retention.go @@ -43,9 +43,9 @@ func newSlmExecuteRetentionFunc(t Transport) SlmExecuteRetention { // ----- API Definition ------------------------------------------------------- -// SlmExecuteRetention - Deletes any snapshots that are expired according to the policy's retention rules. +// SlmExecuteRetention - Run a retention policy // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-execute-retention. type SlmExecuteRetention func(o ...func(*SlmExecuteRetentionRequest)) (*Response, error) // SlmExecuteRetentionRequest configures the Slm Execute Retention API request. diff --git a/esapi/api.xpack.slm.get_lifecycle.go b/esapi/api.xpack.slm.get_lifecycle.go index 1b814af6b1..f40f20a706 100644 --- a/esapi/api.xpack.slm.get_lifecycle.go +++ b/esapi/api.xpack.slm.get_lifecycle.go @@ -43,9 +43,9 @@ func newSlmGetLifecycleFunc(t Transport) SlmGetLifecycle { // ----- API Definition ------------------------------------------------------- -// SlmGetLifecycle - Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. +// SlmGetLifecycle - Get policy information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-get-lifecycle. type SlmGetLifecycle func(o ...func(*SlmGetLifecycleRequest)) (*Response, error) // SlmGetLifecycleRequest configures the Slm Get Lifecycle API request. diff --git a/esapi/api.xpack.slm.get_stats.go b/esapi/api.xpack.slm.get_stats.go index 1dcd07fc32..9a8e82fd8c 100644 --- a/esapi/api.xpack.slm.get_stats.go +++ b/esapi/api.xpack.slm.get_stats.go @@ -43,9 +43,9 @@ func newSlmGetStatsFunc(t Transport) SlmGetStats { // ----- API Definition ------------------------------------------------------- -// SlmGetStats - Returns global and policy-level statistics about actions taken by snapshot lifecycle management. +// SlmGetStats - Get snapshot lifecycle management statistics // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-get-stats. type SlmGetStats func(o ...func(*SlmGetStatsRequest)) (*Response, error) // SlmGetStatsRequest configures the Slm Get Stats API request. diff --git a/esapi/api.xpack.slm.get_status.go b/esapi/api.xpack.slm.get_status.go index 6a025ab677..e605cf9fc8 100644 --- a/esapi/api.xpack.slm.get_status.go +++ b/esapi/api.xpack.slm.get_status.go @@ -43,9 +43,9 @@ func newSlmGetStatusFunc(t Transport) SlmGetStatus { // ----- API Definition ------------------------------------------------------- -// SlmGetStatus - Retrieves the status of snapshot lifecycle management (SLM). +// SlmGetStatus - Get the snapshot lifecycle management status // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-get-status. type SlmGetStatus func(o ...func(*SlmGetStatusRequest)) (*Response, error) // SlmGetStatusRequest configures the Slm Get Status API request. diff --git a/esapi/api.xpack.slm.put_lifecycle.go b/esapi/api.xpack.slm.put_lifecycle.go index afcb90fa33..5411e3dd1e 100644 --- a/esapi/api.xpack.slm.put_lifecycle.go +++ b/esapi/api.xpack.slm.put_lifecycle.go @@ -44,9 +44,9 @@ func newSlmPutLifecycleFunc(t Transport) SlmPutLifecycle { // ----- API Definition ------------------------------------------------------- -// SlmPutLifecycle - Creates or updates a snapshot lifecycle policy. +// SlmPutLifecycle - Create or update a policy // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-put-lifecycle. type SlmPutLifecycle func(policy_id string, o ...func(*SlmPutLifecycleRequest)) (*Response, error) // SlmPutLifecycleRequest configures the Slm Put Lifecycle API request. diff --git a/esapi/api.xpack.slm.start.go b/esapi/api.xpack.slm.start.go index faf89c2adf..41eac4b6fb 100644 --- a/esapi/api.xpack.slm.start.go +++ b/esapi/api.xpack.slm.start.go @@ -43,9 +43,9 @@ func newSlmStartFunc(t Transport) SlmStart { // ----- API Definition ------------------------------------------------------- -// SlmStart - Turns on snapshot lifecycle management (SLM). +// SlmStart - Start snapshot lifecycle management // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-start. type SlmStart func(o ...func(*SlmStartRequest)) (*Response, error) // SlmStartRequest configures the Slm Start API request. diff --git a/esapi/api.xpack.slm.stop.go b/esapi/api.xpack.slm.stop.go index 4944b44cc1..5a12caa3b6 100644 --- a/esapi/api.xpack.slm.stop.go +++ b/esapi/api.xpack.slm.stop.go @@ -43,9 +43,9 @@ func newSlmStopFunc(t Transport) SlmStop { // ----- API Definition ------------------------------------------------------- -// SlmStop - Turns off snapshot lifecycle management (SLM). +// SlmStop - Stop snapshot lifecycle management // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-stop. type SlmStop func(o ...func(*SlmStopRequest)) (*Response, error) // SlmStopRequest configures the Slm Stop API request. diff --git a/esapi/api.xpack.sql.clear_cursor.go b/esapi/api.xpack.sql.clear_cursor.go index 2b9773ad7b..71ed2c9f3e 100644 --- a/esapi/api.xpack.sql.clear_cursor.go +++ b/esapi/api.xpack.sql.clear_cursor.go @@ -43,9 +43,9 @@ func newSQLClearCursorFunc(t Transport) SQLClearCursor { // ----- API Definition ------------------------------------------------------- -// SQLClearCursor - Clears the SQL cursor +// SQLClearCursor - Clear an SQL search cursor // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-sql-cursor-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-clear-cursor. type SQLClearCursor func(body io.Reader, o ...func(*SQLClearCursorRequest)) (*Response, error) // SQLClearCursorRequest configures the SQL Clear Cursor API request. diff --git a/esapi/api.xpack.sql.delete_async.go b/esapi/api.xpack.sql.delete_async.go index c91b9c4b30..b4710896de 100644 --- a/esapi/api.xpack.sql.delete_async.go +++ b/esapi/api.xpack.sql.delete_async.go @@ -42,9 +42,9 @@ func newSQLDeleteAsyncFunc(t Transport) SQLDeleteAsync { // ----- API Definition ------------------------------------------------------- -// SQLDeleteAsync - Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. +// SQLDeleteAsync - Delete an async SQL search // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-async-sql-search-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-delete-async. type SQLDeleteAsync func(id string, o ...func(*SQLDeleteAsyncRequest)) (*Response, error) // SQLDeleteAsyncRequest configures the SQL Delete Async API request. diff --git a/esapi/api.xpack.sql.get_async.go b/esapi/api.xpack.sql.get_async.go index 50e9d66da0..c93d509330 100644 --- a/esapi/api.xpack.sql.get_async.go +++ b/esapi/api.xpack.sql.get_async.go @@ -43,9 +43,9 @@ func newSQLGetAsyncFunc(t Transport) SQLGetAsync { // ----- API Definition ------------------------------------------------------- -// SQLGetAsync - Returns the current status and available results for an async SQL search or stored synchronous SQL search +// SQLGetAsync - Get async SQL search results // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-get-async. type SQLGetAsync func(id string, o ...func(*SQLGetAsyncRequest)) (*Response, error) // SQLGetAsyncRequest configures the SQL Get Async API request. diff --git a/esapi/api.xpack.sql.get_async_status.go b/esapi/api.xpack.sql.get_async_status.go index f5ff094374..105f91b6f5 100644 --- a/esapi/api.xpack.sql.get_async_status.go +++ b/esapi/api.xpack.sql.get_async_status.go @@ -42,9 +42,9 @@ func newSQLGetAsyncStatusFunc(t Transport) SQLGetAsyncStatus { // ----- API Definition ------------------------------------------------------- -// SQLGetAsyncStatus - Returns the current status of an async SQL search or a stored synchronous SQL search +// SQLGetAsyncStatus - Get the async SQL search status // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-status-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-get-async-status. type SQLGetAsyncStatus func(id string, o ...func(*SQLGetAsyncStatusRequest)) (*Response, error) // SQLGetAsyncStatusRequest configures the SQL Get Async Status API request. diff --git a/esapi/api.xpack.sql.query.go b/esapi/api.xpack.sql.query.go index e9e5a1adba..6e9f0a9c9f 100644 --- a/esapi/api.xpack.sql.query.go +++ b/esapi/api.xpack.sql.query.go @@ -43,9 +43,9 @@ func newSQLQueryFunc(t Transport) SQLQuery { // ----- API Definition ------------------------------------------------------- -// SQLQuery - Executes a SQL request +// SQLQuery - Get SQL search results // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-search-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-query. type SQLQuery func(body io.Reader, o ...func(*SQLQueryRequest)) (*Response, error) // SQLQueryRequest configures the SQL Query API request. @@ -180,7 +180,7 @@ func (f SQLQuery) WithContext(v context.Context) func(*SQLQueryRequest) { } } -// WithFormat - a short version of the accept header, e.g. json, yaml. +// WithFormat - the format for the response.you can also specify a format using the `accept` http header.if you specify both this parameter and the `accept` http header, this parameter takes precedence.. func (f SQLQuery) WithFormat(v string) func(*SQLQueryRequest) { return func(r *SQLQueryRequest) { r.Format = v diff --git a/esapi/api.xpack.sql.translate.go b/esapi/api.xpack.sql.translate.go index 6f99ed5d8f..3f2dc82a30 100644 --- a/esapi/api.xpack.sql.translate.go +++ b/esapi/api.xpack.sql.translate.go @@ -43,9 +43,9 @@ func newSQLTranslateFunc(t Transport) SQLTranslate { // ----- API Definition ------------------------------------------------------- -// SQLTranslate - Translates SQL into Elasticsearch queries +// SQLTranslate - Translate SQL into Elasticsearch queries // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-translate. type SQLTranslate func(body io.Reader, o ...func(*SQLTranslateRequest)) (*Response, error) // SQLTranslateRequest configures the SQL Translate API request. diff --git a/esapi/api.xpack.ssl.certificates.go b/esapi/api.xpack.ssl.certificates.go index 171d128356..f2c024a378 100644 --- a/esapi/api.xpack.ssl.certificates.go +++ b/esapi/api.xpack.ssl.certificates.go @@ -42,9 +42,9 @@ func newSSLCertificatesFunc(t Transport) SSLCertificates { // ----- API Definition ------------------------------------------------------- -// SSLCertificates - Retrieves information about the X.509 certificates used to encrypt communications in the cluster. +// SSLCertificates - Get SSL certificates // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ssl-certificates. type SSLCertificates func(o ...func(*SSLCertificatesRequest)) (*Response, error) // SSLCertificatesRequest configures the SSL Certificates API request. diff --git a/esapi/api.xpack.text_structure.find_field_structure.go b/esapi/api.xpack.text_structure.find_field_structure.go index 36074d6472..254e4d3d9c 100644 --- a/esapi/api.xpack.text_structure.find_field_structure.go +++ b/esapi/api.xpack.text_structure.find_field_structure.go @@ -44,9 +44,9 @@ func newTextStructureFindFieldStructureFunc(t Transport) TextStructureFindFieldS // ----- API Definition ------------------------------------------------------- -// TextStructureFindFieldStructure - Finds the structure of a text field in an index. +// TextStructureFindFieldStructure - Find the structure of a text field // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/find-field-structure.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-text_structure. type TextStructureFindFieldStructure func(index string, field string, o ...func(*TextStructureFindFieldStructureRequest)) (*Response, error) // TextStructureFindFieldStructureRequest configures the Text Structure Find Field Structure API request. @@ -258,7 +258,7 @@ func (f TextStructureFindFieldStructure) WithDocumentsToSample(v int) func(*Text } } -// WithEcsCompatibility - optional parameter to specify the compatibility mode with ecs grok patterns - may be either 'v1' or 'disabled'. +// WithEcsCompatibility - the mode of compatibility with ecs compliant grok patterns.use this parameter to specify whether to use ecs grok patterns instead of legacy ones when the structure finder creates a grok pattern.this setting primarily has an impact when a whole message grok pattern such as `%{catalinalog}` matches the input.if the structure finder identifies a common structure but has no idea of the meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output.the intention in that situation is that a user who knows the meanings will rename the fields before using them.. func (f TextStructureFindFieldStructure) WithEcsCompatibility(v string) func(*TextStructureFindFieldStructureRequest) { return func(r *TextStructureFindFieldStructureRequest) { r.EcsCompatibility = v diff --git a/esapi/api.xpack.text_structure.find_message_structure.go b/esapi/api.xpack.text_structure.find_message_structure.go index ed598d6e4c..2cbc7c3839 100644 --- a/esapi/api.xpack.text_structure.find_message_structure.go +++ b/esapi/api.xpack.text_structure.find_message_structure.go @@ -45,9 +45,9 @@ func newTextStructureFindMessageStructureFunc(t Transport) TextStructureFindMess // ----- API Definition ------------------------------------------------------- -// TextStructureFindMessageStructure - Finds the structure of a list of messages. The messages must contain data that is suitable to be ingested into Elasticsearch. +// TextStructureFindMessageStructure - Find the structure of text messages // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/find-message-structure.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-text-structure-find-message-structure. type TextStructureFindMessageStructure func(body io.Reader, o ...func(*TextStructureFindMessageStructureRequest)) (*Response, error) // TextStructureFindMessageStructureRequest configures the Text Structure Find Message Structure API request. @@ -246,7 +246,7 @@ func (f TextStructureFindMessageStructure) WithDelimiter(v string) func(*TextStr } } -// WithEcsCompatibility - optional parameter to specify the compatibility mode with ecs grok patterns - may be either 'v1' or 'disabled'. +// WithEcsCompatibility - the mode of compatibility with ecs compliant grok patterns.use this parameter to specify whether to use ecs grok patterns instead of legacy ones when the structure finder creates a grok pattern.this setting primarily has an impact when a whole message grok pattern such as `%{catalinalog}` matches the input.if the structure finder identifies a common structure but has no idea of meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output, with the intention that a user who knows the meanings rename these fields before using it.. func (f TextStructureFindMessageStructure) WithEcsCompatibility(v string) func(*TextStructureFindMessageStructureRequest) { return func(r *TextStructureFindMessageStructureRequest) { r.EcsCompatibility = v diff --git a/esapi/api.xpack.text_structure.find_structure.go b/esapi/api.xpack.text_structure.find_structure.go index 833e1b5945..3e091d52eb 100644 --- a/esapi/api.xpack.text_structure.find_structure.go +++ b/esapi/api.xpack.text_structure.find_structure.go @@ -45,9 +45,9 @@ func newTextStructureFindStructureFunc(t Transport) TextStructureFindStructure { // ----- API Definition ------------------------------------------------------- -// TextStructureFindStructure - Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. +// TextStructureFindStructure - Find the structure of a text file // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/find-structure.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-text-structure-find-structure. type TextStructureFindStructure func(body io.Reader, o ...func(*TextStructureFindStructureRequest)) (*Response, error) // TextStructureFindStructureRequest configures the Text Structure Find Structure API request. diff --git a/esapi/api.xpack.text_structure.test_grok_pattern.go b/esapi/api.xpack.text_structure.test_grok_pattern.go index ca88235663..5cd42dbf42 100644 --- a/esapi/api.xpack.text_structure.test_grok_pattern.go +++ b/esapi/api.xpack.text_structure.test_grok_pattern.go @@ -43,9 +43,9 @@ func newTextStructureTestGrokPatternFunc(t Transport) TextStructureTestGrokPatte // ----- API Definition ------------------------------------------------------- -// TextStructureTestGrokPattern - Tests a Grok pattern on some text. +// TextStructureTestGrokPattern - Test a Grok pattern // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/master/test-grok-pattern.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-text-structure-test-grok-pattern. type TextStructureTestGrokPattern func(body io.Reader, o ...func(*TextStructureTestGrokPatternRequest)) (*Response, error) // TextStructureTestGrokPatternRequest configures the Text Structure Test Grok Pattern API request. diff --git a/esapi/api.xpack.transform.delete_transform.go b/esapi/api.xpack.transform.delete_transform.go index 40abd0d885..0578c6ee5a 100644 --- a/esapi/api.xpack.transform.delete_transform.go +++ b/esapi/api.xpack.transform.delete_transform.go @@ -44,9 +44,9 @@ func newTransformDeleteTransformFunc(t Transport) TransformDeleteTransform { // ----- API Definition ------------------------------------------------------- -// TransformDeleteTransform - Deletes an existing transform. +// TransformDeleteTransform - Delete a transform // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-delete-transform. type TransformDeleteTransform func(transform_id string, o ...func(*TransformDeleteTransformRequest)) (*Response, error) // TransformDeleteTransformRequest configures the Transform Delete Transform API request. diff --git a/esapi/api.xpack.transform.get_node_stats.go b/esapi/api.xpack.transform.get_node_stats.go index 35a26d7b02..5939b9aba0 100644 --- a/esapi/api.xpack.transform.get_node_stats.go +++ b/esapi/api.xpack.transform.get_node_stats.go @@ -42,7 +42,7 @@ func newTransformGetNodeStatsFunc(t Transport) TransformGetNodeStats { // ----- API Definition ------------------------------------------------------- -// TransformGetNodeStats - Retrieves transform usage information for transform nodes. +// TransformGetNodeStats - Retrieves transform usage information for transform nodes // // See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-node-stats.html. type TransformGetNodeStats func(o ...func(*TransformGetNodeStatsRequest)) (*Response, error) diff --git a/esapi/api.xpack.transform.get_transform.go b/esapi/api.xpack.transform.get_transform.go index 1ea0008e73..8fb356d445 100644 --- a/esapi/api.xpack.transform.get_transform.go +++ b/esapi/api.xpack.transform.get_transform.go @@ -43,9 +43,9 @@ func newTransformGetTransformFunc(t Transport) TransformGetTransform { // ----- API Definition ------------------------------------------------------- -// TransformGetTransform - Retrieves configuration information for transforms. +// TransformGetTransform - Get transforms // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-transform. type TransformGetTransform func(o ...func(*TransformGetTransformRequest)) (*Response, error) // TransformGetTransformRequest configures the Transform Get Transform API request. diff --git a/esapi/api.xpack.transform.get_transform_stats.go b/esapi/api.xpack.transform.get_transform_stats.go index 90ae323110..0b66c3f58f 100644 --- a/esapi/api.xpack.transform.get_transform_stats.go +++ b/esapi/api.xpack.transform.get_transform_stats.go @@ -44,9 +44,9 @@ func newTransformGetTransformStatsFunc(t Transport) TransformGetTransformStats { // ----- API Definition ------------------------------------------------------- -// TransformGetTransformStats - Retrieves usage information for transforms. +// TransformGetTransformStats - Get transform stats // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-transform-stats. type TransformGetTransformStats func(transform_id string, o ...func(*TransformGetTransformStatsRequest)) (*Response, error) // TransformGetTransformStatsRequest configures the Transform Get Transform Stats API request. diff --git a/esapi/api.xpack.transform.preview_transform.go b/esapi/api.xpack.transform.preview_transform.go index 8e042d6ce1..350eff7f2e 100644 --- a/esapi/api.xpack.transform.preview_transform.go +++ b/esapi/api.xpack.transform.preview_transform.go @@ -44,9 +44,9 @@ func newTransformPreviewTransformFunc(t Transport) TransformPreviewTransform { // ----- API Definition ------------------------------------------------------- -// TransformPreviewTransform - Previews a transform. +// TransformPreviewTransform - Preview a transform // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-preview-transform. type TransformPreviewTransform func(o ...func(*TransformPreviewTransformRequest)) (*Response, error) // TransformPreviewTransformRequest configures the Transform Preview Transform API request. diff --git a/esapi/api.xpack.transform.put_transform.go b/esapi/api.xpack.transform.put_transform.go index 5ed94c072e..09bd184aff 100644 --- a/esapi/api.xpack.transform.put_transform.go +++ b/esapi/api.xpack.transform.put_transform.go @@ -45,9 +45,9 @@ func newTransformPutTransformFunc(t Transport) TransformPutTransform { // ----- API Definition ------------------------------------------------------- -// TransformPutTransform - Instantiates a transform. +// TransformPutTransform - Create a transform // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-put-transform. type TransformPutTransform func(body io.Reader, transform_id string, o ...func(*TransformPutTransformRequest)) (*Response, error) // TransformPutTransformRequest configures the Transform Put Transform API request. diff --git a/esapi/api.xpack.transform.reset_transform.go b/esapi/api.xpack.transform.reset_transform.go index abf2f27af3..bf5679cfe1 100644 --- a/esapi/api.xpack.transform.reset_transform.go +++ b/esapi/api.xpack.transform.reset_transform.go @@ -44,9 +44,9 @@ func newTransformResetTransformFunc(t Transport) TransformResetTransform { // ----- API Definition ------------------------------------------------------- -// TransformResetTransform - Resets an existing transform. +// TransformResetTransform - Reset a transform // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-reset-transform. type TransformResetTransform func(transform_id string, o ...func(*TransformResetTransformRequest)) (*Response, error) // TransformResetTransformRequest configures the Transform Reset Transform API request. diff --git a/esapi/api.xpack.transform.schedule_now_transform.go b/esapi/api.xpack.transform.schedule_now_transform.go index 52a384fc6b..9c76158839 100644 --- a/esapi/api.xpack.transform.schedule_now_transform.go +++ b/esapi/api.xpack.transform.schedule_now_transform.go @@ -43,9 +43,9 @@ func newTransformScheduleNowTransformFunc(t Transport) TransformScheduleNowTrans // ----- API Definition ------------------------------------------------------- -// TransformScheduleNowTransform - Schedules now a transform. +// TransformScheduleNowTransform - Schedule a transform to start now // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-schedule-now-transform. type TransformScheduleNowTransform func(transform_id string, o ...func(*TransformScheduleNowTransformRequest)) (*Response, error) // TransformScheduleNowTransformRequest configures the Transform Schedule Now Transform API request. diff --git a/esapi/api.xpack.transform.set_upgrade_mode.go b/esapi/api.xpack.transform.set_upgrade_mode.go new file mode 100644 index 0000000000..0b72dd40bf --- /dev/null +++ b/esapi/api.xpack.transform.set_upgrade_mode.go @@ -0,0 +1,242 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// Code generated from specification version 9.1.0: DO NOT EDIT + +package esapi + +import ( + "context" + "net/http" + "strconv" + "strings" + "time" +) + +func newTransformSetUpgradeModeFunc(t Transport) TransformSetUpgradeMode { + return func(o ...func(*TransformSetUpgradeModeRequest)) (*Response, error) { + var r = TransformSetUpgradeModeRequest{} + for _, f := range o { + f(&r) + } + + if transport, ok := t.(Instrumented); ok { + r.Instrument = transport.InstrumentationEnabled() + } + + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// TransformSetUpgradeMode - Set upgrade_mode for transform indices +// +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-set-upgrade-mode. +type TransformSetUpgradeMode func(o ...func(*TransformSetUpgradeModeRequest)) (*Response, error) + +// TransformSetUpgradeModeRequest configures the Transform Set Upgrade Mode API request. +type TransformSetUpgradeModeRequest struct { + Enabled *bool + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context + + Instrument Instrumentation +} + +// Do executes the request and returns response or error. +func (r TransformSetUpgradeModeRequest) Do(providedCtx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ctx context.Context + ) + + if instrument, ok := r.Instrument.(Instrumentation); ok { + ctx = instrument.Start(providedCtx, "transform.set_upgrade_mode") + defer instrument.Close(ctx) + } + if ctx == nil { + ctx = providedCtx + } + + method = "POST" + + path.Grow(7 + len("/_transform/set_upgrade_mode")) + path.WriteString("http://") + path.WriteString("/_transform/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, err := newRequest(method, path.String(), nil) + if err != nil { + if instrument, ok := r.Instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + 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) + } + + if instrument, ok := r.Instrument.(Instrumentation); ok { + instrument.BeforeRequest(req, "transform.set_upgrade_mode") + } + res, err := transport.Perform(req) + if instrument, ok := r.Instrument.(Instrumentation); ok { + instrument.AfterRequest(req, "elasticsearch", "transform.set_upgrade_mode") + } + if err != nil { + if instrument, ok := r.Instrument.(Instrumentation); ok { + instrument.RecordError(ctx, err) + } + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f TransformSetUpgradeMode) WithContext(v context.Context) func(*TransformSetUpgradeModeRequest) { + return func(r *TransformSetUpgradeModeRequest) { + r.ctx = v + } +} + +// WithEnabled - whether to enable upgrade_mode transform setting or not. defaults to false.. +func (f TransformSetUpgradeMode) WithEnabled(v bool) func(*TransformSetUpgradeModeRequest) { + return func(r *TransformSetUpgradeModeRequest) { + r.Enabled = &v + } +} + +// WithTimeout - controls the time to wait before action times out. defaults to 30 seconds. +func (f TransformSetUpgradeMode) WithTimeout(v time.Duration) func(*TransformSetUpgradeModeRequest) { + return func(r *TransformSetUpgradeModeRequest) { + r.Timeout = v + } +} + +// WithPretty makes the response body pretty-printed. +func (f TransformSetUpgradeMode) WithPretty() func(*TransformSetUpgradeModeRequest) { + return func(r *TransformSetUpgradeModeRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f TransformSetUpgradeMode) WithHuman() func(*TransformSetUpgradeModeRequest) { + return func(r *TransformSetUpgradeModeRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f TransformSetUpgradeMode) WithErrorTrace() func(*TransformSetUpgradeModeRequest) { + return func(r *TransformSetUpgradeModeRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f TransformSetUpgradeMode) WithFilterPath(v ...string) func(*TransformSetUpgradeModeRequest) { + return func(r *TransformSetUpgradeModeRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f TransformSetUpgradeMode) WithHeader(h map[string]string) func(*TransformSetUpgradeModeRequest) { + return func(r *TransformSetUpgradeModeRequest) { + 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 TransformSetUpgradeMode) WithOpaqueID(s string) func(*TransformSetUpgradeModeRequest) { + return func(r *TransformSetUpgradeModeRequest) { + 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 index deb22a6319..dbab6a7e10 100644 --- a/esapi/api.xpack.transform.start_transform.go +++ b/esapi/api.xpack.transform.start_transform.go @@ -43,9 +43,9 @@ func newTransformStartTransformFunc(t Transport) TransformStartTransform { // ----- API Definition ------------------------------------------------------- -// TransformStartTransform - Starts one or more transforms. +// TransformStartTransform - Start a transform // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-start-transform. type TransformStartTransform func(transform_id string, o ...func(*TransformStartTransformRequest)) (*Response, error) // TransformStartTransformRequest configures the Transform Start Transform API request. diff --git a/esapi/api.xpack.transform.stop_transform.go b/esapi/api.xpack.transform.stop_transform.go index 053c256e2f..fe9746a9a0 100644 --- a/esapi/api.xpack.transform.stop_transform.go +++ b/esapi/api.xpack.transform.stop_transform.go @@ -44,9 +44,9 @@ func newTransformStopTransformFunc(t Transport) TransformStopTransform { // ----- API Definition ------------------------------------------------------- -// TransformStopTransform - Stops one or more transforms. +// TransformStopTransform - Stop transforms // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-stop-transform. type TransformStopTransform func(transform_id string, o ...func(*TransformStopTransformRequest)) (*Response, error) // TransformStopTransformRequest configures the Transform Stop Transform API request. diff --git a/esapi/api.xpack.transform.update_transform.go b/esapi/api.xpack.transform.update_transform.go index 56759aa49a..7a7c24257e 100644 --- a/esapi/api.xpack.transform.update_transform.go +++ b/esapi/api.xpack.transform.update_transform.go @@ -45,9 +45,9 @@ func newTransformUpdateTransformFunc(t Transport) TransformUpdateTransform { // ----- API Definition ------------------------------------------------------- -// TransformUpdateTransform - Updates certain properties of a transform. +// TransformUpdateTransform - Update a transform // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-update-transform. type TransformUpdateTransform func(body io.Reader, transform_id string, o ...func(*TransformUpdateTransformRequest)) (*Response, error) // TransformUpdateTransformRequest configures the Transform Update Transform API request. diff --git a/esapi/api.xpack.transform.upgrade_transforms.go b/esapi/api.xpack.transform.upgrade_transforms.go index 9671188dea..112d0e26f5 100644 --- a/esapi/api.xpack.transform.upgrade_transforms.go +++ b/esapi/api.xpack.transform.upgrade_transforms.go @@ -44,9 +44,9 @@ func newTransformUpgradeTransformsFunc(t Transport) TransformUpgradeTransforms { // ----- API Definition ------------------------------------------------------- -// TransformUpgradeTransforms - Upgrades all transforms. +// TransformUpgradeTransforms - Upgrade all transforms // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-upgrade-transforms. type TransformUpgradeTransforms func(o ...func(*TransformUpgradeTransformsRequest)) (*Response, error) // TransformUpgradeTransformsRequest configures the Transform Upgrade Transforms API request. diff --git a/esapi/api.xpack.watcher.ack_watch.go b/esapi/api.xpack.watcher.ack_watch.go index 8706581738..e4d30450a2 100644 --- a/esapi/api.xpack.watcher.ack_watch.go +++ b/esapi/api.xpack.watcher.ack_watch.go @@ -42,9 +42,9 @@ func newWatcherAckWatchFunc(t Transport) WatcherAckWatch { // ----- API Definition ------------------------------------------------------- -// WatcherAckWatch - Acknowledges a watch, manually throttling the execution of the watch's actions. +// WatcherAckWatch - Acknowledge a watch // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-ack-watch. type WatcherAckWatch func(watch_id string, o ...func(*WatcherAckWatchRequest)) (*Response, error) // WatcherAckWatchRequest configures the Watcher Ack Watch API request. diff --git a/esapi/api.xpack.watcher.activate_watch.go b/esapi/api.xpack.watcher.activate_watch.go index cfd579c4a3..edeca4d0d3 100644 --- a/esapi/api.xpack.watcher.activate_watch.go +++ b/esapi/api.xpack.watcher.activate_watch.go @@ -42,9 +42,9 @@ func newWatcherActivateWatchFunc(t Transport) WatcherActivateWatch { // ----- API Definition ------------------------------------------------------- -// WatcherActivateWatch - Activates a currently inactive watch. +// WatcherActivateWatch - Activate a watch // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-activate-watch. type WatcherActivateWatch func(watch_id string, o ...func(*WatcherActivateWatchRequest)) (*Response, error) // WatcherActivateWatchRequest configures the Watcher Activate Watch API request. diff --git a/esapi/api.xpack.watcher.deactivate_watch.go b/esapi/api.xpack.watcher.deactivate_watch.go index 0d5815f0b2..87b8853a21 100644 --- a/esapi/api.xpack.watcher.deactivate_watch.go +++ b/esapi/api.xpack.watcher.deactivate_watch.go @@ -42,9 +42,9 @@ func newWatcherDeactivateWatchFunc(t Transport) WatcherDeactivateWatch { // ----- API Definition ------------------------------------------------------- -// WatcherDeactivateWatch - Deactivates a currently active watch. +// WatcherDeactivateWatch - Deactivate a watch // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-deactivate-watch. type WatcherDeactivateWatch func(watch_id string, o ...func(*WatcherDeactivateWatchRequest)) (*Response, error) // WatcherDeactivateWatchRequest configures the Watcher Deactivate Watch API request. diff --git a/esapi/api.xpack.watcher.delete_watch.go b/esapi/api.xpack.watcher.delete_watch.go index 0db20b9c5d..a05c1bf6f8 100644 --- a/esapi/api.xpack.watcher.delete_watch.go +++ b/esapi/api.xpack.watcher.delete_watch.go @@ -42,9 +42,9 @@ func newWatcherDeleteWatchFunc(t Transport) WatcherDeleteWatch { // ----- API Definition ------------------------------------------------------- -// WatcherDeleteWatch - Removes a watch from Watcher. +// WatcherDeleteWatch - Delete a watch // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-delete-watch. type WatcherDeleteWatch func(id string, o ...func(*WatcherDeleteWatchRequest)) (*Response, error) // WatcherDeleteWatchRequest configures the Watcher Delete Watch API request. diff --git a/esapi/api.xpack.watcher.execute_watch.go b/esapi/api.xpack.watcher.execute_watch.go index a2eae8108a..ad7a57024a 100644 --- a/esapi/api.xpack.watcher.execute_watch.go +++ b/esapi/api.xpack.watcher.execute_watch.go @@ -44,9 +44,9 @@ func newWatcherExecuteWatchFunc(t Transport) WatcherExecuteWatch { // ----- API Definition ------------------------------------------------------- -// WatcherExecuteWatch - Forces the execution of a stored watch. +// WatcherExecuteWatch - Run a watch // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-execute-watch. type WatcherExecuteWatch func(o ...func(*WatcherExecuteWatchRequest)) (*Response, error) // WatcherExecuteWatchRequest configures the Watcher Execute Watch API request. diff --git a/esapi/api.xpack.watcher.get_settings.go b/esapi/api.xpack.watcher.get_settings.go index 686eae58c1..c77c0b3a12 100644 --- a/esapi/api.xpack.watcher.get_settings.go +++ b/esapi/api.xpack.watcher.get_settings.go @@ -43,9 +43,9 @@ func newWatcherGetSettingsFunc(t Transport) WatcherGetSettings { // ----- API Definition ------------------------------------------------------- -// WatcherGetSettings - Retrieve settings for the watcher system index +// WatcherGetSettings - Get Watcher index settings // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-settings.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-get-settings. type WatcherGetSettings func(o ...func(*WatcherGetSettingsRequest)) (*Response, error) // WatcherGetSettingsRequest configures the Watcher Get Settings API request. diff --git a/esapi/api.xpack.watcher.get_watch.go b/esapi/api.xpack.watcher.get_watch.go index e59150398a..a8016ccb86 100644 --- a/esapi/api.xpack.watcher.get_watch.go +++ b/esapi/api.xpack.watcher.get_watch.go @@ -42,9 +42,9 @@ func newWatcherGetWatchFunc(t Transport) WatcherGetWatch { // ----- API Definition ------------------------------------------------------- -// WatcherGetWatch - Retrieves a watch by its ID. +// WatcherGetWatch - Get a watch // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-get-watch. type WatcherGetWatch func(id string, o ...func(*WatcherGetWatchRequest)) (*Response, error) // WatcherGetWatchRequest configures the Watcher Get Watch API request. diff --git a/esapi/api.xpack.watcher.put_watch.go b/esapi/api.xpack.watcher.put_watch.go index 7ba7666cef..7b63804baf 100644 --- a/esapi/api.xpack.watcher.put_watch.go +++ b/esapi/api.xpack.watcher.put_watch.go @@ -28,8 +28,8 @@ import ( ) func newWatcherPutWatchFunc(t Transport) WatcherPutWatch { - return func(id string, o ...func(*WatcherPutWatchRequest)) (*Response, error) { - var r = WatcherPutWatchRequest{WatchID: id} + return func(id string, body io.Reader, o ...func(*WatcherPutWatchRequest)) (*Response, error) { + var r = WatcherPutWatchRequest{WatchID: id, Body: body} for _, f := range o { f(&r) } @@ -44,10 +44,10 @@ func newWatcherPutWatchFunc(t Transport) WatcherPutWatch { // ----- API Definition ------------------------------------------------------- -// WatcherPutWatch - Creates a new watch, or updates an existing one. +// WatcherPutWatch - Create or update a watch // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html. -type WatcherPutWatch func(id string, o ...func(*WatcherPutWatchRequest)) (*Response, error) +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-put-watch. +type WatcherPutWatch func(id string, body io.Reader, o ...func(*WatcherPutWatchRequest)) (*Response, error) // WatcherPutWatchRequest configures the Watcher Put Watch API request. type WatcherPutWatchRequest struct { @@ -206,13 +206,6 @@ func (f WatcherPutWatch) WithContext(v context.Context) func(*WatcherPutWatchReq } } -// 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) { diff --git a/esapi/api.xpack.watcher.query_watches.go b/esapi/api.xpack.watcher.query_watches.go index dd6f59910e..7e28d16db5 100644 --- a/esapi/api.xpack.watcher.query_watches.go +++ b/esapi/api.xpack.watcher.query_watches.go @@ -43,9 +43,9 @@ func newWatcherQueryWatchesFunc(t Transport) WatcherQueryWatches { // ----- API Definition ------------------------------------------------------- -// WatcherQueryWatches - Retrieves stored watches. +// WatcherQueryWatches - Query watches // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-query-watches.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-query-watches. type WatcherQueryWatches func(o ...func(*WatcherQueryWatchesRequest)) (*Response, error) // WatcherQueryWatchesRequest configures the Watcher Query Watches API request. diff --git a/esapi/api.xpack.watcher.start.go b/esapi/api.xpack.watcher.start.go index b152c7ad95..a481bc9d90 100644 --- a/esapi/api.xpack.watcher.start.go +++ b/esapi/api.xpack.watcher.start.go @@ -43,9 +43,9 @@ func newWatcherStartFunc(t Transport) WatcherStart { // ----- API Definition ------------------------------------------------------- -// WatcherStart - Starts Watcher if it is not already running. +// WatcherStart - Start the watch service // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-start. type WatcherStart func(o ...func(*WatcherStartRequest)) (*Response, error) // WatcherStartRequest configures the Watcher Start API request. diff --git a/esapi/api.xpack.watcher.stats.go b/esapi/api.xpack.watcher.stats.go index b8ebffbb4d..adfce7a592 100644 --- a/esapi/api.xpack.watcher.stats.go +++ b/esapi/api.xpack.watcher.stats.go @@ -43,9 +43,9 @@ func newWatcherStatsFunc(t Transport) WatcherStats { // ----- API Definition ------------------------------------------------------- -// WatcherStats - Retrieves the current Watcher metrics. +// WatcherStats - Get Watcher statistics // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-stats. type WatcherStats func(o ...func(*WatcherStatsRequest)) (*Response, error) // WatcherStatsRequest configures the Watcher Stats API request. diff --git a/esapi/api.xpack.watcher.stop.go b/esapi/api.xpack.watcher.stop.go index 3d8546d4db..959f3d1cbd 100644 --- a/esapi/api.xpack.watcher.stop.go +++ b/esapi/api.xpack.watcher.stop.go @@ -43,9 +43,9 @@ func newWatcherStopFunc(t Transport) WatcherStop { // ----- API Definition ------------------------------------------------------- -// WatcherStop - Stops Watcher if it is running. +// WatcherStop - Stop the watch service // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-stop. type WatcherStop func(o ...func(*WatcherStopRequest)) (*Response, error) // WatcherStopRequest configures the Watcher Stop API request. diff --git a/esapi/api.xpack.watcher.update_settings.go b/esapi/api.xpack.watcher.update_settings.go index c706471411..0119223799 100644 --- a/esapi/api.xpack.watcher.update_settings.go +++ b/esapi/api.xpack.watcher.update_settings.go @@ -44,9 +44,9 @@ func newWatcherUpdateSettingsFunc(t Transport) WatcherUpdateSettings { // ----- API Definition ------------------------------------------------------- -// WatcherUpdateSettings - Update settings for the watcher system index +// WatcherUpdateSettings - Update Watcher index settings // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-update-settings.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-update-settings. type WatcherUpdateSettings func(body io.Reader, o ...func(*WatcherUpdateSettingsRequest)) (*Response, error) // WatcherUpdateSettingsRequest configures the Watcher Update Settings API request. diff --git a/esapi/api.xpack.xpack.info.go b/esapi/api.xpack.xpack.info.go index d88b3d5727..8dd681df3a 100644 --- a/esapi/api.xpack.xpack.info.go +++ b/esapi/api.xpack.xpack.info.go @@ -43,9 +43,9 @@ func newXPackInfoFunc(t Transport) XPackInfo { // ----- API Definition ------------------------------------------------------- -// XPackInfo - Retrieves information about the installed X-Pack features. +// XPackInfo - Get information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-info. type XPackInfo func(o ...func(*XPackInfoRequest)) (*Response, error) // XPackInfoRequest configures the X Pack Info API request. diff --git a/esapi/api.xpack.xpack.usage.go b/esapi/api.xpack.xpack.usage.go index 431f34d890..7b0dc976cb 100644 --- a/esapi/api.xpack.xpack.usage.go +++ b/esapi/api.xpack.xpack.usage.go @@ -43,9 +43,9 @@ func newXPackUsageFunc(t Transport) XPackUsage { // ----- API Definition ------------------------------------------------------- -// XPackUsage - Retrieves usage information about the installed X-Pack features. +// XPackUsage - Get usage information // -// See full documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html. +// See full documentation at https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-xpack. type XPackUsage func(o ...func(*XPackUsageRequest)) (*Response, error) // XPackUsageRequest configures the X Pack Usage API request. diff --git a/internal/build/cmd/generate/commands/genexamples/model.go b/internal/build/cmd/generate/commands/genexamples/model.go index 12fb5dcdac..0b6ddbad6e 100644 --- a/internal/build/cmd/generate/commands/genexamples/model.go +++ b/internal/build/cmd/generate/commands/genexamples/model.go @@ -30,7 +30,6 @@ func init() { } // EnabledFiles contains a list of files where documentation should be generated. -// var EnabledFiles = []string{ "aggregations/bucket/datehistogram-aggregation.asciidoc", "aggregations/bucket/filter-aggregation.asciidoc", @@ -103,7 +102,6 @@ var ( // Example represents the code example in documentation. // // See: https://github.com/elastic/built-docs/blob/master/raw/en/elasticsearch/reference/master/alternatives_report.json -// type Example struct { SourceLocation struct { File string @@ -115,7 +113,6 @@ type Example struct { } // IsEnabled returns true when the example should be processed. -// func (e Example) IsEnabled() bool { // TODO(karmi): Use "filepatch.Match()" to support glob patterns @@ -129,38 +126,32 @@ func (e Example) IsEnabled() bool { } // IsExecutable returns true when the example contains a request. -// func (e Example) IsExecutable() bool { return reHTTPMethod.MatchString(e.Source) } // IsTranslated returns true when the example can be converted to Go source code. -// func (e Example) IsTranslated() bool { return Translator{Example: e}.IsTranslated() } // ID returns example identifier. -// func (e Example) ID() string { return fmt.Sprintf("%s:%d", e.SourceLocation.File, e.SourceLocation.Line) } // Chapter returns the example chapter. -// func (e Example) Chapter() string { r := strings.NewReplacer("/", "_", "-", "_", ".asciidoc", "") return r.Replace(e.SourceLocation.File) } // GithubURL returns a link for the example source. -// func (e Example) GithubURL() string { return fmt.Sprintf("https://github.com/elastic/elasticsearch/blob/master/docs/reference/%s#L%d", e.SourceLocation.File, e.SourceLocation.Line) } // Commands returns the list of commands from source. -// func (e Example) Commands() ([]string, error) { var ( buf strings.Builder @@ -200,7 +191,6 @@ func (e Example) Commands() ([]string, error) { } // Translated returns the code translated from Console to Go. -// func (e Example) Translated() (string, error) { return Translator{Example: e}.Translate() } diff --git a/internal/build/cmd/generate/commands/genexamples/translator.go b/internal/build/cmd/generate/commands/genexamples/translator.go index 3ff2fdd220..ed8dabfe1a 100644 --- a/internal/build/cmd/generate/commands/genexamples/translator.go +++ b/internal/build/cmd/generate/commands/genexamples/translator.go @@ -82,7 +82,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString(")") @@ -115,7 +115,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString(")") @@ -148,7 +148,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString(")") @@ -182,7 +182,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString(")") @@ -227,7 +227,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString(")") @@ -267,7 +267,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString("\t)") @@ -411,7 +411,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString("\tes." + apiName + ".WithPretty(),\n") @@ -445,7 +445,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString(")") @@ -601,7 +601,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } } @@ -634,7 +634,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString(")") @@ -673,7 +673,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } } else { fmt.Fprintf(&src, "%q", matches[1]) @@ -792,7 +792,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } else { fmt.Fprintf(&src, "[]string{%q}", matches[1]) } @@ -895,7 +895,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString(")") @@ -928,7 +928,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString(")") @@ -969,7 +969,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) src.WriteString("\tes." + apiName + ".WithPretty(),\n") } @@ -1012,7 +1012,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) src.WriteString("\tes." + apiName + ".WithPretty(),\n") } @@ -1194,7 +1194,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString("\t)") @@ -1277,7 +1277,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString("\t)") @@ -1316,7 +1316,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString("\t)") @@ -1388,7 +1388,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString("\t)") @@ -1419,7 +1419,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString("\t)") @@ -1453,7 +1453,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } src.WriteString("\t)") @@ -1484,7 +1484,7 @@ var ConsoleToGo = []TranslateRule{ if err != nil { return "", fmt.Errorf("error converting params to arguments: %s", err) } - fmt.Fprintf(&src, args) + fmt.Fprint(&src, args) } else { fmt.Fprintf(&src, "[]string{%q}", matches[1]) } diff --git a/internal/build/cmd/generate/commands/gensource/command.go b/internal/build/cmd/generate/commands/gensource/command.go index 3d5c301929..fa02145147 100644 --- a/internal/build/cmd/generate/commands/gensource/command.go +++ b/internal/build/cmd/generate/commands/gensource/command.go @@ -20,13 +20,14 @@ package gensource import ( "bytes" "fmt" - "github.com/elastic/go-elasticsearch/v9/internal/build/cmd" "io" "os" "path/filepath" "strings" "time" + "github.com/elastic/go-elasticsearch/v9/internal/build/cmd" + "github.com/spf13/cobra" "github.com/elastic/go-elasticsearch/v9/internal/build/utils" @@ -220,7 +221,7 @@ func (cmd *Command) processFile(f *os.File) (err error) { if utils.IsTTY() { fmt.Fprint(os.Stderr, "\x1b[2m") } - fmt.Fprintf(os.Stderr, gen.Endpoint.DebugInfo()) + fmt.Fprint(os.Stderr, gen.Endpoint.DebugInfo()) if utils.IsTTY() { fmt.Fprint(os.Stderr, "\x1b[0m") } diff --git a/internal/build/cmd/generate/commands/gensource/debug.go b/internal/build/cmd/generate/commands/gensource/debug.go index 24f6f03f73..aec5be1a2e 100644 --- a/internal/build/cmd/generate/commands/gensource/debug.go +++ b/internal/build/cmd/generate/commands/gensource/debug.go @@ -39,7 +39,7 @@ func (e *Endpoint) DebugInfo() string { fmt.Fprintln(&out, "Paths:") for _, path := range e.URL.Paths { fmt.Fprintf(w, "%6s\t%s", path.Methods[0], path.Path) - if path.Deprecated.Version != "" { + if path.Deprecated.Version != "" && path.Deprecated.Version < EsVersion { fmt.Fprintf(w, "\t*deprecated*") } fmt.Fprintf(w, "\n") @@ -64,7 +64,7 @@ func (e *Endpoint) DebugInfo() string { if part.Default != nil { fmt.Fprintf(w, ", default: %s", part.Default) } - if part.Deprecated { + if part.Deprecated.Version != "" && part.Deprecated.Version < EsVersion { fmt.Fprint(w, ", *deprecated*") } fmt.Fprint(w, "\n") diff --git a/internal/build/cmd/generate/commands/gensource/generator.go b/internal/build/cmd/generate/commands/gensource/generator.go index f7cc1d9c5f..32e6e35005 100644 --- a/internal/build/cmd/generate/commands/gensource/generator.go +++ b/internal/build/cmd/generate/commands/gensource/generator.go @@ -243,7 +243,7 @@ type ` + g.Endpoint.MethodWithNamespace() + `Request struct {`) } } // Skip type only for selected APIs at this point - if p.Name == "type" && p.Deprecated { + if p.Name == "type" && p.Deprecated.Version != "" && p.Deprecated.Version < EsVersion { if g.Endpoint.Name == "bulk" || g.Endpoint.Name == "create" || g.Endpoint.Name == "delete" || @@ -660,7 +660,7 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(providedCtx context. pathContent.WriteString(`if instrument, ok := r.Instrument.(Instrumentation); ok { instrument.RecordPathPart(ctx, "` + a.Name + `", strconv.Itoa(*r.` + p + `)) }` + "\n") - case "string": + case "string", "enum": pathGrow.WriteString(`len(r.` + p + `) + `) pathContent.WriteString(` path.WriteString(r.` + p + `)` + "\n") pathContent.WriteString(`if instrument, ok := r.Instrument.(Instrumentation); ok { @@ -695,7 +695,7 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(providedCtx context. p = a.GoName() switch a.Type { - case "string": + case "string", "enum": pathGrow.WriteString(`1 + len(r.` + p + `) + `) pathContent.WriteString(` if r.` + p + ` != "" {` + "\n") pathContent.WriteString(` path.WriteString("/")` + "\n") @@ -740,7 +740,7 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(providedCtx context. pathGrow.WriteString("1 +") pathContent.WriteString(` path.WriteString("/")` + "\n") switch a.Type { - case "string": + case "string", "enum": pathGrow.WriteString(`len(r.` + p + `)`) pathContent.WriteString(` path.WriteString(r.` + p + `)` + "\n") case "list": diff --git a/internal/build/cmd/generate/commands/gensource/model.go b/internal/build/cmd/generate/commands/gensource/model.go index 6a1e864899..e7d8a9796d 100644 --- a/internal/build/cmd/generate/commands/gensource/model.go +++ b/internal/build/cmd/generate/commands/gensource/model.go @@ -107,11 +107,20 @@ func NewEndpoint(f io.Reader) (*Endpoint, error) { "error_trace": true, "filter_path": true, } - for name, _ := range endpoint.Params { + for name, param := range endpoint.Params { // remove from endpoint if it's in the skip list if _, ok := paramSkipList[name]; ok { delete(endpoint.Params, name) } + + if EsVersion < "9.3.0" { + if endpoint.Name == "bulk" { + if name == "routing" { + param.Type = "string" + } + } + } + } if fpath, ok := f.(*os.File); ok { @@ -142,7 +151,7 @@ func NewEndpoint(f io.Reader) (*Endpoint, error) { var parts []string for partName, part := range path.Parts { // Skip type only for selected APIs at this point - if part.Name == "type" && part.Deprecated { + if part.Name == "type" && part.Deprecated.Version != "" { if endpoint.Name == "bulk" || endpoint.Name == "create" || endpoint.Name == "delete" || @@ -289,7 +298,10 @@ type Part struct { Description string `json:"description"` Required bool `json:"required"` - Deprecated bool `json:"deprecated"` + Deprecated struct { + Version string `json:"version"` + Description string `json:"description"` + } } // Param represents API endpoint parameter. diff --git a/internal/build/cmd/generate/commands/gensource/overrides.go b/internal/build/cmd/generate/commands/gensource/overrides.go index 0a8f5a7602..c78d89b30f 100644 --- a/internal/build/cmd/generate/commands/gensource/overrides.go +++ b/internal/build/cmd/generate/commands/gensource/overrides.go @@ -22,18 +22,15 @@ var ( ) // OverrideFunc defines a function to override generated code for endpoint. -// type OverrideFunc func(*Endpoint, ...interface{}) string // OverrideRule represents an override rule. -// type OverrideRule struct { Func OverrideFunc Matching []string } // GetOverride returns an override function for id and API name. -// func (g *Generator) GetOverride(id, apiName string) OverrideFunc { if rr, ok := overrideRules[id]; ok { for _, r := range rr { @@ -46,7 +43,6 @@ func (g *Generator) GetOverride(id, apiName string) OverrideFunc { } // Match returns true when API name matches a rule. -// func (r OverrideRule) Match(apiName string) bool { for _, v := range r.Matching { if v == "*" { diff --git a/internal/build/cmd/generate/commands/gentests/patches.go b/internal/build/cmd/generate/commands/gentests/patches.go index 6840547dc0..ed3056bea2 100644 --- a/internal/build/cmd/generate/commands/gentests/patches.go +++ b/internal/build/cmd/generate/commands/gentests/patches.go @@ -32,7 +32,6 @@ var ( ) // PatchTestSource performs a regex based patching of the input. -// func PatchTestSource(fpath string, r io.Reader) (io.Reader, error) { c, err := ioutil.ReadAll(r) if err != nil { diff --git a/internal/build/cmd/generate/commands/gentests/skips.go b/internal/build/cmd/generate/commands/gentests/skips.go index 4689383be9..632a735843 100644 --- a/internal/build/cmd/generate/commands/gentests/skips.go +++ b/internal/build/cmd/generate/commands/gentests/skips.go @@ -19,8 +19,9 @@ package gentests import ( "fmt" - "gopkg.in/yaml.v2" "strings" + + "gopkg.in/yaml.v2" ) var skipTests map[string][]string @@ -80,8 +81,12 @@ var skipFiles = []string{ "update/100_synthetic_source.yml", "tsdb/160_nested_fields.yml", "tsdb/90_unsupported_operations.yml", + "cluster.component_template/.*.yml", + "indices.put_index_template/.*.yml", + "ml/forecast.yml", ".*inference/.*.yml", // incompatible inference tests ".*mustache/.*.yml", // incompatible mustache tests + "data_stream/240_data_stream_settings.yml", } // TODO: Comments into descriptions for `Skip()` @@ -466,12 +471,6 @@ data_streams/10_data_stream_resolvability.yml: data_stream/230_data_stream_options.yml: - Test partially resetting failure store options in template composition -data_stream/240_data_stream_settings.yml: - - Test single data stream - - Test dry run - - Test null out settings - - Test null out settings component templates only - # Error: constant 9223372036854775808 overflows int (https://play.golang.org/p/7pUdz-_Pdom) unsigned_long/10_basic.yml: unsigned_long/20_null_value.yml: @@ -662,4 +661,29 @@ search.vectors/41_knn_search_half_byte_quantized.yml: tsdb/25_id_generation.yml: - delete over _bulk +# Data stream mappings tests failing in Go test suite +data_stream/250_data_stream_mappings.yml: + - "Test single data stream" + - "Test mappings component templates only" + +# Data streams stats failing for multiple data streams scenario +data_stream/120_data_streams_stats.yml: + - "Multiple data stream" + +# Search vectors synthetic dense vectors failures (include and update cases) +search.vectors/240_source_synthetic_dense_vectors.yml: + - "include synthetic vectors" + - "Bulk partial update with synthetic vectors" + - "Partial update with synthetic vectors" + +# Search vectors synthetic sparse vectors failures (include and update cases) +search.vectors/250_source_synthetic_sparse_vectors.yml: + - "include synthetic vectors" + - "Bulk partial update with synthetic vectors" + - "Partial update with synthetic vectors" + +rank_vectors/rank_vectors_synthetic_vectors.yml: + - "include synthetic vectors" + - "Bulk partial update with synthetic vectors" + - "Partial update with synthetic vectors" ` diff --git a/internal/build/cmd/tools/commands/spec/command.go b/internal/build/cmd/tools/commands/spec/command.go index c268691198..26f50d53bf 100644 --- a/internal/build/cmd/tools/commands/spec/command.go +++ b/internal/build/cmd/tools/commands/spec/command.go @@ -18,21 +18,14 @@ package cmd import ( - "archive/zip" - "bytes" - "encoding/json" + "context" "fmt" - "io/ioutil" "log" - "net/http" - "net/url" "os" - "path/filepath" - "strings" - "time" "github.com/elastic/go-elasticsearch/v9/internal/build/cmd" - "github.com/elastic/go-elasticsearch/v9/internal/build/utils" + "github.com/elastic/go-elasticsearch/v9/internal/build/sdk/artifacts" + "github.com/elastic/go-elasticsearch/v9/internal/build/sdk/ref" "github.com/elastic/go-elasticsearch/v9/internal/version" "github.com/spf13/cobra" ) @@ -46,7 +39,7 @@ var ( func init() { output = toolsCmd.Flags().StringP("output", "o", "", "Path to a folder for generated output") - commitHash = toolsCmd.Flags().StringP("commit_hash", "c", "", "Elasticsearch commit hash") + commitHash = toolsCmd.Flags().StringP("commit_hash", "c", "", "Elasticsearch commit hash (deprecated: no longer supported)") debug = toolsCmd.Flags().BoolP("debug", "d", false, "Print the generated source to terminal") info = toolsCmd.Flags().Bool("info", false, "Print the API details to terminal") @@ -65,7 +58,7 @@ var toolsCmd = &cobra.Command{ } err := command.Execute() if err != nil { - utils.PrintErr(err) + log.Fatal(err) os.Exit(1) } }, @@ -78,251 +71,43 @@ type Command struct { Info bool } -// download-spec runs a query to the Elastic artifact API, retrieve the list of active artifacts -// downloads, extract and write to disk the rest-resources spec alongside a json with relevant build information. -func (c Command) Execute() (err error) { - const artifactsUrl = "https://artifacts-api.elastic.co/v1/versions" +// Execute downloads the rest-resources specification artifact using the artifacts API. +// It retrieves the spec for the version specified by ELASTICSEARCH_BUILD_VERSION env var, +// or falls back to the client version if not set. +func (c Command) Execute() error { + // Warn if deprecated --commit_hash flag is used + if c.CommitHash != "" { + log.Printf("Warning: --commit_hash flag is deprecated and no longer supported. It will be ignored.") + } esBuildVersion := os.Getenv("ELASTICSEARCH_BUILD_VERSION") if esBuildVersion == "" { esBuildVersion = version.Client } - versionUrl := strings.Join([]string{artifactsUrl, esBuildVersion}, "/") - - res, err := http.Get(versionUrl) - if err != nil { - log.Fatal(err.Error()) - } - defer res.Body.Close() - - if res.StatusCode == http.StatusNotFound { - // Try with version without -SNAPSHOT (e.g., "9.1.0-SNAPSHOT" -> "9.1.0") - fallbackVersion := esBuildVersion - if strings.HasSuffix(esBuildVersion, "-SNAPSHOT") { - fallbackVersion = strings.TrimSuffix(fallbackVersion, "-SNAPSHOT") - } else { - log.Fatalf("Version not found: %s returned 404", esBuildVersion) - } - - fallbackUrl := strings.Join([]string{artifactsUrl, fallbackVersion}, "/") - res, err = http.Get(fallbackUrl) - if err != nil { - log.Fatal(err.Error()) - } - defer res.Body.Close() - - if res.StatusCode == http.StatusNotFound { - log.Fatalf("Version not found: both %s and %s returned 404", esBuildVersion, fallbackVersion) - } - } - - var v Versions - dec := json.NewDecoder(res.Body) - err = dec.Decode(&v) - if err != nil { - log.Fatal(err.Error()) - } - - if c.Debug { - log.Printf("%d builds found", len(v.Version.Builds)) - } - - var build Build - if c.CommitHash != "" { - if build, err = findBuildByCommitHash(c.CommitHash, v.Version.Builds); err != nil { - build = findMostRecentBuild(v.Version.Builds) - } - } else { - build = findMostRecentBuild(v.Version.Builds) - } - if c.Debug { - log.Printf("Build found : %s", build.Projects.Elasticsearch.CommitHash) - } - - data, err := c.downloadZip(build) - if err != nil { - log.Fatalf("Cannot download zip from %s, reason : %s", build.zipfileUrl(), err) - } - - if err := c.extractZipToDest(data); err != nil { - log.Fatal(err.Error()) - } - - d, _ := json.Marshal(build) - - err = c.writeFileToDest("elasticsearch.json", d) - if err != nil { - log.Fatal(err.Error()) - } - - return nil -} - -func (c Command) writeFileToDest(filename string, data []byte) error { - path := filepath.Join(c.Output, filename) - if err := ioutil.WriteFile(path, data, 0644); err != nil { - return fmt.Errorf("cannot write file: %s", err) - } if c.Debug { - log.Printf("Successfuly written file to : %s", path) - } - return nil -} - -type Versions struct { - Version struct { - Builds []Build `json:"builds"` - } `json:"version"` -} - -type PackageUrl struct { - *url.URL -} - -func (p *PackageUrl) UnmarshalJSON(data []byte) error { - if string(data) == "null" { - return nil + log.Printf("Using version: %s", esBuildVersion) } - url, err := url.Parse(string(data[1 : len(data)-1])) - if err == nil { - p.URL = url - } - return err -} - -type BuildStartTime struct { - *time.Time -} - -func (t *BuildStartTime) UnmarshalJSON(data []byte) error { - if string(data) == "null" { - return nil - } - var err error - parsedTime, err := time.Parse(`"`+"Mon, 2 Jan 2006 15:04:05 MST"+`"`, string(data)) - t.Time = &parsedTime - return err -} - -type Build struct { - StartTime BuildStartTime `json:"start_time"` - Version string `json:"version"` - BuildId string `json:"build_id"` - Projects struct { - Elasticsearch struct { - Branch string `json:"branch"` - CommitHash string `json:"commit_hash"` - Packages map[string]struct { - Url PackageUrl `json:"url"` - Type string `json:"type"` - } - } `json:"elasticsearch"` - } `json:"projects"` -} - -func NewBuild() Build { - t := time.Date(1970, 0, 0, 0, 0, 0, 0, time.UTC) - startTime := BuildStartTime{Time: &t} - return Build{StartTime: startTime} -} -// zipfileUrl return the file URL for the rest-resources artifact from Build -// There should be only one artifact matching the requirements par Build. -func (b Build) zipfileUrl() string { - for _, pack := range b.Projects.Elasticsearch.Packages { - if pack.Type == "zip" && strings.Contains(pack.Url.String(), "rest-resources") { - return pack.Url.String() + // Parse the version/branch reference, renaming "main" to "master" for branch lookups + r, err := ref.Parse(esBuildVersion, func(s string) string { + if s == "main" { + return "master" } - } - return "" -} - -// extractZipToDest extract the data from a previously downloaded file loaded in memory to Output target. -func (c Command) extractZipToDest(data []byte) error { - zipReader, err := zip.NewReader(bytes.NewReader(data), int64(len(data))) + return s + }) if err != nil { - return err + return fmt.Errorf("invalid version %q: %w", esBuildVersion, err) } - if err = os.MkdirAll(c.Output, 0744); err != nil { - return fmt.Errorf("cannot created destination directory: %s", err) - } - - for _, file := range zipReader.File { - f, err := file.Open() - if err != nil { - return fmt.Errorf("cannot read file in zipfile: %s", err) - } - defer f.Close() - - if file.FileInfo().IsDir() { - path := filepath.Join(c.Output, file.Name) - _ = os.MkdirAll(path, 0744) - } else { - data, err := ioutil.ReadAll(f) - if err != nil { - return err - } - - if err := c.writeFileToDest(file.Name, data); err != nil { - return err - } - } + client := artifacts.NewClient() + if err := client.DownloadRestResources(context.Background(), r, c.Output); err != nil { + return fmt.Errorf("failed to download rest-resources: %w", err) } if c.Debug { - log.Printf("Zipfile successfully extracted to %s", c.Output) + log.Printf("Successfully downloaded rest-resources to %s", c.Output) } return nil } - -// downloadZip fetches the rest-resources artifact from a Build and return its content as []byte. -func (c Command) downloadZip(b Build) ([]byte, error) { - url := b.zipfileUrl() - if c.Debug { - log.Printf("Zipfile url : %s", b.zipfileUrl()) - } - - client := &http.Client{} - - req, err := http.NewRequest(http.MethodGet, url, nil) - if err != nil { - return nil, err - } - - req.Header.Add("Accept-Content", "gzip") - res, err := client.Do(req) - if err != nil { - return nil, err - } - defer res.Body.Close() - - data, _ := ioutil.ReadAll(res.Body) - return data, err -} - -// findMostRecentBuild iterates through the builds retrieved from the api -// and return the latest one based on the StartTime of each Build. -func findMostRecentBuild(builds []Build) Build { - var latestBuild Build - latestBuild = NewBuild() - for _, build := range builds { - if build.StartTime.After(*latestBuild.StartTime.Time) { - latestBuild = build - } - } - return latestBuild -} - -// findBuildByCommitHash iterates through the builds and returns the first occurrence of Build -// that matches the provided commitHash. -func findBuildByCommitHash(commitHash string, builds []Build) (Build, error) { - for _, build := range builds { - if build.Projects.Elasticsearch.CommitHash == commitHash { - return build, nil - } - } - return Build{}, fmt.Errorf("Build with commit hash %s not found", commitHash) -} diff --git a/internal/build/cmd/tools/commands/spec/command_test.go b/internal/build/cmd/tools/commands/spec/command_test.go deleted file mode 100644 index c4c5e66637..0000000000 --- a/internal/build/cmd/tools/commands/spec/command_test.go +++ /dev/null @@ -1,66 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -package cmd - -import ( - "encoding/json" - "testing" -) - -func TestBuild_zipfileUrl(t *testing.T) { - tests := []struct { - name string - json string - want string - }{ - { - name: "Simple test with valid url", - json: ` - { - "start_time": "Mon, 19 Apr 2021 12:15:47 GMT", - "version": "8.0.0-SNAPSHOT", - "build_id": "8.0.0-ab7cd914", - "projects": { - "elasticsearch": { - "branch": "master", - "commit_hash": "d3be79018b5b70a118ea5a897a539428b728df5a", - "Packages": { - "rest-resources-zip-8.0.0-SNAPSHOT.zip": { - "url": "https://snapshots.elastic.co/8.0.0-ab7cd914/downloads/elasticsearch/rest-resources-zip-8.0.0-SNAPSHOT.zip", - "type": "zip" - } - } - } - } - } - `, - want: "https://snapshots.elastic.co/8.0.0-ab7cd914/downloads/elasticsearch/rest-resources-zip-8.0.0-SNAPSHOT.zip", - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - b := Build{} - if err := json.Unmarshal([]byte(tt.json), &b); err != nil { - t.Fatalf(err.Error()) - } - if got := b.zipfileUrl(); got != tt.want { - t.Errorf("zipfileUrl() = %v, want %v", got, tt.want) - } - }) - } -} diff --git a/internal/build/go.mod b/internal/build/go.mod index ef78599a26..4b63478722 100644 --- a/internal/build/go.mod +++ b/internal/build/go.mod @@ -1,6 +1,6 @@ module github.com/elastic/go-elasticsearch/v9/internal/build -go 1.23.0 +go 1.24.0 toolchain go1.24.2 @@ -9,18 +9,22 @@ replace github.com/elastic/go-elasticsearch/v9 => ../../ require ( github.com/alecthomas/chroma v0.10.0 github.com/elastic/go-elasticsearch/v9 v9.0.0-00010101000000-000000000000 + github.com/hashicorp/go-retryablehttp v0.7.8 + github.com/spf13/afero v1.15.0 github.com/spf13/cobra v1.8.0 golang.org/x/crypto v0.37.0 - golang.org/x/tools v0.32.0 + golang.org/x/tools v0.40.0 gopkg.in/yaml.v2 v2.4.0 ) require ( github.com/dlclark/regexp2 v1.4.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/mod v0.24.0 // indirect - golang.org/x/sync v0.13.0 // indirect - golang.org/x/sys v0.32.0 // indirect + golang.org/x/mod v0.31.0 // indirect + golang.org/x/sync v0.19.0 // indirect + golang.org/x/sys v0.39.0 // indirect golang.org/x/term v0.31.0 // indirect + golang.org/x/text v0.28.0 // indirect ) diff --git a/internal/build/go.sum b/internal/build/go.sum index 0028607c15..d28569ca7e 100644 --- a/internal/build/go.sum +++ b/internal/build/go.sum @@ -6,13 +6,27 @@ 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.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E= github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-retryablehttp v0.7.8 h1:ylXZWnqa7Lhqpk0L1P1LzDtGcCR0rPVUrx/c8Unxc48= +github.com/hashicorp/go-retryablehttp v0.7.8/go.mod h1:rjiScheydd+CxvumBsIrFKlx3iS0jrZ7LvzFGFmuKbw= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 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/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= +github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -22,16 +36,18 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= -golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= -golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= -golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= -golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= -golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI= +golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg= +golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= +golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= +golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= -golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU= -golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= +golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA= +golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc= 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.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= diff --git a/internal/build/sdk/artifacts/client.go b/internal/build/sdk/artifacts/client.go new file mode 100644 index 0000000000..67308b3da9 --- /dev/null +++ b/internal/build/sdk/artifacts/client.go @@ -0,0 +1,129 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package artifacts + +import ( + "context" + "encoding/json" + "fmt" + "io" + "net/http" + + "github.com/hashicorp/go-retryablehttp" + "github.com/spf13/afero" +) + +const ( + defaultReleasesBaseURL = "https://artifacts.elastic.co/" + defaultSnapshotBaseURL = "https://artifacts-snapshot.elastic.co/" +) + +type config struct { + releasesBaseURL string + snapshotBaseURL string + fs afero.Fs +} + +// Client is a client for interacting with the Elastic Artifacts API. +type Client struct { + releasesBaseURL string + snapshotBaseURL string + client *retryablehttp.Client + fs afero.Fs +} + +// Option is a functional option for configuring a Client. +type Option func(*config) + +// WithReleasesBaseURL sets the base URL for release artifacts. +func WithReleasesBaseURL(url string) Option { + return func(c *config) { + c.releasesBaseURL = url + } +} + +// WithSnapshotBaseURL sets the base URL for snapshot artifacts. +func WithSnapshotBaseURL(url string) Option { + return func(c *config) { + c.snapshotBaseURL = url + } +} + +// WithFS sets the filesystem to use for downloading artifacts. +// Defaults to afero.NewOsFs(). +// This is useful for testing. +func WithFS(fs afero.Fs) Option { + return func(c *config) { + c.fs = fs + } +} + +// NewClient returns a new Client. +func NewClient(options ...Option) *Client { + c := &config{ + releasesBaseURL: defaultReleasesBaseURL, + snapshotBaseURL: defaultSnapshotBaseURL, + fs: afero.NewOsFs(), + } + for _, opt := range options { + opt(c) + } + return &Client{ + releasesBaseURL: c.releasesBaseURL, + snapshotBaseURL: c.snapshotBaseURL, + client: retryablehttp.NewClient(), + fs: c.fs, + } +} + +func doGet[T any](ctx context.Context, c *Client, url string) (*T, error) { + request, err := retryablehttp.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + resp, err := c.client.Do(request.WithContext(ctx)) + if err != nil { + return nil, err + } + defer func() { _ = resp.Body.Close() }() + if resp.StatusCode != 200 { + return nil, fmt.Errorf("unexpected status code: %d", resp.StatusCode) + } + var response T + if err := json.NewDecoder(resp.Body).Decode(&response); err != nil { + return nil, err + } + return &response, nil +} + +func doDownload(ctx context.Context, c *Client, url string) ([]byte, error) { + request, err := retryablehttp.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + request.Header.Add("Accept-Encoding", "gzip") + resp, err := c.client.Do(request.WithContext(ctx)) + if err != nil { + return nil, err + } + defer func() { _ = resp.Body.Close() }() + if resp.StatusCode != 200 { + return nil, fmt.Errorf("unexpected status code: %d", resp.StatusCode) + } + return io.ReadAll(resp.Body) +} diff --git a/internal/build/sdk/artifacts/latest_snapshot_get.go b/internal/build/sdk/artifacts/latest_snapshot_get.go new file mode 100644 index 0000000000..eb23d40784 --- /dev/null +++ b/internal/build/sdk/artifacts/latest_snapshot_get.go @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package artifacts + +import ( + "context" + "fmt" + "net/url" +) + +// GetLatestSnapshotRequest represents the request parameters for the GetLatestSnapshot API. +type GetLatestSnapshotRequest struct { + Branch string +} + +// Validate checks the request parameters for errors. +func (r GetLatestSnapshotRequest) Validate() error { + if len(r.Branch) == 0 { + return fmt.Errorf("branch is required") + } + return nil +} + +// GetLatestSnapshotResponse represents the response from the GetLatestSnapshot API. +type GetLatestSnapshotResponse struct { + Version string `json:"version"` + BuildID string `json:"build_id"` + ManifestURL string `json:"manifest_url"` + SummaryURL string `json:"summary_url"` +} + +// GetLatestSnapshot gets the latest snapshot build for a given branch. +func (c *Client) GetLatestSnapshot(ctx context.Context, req *GetLatestSnapshotRequest) (*GetLatestSnapshotResponse, error) { + if err := req.Validate(); err != nil { + return nil, err + } + + requestUrl, err := url.JoinPath(c.snapshotBaseURL, fmt.Sprintf("elasticsearch/latest/%s.json", req.Branch)) + if err != nil { + return nil, err + } + + return doGet[GetLatestSnapshotResponse](ctx, c, requestUrl) +} diff --git a/internal/build/sdk/artifacts/latest_snapshot_get_test.go b/internal/build/sdk/artifacts/latest_snapshot_get_test.go new file mode 100644 index 0000000000..e0e57e3afa --- /dev/null +++ b/internal/build/sdk/artifacts/latest_snapshot_get_test.go @@ -0,0 +1,141 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package artifacts + +import ( + "context" + "errors" + "io" + "net/http" + "reflect" + "strings" + "testing" + + "github.com/hashicorp/go-retryablehttp" +) + +type mockRoundTripper struct { + RoundTripFunc func(*http.Request) (*http.Response, error) +} + +func (m mockRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + if m.RoundTripFunc == nil { + return nil, errors.New("the RoundTripFunc of the mock is nil") + } + return m.RoundTripFunc(req) +} + +func TestClient_GetLatestInfo(t *testing.T) { + type fields struct { + baseURL string + client *retryablehttp.Client + } + type args struct { + ctx context.Context + req *GetLatestSnapshotRequest + } + tests := []struct { + name string + fields fields + args args + want *GetLatestSnapshotResponse + wantErr bool + }{ + { + name: "success", + fields: fields{ + baseURL: defaultSnapshotBaseURL, + client: func() *retryablehttp.Client { + c := retryablehttp.NewClient() + c.Logger = nil + c.HTTPClient.Transport = &mockRoundTripper{ + RoundTripFunc: func(r *http.Request) (*http.Response, error) { + return &http.Response{ + Request: r.Clone(context.Background()), + StatusCode: http.StatusOK, + Body: io.NopCloser(strings.NewReader(`{ + "version": "9.3.0-SNAPSHOT", + "build_id": "9.3.0-dd19c56f", + "manifest_url": "https://artifacts-snapshot.elastic.co/elasticsearch/9.3.0-dd19c56f/manifest-9.3.0-SNAPSHOT.json", + "summary_url": "https://artifacts-snapshot.elastic.co/elasticsearch/9.3.0-dd19c56f/summary-9.3.0-SNAPSHOT.html" +}`)), + }, nil + }, + } + return c + }(), + }, + args: args{ + ctx: context.Background(), + req: &GetLatestSnapshotRequest{ + Branch: "master", + }, + }, + wantErr: false, + want: &GetLatestSnapshotResponse{ + Version: "9.3.0-SNAPSHOT", + BuildID: "9.3.0-dd19c56f", + ManifestURL: "https://artifacts-snapshot.elastic.co/elasticsearch/9.3.0-dd19c56f/manifest-9.3.0-SNAPSHOT.json", + SummaryURL: "https://artifacts-snapshot.elastic.co/elasticsearch/9.3.0-dd19c56f/summary-9.3.0-SNAPSHOT.html", + }, + }, + { + name: "404", + fields: fields{ + baseURL: defaultSnapshotBaseURL, + client: func() *retryablehttp.Client { + c := retryablehttp.NewClient() + c.Logger = nil + c.HTTPClient.Transport = &mockRoundTripper{ + RoundTripFunc: func(r *http.Request) (*http.Response, error) { + return &http.Response{ + Request: r.Clone(context.Background()), + StatusCode: http.StatusNotFound, + Body: io.NopCloser(strings.NewReader(`Not Found`)), + }, nil + }, + } + return c + }(), + }, + args: args{ + ctx: context.Background(), + req: &GetLatestSnapshotRequest{ + Branch: "master", + }, + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &Client{ + snapshotBaseURL: tt.fields.baseURL, + client: tt.fields.client, + } + got, err := c.GetLatestSnapshot(tt.args.ctx, tt.args.req) + if (err != nil) != tt.wantErr { + t.Errorf("GetLatestSnapshot() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetLatestSnapshot() got = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/internal/build/sdk/artifacts/manifest_get.go b/internal/build/sdk/artifacts/manifest_get.go new file mode 100644 index 0000000000..aa78c29e38 --- /dev/null +++ b/internal/build/sdk/artifacts/manifest_get.go @@ -0,0 +1,145 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package artifacts + +import ( + "context" + "fmt" + "strings" +) + +// GetManifestRequest represents the request parameters for the GetManifest API. +type GetManifestRequest struct { + URL string +} + +// Validate checks the request parameters for errors. +func (r GetManifestRequest) Validate() error { + if len(r.URL) == 0 { + return fmt.Errorf("url is required") + } + + return nil +} + +// Package represents a package in the manifest. +type Package struct { + URL string `json:"url"` + ShaURL string `json:"sha_url"` + Type string `json:"type"` + Architecture string `json:"architecture"` + OS []string `json:"os"` +} + +// Dependency represents a dependency in the manifest. +type Dependency struct { + Prefix string `json:"prefix"` + BuildURI string `json:"build_uri"` +} + +// Project represents a project in the manifest. +type Project struct { + Branch string `json:"branch"` + CommitHash string `json:"commit_hash"` + CommitURL string `json:"commit_url"` + BuildDurationSeconds int `json:"build_duration_seconds"` + Packages map[string]Package `json:"packages"` + Dependencies []Dependency `json:"dependencies"` +} + +// Manifest represents the manifest for a build. +type Manifest struct { + Branch string `json:"branch"` + ReleaseBranch string `json:"release_branch"` + Version string `json:"version"` + BuildID string `json:"build_id"` + StartTime string `json:"start_time"` + EndTime string `json:"end_time"` + BuildDurationSeconds int `json:"build_duration_seconds"` + ManifestVersion string `json:"manifest_version"` + Prefix string `json:"prefix"` + Projects struct { + Elasticsearch Project `json:"elasticsearch"` + } `json:"projects"` +} + +// GetManifestResponse represents the response from the GetManifest API. +type GetManifestResponse struct { + Manifest *Manifest +} + +// Build represents the legacy build format for backward compatibility with elasticsearch.json +type Build struct { + StartTime string `json:"start_time"` + Version string `json:"version"` + BuildID string `json:"build_id"` + Projects struct { + Elasticsearch BuildProject `json:"elasticsearch"` + } `json:"projects"` +} + +// BuildProject represents the legacy build project format for backward compatibility with elasticsearch.json +type BuildProject struct { + Branch string `json:"branch"` + CommitHash string `json:"commit_hash"` + Packages map[string]BuildPackage `json:"packages"` +} + +// BuildPackage represents the legacy build package format for backward compatibility with elasticsearch.json +type BuildPackage struct { + URL string `json:"url"` + Type string `json:"type"` +} + +// ToBuild converts a Manifest to the legacy Build format for backward compatibility +func (m *Manifest) ToBuild() Build { + var build Build + + build.StartTime = m.StartTime + build.Version = m.Version + build.BuildID = m.BuildID + build.Projects.Elasticsearch.Branch = m.Projects.Elasticsearch.Branch + build.Projects.Elasticsearch.CommitHash = m.Projects.Elasticsearch.CommitHash + build.Projects.Elasticsearch.Packages = make(map[string]BuildPackage) + + for key, pkg := range m.Projects.Elasticsearch.Packages { + build.Projects.Elasticsearch.Packages[key] = BuildPackage{ + URL: pkg.URL, + Type: pkg.Type, + } + } + + return build +} + +// GetManifest retrieves the manifest for a build. +func (c *Client) GetManifest(ctx context.Context, req *GetManifestRequest) (*GetManifestResponse, error) { + if err := req.Validate(); err != nil { + return nil, err + } + + if !strings.HasPrefix(req.URL, c.snapshotBaseURL) && !strings.HasPrefix(req.URL, c.releasesBaseURL) { + return nil, fmt.Errorf("invalid url: %s, must be child of: %s or %s", req.URL, c.snapshotBaseURL, c.releasesBaseURL) + } + + manifest, err := doGet[Manifest](ctx, c, req.URL) + if err != nil { + return nil, err + } + return &GetManifestResponse{Manifest: manifest}, nil +} diff --git a/internal/build/sdk/artifacts/manifest_get_test.go b/internal/build/sdk/artifacts/manifest_get_test.go new file mode 100644 index 0000000000..e6e617ddd7 --- /dev/null +++ b/internal/build/sdk/artifacts/manifest_get_test.go @@ -0,0 +1,213 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package artifacts + +import ( + "context" + "io" + "net/http" + "reflect" + "strings" + "testing" + + "github.com/hashicorp/go-retryablehttp" +) + +func TestClient_GetManifest(t *testing.T) { + type fields struct { + snapshotBaseURL string + releasesBaseURL string + client *retryablehttp.Client + } + type args struct { + ctx context.Context + req *GetManifestRequest + } + tests := []struct { + name string + fields fields + args args + want *GetManifestResponse + wantErr bool + }{ + { + name: "success", + fields: fields{ + snapshotBaseURL: defaultSnapshotBaseURL, + releasesBaseURL: defaultReleasesBaseURL, + client: func() *retryablehttp.Client { + c := retryablehttp.NewClient() + c.Logger = nil + c.HTTPClient.Transport = &mockRoundTripper{ + RoundTripFunc: func(r *http.Request) (*http.Response, error) { + return &http.Response{ + Request: r.Clone(context.Background()), + StatusCode: http.StatusOK, + Body: io.NopCloser(strings.NewReader(`{ + "branch": "main", + "release_branch": "main", + "version": "9.3.0-SNAPSHOT", + "build_id": "9.3.0-abc123", + "start_time": "2025-05-22T12:43:21+00:00", + "end_time": "2025-05-22T13:00:00+00:00", + "build_duration_seconds": 1000, + "manifest_version": "1.0", + "prefix": "elasticsearch", + "projects": { + "elasticsearch": { + "branch": "main", + "commit_hash": "abc123def456", + "commit_url": "https://github.com/elastic/elasticsearch/commit/abc123def456", + "build_duration_seconds": 500, + "packages": { + "rest-resources-zip-9.3.0-SNAPSHOT.zip": { + "url": "https://artifacts-snapshot.elastic.co/elasticsearch/rest-resources.zip", + "sha_url": "https://artifacts-snapshot.elastic.co/elasticsearch/rest-resources.zip.sha512", + "type": "zip", + "architecture": "any", + "os": ["any"] + } + }, + "dependencies": [] + } + } +}`)), + }, nil + }, + } + return c + }(), + }, + args: args{ + ctx: context.Background(), + req: &GetManifestRequest{ + URL: "https://artifacts-snapshot.elastic.co/elasticsearch/9.3.0-abc123/manifest.json", + }, + }, + wantErr: false, + want: &GetManifestResponse{ + Manifest: &Manifest{ + Branch: "main", + ReleaseBranch: "main", + Version: "9.3.0-SNAPSHOT", + BuildID: "9.3.0-abc123", + StartTime: "2025-05-22T12:43:21+00:00", + EndTime: "2025-05-22T13:00:00+00:00", + BuildDurationSeconds: 1000, + ManifestVersion: "1.0", + Prefix: "elasticsearch", + Projects: struct { + Elasticsearch Project `json:"elasticsearch"` + }{ + Elasticsearch: Project{ + Branch: "main", + CommitHash: "abc123def456", + CommitURL: "https://github.com/elastic/elasticsearch/commit/abc123def456", + BuildDurationSeconds: 500, + Packages: map[string]Package{ + "rest-resources-zip-9.3.0-SNAPSHOT.zip": { + URL: "https://artifacts-snapshot.elastic.co/elasticsearch/rest-resources.zip", + ShaURL: "https://artifacts-snapshot.elastic.co/elasticsearch/rest-resources.zip.sha512", + Type: "zip", + Architecture: "any", + OS: []string{"any"}, + }, + }, + Dependencies: []Dependency{}, + }, + }, + }, + }, + }, + { + name: "404", + fields: fields{ + snapshotBaseURL: defaultSnapshotBaseURL, + releasesBaseURL: defaultReleasesBaseURL, + client: func() *retryablehttp.Client { + c := retryablehttp.NewClient() + c.Logger = nil + c.HTTPClient.Transport = &mockRoundTripper{ + RoundTripFunc: func(r *http.Request) (*http.Response, error) { + return &http.Response{ + Request: r.Clone(context.Background()), + StatusCode: http.StatusNotFound, + Body: io.NopCloser(strings.NewReader(`Not Found`)), + }, nil + }, + } + return c + }(), + }, + args: args{ + ctx: context.Background(), + req: &GetManifestRequest{ + URL: "https://artifacts-snapshot.elastic.co/elasticsearch/not-found/manifest.json", + }, + }, + wantErr: true, + }, + { + name: "validation error - empty URL", + fields: fields{ + snapshotBaseURL: defaultSnapshotBaseURL, + releasesBaseURL: defaultReleasesBaseURL, + client: retryablehttp.NewClient(), + }, + args: args{ + ctx: context.Background(), + req: &GetManifestRequest{ + URL: "", + }, + }, + wantErr: true, + }, + { + name: "invalid URL - not child of base URLs", + fields: fields{ + snapshotBaseURL: defaultSnapshotBaseURL, + releasesBaseURL: defaultReleasesBaseURL, + client: retryablehttp.NewClient(), + }, + args: args{ + ctx: context.Background(), + req: &GetManifestRequest{ + URL: "https://malicious-site.com/manifest.json", + }, + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &Client{ + snapshotBaseURL: tt.fields.snapshotBaseURL, + releasesBaseURL: tt.fields.releasesBaseURL, + client: tt.fields.client, + } + got, err := c.GetManifest(tt.args.ctx, tt.args.req) + if (err != nil) != tt.wantErr { + t.Errorf("GetManifest() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetManifest() got = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/internal/build/sdk/artifacts/releases_list.go b/internal/build/sdk/artifacts/releases_list.go new file mode 100644 index 0000000000..622658bc9b --- /dev/null +++ b/internal/build/sdk/artifacts/releases_list.go @@ -0,0 +1,51 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package artifacts + +import ( + "context" + "net/url" +) + +// Release represents a release in the Stack API. +type Release struct { + Version string `json:"version"` + PublicReleaseDate *string `json:"public_release_date"` + IsEndOfSupport *bool `json:"is_end_of_support"` + EndOfSupportDate *string `json:"end_of_support_date"` + IsEndOfMaintenance *bool `json:"is_end_of_maintenance"` + EndOfMaintenanceDate *string `json:"end_of_maintenance_date"` + IsRetired *bool `json:"is_retired"` + RetiredDate *string `json:"retired_date"` + Manifest *string `json:"manifest"` +} + +// ListReleasesResponse represents the response from the ListReleases API. +type ListReleasesResponse struct { + Releases []Release `json:"releases"` +} + +// ListReleases lists all releases. +func (c *Client) ListReleases(ctx context.Context) (*ListReleasesResponse, error) { + requestUrl, err := url.JoinPath(c.releasesBaseURL, "releases", "stack.json") + if err != nil { + return nil, err + } + + return doGet[ListReleasesResponse](ctx, c, requestUrl) +} diff --git a/internal/build/sdk/artifacts/releases_list_test.go b/internal/build/sdk/artifacts/releases_list_test.go new file mode 100644 index 0000000000..cf4987980e --- /dev/null +++ b/internal/build/sdk/artifacts/releases_list_test.go @@ -0,0 +1,215 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package artifacts + +import ( + "context" + "io" + "net/http" + "reflect" + "strings" + "testing" + + "github.com/hashicorp/go-retryablehttp" +) + +func ptr[T any](v T) *T { + return &v +} + +func TestClient_ListReleases(t *testing.T) { + type fields struct { + releasesBaseURL string + client *retryablehttp.Client + } + type args struct { + ctx context.Context + } + tests := []struct { + name string + fields fields + args args + want *ListReleasesResponse + wantErr bool + }{ + { + name: "success with multiple releases", + fields: fields{ + releasesBaseURL: defaultReleasesBaseURL, + client: func() *retryablehttp.Client { + c := retryablehttp.NewClient() + c.Logger = nil + c.HTTPClient.Transport = &mockRoundTripper{ + RoundTripFunc: func(r *http.Request) (*http.Response, error) { + return &http.Response{ + Request: r.Clone(context.Background()), + StatusCode: http.StatusOK, + Body: io.NopCloser(strings.NewReader(`{ + "releases": [ + { + "version": "8.15.0", + "public_release_date": "2024-08-08", + "is_end_of_support": false, + "end_of_support_date": "2026-02-08", + "is_end_of_maintenance": false, + "end_of_maintenance_date": "2025-02-08", + "is_retired": false, + "retired_date": null, + "manifest": "https://artifacts.elastic.co/releases/8.15.0/manifest.json" + }, + { + "version": "8.14.3", + "public_release_date": "2024-07-10", + "is_end_of_support": false, + "end_of_support_date": "2026-01-10", + "is_end_of_maintenance": true, + "end_of_maintenance_date": "2024-08-08", + "is_retired": false, + "retired_date": null, + "manifest": "https://artifacts.elastic.co/releases/8.14.3/manifest.json" + }, + { + "version": "7.17.22", + "public_release_date": "2024-06-01", + "is_end_of_support": true, + "end_of_support_date": "2023-08-01", + "is_end_of_maintenance": true, + "end_of_maintenance_date": "2023-02-01", + "is_retired": true, + "retired_date": "2024-01-01", + "manifest": null + } + ] +}`)), + }, nil + }, + } + return c + }(), + }, + args: args{ + ctx: context.Background(), + }, + wantErr: false, + want: &ListReleasesResponse{ + Releases: []Release{ + { + Version: "8.15.0", + PublicReleaseDate: ptr("2024-08-08"), + IsEndOfSupport: ptr(false), + EndOfSupportDate: ptr("2026-02-08"), + IsEndOfMaintenance: ptr(false), + EndOfMaintenanceDate: ptr("2025-02-08"), + IsRetired: ptr(false), + RetiredDate: nil, + Manifest: ptr("https://artifacts.elastic.co/releases/8.15.0/manifest.json"), + }, + { + Version: "8.14.3", + PublicReleaseDate: ptr("2024-07-10"), + IsEndOfSupport: ptr(false), + EndOfSupportDate: ptr("2026-01-10"), + IsEndOfMaintenance: ptr(true), + EndOfMaintenanceDate: ptr("2024-08-08"), + IsRetired: ptr(false), + RetiredDate: nil, + Manifest: ptr("https://artifacts.elastic.co/releases/8.14.3/manifest.json"), + }, + { + Version: "7.17.22", + PublicReleaseDate: ptr("2024-06-01"), + IsEndOfSupport: ptr(true), + EndOfSupportDate: ptr("2023-08-01"), + IsEndOfMaintenance: ptr(true), + EndOfMaintenanceDate: ptr("2023-02-01"), + IsRetired: ptr(true), + RetiredDate: ptr("2024-01-01"), + Manifest: nil, + }, + }, + }, + }, + { + name: "404", + fields: fields{ + releasesBaseURL: defaultReleasesBaseURL, + client: func() *retryablehttp.Client { + c := retryablehttp.NewClient() + c.Logger = nil + c.HTTPClient.Transport = &mockRoundTripper{ + RoundTripFunc: func(r *http.Request) (*http.Response, error) { + return &http.Response{ + Request: r.Clone(context.Background()), + StatusCode: http.StatusNotFound, + Body: io.NopCloser(strings.NewReader(`Not Found`)), + }, nil + }, + } + return c + }(), + }, + args: args{ + ctx: context.Background(), + }, + wantErr: true, + }, + { + name: "empty releases array", + fields: fields{ + releasesBaseURL: defaultReleasesBaseURL, + client: func() *retryablehttp.Client { + c := retryablehttp.NewClient() + c.Logger = nil + c.HTTPClient.Transport = &mockRoundTripper{ + RoundTripFunc: func(r *http.Request) (*http.Response, error) { + return &http.Response{ + Request: r.Clone(context.Background()), + StatusCode: http.StatusOK, + Body: io.NopCloser(strings.NewReader(`{"releases": []}`)), + }, nil + }, + } + return c + }(), + }, + args: args{ + ctx: context.Background(), + }, + wantErr: false, + want: &ListReleasesResponse{ + Releases: []Release{}, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &Client{ + releasesBaseURL: tt.fields.releasesBaseURL, + client: tt.fields.client, + } + got, err := c.ListReleases(tt.args.ctx) + if (err != nil) != tt.wantErr { + t.Errorf("ListReleases() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("ListReleases() got = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/internal/build/sdk/artifacts/rest_resources_download.go b/internal/build/sdk/artifacts/rest_resources_download.go new file mode 100644 index 0000000000..ac0550ba3d --- /dev/null +++ b/internal/build/sdk/artifacts/rest_resources_download.go @@ -0,0 +1,184 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package artifacts + +import ( + "archive/zip" + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "path/filepath" + "strings" + + "github.com/elastic/go-elasticsearch/v9/internal/build/sdk/ref" +) + +// DownloadRestResources downloads the rest-resources zip file for the given Elasticsearch version +// and extracts it to the destination directory. +// It also writes elasticsearch.json with build info for backward compatibility. +func (c *Client) DownloadRestResources(ctx context.Context, ref ref.Ref, dest string) error { + if ref.IsEmpty() { + return errors.New("empty ref") + } + if dest == "" { + return errors.New("empty destination") + } + + var manifestURL string + + if ref.IsPreRelease() { + latestSnapshot, err := c.GetLatestSnapshot(ctx, &GetLatestSnapshotRequest{Branch: ref.TargetBranch()}) + if err != nil { + return fmt.Errorf("cannot get latest snapshot: %w", err) + } + manifestURL = latestSnapshot.ManifestURL + } else { + releases, err := c.ListReleases(ctx) + if err != nil { + return fmt.Errorf("cannot list releases: %w", err) + } + var release *Release + for i := range releases.Releases { + if releases.Releases[i].Version == ref.String() { + release = &releases.Releases[i] + break + } + } + if release == nil { + return fmt.Errorf("release %s not found", ref.String()) + } + if release.Manifest == nil { + return fmt.Errorf("release %s does not have a manifest", ref.String()) + } + manifestURL = *release.Manifest + } + + manifest, err := c.GetManifest(ctx, &GetManifestRequest{URL: manifestURL}) + if err != nil { + return fmt.Errorf("cannot get manifest: %w", err) + } + + elasticsearchProject := manifest.Manifest.Projects.Elasticsearch + + var zipURL string + + for key, value := range elasticsearchProject.Packages { + if strings.Contains(key, "rest-resources") { + zipURL = value.URL + break + } + } + + if zipURL == "" { + return errors.New("rest-resources package not found in manifest") + } + + // Download the zip file + zipData, err := doDownload(ctx, c, zipURL) + if err != nil { + return fmt.Errorf("cannot download rest-resources zip: %w", err) + } + + // Extract zip to destination + if err := c.extractZipToDestination(zipData, dest); err != nil { + return fmt.Errorf("cannot extract zip: %w", err) + } + + // Write elasticsearch.json with build info for backward compatibility + build := manifest.Manifest.ToBuild() + buildJSON, err := json.MarshalIndent(build, "", " ") + if err != nil { + return fmt.Errorf("cannot marshal build info: %w", err) + } + + if err := c.writeFile(filepath.Join(dest, "elasticsearch.json"), buildJSON); err != nil { + return fmt.Errorf("cannot write elasticsearch.json: %w", err) + } + + return nil +} + +// extractZipToDestination extracts zip data to the destination directory using the client's filesystem +func (c *Client) extractZipToDestination(data []byte, dest string) error { + zipReader, err := zip.NewReader(bytes.NewReader(data), int64(len(data))) + if err != nil { + return fmt.Errorf("cannot read zip: %w", err) + } + + if err := c.fs.MkdirAll(dest, 0755); err != nil { + return fmt.Errorf("cannot create destination directory: %w", err) + } + + for _, file := range zipReader.File { + destPath := filepath.Join(dest, file.Name) + + if file.FileInfo().IsDir() { + if err := c.fs.MkdirAll(destPath, 0755); err != nil { + return fmt.Errorf("cannot create directory %s: %w", destPath, err) + } + continue + } + + // Ensure parent directory exists + if err := c.fs.MkdirAll(filepath.Dir(destPath), 0755); err != nil { + return fmt.Errorf("cannot create parent directory for %s: %w", destPath, err) + } + + if err := c.extractZipFile(file, destPath); err != nil { + return err + } + } + + return nil +} + +// extractZipFile extracts a single file from the zip archive +func (c *Client) extractZipFile(file *zip.File, destPath string) error { + src, err := file.Open() + if err != nil { + return fmt.Errorf("cannot open file in zip: %w", err) + } + defer func() { _ = src.Close() }() + + dst, err := c.fs.Create(destPath) + if err != nil { + return fmt.Errorf("cannot create file %s: %w", destPath, err) + } + defer func() { _ = dst.Close() }() + + if _, err := io.Copy(dst, src); err != nil { + return fmt.Errorf("cannot write file %s: %w", destPath, err) + } + + return nil +} + +// writeFile writes data to a file using the client's filesystem +func (c *Client) writeFile(path string, data []byte) error { + f, err := c.fs.Create(path) + if err != nil { + return err + } + defer func() { _ = f.Close() }() + + _, err = f.Write(data) + return err +} diff --git a/internal/build/sdk/artifacts/rest_resources_download_test.go b/internal/build/sdk/artifacts/rest_resources_download_test.go new file mode 100644 index 0000000000..3c632e6a9d --- /dev/null +++ b/internal/build/sdk/artifacts/rest_resources_download_test.go @@ -0,0 +1,349 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package artifacts + +import ( + "archive/zip" + "bytes" + "context" + "encoding/json" + "io" + "net/http" + "strings" + "testing" + + "github.com/elastic/go-elasticsearch/v9/internal/build/sdk/ref" + "github.com/hashicorp/go-retryablehttp" + "github.com/spf13/afero" +) + +// createTestZip creates a zip file in memory with the given files +func createTestZip(files map[string]string) ([]byte, error) { + buf := new(bytes.Buffer) + w := zip.NewWriter(buf) + + for name, content := range files { + f, err := w.Create(name) + if err != nil { + return nil, err + } + if _, err := f.Write([]byte(content)); err != nil { + return nil, err + } + } + + if err := w.Close(); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} + +func TestClient_DownloadRestResources(t *testing.T) { + // Create test zip content + testZipFiles := map[string]string{ + "rest-api-spec/api/search.json": `{"name": "search"}`, + "rest-api-spec/api/index.json": `{"name": "index"}`, + "rest-api-spec/test/test1.yaml": "test: 1", + } + testZipData, err := createTestZip(testZipFiles) + if err != nil { + t.Fatalf("failed to create test zip: %v", err) + } + + tests := []struct { + name string + ref string + dest string + responses map[string]string + wantErr bool + wantErrMsg string + wantFiles []string + }{ + { + name: "success with snapshot", + ref: "main", + dest: "/output", + responses: map[string]string{ + "https://artifacts-snapshot.elastic.co/elasticsearch/latest/main.json": `{ + "version": "9.3.0-SNAPSHOT", + "build_id": "9.3.0-abc123", + "manifest_url": "https://artifacts-snapshot.elastic.co/elasticsearch/9.3.0-abc123/manifest-9.3.0-SNAPSHOT.json", + "summary_url": "https://artifacts-snapshot.elastic.co/elasticsearch/9.3.0-abc123/summary.html" + }`, + "https://artifacts-snapshot.elastic.co/elasticsearch/9.3.0-abc123/manifest-9.3.0-SNAPSHOT.json": `{ + "branch": "main", + "version": "9.3.0-SNAPSHOT", + "build_id": "9.3.0-abc123", + "start_time": "2025-05-22T12:43:21+00:00", + "projects": { + "elasticsearch": { + "branch": "main", + "commit_hash": "abc123def456", + "packages": { + "rest-resources-zip-9.3.0-SNAPSHOT.zip": { + "url": "https://artifacts-snapshot.elastic.co/elasticsearch/rest-resources.zip", + "type": "zip" + } + } + } + } + }`, + }, + wantErr: false, + wantFiles: []string{ + "/output/rest-api-spec/api/search.json", + "/output/rest-api-spec/api/index.json", + "/output/rest-api-spec/test/test1.yaml", + "/output/elasticsearch.json", + }, + }, + { + name: "success with release", + ref: "8.15.0", + dest: "/output", + responses: map[string]string{ + "https://artifacts.elastic.co/releases/stack.json": `{ + "releases": [ + { + "version": "8.15.0", + "manifest": "https://artifacts.elastic.co/releases/8.15.0/manifest.json" + } + ] + }`, + "https://artifacts.elastic.co/releases/8.15.0/manifest.json": `{ + "branch": "8.15", + "version": "8.15.0", + "build_id": "8.15.0-release", + "start_time": "2025-01-15T10:00:00+00:00", + "projects": { + "elasticsearch": { + "branch": "8.15", + "commit_hash": "release123", + "packages": { + "rest-resources-zip-8.15.0.zip": { + "url": "https://artifacts.elastic.co/releases/rest-resources.zip", + "type": "zip" + } + } + } + } + }`, + }, + wantErr: false, + wantFiles: []string{ + "/output/rest-api-spec/api/search.json", + "/output/rest-api-spec/api/index.json", + "/output/rest-api-spec/test/test1.yaml", + "/output/elasticsearch.json", + }, + }, + { + name: "empty ref", + ref: "", + dest: "/output", + wantErr: true, + wantErrMsg: "empty ref", + }, + { + name: "empty destination", + ref: "main", + dest: "", + wantErr: true, + wantErrMsg: "empty destination", + }, + { + name: "release not found", + ref: "99.99.99", + dest: "/output", + responses: map[string]string{ + "https://artifacts.elastic.co/releases/stack.json": `{ + "releases": [ + { + "version": "8.15.0", + "manifest": "https://artifacts.elastic.co/releases/8.15.0/manifest.json" + } + ] + }`, + }, + wantErr: true, + wantErrMsg: "release 99.99.99 not found", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + memFs := afero.NewMemMapFs() + + httpClient := retryablehttp.NewClient() + httpClient.Logger = nil + httpClient.RetryMax = 0 + httpClient.HTTPClient.Transport = &mockRoundTripper{ + RoundTripFunc: func(r *http.Request) (*http.Response, error) { + url := r.URL.String() + + // Check for zip download + if strings.HasSuffix(url, "rest-resources.zip") { + return &http.Response{ + Request: r.Clone(context.Background()), + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewReader(testZipData)), + }, nil + } + + // Check for JSON responses + if response, ok := tt.responses[url]; ok { + return &http.Response{ + Request: r.Clone(context.Background()), + StatusCode: http.StatusOK, + Body: io.NopCloser(strings.NewReader(response)), + }, nil + } + + return &http.Response{ + Request: r.Clone(context.Background()), + StatusCode: http.StatusNotFound, + Body: io.NopCloser(strings.NewReader("Not Found")), + }, nil + }, + } + + client := &Client{ + releasesBaseURL: defaultReleasesBaseURL, + snapshotBaseURL: defaultSnapshotBaseURL, + client: httpClient, + fs: memFs, + } + + parsedRef, _ := ref.Parse(tt.ref) + err := client.DownloadRestResources(context.Background(), parsedRef, tt.dest) + + if tt.wantErr { + if err == nil { + t.Errorf("DownloadRestResources() expected error, got nil") + return + } + if tt.wantErrMsg != "" && !strings.Contains(err.Error(), tt.wantErrMsg) { + t.Errorf("DownloadRestResources() error = %v, want error containing %q", err, tt.wantErrMsg) + } + return + } + + if err != nil { + t.Errorf("DownloadRestResources() unexpected error: %v", err) + return + } + + // Verify expected files exist + for _, wantFile := range tt.wantFiles { + exists, err := afero.Exists(memFs, wantFile) + if err != nil { + t.Errorf("error checking file %s: %v", wantFile, err) + continue + } + if !exists { + t.Errorf("expected file %s does not exist", wantFile) + } + } + + // Verify elasticsearch.json content + if tt.dest != "" { + elasticsearchJSON, err := afero.ReadFile(memFs, tt.dest+"/elasticsearch.json") + if err != nil { + t.Errorf("cannot read elasticsearch.json: %v", err) + return + } + + var build Build + if err := json.Unmarshal(elasticsearchJSON, &build); err != nil { + t.Errorf("cannot unmarshal elasticsearch.json: %v", err) + return + } + + if build.Version == "" { + t.Error("elasticsearch.json has empty version") + } + if build.Projects.Elasticsearch.CommitHash == "" { + t.Error("elasticsearch.json has empty commit hash") + } + } + }) + } +} + +func TestManifest_ToBuild(t *testing.T) { + manifest := &Manifest{ + Branch: "main", + Version: "9.3.0-SNAPSHOT", + BuildID: "9.3.0-abc123", + StartTime: "2025-05-22T12:43:21+00:00", + Projects: struct { + Elasticsearch Project `json:"elasticsearch"` + }{ + Elasticsearch: Project{ + Branch: "main", + CommitHash: "abc123def456", + Packages: map[string]Package{ + "rest-resources.zip": { + URL: "https://example.com/rest-resources.zip", + Type: "zip", + }, + }, + }, + }, + } + + build := manifest.ToBuild() + + if build.Version != "9.3.0-SNAPSHOT" { + t.Errorf("Version = %q, want %q", build.Version, "9.3.0-SNAPSHOT") + } + + if build.BuildID != "9.3.0-abc123" { + t.Errorf("BuildID = %q, want %q", build.BuildID, "9.3.0-abc123") + } + + // Check start time is kept in RFC3339 format (matches original time.Time serialization) + if build.StartTime != "2025-05-22T12:43:21Z" { + t.Errorf("StartTime = %q, want %q", build.StartTime, "2025-05-22T12:43:21Z") + } + + if build.Projects.Elasticsearch.Branch != "main" { + t.Errorf("Branch = %q, want %q", build.Projects.Elasticsearch.Branch, "main") + } + + if build.Projects.Elasticsearch.CommitHash != "abc123def456" { + t.Errorf("CommitHash = %q, want %q", build.Projects.Elasticsearch.CommitHash, "abc123def456") + } + + if len(build.Projects.Elasticsearch.Packages) != 1 { + t.Errorf("Packages count = %d, want 1", len(build.Projects.Elasticsearch.Packages)) + } + + pkg, ok := build.Projects.Elasticsearch.Packages["rest-resources.zip"] + if !ok { + t.Error("rest-resources.zip package not found") + } else { + if pkg.URL != "https://example.com/rest-resources.zip" { + t.Errorf("Package URL = %q, want %q", pkg.URL, "https://example.com/rest-resources.zip") + } + if pkg.Type != "zip" { + t.Errorf("Package Type = %q, want %q", pkg.Type, "zip") + } + } +} diff --git a/internal/build/sdk/ref/ref.go b/internal/build/sdk/ref/ref.go new file mode 100644 index 0000000000..e5437f354c --- /dev/null +++ b/internal/build/sdk/ref/ref.go @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package ref + +import ( + "errors" + "fmt" + + "github.com/elastic/go-elasticsearch/v9/internal/build/sdk/version" +) + +type Ref struct { + branch string + version *version.Version +} + +func (r Ref) IsEmpty() bool { + return r.version == nil && r.branch == "" +} + +func (r Ref) IsPreRelease() bool { + return (r.version != nil && r.version.IsPreRelease()) || r.branch != "" +} + +// Parse parses a reference string into a Ref. The reference can be a semantic +// version (e.g., "8.15.0", "9.0.0-SNAPSHOT") or a branch name (e.g., "main", "master"). +// An optional rename function can be provided to transform branch names during parsing. +func Parse(reference string, rename ...func(string) string) (Ref, error) { + if reference == "" { + return Ref{}, errors.New("empty reference") + } + + // Try to parse as a version first + if ver, err := version.Parse(reference); err == nil { + return Ref{version: &ver}, nil + } + + // Otherwise, treat as a branch name + branch := reference + if len(rename) > 0 && rename[0] != nil { + branch = rename[0](reference) + } + return Ref{branch: branch}, nil +} + +func (r Ref) TargetBranch() string { + if r.branch != "" { + return r.branch + } + return fmt.Sprintf("%d.%d", r.version.Major(), r.version.Minor()) +} + +func (r Ref) String() string { + if r.version != nil { + return r.version.String() + } + return r.branch +} diff --git a/internal/build/sdk/ref/ref_test.go b/internal/build/sdk/ref/ref_test.go new file mode 100644 index 0000000000..c128af2c36 --- /dev/null +++ b/internal/build/sdk/ref/ref_test.go @@ -0,0 +1,324 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package ref + +import ( + "strings" + "testing" +) + +func TestParse(t *testing.T) { + tests := []struct { + name string + reference string + rename func(string) string + wantStr string + wantErr bool + }{ + { + name: "valid semantic version", + reference: "8.15.0", + wantStr: "8.15.0", + wantErr: false, + }, + { + name: "valid semantic version with snapshot", + reference: "9.0.0-SNAPSHOT", + wantStr: "9.0.0-SNAPSHOT", + wantErr: false, + }, + { + name: "valid semantic version with rc", + reference: "8.15.0-rc1", + wantStr: "8.15.0-rc1", + wantErr: false, + }, + { + name: "branch name main", + reference: "main", + wantStr: "main", + wantErr: false, + }, + { + name: "branch name master", + reference: "master", + wantStr: "master", + wantErr: false, + }, + { + name: "branch name with rename function", + reference: "main", + rename: func(s string) string { return "renamed-" + s }, + wantStr: "renamed-main", + wantErr: false, + }, + { + name: "version is not affected by rename function", + reference: "8.15.0", + rename: func(s string) string { return "renamed-" + s }, + wantStr: "8.15.0", + wantErr: false, + }, + { + name: "feature branch", + reference: "feature/new-api", + wantStr: "feature/new-api", + wantErr: false, + }, + { + name: "empty reference", + reference: "", + wantErr: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var got Ref + var err error + if tt.rename != nil { + got, err = Parse(tt.reference, tt.rename) + } else { + got, err = Parse(tt.reference) + } + + if (err != nil) != tt.wantErr { + t.Errorf("Parse() error = %v, wantErr %v", err, tt.wantErr) + return + } + if err != nil { + return + } + if got.String() != tt.wantStr { + t.Errorf("Parse() got = %v, want %v", got.String(), tt.wantStr) + } + }) + } +} + +func TestRef_IsEmpty(t *testing.T) { + tests := []struct { + name string + ref Ref + want bool + }{ + { + name: "empty ref", + ref: Ref{}, + want: true, + }, + { + name: "ref with branch", + ref: mustParse("main"), + want: false, + }, + { + name: "ref with version", + ref: mustParse("8.15.0"), + want: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := tt.ref.IsEmpty(); got != tt.want { + t.Errorf("Ref.IsEmpty() = %v, want %v", got, tt.want) + } + }) + } +} + +func TestRef_IsPreRelease(t *testing.T) { + tests := []struct { + name string + ref Ref + want bool + }{ + { + name: "stable version is not pre-release", + ref: mustParse("8.15.0"), + want: false, + }, + { + name: "snapshot version is pre-release", + ref: mustParse("9.0.0-SNAPSHOT"), + want: true, + }, + { + name: "rc version is pre-release", + ref: mustParse("8.15.0-rc1"), + want: true, + }, + { + name: "alpha version is pre-release", + ref: mustParse("8.15.0-alpha1"), + want: true, + }, + { + name: "branch is pre-release", + ref: mustParse("main"), + want: true, + }, + { + name: "feature branch is pre-release", + ref: mustParse("feature/new-api"), + want: true, + }, + { + name: "empty ref is not pre-release", + ref: Ref{}, + want: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := tt.ref.IsPreRelease(); got != tt.want { + t.Errorf("Ref.IsPreRelease() = %v, want %v", got, tt.want) + } + }) + } +} + +func TestRef_TargetBranch(t *testing.T) { + tests := []struct { + name string + ref Ref + want string + }{ + { + name: "version returns major.minor", + ref: mustParse("8.15.0"), + want: "8.15", + }, + { + name: "snapshot version returns major.minor", + ref: mustParse("9.0.0-SNAPSHOT"), + want: "9.0", + }, + { + name: "branch returns branch name", + ref: mustParse("main"), + want: "main", + }, + { + name: "feature branch returns branch name", + ref: mustParse("feature/new-api"), + want: "feature/new-api", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := tt.ref.TargetBranch(); got != tt.want { + t.Errorf("Ref.TargetBranch() = %v, want %v", got, tt.want) + } + }) + } +} + +func TestRef_String(t *testing.T) { + tests := []struct { + name string + ref Ref + want string + }{ + { + name: "version returns version string", + ref: mustParse("8.15.0"), + want: "8.15.0", + }, + { + name: "snapshot version returns full version string", + ref: mustParse("9.0.0-SNAPSHOT"), + want: "9.0.0-SNAPSHOT", + }, + { + name: "branch returns branch name", + ref: mustParse("main"), + want: "main", + }, + { + name: "empty ref returns empty string", + ref: Ref{}, + want: "", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := tt.ref.String(); got != tt.want { + t.Errorf("Ref.String() = %v, want %v", got, tt.want) + } + }) + } +} + +func TestParse_WithRenameFunction(t *testing.T) { + // Test that the rename function is applied correctly to branch names + uppercaseRename := func(s string) string { + return strings.ToUpper(s) + } + + tests := []struct { + name string + reference string + rename func(string) string + wantStr string + }{ + { + name: "rename main to MAIN", + reference: "main", + rename: uppercaseRename, + wantStr: "MAIN", + }, + { + name: "nil rename function does not modify branch", + reference: "main", + rename: nil, + wantStr: "main", + }, + { + name: "version is not renamed", + reference: "8.15.0", + rename: uppercaseRename, + wantStr: "8.15.0", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := Parse(tt.reference, tt.rename) + if err != nil { + t.Errorf("Parse() unexpected error = %v", err) + return + } + if got.String() != tt.wantStr { + t.Errorf("Parse() got = %v, want %v", got.String(), tt.wantStr) + } + }) + } +} + +func mustParse(reference string) Ref { + ref, err := Parse(reference) + if err != nil { + panic(err) + } + return ref +} diff --git a/internal/build/sdk/version/version.go b/internal/build/sdk/version/version.go new file mode 100644 index 0000000000..92773fc0c6 --- /dev/null +++ b/internal/build/sdk/version/version.go @@ -0,0 +1,152 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package version + +import ( + "errors" + "fmt" + "regexp" + "strconv" + "strings" +) + +var ( + versionRexep = regexp.MustCompile(`^(?P\d+)\.(?P\d+)\.(?P\d+)(?:-(?P[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$`) +) + +// Version represents a semantic version. +type Version struct { + major, minor, patch int + preRelease string +} + +// Major returns the major version. +func (v Version) Major() int { + return v.major +} + +// Minor returns the minor version. +func (v Version) Minor() int { + return v.minor +} + +// Patch returns the patch version. +func (v Version) Patch() int { + return v.patch +} + +// PreRelease returns the pre-release version, if any. +func (v Version) PreRelease() string { + return v.preRelease +} + +// IsPreRelease returns true if the version is a pre-release version. e.g. 7.10.0-alpha1, or 7.10.0-SNAPSHOT +func (v Version) IsPreRelease() bool { + return v.PreRelease() != "" +} + +// WithMajor returns a new Version with the given major version. +func (v Version) WithMajor(major int) Version { + return Version{major: major, minor: v.minor, patch: v.patch, preRelease: v.preRelease} +} + +// WithMinor returns a new Version with the given minor version. +func (v Version) WithMinor(minor int) Version { + return Version{major: v.major, minor: minor, patch: v.patch, preRelease: v.preRelease} +} + +// WithPatch returns a new Version with the given patch version. +func (v Version) WithPatch(patch int) Version { + return Version{major: v.major, minor: v.minor, patch: patch, preRelease: v.preRelease} +} + +// WithPreRelease returns a new Version with the given pre-release version. +func (v Version) WithPreRelease(preRelease string) Version { + return Version{major: v.major, minor: v.minor, patch: v.patch, preRelease: preRelease} +} + +// String returns the version as a string. +func (v Version) String() string { + base := strings.Join( + []string{ + fmt.Sprint(v.major), + fmt.Sprint(v.minor), + fmt.Sprint(v.patch), + }, ".") + + if v.IsPreRelease() { + return fmt.Sprintf("%s-%s", base, v.preRelease) + } + return base +} + +// parseIntField extracts and parses an integer field from the regex match results. +func parseIntField(result map[string]string, field string) (int, error) { + if val, ok := result[field]; ok && val != "" { + return strconv.Atoi(val) + } + return 0, nil +} + +// Parse parses a version string into a Version struct. +func Parse(versionStr string) (Version, error) { + matches := versionRexep.FindStringSubmatch(versionStr) + if matches == nil { + return Version{}, errors.New("invalid version format") + } + + groupNames := versionRexep.SubexpNames() + result := make(map[string]string) + for i, name := range groupNames { + if i != 0 && name != "" { + result[name] = matches[i] + } + } + + major, err := parseIntField(result, "major") + if err != nil { + return Version{}, fmt.Errorf("invalid major version: %w", err) + } + + minor, err := parseIntField(result, "minor") + if err != nil { + return Version{}, fmt.Errorf("invalid minor version: %w", err) + } + + patch, err := parseIntField(result, "patch") + if err != nil { + return Version{}, fmt.Errorf("invalid patch version: %w", err) + } + + return Version{ + major: major, + minor: minor, + patch: patch, + preRelease: result["prerelease"], + }, nil +} + +// MustParse parses a version string into a Version struct. +// It panics if the version string is invalid. +func MustParse(version string) Version { + v, err := Parse(version) + if err != nil { + panic(err) + } + return v +} diff --git a/internal/build/sdk/version/version_test.go b/internal/build/sdk/version/version_test.go new file mode 100644 index 0000000000..700794ea9d --- /dev/null +++ b/internal/build/sdk/version/version_test.go @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package version + +import ( + "reflect" + "testing" +) + +func TestParse(t *testing.T) { + type args struct { + versionStr string + } + tests := []struct { + name string + args args + want Version + wantErr bool + }{ + { + name: "9.0.1-SNAPSHOT", + args: args{versionStr: "9.0.1-SNAPSHOT"}, + want: Version{9, 0, 1, "SNAPSHOT"}, + wantErr: false, + }, + { + name: "9.0.1-rc1", + args: args{versionStr: "9.0.1-rc1"}, + want: Version{9, 0, 1, "rc1"}, + wantErr: false, + }, + { + name: "9.0.1", + args: args{versionStr: "9.0.1"}, + want: Version{9, 0, 1, ""}, + wantErr: false, + }, + { + name: "9.0.1.0", + args: args{versionStr: "9.0.1.0"}, + wantErr: true, + }, + { + name: "9.0.1.0-SNAPSHOT", + args: args{versionStr: "9.0.1.0-SNAPSHOT"}, + wantErr: true, + }, + { + name: "9.0-SNAPSHOT", + args: args{versionStr: "9.0-SNAPSHOT"}, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := Parse(tt.args.versionStr) + if (err != nil) != tt.wantErr { + t.Errorf("Parse() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("Parse() got = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/internal/build/utils/chromatize.go b/internal/build/utils/chromatize.go index 389fcc3625..f01445dfef 100644 --- a/internal/build/utils/chromatize.go +++ b/internal/build/utils/chromatize.go @@ -28,7 +28,6 @@ import ( ) // Chromatize returns a syntax highlighted Go code. -// func Chromatize(r io.Reader) (io.Reader, error) { var b bytes.Buffer lexer := lexers.Get("go") diff --git a/internal/build/utils/debug.go b/internal/build/utils/debug.go index 1c2ec1d9ac..38c4689e98 100644 --- a/internal/build/utils/debug.go +++ b/internal/build/utils/debug.go @@ -28,7 +28,6 @@ import ( ) // PrintSourceWithErr returns source code annotated with location of an error. -// func PrintSourceWithErr(out io.Reader, err error) { if IsTTY() { fmt.Fprint(os.Stderr, "\x1b[2m") @@ -78,13 +77,13 @@ func PrintSourceWithErr(out io.Reader, err error) { if IsTTY() { fmt.Fprint(os.Stderr, "\x1b[31m") } - fmt.Fprintf(os.Stderr, strings.Repeat(" ", 4)) + fmt.Fprint(os.Stderr, strings.Repeat(" ", 4)) for i := 0; i < e.Pos.Column; i++ { fmt.Fprintf(os.Stderr, "-") } - fmt.Fprintf(os.Stderr, "^ ") - fmt.Fprintf(os.Stderr, e.Msg) - fmt.Fprintf(os.Stderr, "\n") + fmt.Fprint(os.Stderr, "^ ") + fmt.Fprint(os.Stderr, e.Msg) + fmt.Fprint(os.Stderr, "\n") if IsTTY() { fmt.Fprint(os.Stderr, "\x1b[0m") } diff --git a/internal/build/utils/strings.go b/internal/build/utils/strings.go index 7b9792ebe0..e423b32364 100644 --- a/internal/build/utils/strings.go +++ b/internal/build/utils/strings.go @@ -26,7 +26,6 @@ var ( ) // IDToUpper returns a string with all occurrences of "id" capitalized. -// func IDToUpper(s string) string { return reIDString.ReplaceAllLiteralString(s, "ID") } diff --git a/internal/build/utils/terminal.go b/internal/build/utils/terminal.go index 641bed76c6..f7add47b23 100644 --- a/internal/build/utils/terminal.go +++ b/internal/build/utils/terminal.go @@ -35,7 +35,6 @@ func init() { } // PrintErr prints an error to STDERR. -// func PrintErr(err error) { if isTTY { fmt.Fprint(os.Stderr, "\x1b[1;37;41m") @@ -48,13 +47,11 @@ func PrintErr(err error) { } // IsTTY returns true when os.Stderr is a terminal. -// func IsTTY() bool { return isTTY } // TerminalWidth returns the width of terminal, or zero. -// func TerminalWidth() int { if tWidth < 0 { return 0