diff --git a/Makefile b/Makefile index 71cf4c7b3..2163f836e 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,7 @@ lint: ## Run lint on the package } -backport: ## Backport one or more commits from master into version branches +backport: ## Backport one or more commits from main into version branches ifeq ($(origin commits), undefined) @echo "Missing commit(s), exiting..." @exit 2 diff --git a/internal/build/cmd/tools/commands/spec/command_test.go b/internal/build/cmd/tools/commands/spec/command_test.go index 21f1bab1d..5b647e69b 100644 --- a/internal/build/cmd/tools/commands/spec/command_test.go +++ b/internal/build/cmd/tools/commands/spec/command_test.go @@ -46,7 +46,7 @@ func TestBuild_zipfileUrl(t *testing.T) { "build_id": "1.0.0-ab7cd914", "projects": { "opensearch": { - "branch": "master", + "branch": "main", "commit_hash": "d3be79018b5b70a118ea5a897a539428b728df5a", "Packages": { "rest-resources-zip-8.0.0-SNAPSHOT.zip": { diff --git a/opensearchapi/api._.go b/opensearchapi/api._.go index 3e945eb6c..5382f0088 100755 --- a/opensearchapi/api._.go +++ b/opensearchapi/api._.go @@ -84,26 +84,29 @@ type API struct { // Cat contains the Cat APIs type Cat struct { - Aliases CatAliases - Allocation CatAllocation - Count CatCount - Fielddata CatFielddata - Health CatHealth - Help CatHelp - Indices CatIndices - Master CatMaster - Nodeattrs CatNodeattrs - Nodes CatNodes - PendingTasks CatPendingTasks - Plugins CatPlugins - Recovery CatRecovery - Repositories CatRepositories - Segments CatSegments - Shards CatShards - Snapshots CatSnapshots - Tasks CatTasks - Templates CatTemplates - ThreadPool CatThreadPool + Aliases CatAliases + Allocation CatAllocation + ClusterManager CatClusterManager + Count CatCount + Fielddata CatFielddata + Health CatHealth + Help CatHelp + Indices CatIndices + Nodeattrs CatNodeattrs + Nodes CatNodes + PendingTasks CatPendingTasks + Plugins CatPlugins + Recovery CatRecovery + Repositories CatRepositories + Segments CatSegments + Shards CatShards + Snapshots CatSnapshots + Tasks CatTasks + Templates CatTemplates + ThreadPool CatThreadPool + + // Deprecated: To promote inclusive language, please use ClusterManager instead. + Master CatMaster } // Cluster contains the Cluster APIs @@ -220,7 +223,6 @@ type Tasks struct { } // New creates new API -// func New(t Transport) *API { return &API{ Bulk: newBulkFunc(t), @@ -266,26 +268,27 @@ func New(t Transport) *API { UpdateByQueryRethrottle: newUpdateByQueryRethrottleFunc(t), Update: newUpdateFunc(t), Cat: &Cat{ - Aliases: newCatAliasesFunc(t), - Allocation: newCatAllocationFunc(t), - Count: newCatCountFunc(t), - Fielddata: newCatFielddataFunc(t), - Health: newCatHealthFunc(t), - Help: newCatHelpFunc(t), - Indices: newCatIndicesFunc(t), - Master: newCatMasterFunc(t), - Nodeattrs: newCatNodeattrsFunc(t), - Nodes: newCatNodesFunc(t), - PendingTasks: newCatPendingTasksFunc(t), - Plugins: newCatPluginsFunc(t), - Recovery: newCatRecoveryFunc(t), - Repositories: newCatRepositoriesFunc(t), - Segments: newCatSegmentsFunc(t), - Shards: newCatShardsFunc(t), - Snapshots: newCatSnapshotsFunc(t), - Tasks: newCatTasksFunc(t), - Templates: newCatTemplatesFunc(t), - ThreadPool: newCatThreadPoolFunc(t), + Aliases: newCatAliasesFunc(t), + Allocation: newCatAllocationFunc(t), + ClusterManager: newCatClusterManagerFunc(t), + Count: newCatCountFunc(t), + Fielddata: newCatFielddataFunc(t), + Health: newCatHealthFunc(t), + Help: newCatHelpFunc(t), + Indices: newCatIndicesFunc(t), + Master: newCatMasterFunc(t), + Nodeattrs: newCatNodeattrsFunc(t), + Nodes: newCatNodesFunc(t), + PendingTasks: newCatPendingTasksFunc(t), + Plugins: newCatPluginsFunc(t), + Recovery: newCatRecoveryFunc(t), + Repositories: newCatRepositoriesFunc(t), + Segments: newCatSegmentsFunc(t), + Shards: newCatShardsFunc(t), + Snapshots: newCatSnapshotsFunc(t), + Tasks: newCatTasksFunc(t), + Templates: newCatTemplatesFunc(t), + ThreadPool: newCatThreadPoolFunc(t), }, Cluster: &Cluster{ AllocationExplain: newClusterAllocationExplainFunc(t), diff --git a/opensearchapi/api.cat.aliases.go b/opensearchapi/api.cat.aliases.go index e0776f0c9..22cb459c7 100644 --- a/opensearchapi/api.cat.aliases.go +++ b/opensearchapi/api.cat.aliases.go @@ -231,7 +231,7 @@ func (f CatAliases) WithHelp(v bool) func(*CatAliasesRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f CatAliases) WithLocal(v bool) func(*CatAliasesRequest) { return func(r *CatAliasesRequest) { diff --git a/opensearchapi/api.cat.allocation.go b/opensearchapi/api.cat.allocation.go index 181ba139b..e15739fd5 100644 --- a/opensearchapi/api.cat.allocation.go +++ b/opensearchapi/api.cat.allocation.go @@ -57,14 +57,15 @@ type CatAllocation func(o ...func(*CatAllocationRequest)) (*Response, error) type CatAllocationRequest struct { NodeID []string - Bytes string - Format string - H []string - Help *bool - Local *bool - MasterTimeout time.Duration - S []string - V *bool + Bytes string + Format string + H []string + Help *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + S []string + V *bool Pretty bool Human bool @@ -123,6 +124,10 @@ func (r CatAllocationRequest) Do(ctx context.Context, transport Transport) (*Res params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -238,7 +243,7 @@ func (f CatAllocation) WithHelp(v bool) func(*CatAllocationRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f CatAllocation) WithLocal(v bool) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { @@ -246,7 +251,9 @@ func (f CatAllocation) WithLocal(v bool) func(*CatAllocationRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f CatAllocation) WithMasterTimeout(v time.Duration) func(*CatAllocationRequest) { return func(r *CatAllocationRequest) { @@ -254,6 +261,14 @@ func (f CatAllocation) WithMasterTimeout(v time.Duration) func(*CatAllocationReq } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f CatAllocation) WithClusterManagerTimeout(v time.Duration) func(*CatAllocationRequest) { + return func(r *CatAllocationRequest) { + r.ClusterManagerTimeout = v + } +} + // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatAllocation) WithS(v ...string) func(*CatAllocationRequest) { diff --git a/opensearchapi/api.cat.cluster_manager.go b/opensearchapi/api.cat.cluster_manager.go new file mode 100644 index 000000000..bf8aeaaa2 --- /dev/null +++ b/opensearchapi/api.cat.cluster_manager.go @@ -0,0 +1,275 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +package opensearchapi + +import ( + "context" + "net/http" + "strconv" + "strings" + "time" +) + +func newCatClusterManagerFunc(t Transport) CatClusterManager { + return func(o ...func(*CatClusterManagerRequest)) (*Response, error) { + var r = CatClusterManagerRequest{} + for _, f := range o { + f(&r) + } + return r.Do(r.ctx, t) + } +} + +// ----- API Definition ------------------------------------------------------- + +// CatClusterManager returns information about the cluster-manager node. +type CatClusterManager func(o ...func(*CatClusterManagerRequest)) (*Response, error) + +// CatClusterManagerRequest configures the Cat Cluster Manager API request. +type CatClusterManagerRequest struct { + Format string + H []string + Help *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + S []string + V *bool + + Pretty bool + Human bool + ErrorTrace bool + FilterPath []string + + Header http.Header + + ctx context.Context +} + +// Do executes the request and returns response or error. +func (r CatClusterManagerRequest) Do(ctx context.Context, transport Transport) (*Response, error) { + var ( + method string + path strings.Builder + params map[string]string + ) + + method = "GET" + + path.Grow(len("/_cat/cluster_manager")) + path.WriteString("/_cat/cluster_manager") + + params = make(map[string]string) + + if r.Format != "" { + params["format"] = r.Format + } + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Help != nil { + params["help"] = strconv.FormatBool(*r.Help) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.S) > 0 { + params["s"] = strings.Join(r.S, ",") + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + if len(r.FilterPath) > 0 { + params["filter_path"] = strings.Join(r.FilterPath, ",") + } + + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := req.URL.Query() + for k, v := range params { + q.Set(k, v) + } + req.URL.RawQuery = q.Encode() + } + + if len(r.Header) > 0 { + if len(req.Header) == 0 { + req.Header = r.Header + } else { + for k, vv := range r.Header { + for _, v := range vv { + req.Header.Add(k, v) + } + } + } + } + + if ctx != nil { + req = req.WithContext(ctx) + } + + res, err := transport.Perform(req) + if err != nil { + return nil, err + } + + response := Response{ + StatusCode: res.StatusCode, + Body: res.Body, + Header: res.Header, + } + + return &response, nil +} + +// WithContext sets the request context. +func (f CatClusterManager) WithContext(v context.Context) func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + r.ctx = v + } +} + +// WithFormat - a short version of the accept header, e.g. json, yaml. +func (f CatClusterManager) WithFormat(v string) func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + r.Format = v + } +} + +// WithH - comma-separated list of column names to display. +func (f CatClusterManager) WithH(v ...string) func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + r.H = v + } +} + +// WithHelp - return help information. +func (f CatClusterManager) WithHelp(v bool) func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + r.Help = &v + } +} + +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). +func (f CatClusterManager) WithLocal(v bool) func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + r.Local = &v + } +} + +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. +func (f CatClusterManager) WithMasterTimeout(v time.Duration) func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + r.MasterTimeout = v + } +} + +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +func (f CatClusterManager) WithClusterManagerTimeout(v time.Duration) func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + r.ClusterManagerTimeout = v + } +} + +// WithS - comma-separated list of column names or column aliases to sort by. +func (f CatClusterManager) WithS(v ...string) func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + r.S = v + } +} + +// WithV - verbose mode. display column headers. +func (f CatClusterManager) WithV(v bool) func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + r.V = &v + } +} + +// WithPretty makes the response body pretty-printed. +func (f CatClusterManager) WithPretty() func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + r.Pretty = true + } +} + +// WithHuman makes statistical values human-readable. +func (f CatClusterManager) WithHuman() func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + r.Human = true + } +} + +// WithErrorTrace includes the stack trace for errors in the response body. +func (f CatClusterManager) WithErrorTrace() func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + r.ErrorTrace = true + } +} + +// WithFilterPath filters the properties of the response body. +func (f CatClusterManager) WithFilterPath(v ...string) func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + r.FilterPath = v + } +} + +// WithHeader adds the headers to the HTTP request. +func (f CatClusterManager) WithHeader(h map[string]string) func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + 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 CatClusterManager) WithOpaqueID(s string) func(*CatClusterManagerRequest) { + return func(r *CatClusterManagerRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/opensearchapi/api.cat.indices.go b/opensearchapi/api.cat.indices.go index c8f17ed4b..5c051b4ec 100644 --- a/opensearchapi/api.cat.indices.go +++ b/opensearchapi/api.cat.indices.go @@ -65,6 +65,7 @@ type CatIndicesRequest struct { IncludeUnloadedSegments *bool Local *bool MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pri *bool S []string Time string @@ -139,6 +140,10 @@ func (r CatIndicesRequest) Do(ctx context.Context, transport Transport) (*Respon params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pri != nil { params["pri"] = strconv.FormatBool(*r.Pri) } @@ -286,7 +291,7 @@ func (f CatIndices) WithIncludeUnloadedSegments(v bool) func(*CatIndicesRequest) } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f CatIndices) WithLocal(v bool) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { @@ -294,7 +299,9 @@ func (f CatIndices) WithLocal(v bool) func(*CatIndicesRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f CatIndices) WithMasterTimeout(v time.Duration) func(*CatIndicesRequest) { return func(r *CatIndicesRequest) { @@ -302,6 +309,14 @@ func (f CatIndices) WithMasterTimeout(v time.Duration) func(*CatIndicesRequest) } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f CatIndices) WithClusterManagerTimeout(v time.Duration) func(*CatIndicesRequest) { + return func(r *CatIndicesRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPri - set to true to return stats only for primary shards. // func (f CatIndices) WithPri(v bool) func(*CatIndicesRequest) { diff --git a/opensearchapi/api.cat.master.go b/opensearchapi/api.cat.master.go index 0aab1edab..9fd681b06 100644 --- a/opensearchapi/api.cat.master.go +++ b/opensearchapi/api.cat.master.go @@ -46,21 +46,21 @@ func newCatMasterFunc(t Transport) CatMaster { // ----- API Definition ------------------------------------------------------- -// CatMaster returns information about the master node. -// +// CatMaster returns information about the cluster-manager node. // +// Deprecated: To promote inclusive language, please use CatClusterManager instead. type CatMaster func(o ...func(*CatMasterRequest)) (*Response, error) // CatMasterRequest configures the Cat Master API request. -// type CatMasterRequest struct { - Format string - H []string - Help *bool - Local *bool - MasterTimeout time.Duration - S []string - V *bool + Format string + H []string + Help *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + S []string + V *bool Pretty bool Human bool @@ -73,7 +73,6 @@ type CatMasterRequest struct { } // Do executes the request and returns response or error. -// func (r CatMasterRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -108,6 +107,10 @@ func (r CatMasterRequest) Do(ctx context.Context, transport Transport) (*Respons params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -176,7 +179,6 @@ func (r CatMasterRequest) Do(ctx context.Context, transport Transport) (*Respons } // WithContext sets the request context. -// func (f CatMaster) WithContext(v context.Context) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.ctx = v @@ -184,7 +186,6 @@ func (f CatMaster) WithContext(v context.Context) func(*CatMasterRequest) { } // WithFormat - a short version of the accept header, e.g. json, yaml. -// func (f CatMaster) WithFormat(v string) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.Format = v @@ -192,7 +193,6 @@ func (f CatMaster) WithFormat(v string) func(*CatMasterRequest) { } // WithH - comma-separated list of column names to display. -// func (f CatMaster) WithH(v ...string) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.H = v @@ -200,31 +200,36 @@ func (f CatMaster) WithH(v ...string) func(*CatMasterRequest) { } // WithHelp - return help information. -// func (f CatMaster) WithHelp(v bool) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.Help = &v } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). -// +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). func (f CatMaster) WithLocal(v bool) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.Local = &v } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. // +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. func (f CatMaster) WithMasterTimeout(v time.Duration) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.MasterTimeout = v } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +func (f CatMaster) WithClusterManagerTimeout(v time.Duration) func(*CatMasterRequest) { + return func(r *CatMasterRequest) { + r.ClusterManagerTimeout = v + } +} + // WithS - comma-separated list of column names or column aliases to sort by. -// func (f CatMaster) WithS(v ...string) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.S = v @@ -232,7 +237,6 @@ func (f CatMaster) WithS(v ...string) func(*CatMasterRequest) { } // WithV - verbose mode. display column headers. -// func (f CatMaster) WithV(v bool) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.V = &v @@ -240,7 +244,6 @@ func (f CatMaster) WithV(v bool) func(*CatMasterRequest) { } // WithPretty makes the response body pretty-printed. -// func (f CatMaster) WithPretty() func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.Pretty = true @@ -248,7 +251,6 @@ func (f CatMaster) WithPretty() func(*CatMasterRequest) { } // WithHuman makes statistical values human-readable. -// func (f CatMaster) WithHuman() func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.Human = true @@ -256,7 +258,6 @@ func (f CatMaster) WithHuman() func(*CatMasterRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. -// func (f CatMaster) WithErrorTrace() func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.ErrorTrace = true @@ -264,7 +265,6 @@ func (f CatMaster) WithErrorTrace() func(*CatMasterRequest) { } // WithFilterPath filters the properties of the response body. -// func (f CatMaster) WithFilterPath(v ...string) func(*CatMasterRequest) { return func(r *CatMasterRequest) { r.FilterPath = v @@ -272,7 +272,6 @@ func (f CatMaster) WithFilterPath(v ...string) func(*CatMasterRequest) { } // WithHeader adds the headers to the HTTP request. -// func (f CatMaster) WithHeader(h map[string]string) func(*CatMasterRequest) { return func(r *CatMasterRequest) { if r.Header == nil { @@ -285,7 +284,6 @@ func (f CatMaster) WithHeader(h map[string]string) func(*CatMasterRequest) { } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. -// func (f CatMaster) WithOpaqueID(s string) func(*CatMasterRequest) { return func(r *CatMasterRequest) { if r.Header == nil { diff --git a/opensearchapi/api.cat.nodeattrs.go b/opensearchapi/api.cat.nodeattrs.go index 7b54ea626..a6fe51650 100644 --- a/opensearchapi/api.cat.nodeattrs.go +++ b/opensearchapi/api.cat.nodeattrs.go @@ -54,13 +54,14 @@ type CatNodeattrs func(o ...func(*CatNodeattrsRequest)) (*Response, error) // CatNodeattrsRequest configures the Cat Nodeattrs API request. // type CatNodeattrsRequest struct { - Format string - H []string - Help *bool - Local *bool - MasterTimeout time.Duration - S []string - V *bool + Format string + H []string + Help *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + S []string + V *bool Pretty bool Human bool @@ -108,6 +109,10 @@ func (r CatNodeattrsRequest) Do(ctx context.Context, transport Transport) (*Resp params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -207,7 +212,7 @@ func (f CatNodeattrs) WithHelp(v bool) func(*CatNodeattrsRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f CatNodeattrs) WithLocal(v bool) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { @@ -215,7 +220,9 @@ func (f CatNodeattrs) WithLocal(v bool) func(*CatNodeattrsRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f CatNodeattrs) WithMasterTimeout(v time.Duration) func(*CatNodeattrsRequest) { return func(r *CatNodeattrsRequest) { @@ -223,6 +230,14 @@ func (f CatNodeattrs) WithMasterTimeout(v time.Duration) func(*CatNodeattrsReque } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f CatNodeattrs) WithClusterManagerTimeout(v time.Duration) func(*CatNodeattrsRequest) { + return func(r *CatNodeattrsRequest) { + r.ClusterManagerTimeout = v + } +} + // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatNodeattrs) WithS(v ...string) func(*CatNodeattrsRequest) { diff --git a/opensearchapi/api.cat.nodes.go b/opensearchapi/api.cat.nodes.go index 2bd5d9533..dd39e8336 100644 --- a/opensearchapi/api.cat.nodes.go +++ b/opensearchapi/api.cat.nodes.go @@ -62,6 +62,7 @@ type CatNodesRequest struct { IncludeUnloadedSegments *bool Local *bool MasterTimeout time.Duration + ClusterManagerTimeout time.Duration S []string Time string V *bool @@ -124,6 +125,10 @@ func (r CatNodesRequest) Do(ctx context.Context, transport Transport) (*Response params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -251,7 +256,7 @@ func (f CatNodes) WithIncludeUnloadedSegments(v bool) func(*CatNodesRequest) { } } -// WithLocal - calculate the selected nodes using the local cluster state rather than the state from master node (default: false). +// WithLocal - calculate the selected nodes using the local cluster state rather than the state from cluster-manager node (default: false). // func (f CatNodes) WithLocal(v bool) func(*CatNodesRequest) { return func(r *CatNodesRequest) { @@ -259,7 +264,9 @@ func (f CatNodes) WithLocal(v bool) func(*CatNodesRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f CatNodes) WithMasterTimeout(v time.Duration) func(*CatNodesRequest) { return func(r *CatNodesRequest) { @@ -267,6 +274,14 @@ func (f CatNodes) WithMasterTimeout(v time.Duration) func(*CatNodesRequest) { } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f CatNodes) WithClusterManagerTimeout(v time.Duration) func(*CatNodesRequest) { + return func(r *CatNodesRequest) { + r.ClusterManagerTimeout = v + } +} + // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatNodes) WithS(v ...string) func(*CatNodesRequest) { diff --git a/opensearchapi/api.cat.pending_tasks.go b/opensearchapi/api.cat.pending_tasks.go index 1729d6b3c..e66265168 100644 --- a/opensearchapi/api.cat.pending_tasks.go +++ b/opensearchapi/api.cat.pending_tasks.go @@ -54,14 +54,15 @@ type CatPendingTasks func(o ...func(*CatPendingTasksRequest)) (*Response, error) // CatPendingTasksRequest configures the Cat Pending Tasks API request. // type CatPendingTasksRequest struct { - Format string - H []string - Help *bool - Local *bool - MasterTimeout time.Duration - S []string - Time string - V *bool + Format string + H []string + Help *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + S []string + Time string + V *bool Pretty bool Human bool @@ -109,6 +110,10 @@ func (r CatPendingTasksRequest) Do(ctx context.Context, transport Transport) (*R params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -212,7 +217,7 @@ func (f CatPendingTasks) WithHelp(v bool) func(*CatPendingTasksRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f CatPendingTasks) WithLocal(v bool) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { @@ -220,7 +225,9 @@ func (f CatPendingTasks) WithLocal(v bool) func(*CatPendingTasksRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f CatPendingTasks) WithMasterTimeout(v time.Duration) func(*CatPendingTasksRequest) { return func(r *CatPendingTasksRequest) { @@ -228,6 +235,14 @@ func (f CatPendingTasks) WithMasterTimeout(v time.Duration) func(*CatPendingTask } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f CatPendingTasks) WithClusterManagerTimeout(v time.Duration) func(*CatPendingTasksRequest) { + return func(r *CatPendingTasksRequest) { + r.ClusterManagerTimeout = v + } +} + // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatPendingTasks) WithS(v ...string) func(*CatPendingTasksRequest) { diff --git a/opensearchapi/api.cat.plugins.go b/opensearchapi/api.cat.plugins.go index 1d281c3a5..3805a209e 100644 --- a/opensearchapi/api.cat.plugins.go +++ b/opensearchapi/api.cat.plugins.go @@ -54,14 +54,15 @@ type CatPlugins func(o ...func(*CatPluginsRequest)) (*Response, error) // CatPluginsRequest configures the Cat Plugins API request. // type CatPluginsRequest struct { - Format string - H []string - Help *bool - IncludeBootstrap *bool - Local *bool - MasterTimeout time.Duration - S []string - V *bool + Format string + H []string + Help *bool + IncludeBootstrap *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + S []string + V *bool Pretty bool Human bool @@ -113,6 +114,10 @@ func (r CatPluginsRequest) Do(ctx context.Context, transport Transport) (*Respon params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -220,7 +225,7 @@ func (f CatPlugins) WithIncludeBootstrap(v bool) func(*CatPluginsRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f CatPlugins) WithLocal(v bool) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { @@ -228,7 +233,9 @@ func (f CatPlugins) WithLocal(v bool) func(*CatPluginsRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f CatPlugins) WithMasterTimeout(v time.Duration) func(*CatPluginsRequest) { return func(r *CatPluginsRequest) { @@ -236,6 +243,14 @@ func (f CatPlugins) WithMasterTimeout(v time.Duration) func(*CatPluginsRequest) } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f CatPlugins) WithClusterManagerTimeout(v time.Duration) func(*CatPluginsRequest) { + return func(r *CatPluginsRequest) { + r.ClusterManagerTimeout = v + } +} + // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatPlugins) WithS(v ...string) func(*CatPluginsRequest) { diff --git a/opensearchapi/api.cat.repositories.go b/opensearchapi/api.cat.repositories.go index 60c5bdc76..d249335cf 100644 --- a/opensearchapi/api.cat.repositories.go +++ b/opensearchapi/api.cat.repositories.go @@ -54,13 +54,14 @@ type CatRepositories func(o ...func(*CatRepositoriesRequest)) (*Response, error) // CatRepositoriesRequest configures the Cat Repositories API request. // type CatRepositoriesRequest struct { - Format string - H []string - Help *bool - Local *bool - MasterTimeout time.Duration - S []string - V *bool + Format string + H []string + Help *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + S []string + V *bool Pretty bool Human bool @@ -108,6 +109,10 @@ func (r CatRepositoriesRequest) Do(ctx context.Context, transport Transport) (*R params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -207,7 +212,7 @@ func (f CatRepositories) WithHelp(v bool) func(*CatRepositoriesRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node. +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f CatRepositories) WithLocal(v bool) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { @@ -215,7 +220,9 @@ func (f CatRepositories) WithLocal(v bool) func(*CatRepositoriesRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f CatRepositories) WithMasterTimeout(v time.Duration) func(*CatRepositoriesRequest) { return func(r *CatRepositoriesRequest) { @@ -223,6 +230,14 @@ func (f CatRepositories) WithMasterTimeout(v time.Duration) func(*CatRepositorie } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f CatRepositories) WithClusterManagerTimeout(v time.Duration) func(*CatRepositoriesRequest) { + return func(r *CatRepositoriesRequest) { + r.ClusterManagerTimeout = v + } +} + // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatRepositories) WithS(v ...string) func(*CatRepositoriesRequest) { diff --git a/opensearchapi/api.cat.shards.go b/opensearchapi/api.cat.shards.go index 34b8da47c..232045148 100644 --- a/opensearchapi/api.cat.shards.go +++ b/opensearchapi/api.cat.shards.go @@ -56,15 +56,16 @@ type CatShards func(o ...func(*CatShardsRequest)) (*Response, error) type CatShardsRequest struct { Index []string - Bytes string - Format string - H []string - Help *bool - Local *bool - MasterTimeout time.Duration - S []string - Time string - V *bool + Bytes string + Format string + H []string + Help *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + S []string + Time string + V *bool Pretty bool Human bool @@ -123,6 +124,10 @@ func (r CatShardsRequest) Do(ctx context.Context, transport Transport) (*Respons params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -242,7 +247,7 @@ func (f CatShards) WithHelp(v bool) func(*CatShardsRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f CatShards) WithLocal(v bool) func(*CatShardsRequest) { return func(r *CatShardsRequest) { @@ -250,7 +255,9 @@ func (f CatShards) WithLocal(v bool) func(*CatShardsRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f CatShards) WithMasterTimeout(v time.Duration) func(*CatShardsRequest) { return func(r *CatShardsRequest) { @@ -258,6 +265,14 @@ func (f CatShards) WithMasterTimeout(v time.Duration) func(*CatShardsRequest) { } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f CatShards) WithClusterManagerTimeout(v time.Duration) func(*CatShardsRequest) { + return func(r *CatShardsRequest) { + r.ClusterManagerTimeout = v + } +} + // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatShards) WithS(v ...string) func(*CatShardsRequest) { diff --git a/opensearchapi/api.cat.snapshots.go b/opensearchapi/api.cat.snapshots.go index f3d8da153..08d680a9a 100644 --- a/opensearchapi/api.cat.snapshots.go +++ b/opensearchapi/api.cat.snapshots.go @@ -56,14 +56,15 @@ type CatSnapshots func(o ...func(*CatSnapshotsRequest)) (*Response, error) type CatSnapshotsRequest struct { Repository []string - Format string - H []string - Help *bool - IgnoreUnavailable *bool - MasterTimeout time.Duration - S []string - Time string - V *bool + Format string + H []string + Help *bool + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + S []string + Time string + V *bool Pretty bool Human bool @@ -118,6 +119,10 @@ func (r CatSnapshotsRequest) Do(ctx context.Context, transport Transport) (*Resp params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -237,7 +242,9 @@ func (f CatSnapshots) WithIgnoreUnavailable(v bool) func(*CatSnapshotsRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f CatSnapshots) WithMasterTimeout(v time.Duration) func(*CatSnapshotsRequest) { return func(r *CatSnapshotsRequest) { @@ -245,6 +252,14 @@ func (f CatSnapshots) WithMasterTimeout(v time.Duration) func(*CatSnapshotsReque } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f CatSnapshots) WithClusterManagerTimeout(v time.Duration) func(*CatSnapshotsRequest) { + return func(r *CatSnapshotsRequest) { + r.ClusterManagerTimeout = v + } +} + // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatSnapshots) WithS(v ...string) func(*CatSnapshotsRequest) { diff --git a/opensearchapi/api.cat.templates.go b/opensearchapi/api.cat.templates.go index 4df7dea66..0f0f75e21 100644 --- a/opensearchapi/api.cat.templates.go +++ b/opensearchapi/api.cat.templates.go @@ -56,13 +56,14 @@ type CatTemplates func(o ...func(*CatTemplatesRequest)) (*Response, error) type CatTemplatesRequest struct { Name string - Format string - H []string - Help *bool - Local *bool - MasterTimeout time.Duration - S []string - V *bool + Format string + H []string + Help *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + S []string + V *bool Pretty bool Human bool @@ -117,6 +118,10 @@ func (r CatTemplatesRequest) Do(ctx context.Context, transport Transport) (*Resp params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -224,7 +229,7 @@ func (f CatTemplates) WithHelp(v bool) func(*CatTemplatesRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f CatTemplates) WithLocal(v bool) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { @@ -232,7 +237,9 @@ func (f CatTemplates) WithLocal(v bool) func(*CatTemplatesRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f CatTemplates) WithMasterTimeout(v time.Duration) func(*CatTemplatesRequest) { return func(r *CatTemplatesRequest) { @@ -240,6 +247,14 @@ func (f CatTemplates) WithMasterTimeout(v time.Duration) func(*CatTemplatesReque } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f CatTemplates) WithClusterManagerTimeout(v time.Duration) func(*CatTemplatesRequest) { + return func(r *CatTemplatesRequest) { + r.ClusterManagerTimeout = v + } +} + // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatTemplates) WithS(v ...string) func(*CatTemplatesRequest) { diff --git a/opensearchapi/api.cat.thread_pool.go b/opensearchapi/api.cat.thread_pool.go index 80a90dc5a..a3e572fa7 100644 --- a/opensearchapi/api.cat.thread_pool.go +++ b/opensearchapi/api.cat.thread_pool.go @@ -57,14 +57,15 @@ type CatThreadPool func(o ...func(*CatThreadPoolRequest)) (*Response, error) type CatThreadPoolRequest struct { ThreadPoolPatterns []string - Format string - H []string - Help *bool - Local *bool - MasterTimeout time.Duration - S []string - Size string - V *bool + Format string + H []string + Help *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + S []string + Size string + V *bool Pretty bool Human bool @@ -119,6 +120,10 @@ func (r CatThreadPoolRequest) Do(ctx context.Context, transport Transport) (*Res params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if len(r.S) > 0 { params["s"] = strings.Join(r.S, ",") } @@ -230,7 +235,7 @@ func (f CatThreadPool) WithHelp(v bool) func(*CatThreadPoolRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f CatThreadPool) WithLocal(v bool) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { @@ -238,7 +243,9 @@ func (f CatThreadPool) WithLocal(v bool) func(*CatThreadPoolRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f CatThreadPool) WithMasterTimeout(v time.Duration) func(*CatThreadPoolRequest) { return func(r *CatThreadPoolRequest) { @@ -246,6 +253,14 @@ func (f CatThreadPool) WithMasterTimeout(v time.Duration) func(*CatThreadPoolReq } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f CatThreadPool) WithClusterManagerTimeout(v time.Duration) func(*CatThreadPoolRequest) { + return func(r *CatThreadPoolRequest) { + r.ClusterManagerTimeout = v + } +} + // WithS - comma-separated list of column names or column aliases to sort by. // func (f CatThreadPool) WithS(v ...string) func(*CatThreadPoolRequest) { diff --git a/opensearchapi/api.cluster.delete_component_template.go b/opensearchapi/api.cluster.delete_component_template.go index c6b9ddf6a..f7e8d388a 100644 --- a/opensearchapi/api.cluster.delete_component_template.go +++ b/opensearchapi/api.cluster.delete_component_template.go @@ -55,8 +55,9 @@ type ClusterDeleteComponentTemplate func(name string, o ...func(*ClusterDeleteCo type ClusterDeleteComponentTemplateRequest struct { Name string - MasterTimeout time.Duration - Timeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -91,6 +92,10 @@ func (r ClusterDeleteComponentTemplateRequest) Do(ctx context.Context, transport params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -162,7 +167,9 @@ func (f ClusterDeleteComponentTemplate) WithContext(v context.Context) func(*Clu } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f ClusterDeleteComponentTemplate) WithMasterTimeout(v time.Duration) func(*ClusterDeleteComponentTemplateRequest) { return func(r *ClusterDeleteComponentTemplateRequest) { @@ -170,6 +177,14 @@ func (f ClusterDeleteComponentTemplate) WithMasterTimeout(v time.Duration) func( } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f ClusterDeleteComponentTemplate) WithClusterManagerTimeout(v time.Duration) func(*ClusterDeleteComponentTemplateRequest) { + return func(r *ClusterDeleteComponentTemplateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f ClusterDeleteComponentTemplate) WithTimeout(v time.Duration) func(*ClusterDeleteComponentTemplateRequest) { diff --git a/opensearchapi/api.cluster.exists_component_template.go b/opensearchapi/api.cluster.exists_component_template.go index def02c64b..36c951c2d 100644 --- a/opensearchapi/api.cluster.exists_component_template.go +++ b/opensearchapi/api.cluster.exists_component_template.go @@ -56,8 +56,9 @@ type ClusterExistsComponentTemplate func(name string, o ...func(*ClusterExistsCo type ClusterExistsComponentTemplateRequest struct { Name string - Local *bool - MasterTimeout time.Duration + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -96,6 +97,10 @@ func (r ClusterExistsComponentTemplateRequest) Do(ctx context.Context, transport params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -163,7 +168,7 @@ func (f ClusterExistsComponentTemplate) WithContext(v context.Context) func(*Clu } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f ClusterExistsComponentTemplate) WithLocal(v bool) func(*ClusterExistsComponentTemplateRequest) { return func(r *ClusterExistsComponentTemplateRequest) { @@ -171,7 +176,9 @@ func (f ClusterExistsComponentTemplate) WithLocal(v bool) func(*ClusterExistsCom } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f ClusterExistsComponentTemplate) WithMasterTimeout(v time.Duration) func(*ClusterExistsComponentTemplateRequest) { return func(r *ClusterExistsComponentTemplateRequest) { @@ -179,6 +186,14 @@ func (f ClusterExistsComponentTemplate) WithMasterTimeout(v time.Duration) func( } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f ClusterExistsComponentTemplate) WithClusterManagerTimeout(v time.Duration) func(*ClusterExistsComponentTemplateRequest) { + return func(r *ClusterExistsComponentTemplateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f ClusterExistsComponentTemplate) WithPretty() func(*ClusterExistsComponentTemplateRequest) { diff --git a/opensearchapi/api.cluster.get_component_template.go b/opensearchapi/api.cluster.get_component_template.go index 72a5fdbb8..9e97ce881 100644 --- a/opensearchapi/api.cluster.get_component_template.go +++ b/opensearchapi/api.cluster.get_component_template.go @@ -56,8 +56,9 @@ type ClusterGetComponentTemplate func(o ...func(*ClusterGetComponentTemplateRequ type ClusterGetComponentTemplateRequest struct { Name []string - Local *bool - MasterTimeout time.Duration + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -98,6 +99,10 @@ func (r ClusterGetComponentTemplateRequest) Do(ctx context.Context, transport Tr params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -173,7 +178,7 @@ func (f ClusterGetComponentTemplate) WithName(v ...string) func(*ClusterGetCompo } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f ClusterGetComponentTemplate) WithLocal(v bool) func(*ClusterGetComponentTemplateRequest) { return func(r *ClusterGetComponentTemplateRequest) { @@ -181,7 +186,9 @@ func (f ClusterGetComponentTemplate) WithLocal(v bool) func(*ClusterGetComponent } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f ClusterGetComponentTemplate) WithMasterTimeout(v time.Duration) func(*ClusterGetComponentTemplateRequest) { return func(r *ClusterGetComponentTemplateRequest) { @@ -189,6 +196,14 @@ func (f ClusterGetComponentTemplate) WithMasterTimeout(v time.Duration) func(*Cl } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f ClusterGetComponentTemplate) WithClusterManagerTimeout(v time.Duration) func(*ClusterGetComponentTemplateRequest) { + return func(r *ClusterGetComponentTemplateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f ClusterGetComponentTemplate) WithPretty() func(*ClusterGetComponentTemplateRequest) { diff --git a/opensearchapi/api.cluster.get_settings.go b/opensearchapi/api.cluster.get_settings.go index 20709a912..bdf565fac 100644 --- a/opensearchapi/api.cluster.get_settings.go +++ b/opensearchapi/api.cluster.get_settings.go @@ -54,10 +54,11 @@ type ClusterGetSettings func(o ...func(*ClusterGetSettingsRequest)) (*Response, // ClusterGetSettingsRequest configures the Cluster Get Settings API request. // type ClusterGetSettingsRequest struct { - FlatSettings *bool - IncludeDefaults *bool - MasterTimeout time.Duration - Timeout time.Duration + FlatSettings *bool + IncludeDefaults *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -97,6 +98,10 @@ func (r ClusterGetSettingsRequest) Do(ctx context.Context, transport Transport) params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -184,7 +189,9 @@ func (f ClusterGetSettings) WithIncludeDefaults(v bool) func(*ClusterGetSettings } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f ClusterGetSettings) WithMasterTimeout(v time.Duration) func(*ClusterGetSettingsRequest) { return func(r *ClusterGetSettingsRequest) { @@ -192,6 +199,14 @@ func (f ClusterGetSettings) WithMasterTimeout(v time.Duration) func(*ClusterGetS } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f ClusterGetSettings) WithClusterManagerTimeout(v time.Duration) func(*ClusterGetSettingsRequest) { + return func(r *ClusterGetSettingsRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f ClusterGetSettings) WithTimeout(v time.Duration) func(*ClusterGetSettingsRequest) { diff --git a/opensearchapi/api.cluster.health.go b/opensearchapi/api.cluster.health.go index 630b5b467..4cdc8331a 100644 --- a/opensearchapi/api.cluster.health.go +++ b/opensearchapi/api.cluster.health.go @@ -60,6 +60,7 @@ type ClusterHealthRequest struct { Level string Local *bool MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Timeout time.Duration WaitForActiveShards string WaitForEvents string @@ -117,6 +118,10 @@ func (r ClusterHealthRequest) Do(ctx context.Context, transport Transport) (*Res params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -236,7 +241,7 @@ func (f ClusterHealth) WithLevel(v string) func(*ClusterHealthRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f ClusterHealth) WithLocal(v bool) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { @@ -244,7 +249,9 @@ func (f ClusterHealth) WithLocal(v bool) func(*ClusterHealthRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f ClusterHealth) WithMasterTimeout(v time.Duration) func(*ClusterHealthRequest) { return func(r *ClusterHealthRequest) { @@ -252,6 +259,14 @@ func (f ClusterHealth) WithMasterTimeout(v time.Duration) func(*ClusterHealthReq } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f ClusterHealth) WithClusterManagerTimeout(v time.Duration) func(*ClusterHealthRequest) { + return func(r *ClusterHealthRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f ClusterHealth) WithTimeout(v time.Duration) func(*ClusterHealthRequest) { diff --git a/opensearchapi/api.cluster.pending_tasks.go b/opensearchapi/api.cluster.pending_tasks.go index 15e64449c..9039cc28c 100644 --- a/opensearchapi/api.cluster.pending_tasks.go +++ b/opensearchapi/api.cluster.pending_tasks.go @@ -55,8 +55,9 @@ type ClusterPendingTasks func(o ...func(*ClusterPendingTasksRequest)) (*Response // ClusterPendingTasksRequest configures the Cluster Pending Tasks API request. // type ClusterPendingTasksRequest struct { - Local *bool - MasterTimeout time.Duration + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -92,6 +93,10 @@ func (r ClusterPendingTasksRequest) Do(ctx context.Context, transport Transport) params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -159,7 +164,7 @@ func (f ClusterPendingTasks) WithContext(v context.Context) func(*ClusterPending } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f ClusterPendingTasks) WithLocal(v bool) func(*ClusterPendingTasksRequest) { return func(r *ClusterPendingTasksRequest) { @@ -167,7 +172,9 @@ func (f ClusterPendingTasks) WithLocal(v bool) func(*ClusterPendingTasksRequest) } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f ClusterPendingTasks) WithMasterTimeout(v time.Duration) func(*ClusterPendingTasksRequest) { return func(r *ClusterPendingTasksRequest) { @@ -175,6 +182,14 @@ func (f ClusterPendingTasks) WithMasterTimeout(v time.Duration) func(*ClusterPen } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f ClusterPendingTasks) WithClusterManagerTimeout(v time.Duration) func(*ClusterPendingTasksRequest) { + return func(r *ClusterPendingTasksRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f ClusterPendingTasks) WithPretty() func(*ClusterPendingTasksRequest) { diff --git a/opensearchapi/api.cluster.put_component_template.go b/opensearchapi/api.cluster.put_component_template.go index c54cebe8d..ac12663a5 100644 --- a/opensearchapi/api.cluster.put_component_template.go +++ b/opensearchapi/api.cluster.put_component_template.go @@ -59,9 +59,10 @@ type ClusterPutComponentTemplateRequest struct { Name string - Create *bool - MasterTimeout time.Duration - Timeout time.Duration + Create *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -100,6 +101,10 @@ func (r ClusterPutComponentTemplateRequest) Do(ctx context.Context, transport Tr params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -183,7 +188,9 @@ func (f ClusterPutComponentTemplate) WithCreate(v bool) func(*ClusterPutComponen } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f ClusterPutComponentTemplate) WithMasterTimeout(v time.Duration) func(*ClusterPutComponentTemplateRequest) { return func(r *ClusterPutComponentTemplateRequest) { @@ -191,6 +198,14 @@ func (f ClusterPutComponentTemplate) WithMasterTimeout(v time.Duration) func(*Cl } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f ClusterPutComponentTemplate) WithClusterManagerTimeout(v time.Duration) func(*ClusterPutComponentTemplateRequest) { + return func(r *ClusterPutComponentTemplateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f ClusterPutComponentTemplate) WithTimeout(v time.Duration) func(*ClusterPutComponentTemplateRequest) { diff --git a/opensearchapi/api.cluster.put_settings.go b/opensearchapi/api.cluster.put_settings.go index 64ed6bc58..a898de36d 100644 --- a/opensearchapi/api.cluster.put_settings.go +++ b/opensearchapi/api.cluster.put_settings.go @@ -57,9 +57,10 @@ type ClusterPutSettings func(body io.Reader, o ...func(*ClusterPutSettingsReques type ClusterPutSettingsRequest struct { Body io.Reader - FlatSettings *bool - MasterTimeout time.Duration - Timeout time.Duration + FlatSettings *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -95,6 +96,10 @@ func (r ClusterPutSettingsRequest) Do(ctx context.Context, transport Transport) params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -178,7 +183,9 @@ func (f ClusterPutSettings) WithFlatSettings(v bool) func(*ClusterPutSettingsReq } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f ClusterPutSettings) WithMasterTimeout(v time.Duration) func(*ClusterPutSettingsRequest) { return func(r *ClusterPutSettingsRequest) { @@ -186,6 +193,14 @@ func (f ClusterPutSettings) WithMasterTimeout(v time.Duration) func(*ClusterPutS } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f ClusterPutSettings) WithClusterManagerTimeout(v time.Duration) func(*ClusterPutSettingsRequest) { + return func(r *ClusterPutSettingsRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f ClusterPutSettings) WithTimeout(v time.Duration) func(*ClusterPutSettingsRequest) { diff --git a/opensearchapi/api.cluster.reroute.go b/opensearchapi/api.cluster.reroute.go index a810f3726..a5d0be0ea 100644 --- a/opensearchapi/api.cluster.reroute.go +++ b/opensearchapi/api.cluster.reroute.go @@ -57,12 +57,13 @@ type ClusterReroute func(o ...func(*ClusterRerouteRequest)) (*Response, error) type ClusterRerouteRequest struct { Body io.Reader - DryRun *bool - Explain *bool - MasterTimeout time.Duration - Metric []string - RetryFailed *bool - Timeout time.Duration + DryRun *bool + Explain *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Metric []string + RetryFailed *bool + Timeout time.Duration Pretty bool Human bool @@ -102,6 +103,10 @@ func (r ClusterRerouteRequest) Do(ctx context.Context, transport Transport) (*Re params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if len(r.Metric) > 0 { params["metric"] = strings.Join(r.Metric, ",") } @@ -209,7 +214,9 @@ func (f ClusterReroute) WithExplain(v bool) func(*ClusterRerouteRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f ClusterReroute) WithMasterTimeout(v time.Duration) func(*ClusterRerouteRequest) { return func(r *ClusterRerouteRequest) { @@ -217,6 +224,14 @@ func (f ClusterReroute) WithMasterTimeout(v time.Duration) func(*ClusterRerouteR } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f ClusterReroute) WithClusterManagerTimeout(v time.Duration) func(*ClusterRerouteRequest) { + return func(r *ClusterRerouteRequest) { + r.ClusterManagerTimeout = v + } +} + // WithMetric - limit the information returned to the specified metrics. defaults to all but metadata. // func (f ClusterReroute) WithMetric(v ...string) func(*ClusterRerouteRequest) { diff --git a/opensearchapi/api.cluster.state.go b/opensearchapi/api.cluster.state.go index 3abced62e..211c39e79 100644 --- a/opensearchapi/api.cluster.state.go +++ b/opensearchapi/api.cluster.state.go @@ -64,6 +64,7 @@ type ClusterStateRequest struct { IgnoreUnavailable *bool Local *bool MasterTimeout time.Duration + ClusterManagerTimeout time.Duration WaitForMetadataVersion *int WaitForTimeout time.Duration @@ -128,6 +129,10 @@ func (r ClusterStateRequest) Do(ctx context.Context, transport Transport) (*Resp params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.WaitForMetadataVersion != nil { params["wait_for_metadata_version"] = strconv.FormatInt(int64(*r.WaitForMetadataVersion), 10) } @@ -251,7 +256,7 @@ func (f ClusterState) WithIgnoreUnavailable(v bool) func(*ClusterStateRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f ClusterState) WithLocal(v bool) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { @@ -259,7 +264,9 @@ func (f ClusterState) WithLocal(v bool) func(*ClusterStateRequest) { } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f ClusterState) WithMasterTimeout(v time.Duration) func(*ClusterStateRequest) { return func(r *ClusterStateRequest) { @@ -267,6 +274,14 @@ func (f ClusterState) WithMasterTimeout(v time.Duration) func(*ClusterStateReque } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f ClusterState) WithClusterManagerTimeout(v time.Duration) func(*ClusterStateRequest) { + return func(r *ClusterStateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithWaitForMetadataVersion - wait for the metadata version to be equal or greater than the specified metadata version. // func (f ClusterState) WithWaitForMetadataVersion(v int) func(*ClusterStateRequest) { diff --git a/opensearchapi/api.dangling_indices.delete_dangling_index.go b/opensearchapi/api.dangling_indices.delete_dangling_index.go index b931235ae..33c4588d1 100644 --- a/opensearchapi/api.dangling_indices.delete_dangling_index.go +++ b/opensearchapi/api.dangling_indices.delete_dangling_index.go @@ -56,9 +56,10 @@ type DanglingIndicesDeleteDanglingIndex func(index_uuid string, o ...func(*Dangl type DanglingIndicesDeleteDanglingIndexRequest struct { IndexUUID string - AcceptDataLoss *bool - MasterTimeout time.Duration - Timeout time.Duration + AcceptDataLoss *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -97,6 +98,10 @@ func (r DanglingIndicesDeleteDanglingIndexRequest) Do(ctx context.Context, trans params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -176,7 +181,9 @@ func (f DanglingIndicesDeleteDanglingIndex) WithAcceptDataLoss(v bool) func(*Dan } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f DanglingIndicesDeleteDanglingIndex) WithMasterTimeout(v time.Duration) func(*DanglingIndicesDeleteDanglingIndexRequest) { return func(r *DanglingIndicesDeleteDanglingIndexRequest) { @@ -184,6 +191,14 @@ func (f DanglingIndicesDeleteDanglingIndex) WithMasterTimeout(v time.Duration) f } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f DanglingIndicesDeleteDanglingIndex) WithClusterManagerTimeout(v time.Duration) func(*DanglingIndicesDeleteDanglingIndexRequest) { + return func(r *DanglingIndicesDeleteDanglingIndexRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f DanglingIndicesDeleteDanglingIndex) WithTimeout(v time.Duration) func(*DanglingIndicesDeleteDanglingIndexRequest) { diff --git a/opensearchapi/api.dangling_indices.import_dangling_index.go b/opensearchapi/api.dangling_indices.import_dangling_index.go index fb46c0668..e251b43ab 100644 --- a/opensearchapi/api.dangling_indices.import_dangling_index.go +++ b/opensearchapi/api.dangling_indices.import_dangling_index.go @@ -56,9 +56,10 @@ type DanglingIndicesImportDanglingIndex func(index_uuid string, o ...func(*Dangl type DanglingIndicesImportDanglingIndexRequest struct { IndexUUID string - AcceptDataLoss *bool - MasterTimeout time.Duration - Timeout time.Duration + AcceptDataLoss *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -97,6 +98,10 @@ func (r DanglingIndicesImportDanglingIndexRequest) Do(ctx context.Context, trans params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -176,7 +181,9 @@ func (f DanglingIndicesImportDanglingIndex) WithAcceptDataLoss(v bool) func(*Dan } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f DanglingIndicesImportDanglingIndex) WithMasterTimeout(v time.Duration) func(*DanglingIndicesImportDanglingIndexRequest) { return func(r *DanglingIndicesImportDanglingIndexRequest) { @@ -184,6 +191,14 @@ func (f DanglingIndicesImportDanglingIndex) WithMasterTimeout(v time.Duration) f } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f DanglingIndicesImportDanglingIndex) WithClusterManagerTimeout(v time.Duration) func(*DanglingIndicesImportDanglingIndexRequest) { + return func(r *DanglingIndicesImportDanglingIndexRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f DanglingIndicesImportDanglingIndex) WithTimeout(v time.Duration) func(*DanglingIndicesImportDanglingIndexRequest) { diff --git a/opensearchapi/api.delete_script.go b/opensearchapi/api.delete_script.go index e2a7aee61..3f8e38597 100644 --- a/opensearchapi/api.delete_script.go +++ b/opensearchapi/api.delete_script.go @@ -55,8 +55,9 @@ type DeleteScript func(id string, o ...func(*DeleteScriptRequest)) (*Response, e type DeleteScriptRequest struct { ScriptID string - MasterTimeout time.Duration - Timeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -91,6 +92,10 @@ func (r DeleteScriptRequest) Do(ctx context.Context, transport Transport) (*Resp params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -162,7 +167,9 @@ func (f DeleteScript) WithContext(v context.Context) func(*DeleteScriptRequest) } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f DeleteScript) WithMasterTimeout(v time.Duration) func(*DeleteScriptRequest) { return func(r *DeleteScriptRequest) { @@ -170,6 +177,14 @@ func (f DeleteScript) WithMasterTimeout(v time.Duration) func(*DeleteScriptReque } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f DeleteScript) WithClusterManagerTimeout(v time.Duration) func(*DeleteScriptRequest) { + return func(r *DeleteScriptRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f DeleteScript) WithTimeout(v time.Duration) func(*DeleteScriptRequest) { diff --git a/opensearchapi/api.get_script.go b/opensearchapi/api.get_script.go index 4af9cc227..9a8be7f89 100644 --- a/opensearchapi/api.get_script.go +++ b/opensearchapi/api.get_script.go @@ -55,7 +55,8 @@ type GetScript func(id string, o ...func(*GetScriptRequest)) (*Response, error) type GetScriptRequest struct { ScriptID string - MasterTimeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -90,6 +91,10 @@ func (r GetScriptRequest) Do(ctx context.Context, transport Transport) (*Respons params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -157,7 +162,9 @@ func (f GetScript) WithContext(v context.Context) func(*GetScriptRequest) { } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f GetScript) WithMasterTimeout(v time.Duration) func(*GetScriptRequest) { return func(r *GetScriptRequest) { @@ -165,6 +172,14 @@ func (f GetScript) WithMasterTimeout(v time.Duration) func(*GetScriptRequest) { } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f GetScript) WithClusterManagerTimeout(v time.Duration) func(*GetScriptRequest) { + return func(r *GetScriptRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f GetScript) WithPretty() func(*GetScriptRequest) { diff --git a/opensearchapi/api.indices.add_block.go b/opensearchapi/api.indices.add_block.go index 0f2417180..59ee03c1d 100644 --- a/opensearchapi/api.indices.add_block.go +++ b/opensearchapi/api.indices.add_block.go @@ -58,11 +58,12 @@ type IndicesAddBlockRequest struct { Block string - AllowNoIndices *bool - ExpandWildcards string - IgnoreUnavailable *bool - MasterTimeout time.Duration - Timeout time.Duration + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -111,6 +112,10 @@ func (r IndicesAddBlockRequest) Do(ctx context.Context, transport Transport) (*R params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -206,7 +211,9 @@ func (f IndicesAddBlock) WithIgnoreUnavailable(v bool) func(*IndicesAddBlockRequ } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesAddBlock) WithMasterTimeout(v time.Duration) func(*IndicesAddBlockRequest) { return func(r *IndicesAddBlockRequest) { @@ -214,6 +221,14 @@ func (f IndicesAddBlock) WithMasterTimeout(v time.Duration) func(*IndicesAddBloc } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesAddBlock) WithClusterManagerTimeout(v time.Duration) func(*IndicesAddBlockRequest) { + return func(r *IndicesAddBlockRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f IndicesAddBlock) WithTimeout(v time.Duration) func(*IndicesAddBlockRequest) { diff --git a/opensearchapi/api.indices.clone.go b/opensearchapi/api.indices.clone.go index 177085178..ce98843f1 100644 --- a/opensearchapi/api.indices.clone.go +++ b/opensearchapi/api.indices.clone.go @@ -60,9 +60,10 @@ type IndicesCloneRequest struct { Target string - MasterTimeout time.Duration - Timeout time.Duration - WaitForActiveShards string + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string Pretty bool Human bool @@ -99,6 +100,10 @@ func (r IndicesCloneRequest) Do(ctx context.Context, transport Transport) (*Resp params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -186,7 +191,9 @@ func (f IndicesClone) WithBody(v io.Reader) func(*IndicesCloneRequest) { } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesClone) WithMasterTimeout(v time.Duration) func(*IndicesCloneRequest) { return func(r *IndicesCloneRequest) { @@ -194,6 +201,14 @@ func (f IndicesClone) WithMasterTimeout(v time.Duration) func(*IndicesCloneReque } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesClone) WithClusterManagerTimeout(v time.Duration) func(*IndicesCloneRequest) { + return func(r *IndicesCloneRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f IndicesClone) WithTimeout(v time.Duration) func(*IndicesCloneRequest) { diff --git a/opensearchapi/api.indices.close.go b/opensearchapi/api.indices.close.go index 32bf1b54e..830b104e2 100644 --- a/opensearchapi/api.indices.close.go +++ b/opensearchapi/api.indices.close.go @@ -56,12 +56,13 @@ type IndicesClose func(index []string, o ...func(*IndicesCloseRequest)) (*Respon type IndicesCloseRequest struct { Index []string - AllowNoIndices *bool - ExpandWildcards string - IgnoreUnavailable *bool - MasterTimeout time.Duration - Timeout time.Duration - WaitForActiveShards string + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string Pretty bool Human bool @@ -108,6 +109,10 @@ func (r IndicesCloseRequest) Do(ctx context.Context, transport Transport) (*Resp params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -207,7 +212,9 @@ func (f IndicesClose) WithIgnoreUnavailable(v bool) func(*IndicesCloseRequest) { } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesClose) WithMasterTimeout(v time.Duration) func(*IndicesCloseRequest) { return func(r *IndicesCloseRequest) { @@ -215,6 +222,14 @@ func (f IndicesClose) WithMasterTimeout(v time.Duration) func(*IndicesCloseReque } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesClose) WithClusterManagerTimeout(v time.Duration) func(*IndicesCloseRequest) { + return func(r *IndicesCloseRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f IndicesClose) WithTimeout(v time.Duration) func(*IndicesCloseRequest) { diff --git a/opensearchapi/api.indices.create.go b/opensearchapi/api.indices.create.go index e4ac829f4..93b4aac1a 100644 --- a/opensearchapi/api.indices.create.go +++ b/opensearchapi/api.indices.create.go @@ -58,9 +58,10 @@ type IndicesCreateRequest struct { Body io.Reader - MasterTimeout time.Duration - Timeout time.Duration - WaitForActiveShards string + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string Pretty bool Human bool @@ -93,6 +94,10 @@ func (r IndicesCreateRequest) Do(ctx context.Context, transport Transport) (*Res params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -180,7 +185,9 @@ func (f IndicesCreate) WithBody(v io.Reader) func(*IndicesCreateRequest) { } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesCreate) WithMasterTimeout(v time.Duration) func(*IndicesCreateRequest) { return func(r *IndicesCreateRequest) { @@ -188,6 +195,14 @@ func (f IndicesCreate) WithMasterTimeout(v time.Duration) func(*IndicesCreateReq } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesCreate) WithClusterManagerTimeout(v time.Duration) func(*IndicesCreateRequest) { + return func(r *IndicesCreateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f IndicesCreate) WithTimeout(v time.Duration) func(*IndicesCreateRequest) { diff --git a/opensearchapi/api.indices.delete.go b/opensearchapi/api.indices.delete.go index 401e6eb71..92544be4d 100644 --- a/opensearchapi/api.indices.delete.go +++ b/opensearchapi/api.indices.delete.go @@ -56,11 +56,12 @@ type IndicesDelete func(index []string, o ...func(*IndicesDeleteRequest)) (*Resp type IndicesDeleteRequest struct { Index []string - AllowNoIndices *bool - ExpandWildcards string - IgnoreUnavailable *bool - MasterTimeout time.Duration - Timeout time.Duration + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -105,6 +106,10 @@ func (r IndicesDeleteRequest) Do(ctx context.Context, transport Transport) (*Res params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -200,7 +205,9 @@ func (f IndicesDelete) WithIgnoreUnavailable(v bool) func(*IndicesDeleteRequest) } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesDelete) WithMasterTimeout(v time.Duration) func(*IndicesDeleteRequest) { return func(r *IndicesDeleteRequest) { @@ -208,6 +215,14 @@ func (f IndicesDelete) WithMasterTimeout(v time.Duration) func(*IndicesDeleteReq } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesDelete) WithClusterManagerTimeout(v time.Duration) func(*IndicesDeleteRequest) { + return func(r *IndicesDeleteRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f IndicesDelete) WithTimeout(v time.Duration) func(*IndicesDeleteRequest) { diff --git a/opensearchapi/api.indices.delete_alias.go b/opensearchapi/api.indices.delete_alias.go index 46220832a..ee8dcd6d1 100644 --- a/opensearchapi/api.indices.delete_alias.go +++ b/opensearchapi/api.indices.delete_alias.go @@ -57,8 +57,9 @@ type IndicesDeleteAliasRequest struct { Name []string - MasterTimeout time.Duration - Timeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -95,6 +96,10 @@ func (r IndicesDeleteAliasRequest) Do(ctx context.Context, transport Transport) params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -166,7 +171,9 @@ func (f IndicesDeleteAlias) WithContext(v context.Context) func(*IndicesDeleteAl } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesDeleteAlias) WithMasterTimeout(v time.Duration) func(*IndicesDeleteAliasRequest) { return func(r *IndicesDeleteAliasRequest) { @@ -174,6 +181,14 @@ func (f IndicesDeleteAlias) WithMasterTimeout(v time.Duration) func(*IndicesDele } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesDeleteAlias) WithClusterManagerTimeout(v time.Duration) func(*IndicesDeleteAliasRequest) { + return func(r *IndicesDeleteAliasRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit timestamp for the document. // func (f IndicesDeleteAlias) WithTimeout(v time.Duration) func(*IndicesDeleteAliasRequest) { diff --git a/opensearchapi/api.indices.delete_index_template.go b/opensearchapi/api.indices.delete_index_template.go index 19e77aedf..777e10103 100644 --- a/opensearchapi/api.indices.delete_index_template.go +++ b/opensearchapi/api.indices.delete_index_template.go @@ -55,8 +55,9 @@ type IndicesDeleteIndexTemplate func(name string, o ...func(*IndicesDeleteIndexT type IndicesDeleteIndexTemplateRequest struct { Name string - MasterTimeout time.Duration - Timeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -91,6 +92,10 @@ func (r IndicesDeleteIndexTemplateRequest) Do(ctx context.Context, transport Tra params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -162,7 +167,9 @@ func (f IndicesDeleteIndexTemplate) WithContext(v context.Context) func(*Indices } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesDeleteIndexTemplate) WithMasterTimeout(v time.Duration) func(*IndicesDeleteIndexTemplateRequest) { return func(r *IndicesDeleteIndexTemplateRequest) { @@ -170,6 +177,14 @@ func (f IndicesDeleteIndexTemplate) WithMasterTimeout(v time.Duration) func(*Ind } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesDeleteIndexTemplate) WithClusterManagerTimeout(v time.Duration) func(*IndicesDeleteIndexTemplateRequest) { + return func(r *IndicesDeleteIndexTemplateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f IndicesDeleteIndexTemplate) WithTimeout(v time.Duration) func(*IndicesDeleteIndexTemplateRequest) { diff --git a/opensearchapi/api.indices.delete_template.go b/opensearchapi/api.indices.delete_template.go index c5f22b22e..7a9b2cadb 100644 --- a/opensearchapi/api.indices.delete_template.go +++ b/opensearchapi/api.indices.delete_template.go @@ -55,8 +55,9 @@ type IndicesDeleteTemplate func(name string, o ...func(*IndicesDeleteTemplateReq type IndicesDeleteTemplateRequest struct { Name string - MasterTimeout time.Duration - Timeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -91,6 +92,10 @@ func (r IndicesDeleteTemplateRequest) Do(ctx context.Context, transport Transpor params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -162,7 +167,9 @@ func (f IndicesDeleteTemplate) WithContext(v context.Context) func(*IndicesDelet } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesDeleteTemplate) WithMasterTimeout(v time.Duration) func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { @@ -170,6 +177,14 @@ func (f IndicesDeleteTemplate) WithMasterTimeout(v time.Duration) func(*IndicesD } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesDeleteTemplate) WithClusterManagerTimeout(v time.Duration) func(*IndicesDeleteTemplateRequest) { + return func(r *IndicesDeleteTemplateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f IndicesDeleteTemplate) WithTimeout(v time.Duration) func(*IndicesDeleteTemplateRequest) { diff --git a/opensearchapi/api.indices.exists.go b/opensearchapi/api.indices.exists.go index b27334336..70f6d047f 100644 --- a/opensearchapi/api.indices.exists.go +++ b/opensearchapi/api.indices.exists.go @@ -220,7 +220,7 @@ func (f IndicesExists) WithIncludeDefaults(v bool) func(*IndicesExistsRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f IndicesExists) WithLocal(v bool) func(*IndicesExistsRequest) { return func(r *IndicesExistsRequest) { diff --git a/opensearchapi/api.indices.exists_alias.go b/opensearchapi/api.indices.exists_alias.go index cf80d38a5..a8782276d 100644 --- a/opensearchapi/api.indices.exists_alias.go +++ b/opensearchapi/api.indices.exists_alias.go @@ -210,7 +210,7 @@ func (f IndicesExistsAlias) WithIgnoreUnavailable(v bool) func(*IndicesExistsAli } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f IndicesExistsAlias) WithLocal(v bool) func(*IndicesExistsAliasRequest) { return func(r *IndicesExistsAliasRequest) { diff --git a/opensearchapi/api.indices.exists_index_template.go b/opensearchapi/api.indices.exists_index_template.go index 3e8b11a41..901f0fe2d 100644 --- a/opensearchapi/api.indices.exists_index_template.go +++ b/opensearchapi/api.indices.exists_index_template.go @@ -56,9 +56,10 @@ type IndicesExistsIndexTemplate func(name string, o ...func(*IndicesExistsIndexT type IndicesExistsIndexTemplateRequest struct { Name string - FlatSettings *bool - Local *bool - MasterTimeout time.Duration + FlatSettings *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -101,6 +102,10 @@ func (r IndicesExistsIndexTemplateRequest) Do(ctx context.Context, transport Tra params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -176,7 +181,7 @@ func (f IndicesExistsIndexTemplate) WithFlatSettings(v bool) func(*IndicesExists } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f IndicesExistsIndexTemplate) WithLocal(v bool) func(*IndicesExistsIndexTemplateRequest) { return func(r *IndicesExistsIndexTemplateRequest) { @@ -184,7 +189,9 @@ func (f IndicesExistsIndexTemplate) WithLocal(v bool) func(*IndicesExistsIndexTe } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesExistsIndexTemplate) WithMasterTimeout(v time.Duration) func(*IndicesExistsIndexTemplateRequest) { return func(r *IndicesExistsIndexTemplateRequest) { @@ -192,6 +199,14 @@ func (f IndicesExistsIndexTemplate) WithMasterTimeout(v time.Duration) func(*Ind } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesExistsIndexTemplate) WithClusterManagerTimeout(v time.Duration) func(*IndicesExistsIndexTemplateRequest) { + return func(r *IndicesExistsIndexTemplateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f IndicesExistsIndexTemplate) WithPretty() func(*IndicesExistsIndexTemplateRequest) { diff --git a/opensearchapi/api.indices.exists_template.go b/opensearchapi/api.indices.exists_template.go index 6feb7daa7..89e60498b 100644 --- a/opensearchapi/api.indices.exists_template.go +++ b/opensearchapi/api.indices.exists_template.go @@ -56,9 +56,10 @@ type IndicesExistsTemplate func(name []string, o ...func(*IndicesExistsTemplateR type IndicesExistsTemplateRequest struct { Name []string - FlatSettings *bool - Local *bool - MasterTimeout time.Duration + FlatSettings *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -101,6 +102,10 @@ func (r IndicesExistsTemplateRequest) Do(ctx context.Context, transport Transpor params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -176,7 +181,7 @@ func (f IndicesExistsTemplate) WithFlatSettings(v bool) func(*IndicesExistsTempl } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f IndicesExistsTemplate) WithLocal(v bool) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { @@ -184,7 +189,9 @@ func (f IndicesExistsTemplate) WithLocal(v bool) func(*IndicesExistsTemplateRequ } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesExistsTemplate) WithMasterTimeout(v time.Duration) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { @@ -192,6 +199,14 @@ func (f IndicesExistsTemplate) WithMasterTimeout(v time.Duration) func(*IndicesE } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesExistsTemplate) WithClusterManagerTimeout(v time.Duration) func(*IndicesExistsTemplateRequest) { + return func(r *IndicesExistsTemplateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f IndicesExistsTemplate) WithPretty() func(*IndicesExistsTemplateRequest) { diff --git a/opensearchapi/api.indices.get.go b/opensearchapi/api.indices.get.go index a3018d420..86b2574ea 100644 --- a/opensearchapi/api.indices.get.go +++ b/opensearchapi/api.indices.get.go @@ -56,13 +56,14 @@ type IndicesGet func(index []string, o ...func(*IndicesGetRequest)) (*Response, type IndicesGetRequest struct { Index []string - AllowNoIndices *bool - ExpandWildcards string - FlatSettings *bool - IgnoreUnavailable *bool - IncludeDefaults *bool - Local *bool - MasterTimeout time.Duration + AllowNoIndices *bool + ExpandWildcards string + FlatSettings *bool + IgnoreUnavailable *bool + IncludeDefaults *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -119,6 +120,10 @@ func (r IndicesGetRequest) Do(ctx context.Context, transport Transport) (*Respon params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -226,7 +231,7 @@ func (f IndicesGet) WithIncludeDefaults(v bool) func(*IndicesGetRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f IndicesGet) WithLocal(v bool) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { @@ -234,7 +239,9 @@ func (f IndicesGet) WithLocal(v bool) func(*IndicesGetRequest) { } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesGet) WithMasterTimeout(v time.Duration) func(*IndicesGetRequest) { return func(r *IndicesGetRequest) { @@ -242,6 +249,14 @@ func (f IndicesGet) WithMasterTimeout(v time.Duration) func(*IndicesGetRequest) } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesGet) WithClusterManagerTimeout(v time.Duration) func(*IndicesGetRequest) { + return func(r *IndicesGetRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f IndicesGet) WithPretty() func(*IndicesGetRequest) { diff --git a/opensearchapi/api.indices.get_alias.go b/opensearchapi/api.indices.get_alias.go index 5c9153878..420b2faa1 100644 --- a/opensearchapi/api.indices.get_alias.go +++ b/opensearchapi/api.indices.get_alias.go @@ -220,7 +220,7 @@ func (f IndicesGetAlias) WithIgnoreUnavailable(v bool) func(*IndicesGetAliasRequ } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f IndicesGetAlias) WithLocal(v bool) func(*IndicesGetAliasRequest) { return func(r *IndicesGetAliasRequest) { diff --git a/opensearchapi/api.indices.get_field_mapping.go b/opensearchapi/api.indices.get_field_mapping.go index a429acfd9..911b519a3 100644 --- a/opensearchapi/api.indices.get_field_mapping.go +++ b/opensearchapi/api.indices.get_field_mapping.go @@ -225,7 +225,7 @@ func (f IndicesGetFieldMapping) WithIncludeDefaults(v bool) func(*IndicesGetFiel } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f IndicesGetFieldMapping) WithLocal(v bool) func(*IndicesGetFieldMappingRequest) { return func(r *IndicesGetFieldMappingRequest) { diff --git a/opensearchapi/api.indices.get_index_template.go b/opensearchapi/api.indices.get_index_template.go index e5bb78409..c17e15e85 100644 --- a/opensearchapi/api.indices.get_index_template.go +++ b/opensearchapi/api.indices.get_index_template.go @@ -56,9 +56,10 @@ type IndicesGetIndexTemplate func(o ...func(*IndicesGetIndexTemplateRequest)) (* type IndicesGetIndexTemplateRequest struct { Name []string - FlatSettings *bool - Local *bool - MasterTimeout time.Duration + FlatSettings *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -103,6 +104,10 @@ func (r IndicesGetIndexTemplateRequest) Do(ctx context.Context, transport Transp params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -186,7 +191,7 @@ func (f IndicesGetIndexTemplate) WithFlatSettings(v bool) func(*IndicesGetIndexT } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f IndicesGetIndexTemplate) WithLocal(v bool) func(*IndicesGetIndexTemplateRequest) { return func(r *IndicesGetIndexTemplateRequest) { @@ -194,7 +199,9 @@ func (f IndicesGetIndexTemplate) WithLocal(v bool) func(*IndicesGetIndexTemplate } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesGetIndexTemplate) WithMasterTimeout(v time.Duration) func(*IndicesGetIndexTemplateRequest) { return func(r *IndicesGetIndexTemplateRequest) { @@ -202,6 +209,14 @@ func (f IndicesGetIndexTemplate) WithMasterTimeout(v time.Duration) func(*Indice } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesGetIndexTemplate) WithClusterManagerTimeout(v time.Duration) func(*IndicesGetIndexTemplateRequest) { + return func(r *IndicesGetIndexTemplateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f IndicesGetIndexTemplate) WithPretty() func(*IndicesGetIndexTemplateRequest) { diff --git a/opensearchapi/api.indices.get_mapping.go b/opensearchapi/api.indices.get_mapping.go index 0f85ba0ab..c407a8edd 100644 --- a/opensearchapi/api.indices.get_mapping.go +++ b/opensearchapi/api.indices.get_mapping.go @@ -54,13 +54,14 @@ type IndicesGetMapping func(o ...func(*IndicesGetMappingRequest)) (*Response, er // IndicesGetMappingRequest configures the Indices Get Mapping API request. // type IndicesGetMappingRequest struct { - Index []string + Index []string - AllowNoIndices *bool - ExpandWildcards string - IgnoreUnavailable *bool - Local *bool - MasterTimeout time.Duration + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -112,6 +113,10 @@ func (r IndicesGetMappingRequest) Do(ctx context.Context, transport Transport) ( params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -211,7 +216,7 @@ func (f IndicesGetMapping) WithIgnoreUnavailable(v bool) func(*IndicesGetMapping } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f IndicesGetMapping) WithLocal(v bool) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { @@ -219,7 +224,9 @@ func (f IndicesGetMapping) WithLocal(v bool) func(*IndicesGetMappingRequest) { } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesGetMapping) WithMasterTimeout(v time.Duration) func(*IndicesGetMappingRequest) { return func(r *IndicesGetMappingRequest) { @@ -227,6 +234,14 @@ func (f IndicesGetMapping) WithMasterTimeout(v time.Duration) func(*IndicesGetMa } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesGetMapping) WithClusterManagerTimeout(v time.Duration) func(*IndicesGetMappingRequest) { + return func(r *IndicesGetMappingRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f IndicesGetMapping) WithPretty() func(*IndicesGetMappingRequest) { diff --git a/opensearchapi/api.indices.get_settings.go b/opensearchapi/api.indices.get_settings.go index f16ecdffd..816202c42 100644 --- a/opensearchapi/api.indices.get_settings.go +++ b/opensearchapi/api.indices.get_settings.go @@ -58,13 +58,14 @@ type IndicesGetSettingsRequest struct { Name []string - AllowNoIndices *bool - ExpandWildcards string - FlatSettings *bool - IgnoreUnavailable *bool - IncludeDefaults *bool - Local *bool - MasterTimeout time.Duration + AllowNoIndices *bool + ExpandWildcards string + FlatSettings *bool + IgnoreUnavailable *bool + IncludeDefaults *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -129,6 +130,10 @@ func (r IndicesGetSettingsRequest) Do(ctx context.Context, transport Transport) params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -252,7 +257,7 @@ func (f IndicesGetSettings) WithIncludeDefaults(v bool) func(*IndicesGetSettings } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f IndicesGetSettings) WithLocal(v bool) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { @@ -260,7 +265,9 @@ func (f IndicesGetSettings) WithLocal(v bool) func(*IndicesGetSettingsRequest) { } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesGetSettings) WithMasterTimeout(v time.Duration) func(*IndicesGetSettingsRequest) { return func(r *IndicesGetSettingsRequest) { @@ -268,6 +275,14 @@ func (f IndicesGetSettings) WithMasterTimeout(v time.Duration) func(*IndicesGetS } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesGetSettings) WithClusterManagerTimeout(v time.Duration) func(*IndicesGetSettingsRequest) { + return func(r *IndicesGetSettingsRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f IndicesGetSettings) WithPretty() func(*IndicesGetSettingsRequest) { diff --git a/opensearchapi/api.indices.get_template.go b/opensearchapi/api.indices.get_template.go index 8c6235e6b..67eb1517b 100644 --- a/opensearchapi/api.indices.get_template.go +++ b/opensearchapi/api.indices.get_template.go @@ -56,9 +56,10 @@ type IndicesGetTemplate func(o ...func(*IndicesGetTemplateRequest)) (*Response, type IndicesGetTemplateRequest struct { Name []string - FlatSettings *bool - Local *bool - MasterTimeout time.Duration + FlatSettings *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -103,6 +104,10 @@ func (r IndicesGetTemplateRequest) Do(ctx context.Context, transport Transport) params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -186,7 +191,7 @@ func (f IndicesGetTemplate) WithFlatSettings(v bool) func(*IndicesGetTemplateReq } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f IndicesGetTemplate) WithLocal(v bool) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { @@ -194,7 +199,9 @@ func (f IndicesGetTemplate) WithLocal(v bool) func(*IndicesGetTemplateRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesGetTemplate) WithMasterTimeout(v time.Duration) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { @@ -202,6 +209,14 @@ func (f IndicesGetTemplate) WithMasterTimeout(v time.Duration) func(*IndicesGetT } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesGetTemplate) WithClusterManagerTimeout(v time.Duration) func(*IndicesGetTemplateRequest) { + return func(r *IndicesGetTemplateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f IndicesGetTemplate) WithPretty() func(*IndicesGetTemplateRequest) { diff --git a/opensearchapi/api.indices.open.go b/opensearchapi/api.indices.open.go index 8e7607005..a020f3e5c 100644 --- a/opensearchapi/api.indices.open.go +++ b/opensearchapi/api.indices.open.go @@ -56,12 +56,13 @@ type IndicesOpen func(index []string, o ...func(*IndicesOpenRequest)) (*Response type IndicesOpenRequest struct { Index []string - AllowNoIndices *bool - ExpandWildcards string - IgnoreUnavailable *bool - MasterTimeout time.Duration - Timeout time.Duration - WaitForActiveShards string + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string Pretty bool Human bool @@ -108,6 +109,10 @@ func (r IndicesOpenRequest) Do(ctx context.Context, transport Transport) (*Respo params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -207,7 +212,9 @@ func (f IndicesOpen) WithIgnoreUnavailable(v bool) func(*IndicesOpenRequest) { } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesOpen) WithMasterTimeout(v time.Duration) func(*IndicesOpenRequest) { return func(r *IndicesOpenRequest) { @@ -215,6 +222,14 @@ func (f IndicesOpen) WithMasterTimeout(v time.Duration) func(*IndicesOpenRequest } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesOpen) WithClusterManagerTimeout(v time.Duration) func(*IndicesOpenRequest) { + return func(r *IndicesOpenRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f IndicesOpen) WithTimeout(v time.Duration) func(*IndicesOpenRequest) { diff --git a/opensearchapi/api.indices.put_alias.go b/opensearchapi/api.indices.put_alias.go index 64bf6ffe4..bf0a9a002 100644 --- a/opensearchapi/api.indices.put_alias.go +++ b/opensearchapi/api.indices.put_alias.go @@ -60,8 +60,9 @@ type IndicesPutAliasRequest struct { Name string - MasterTimeout time.Duration - Timeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -98,6 +99,10 @@ func (r IndicesPutAliasRequest) Do(ctx context.Context, transport Transport) (*R params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -181,7 +186,9 @@ func (f IndicesPutAlias) WithBody(v io.Reader) func(*IndicesPutAliasRequest) { } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesPutAlias) WithMasterTimeout(v time.Duration) func(*IndicesPutAliasRequest) { return func(r *IndicesPutAliasRequest) { @@ -189,6 +196,14 @@ func (f IndicesPutAlias) WithMasterTimeout(v time.Duration) func(*IndicesPutAlia } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesPutAlias) WithClusterManagerTimeout(v time.Duration) func(*IndicesPutAliasRequest) { + return func(r *IndicesPutAliasRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit timestamp for the document. // func (f IndicesPutAlias) WithTimeout(v time.Duration) func(*IndicesPutAliasRequest) { diff --git a/opensearchapi/api.indices.put_index_template.go b/opensearchapi/api.indices.put_index_template.go index 05e85b133..e34c6c70f 100644 --- a/opensearchapi/api.indices.put_index_template.go +++ b/opensearchapi/api.indices.put_index_template.go @@ -59,9 +59,10 @@ type IndicesPutIndexTemplateRequest struct { Name string - Cause string - Create *bool - MasterTimeout time.Duration + Cause string + Create *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -104,6 +105,10 @@ func (r IndicesPutIndexTemplateRequest) Do(ctx context.Context, transport Transp params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -191,7 +196,9 @@ func (f IndicesPutIndexTemplate) WithCreate(v bool) func(*IndicesPutIndexTemplat } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesPutIndexTemplate) WithMasterTimeout(v time.Duration) func(*IndicesPutIndexTemplateRequest) { return func(r *IndicesPutIndexTemplateRequest) { @@ -199,6 +206,14 @@ func (f IndicesPutIndexTemplate) WithMasterTimeout(v time.Duration) func(*Indice } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesPutIndexTemplate) WithClusterManagerTimeout(v time.Duration) func(*IndicesPutIndexTemplateRequest) { + return func(r *IndicesPutIndexTemplateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f IndicesPutIndexTemplate) WithPretty() func(*IndicesPutIndexTemplateRequest) { diff --git a/opensearchapi/api.indices.put_mapping.go b/opensearchapi/api.indices.put_mapping.go index e51d99e09..e7d721c27 100644 --- a/opensearchapi/api.indices.put_mapping.go +++ b/opensearchapi/api.indices.put_mapping.go @@ -55,16 +55,17 @@ type IndicesPutMapping func(body io.Reader, o ...func(*IndicesPutMappingRequest) // IndicesPutMappingRequest configures the Indices Put Mapping API request. // type IndicesPutMappingRequest struct { - Index []string + Index []string Body io.Reader - AllowNoIndices *bool - ExpandWildcards string - IgnoreUnavailable *bool - MasterTimeout time.Duration - Timeout time.Duration - WriteIndexOnly *bool + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WriteIndexOnly *bool Pretty bool Human bool @@ -113,6 +114,10 @@ func (r IndicesPutMappingRequest) Do(ctx context.Context, transport Transport) ( params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -224,7 +229,9 @@ func (f IndicesPutMapping) WithIgnoreUnavailable(v bool) func(*IndicesPutMapping } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesPutMapping) WithMasterTimeout(v time.Duration) func(*IndicesPutMappingRequest) { return func(r *IndicesPutMappingRequest) { @@ -232,6 +239,14 @@ func (f IndicesPutMapping) WithMasterTimeout(v time.Duration) func(*IndicesPutMa } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesPutMapping) WithClusterManagerTimeout(v time.Duration) func(*IndicesPutMappingRequest) { + return func(r *IndicesPutMappingRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f IndicesPutMapping) WithTimeout(v time.Duration) func(*IndicesPutMappingRequest) { diff --git a/opensearchapi/api.indices.put_settings.go b/opensearchapi/api.indices.put_settings.go index ea4848056..711dd615e 100644 --- a/opensearchapi/api.indices.put_settings.go +++ b/opensearchapi/api.indices.put_settings.go @@ -59,13 +59,14 @@ type IndicesPutSettingsRequest struct { Body io.Reader - AllowNoIndices *bool - ExpandWildcards string - FlatSettings *bool - IgnoreUnavailable *bool - MasterTimeout time.Duration - PreserveExisting *bool - Timeout time.Duration + AllowNoIndices *bool + ExpandWildcards string + FlatSettings *bool + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + PreserveExisting *bool + Timeout time.Duration Pretty bool Human bool @@ -118,6 +119,10 @@ func (r IndicesPutSettingsRequest) Do(ctx context.Context, transport Transport) params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.PreserveExisting != nil { params["preserve_existing"] = strconv.FormatBool(*r.PreserveExisting) } @@ -237,7 +242,9 @@ func (f IndicesPutSettings) WithIgnoreUnavailable(v bool) func(*IndicesPutSettin } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesPutSettings) WithMasterTimeout(v time.Duration) func(*IndicesPutSettingsRequest) { return func(r *IndicesPutSettingsRequest) { @@ -245,6 +252,14 @@ func (f IndicesPutSettings) WithMasterTimeout(v time.Duration) func(*IndicesPutS } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesPutSettings) WithClusterManagerTimeout(v time.Duration) func(*IndicesPutSettingsRequest) { + return func(r *IndicesPutSettingsRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPreserveExisting - whether to update existing settings. if set to `true` existing settings on an index remain unchanged, the default is `false`. // func (f IndicesPutSettings) WithPreserveExisting(v bool) func(*IndicesPutSettingsRequest) { diff --git a/opensearchapi/api.indices.put_template.go b/opensearchapi/api.indices.put_template.go index 4706644f6..34a3a6b8f 100644 --- a/opensearchapi/api.indices.put_template.go +++ b/opensearchapi/api.indices.put_template.go @@ -59,9 +59,10 @@ type IndicesPutTemplateRequest struct { Name string - Create *bool - MasterTimeout time.Duration - Order *int + Create *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Order *int Pretty bool Human bool @@ -100,6 +101,10 @@ func (r IndicesPutTemplateRequest) Do(ctx context.Context, transport Transport) params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Order != nil { params["order"] = strconv.FormatInt(int64(*r.Order), 10) } @@ -183,7 +188,9 @@ func (f IndicesPutTemplate) WithCreate(v bool) func(*IndicesPutTemplateRequest) } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesPutTemplate) WithMasterTimeout(v time.Duration) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { @@ -191,6 +198,14 @@ func (f IndicesPutTemplate) WithMasterTimeout(v time.Duration) func(*IndicesPutT } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesPutTemplate) WithClusterManagerTimeout(v time.Duration) func(*IndicesPutTemplateRequest) { + return func(r *IndicesPutTemplateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithOrder - the order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers). // func (f IndicesPutTemplate) WithOrder(v int) func(*IndicesPutTemplateRequest) { diff --git a/opensearchapi/api.indices.rollover.go b/opensearchapi/api.indices.rollover.go index c44091a25..4c3f8c35f 100644 --- a/opensearchapi/api.indices.rollover.go +++ b/opensearchapi/api.indices.rollover.go @@ -61,10 +61,11 @@ type IndicesRolloverRequest struct { Alias string NewIndex string - DryRun *bool - MasterTimeout time.Duration - Timeout time.Duration - WaitForActiveShards string + DryRun *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string Pretty bool Human bool @@ -107,6 +108,10 @@ func (r IndicesRolloverRequest) Do(ctx context.Context, transport Transport) (*R params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -210,7 +215,9 @@ func (f IndicesRollover) WithDryRun(v bool) func(*IndicesRolloverRequest) { } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesRollover) WithMasterTimeout(v time.Duration) func(*IndicesRolloverRequest) { return func(r *IndicesRolloverRequest) { @@ -218,6 +225,14 @@ func (f IndicesRollover) WithMasterTimeout(v time.Duration) func(*IndicesRollove } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesRollover) WithClusterManagerTimeout(v time.Duration) func(*IndicesRolloverRequest) { + return func(r *IndicesRolloverRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f IndicesRollover) WithTimeout(v time.Duration) func(*IndicesRolloverRequest) { diff --git a/opensearchapi/api.indices.shrink.go b/opensearchapi/api.indices.shrink.go index d37b4bbfd..11763b35a 100644 --- a/opensearchapi/api.indices.shrink.go +++ b/opensearchapi/api.indices.shrink.go @@ -61,10 +61,11 @@ type IndicesShrinkRequest struct { Target string - CopySettings *bool - MasterTimeout time.Duration - Timeout time.Duration - WaitForActiveShards string + CopySettings *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string Pretty bool Human bool @@ -105,6 +106,10 @@ func (r IndicesShrinkRequest) Do(ctx context.Context, transport Transport) (*Res params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -200,7 +205,9 @@ func (f IndicesShrink) WithCopySettings(v bool) func(*IndicesShrinkRequest) { } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesShrink) WithMasterTimeout(v time.Duration) func(*IndicesShrinkRequest) { return func(r *IndicesShrinkRequest) { @@ -208,6 +215,14 @@ func (f IndicesShrink) WithMasterTimeout(v time.Duration) func(*IndicesShrinkReq } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesShrink) WithClusterManagerTimeout(v time.Duration) func(*IndicesShrinkRequest) { + return func(r *IndicesShrinkRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f IndicesShrink) WithTimeout(v time.Duration) func(*IndicesShrinkRequest) { diff --git a/opensearchapi/api.indices.simulate_index_template.go b/opensearchapi/api.indices.simulate_index_template.go index 87951d3dc..770f1d908 100644 --- a/opensearchapi/api.indices.simulate_index_template.go +++ b/opensearchapi/api.indices.simulate_index_template.go @@ -59,9 +59,10 @@ type IndicesSimulateIndexTemplateRequest struct { Name string - Cause string - Create *bool - MasterTimeout time.Duration + Cause string + Create *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -106,6 +107,10 @@ func (r IndicesSimulateIndexTemplateRequest) Do(ctx context.Context, transport T params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -201,7 +206,9 @@ func (f IndicesSimulateIndexTemplate) WithCreate(v bool) func(*IndicesSimulateIn } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesSimulateIndexTemplate) WithMasterTimeout(v time.Duration) func(*IndicesSimulateIndexTemplateRequest) { return func(r *IndicesSimulateIndexTemplateRequest) { @@ -209,6 +216,14 @@ func (f IndicesSimulateIndexTemplate) WithMasterTimeout(v time.Duration) func(*I } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesSimulateIndexTemplate) WithClusterManagerTimeout(v time.Duration) func(*IndicesSimulateIndexTemplateRequest) { + return func(r *IndicesSimulateIndexTemplateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f IndicesSimulateIndexTemplate) WithPretty() func(*IndicesSimulateIndexTemplateRequest) { diff --git a/opensearchapi/api.indices.simulate_template.go b/opensearchapi/api.indices.simulate_template.go index 12ce8e9a7..9808f2c26 100644 --- a/opensearchapi/api.indices.simulate_template.go +++ b/opensearchapi/api.indices.simulate_template.go @@ -59,9 +59,10 @@ type IndicesSimulateTemplateRequest struct { Name string - Cause string - Create *bool - MasterTimeout time.Duration + Cause string + Create *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -108,6 +109,10 @@ func (r IndicesSimulateTemplateRequest) Do(ctx context.Context, transport Transp params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -211,7 +216,9 @@ func (f IndicesSimulateTemplate) WithCreate(v bool) func(*IndicesSimulateTemplat } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesSimulateTemplate) WithMasterTimeout(v time.Duration) func(*IndicesSimulateTemplateRequest) { return func(r *IndicesSimulateTemplateRequest) { @@ -219,6 +226,14 @@ func (f IndicesSimulateTemplate) WithMasterTimeout(v time.Duration) func(*Indice } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesSimulateTemplate) WithClusterManagerTimeout(v time.Duration) func(*IndicesSimulateTemplateRequest) { + return func(r *IndicesSimulateTemplateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f IndicesSimulateTemplate) WithPretty() func(*IndicesSimulateTemplateRequest) { diff --git a/opensearchapi/api.indices.split.go b/opensearchapi/api.indices.split.go index de2c9bacf..af2c3516a 100644 --- a/opensearchapi/api.indices.split.go +++ b/opensearchapi/api.indices.split.go @@ -61,10 +61,11 @@ type IndicesSplitRequest struct { Target string - CopySettings *bool - MasterTimeout time.Duration - Timeout time.Duration - WaitForActiveShards string + CopySettings *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string Pretty bool Human bool @@ -105,6 +106,10 @@ func (r IndicesSplitRequest) Do(ctx context.Context, transport Transport) (*Resp params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -200,7 +205,9 @@ func (f IndicesSplit) WithCopySettings(v bool) func(*IndicesSplitRequest) { } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesSplit) WithMasterTimeout(v time.Duration) func(*IndicesSplitRequest) { return func(r *IndicesSplitRequest) { @@ -208,6 +215,14 @@ func (f IndicesSplit) WithMasterTimeout(v time.Duration) func(*IndicesSplitReque } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesSplit) WithClusterManagerTimeout(v time.Duration) func(*IndicesSplitRequest) { + return func(r *IndicesSplitRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f IndicesSplit) WithTimeout(v time.Duration) func(*IndicesSplitRequest) { diff --git a/opensearchapi/api.indices.update_aliases.go b/opensearchapi/api.indices.update_aliases.go index 49f0bc998..cc6cd3433 100644 --- a/opensearchapi/api.indices.update_aliases.go +++ b/opensearchapi/api.indices.update_aliases.go @@ -56,8 +56,9 @@ type IndicesUpdateAliases func(body io.Reader, o ...func(*IndicesUpdateAliasesRe type IndicesUpdateAliasesRequest struct { Body io.Reader - MasterTimeout time.Duration - Timeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -89,6 +90,10 @@ func (r IndicesUpdateAliasesRequest) Do(ctx context.Context, transport Transport params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -164,7 +169,9 @@ func (f IndicesUpdateAliases) WithContext(v context.Context) func(*IndicesUpdate } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IndicesUpdateAliases) WithMasterTimeout(v time.Duration) func(*IndicesUpdateAliasesRequest) { return func(r *IndicesUpdateAliasesRequest) { @@ -172,6 +179,14 @@ func (f IndicesUpdateAliases) WithMasterTimeout(v time.Duration) func(*IndicesUp } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IndicesUpdateAliases) WithClusterManagerTimeout(v time.Duration) func(*IndicesUpdateAliasesRequest) { + return func(r *IndicesUpdateAliasesRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - request timeout. // func (f IndicesUpdateAliases) WithTimeout(v time.Duration) func(*IndicesUpdateAliasesRequest) { diff --git a/opensearchapi/api.ingest.delete_pipeline.go b/opensearchapi/api.ingest.delete_pipeline.go index a88d8dd79..beeebe3c7 100644 --- a/opensearchapi/api.ingest.delete_pipeline.go +++ b/opensearchapi/api.ingest.delete_pipeline.go @@ -55,8 +55,9 @@ type IngestDeletePipeline func(id string, o ...func(*IngestDeletePipelineRequest type IngestDeletePipelineRequest struct { PipelineID string - MasterTimeout time.Duration - Timeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -93,6 +94,10 @@ func (r IngestDeletePipelineRequest) Do(ctx context.Context, transport Transport params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -164,7 +169,9 @@ func (f IngestDeletePipeline) WithContext(v context.Context) func(*IngestDeleteP } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IngestDeletePipeline) WithMasterTimeout(v time.Duration) func(*IngestDeletePipelineRequest) { return func(r *IngestDeletePipelineRequest) { @@ -172,6 +179,14 @@ func (f IngestDeletePipeline) WithMasterTimeout(v time.Duration) func(*IngestDel } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IngestDeletePipeline) WithClusterManagerTimeout(v time.Duration) func(*IngestDeletePipelineRequest) { + return func(r *IngestDeletePipelineRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f IngestDeletePipeline) WithTimeout(v time.Duration) func(*IngestDeletePipelineRequest) { diff --git a/opensearchapi/api.ingest.get_pipeline.go b/opensearchapi/api.ingest.get_pipeline.go index 57038bbc4..b0f3bae46 100644 --- a/opensearchapi/api.ingest.get_pipeline.go +++ b/opensearchapi/api.ingest.get_pipeline.go @@ -56,8 +56,9 @@ type IngestGetPipeline func(o ...func(*IngestGetPipelineRequest)) (*Response, er type IngestGetPipelineRequest struct { PipelineID string - MasterTimeout time.Duration - Summary *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Summary *bool Pretty bool Human bool @@ -96,6 +97,10 @@ func (r IngestGetPipelineRequest) Do(ctx context.Context, transport Transport) ( params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Summary != nil { params["summary"] = strconv.FormatBool(*r.Summary) } @@ -175,7 +180,9 @@ func (f IngestGetPipeline) WithPipelineID(v string) func(*IngestGetPipelineReque } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IngestGetPipeline) WithMasterTimeout(v time.Duration) func(*IngestGetPipelineRequest) { return func(r *IngestGetPipelineRequest) { @@ -183,6 +190,14 @@ func (f IngestGetPipeline) WithMasterTimeout(v time.Duration) func(*IngestGetPip } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IngestGetPipeline) WithClusterManagerTimeout(v time.Duration) func(*IngestGetPipelineRequest) { + return func(r *IngestGetPipelineRequest) { + r.ClusterManagerTimeout = v + } +} + // WithSummary - return pipelines without their definitions (default: false). // func (f IngestGetPipeline) WithSummary(v bool) func(*IngestGetPipelineRequest) { diff --git a/opensearchapi/api.ingest.put_pipeline.go b/opensearchapi/api.ingest.put_pipeline.go index 228832b2b..d8343f3c0 100644 --- a/opensearchapi/api.ingest.put_pipeline.go +++ b/opensearchapi/api.ingest.put_pipeline.go @@ -58,8 +58,9 @@ type IngestPutPipelineRequest struct { Body io.Reader - MasterTimeout time.Duration - Timeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -96,6 +97,10 @@ func (r IngestPutPipelineRequest) Do(ctx context.Context, transport Transport) ( params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -171,7 +176,9 @@ func (f IngestPutPipeline) WithContext(v context.Context) func(*IngestPutPipelin } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f IngestPutPipeline) WithMasterTimeout(v time.Duration) func(*IngestPutPipelineRequest) { return func(r *IngestPutPipelineRequest) { @@ -179,6 +186,14 @@ func (f IngestPutPipeline) WithMasterTimeout(v time.Duration) func(*IngestPutPip } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f IngestPutPipeline) WithClusterManagerTimeout(v time.Duration) func(*IngestPutPipelineRequest) { + return func(r *IngestPutPipelineRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f IngestPutPipeline) WithTimeout(v time.Duration) func(*IngestPutPipelineRequest) { diff --git a/opensearchapi/api.put_script.go b/opensearchapi/api.put_script.go index 2349b42e1..48a1f6793 100644 --- a/opensearchapi/api.put_script.go +++ b/opensearchapi/api.put_script.go @@ -60,8 +60,9 @@ type PutScriptRequest struct { ScriptContext string - MasterTimeout time.Duration - Timeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -104,6 +105,10 @@ func (r PutScriptRequest) Do(ctx context.Context, transport Transport) (*Respons params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -187,7 +192,9 @@ func (f PutScript) WithScriptContext(v string) func(*PutScriptRequest) { } } -// WithMasterTimeout - specify timeout for connection to master. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f PutScript) WithMasterTimeout(v time.Duration) func(*PutScriptRequest) { return func(r *PutScriptRequest) { @@ -195,6 +202,14 @@ func (f PutScript) WithMasterTimeout(v time.Duration) func(*PutScriptRequest) { } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f PutScript) WithClusterManagerTimeout(v time.Duration) func(*PutScriptRequest) { + return func(r *PutScriptRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f PutScript) WithTimeout(v time.Duration) func(*PutScriptRequest) { diff --git a/opensearchapi/api.search_shards.go b/opensearchapi/api.search_shards.go index 7baefdb89..43d1e218f 100644 --- a/opensearchapi/api.search_shards.go +++ b/opensearchapi/api.search_shards.go @@ -216,7 +216,7 @@ func (f SearchShards) WithIgnoreUnavailable(v bool) func(*SearchShardsRequest) { } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f SearchShards) WithLocal(v bool) func(*SearchShardsRequest) { return func(r *SearchShardsRequest) { diff --git a/opensearchapi/api.snapshot.cleanup_repository.go b/opensearchapi/api.snapshot.cleanup_repository.go index 8d734ce94..c04785ea5 100644 --- a/opensearchapi/api.snapshot.cleanup_repository.go +++ b/opensearchapi/api.snapshot.cleanup_repository.go @@ -55,8 +55,9 @@ type SnapshotCleanupRepository func(repository string, o ...func(*SnapshotCleanu type SnapshotCleanupRepositoryRequest struct { Repository string - MasterTimeout time.Duration - Timeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -93,6 +94,10 @@ func (r SnapshotCleanupRepositoryRequest) Do(ctx context.Context, transport Tran params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -164,7 +169,9 @@ func (f SnapshotCleanupRepository) WithContext(v context.Context) func(*Snapshot } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f SnapshotCleanupRepository) WithMasterTimeout(v time.Duration) func(*SnapshotCleanupRepositoryRequest) { return func(r *SnapshotCleanupRepositoryRequest) { @@ -172,6 +179,14 @@ func (f SnapshotCleanupRepository) WithMasterTimeout(v time.Duration) func(*Snap } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f SnapshotCleanupRepository) WithClusterManagerTimeout(v time.Duration) func(*SnapshotCleanupRepositoryRequest) { + return func(r *SnapshotCleanupRepositoryRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f SnapshotCleanupRepository) WithTimeout(v time.Duration) func(*SnapshotCleanupRepositoryRequest) { diff --git a/opensearchapi/api.snapshot.clone.go b/opensearchapi/api.snapshot.clone.go index 10ab03a44..2642eaba3 100644 --- a/opensearchapi/api.snapshot.clone.go +++ b/opensearchapi/api.snapshot.clone.go @@ -60,7 +60,8 @@ type SnapshotCloneRequest struct { Snapshot string TargetSnapshot string - MasterTimeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -101,6 +102,10 @@ func (r SnapshotCloneRequest) Do(ctx context.Context, transport Transport) (*Res params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -172,7 +177,9 @@ func (f SnapshotClone) WithContext(v context.Context) func(*SnapshotCloneRequest } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f SnapshotClone) WithMasterTimeout(v time.Duration) func(*SnapshotCloneRequest) { return func(r *SnapshotCloneRequest) { @@ -180,6 +187,14 @@ func (f SnapshotClone) WithMasterTimeout(v time.Duration) func(*SnapshotCloneReq } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f SnapshotClone) WithClusterManagerTimeout(v time.Duration) func(*SnapshotCloneRequest) { + return func(r *SnapshotCloneRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f SnapshotClone) WithPretty() func(*SnapshotCloneRequest) { diff --git a/opensearchapi/api.snapshot.create.go b/opensearchapi/api.snapshot.create.go index 7dc6223e9..a6adc9db5 100644 --- a/opensearchapi/api.snapshot.create.go +++ b/opensearchapi/api.snapshot.create.go @@ -60,8 +60,9 @@ type SnapshotCreateRequest struct { Repository string Snapshot string - MasterTimeout time.Duration - WaitForCompletion *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + WaitForCompletion *bool Pretty bool Human bool @@ -98,6 +99,10 @@ func (r SnapshotCreateRequest) Do(ctx context.Context, transport Transport) (*Re params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.WaitForCompletion != nil { params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) } @@ -181,7 +186,9 @@ func (f SnapshotCreate) WithBody(v io.Reader) func(*SnapshotCreateRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f SnapshotCreate) WithMasterTimeout(v time.Duration) func(*SnapshotCreateRequest) { return func(r *SnapshotCreateRequest) { @@ -189,6 +196,14 @@ func (f SnapshotCreate) WithMasterTimeout(v time.Duration) func(*SnapshotCreateR } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f SnapshotCreate) WithClusterManagerTimeout(v time.Duration) func(*SnapshotCreateRequest) { + return func(r *SnapshotCreateRequest) { + r.ClusterManagerTimeout = v + } +} + // WithWaitForCompletion - should this request wait until the operation has completed before returning. // func (f SnapshotCreate) WithWaitForCompletion(v bool) func(*SnapshotCreateRequest) { diff --git a/opensearchapi/api.snapshot.create_repository.go b/opensearchapi/api.snapshot.create_repository.go index 615ce23eb..cfbf684e2 100644 --- a/opensearchapi/api.snapshot.create_repository.go +++ b/opensearchapi/api.snapshot.create_repository.go @@ -59,9 +59,10 @@ type SnapshotCreateRepositoryRequest struct { Repository string - MasterTimeout time.Duration - Timeout time.Duration - Verify *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + Verify *bool Pretty bool Human bool @@ -96,6 +97,10 @@ func (r SnapshotCreateRepositoryRequest) Do(ctx context.Context, transport Trans params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -175,7 +180,9 @@ func (f SnapshotCreateRepository) WithContext(v context.Context) func(*SnapshotC } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f SnapshotCreateRepository) WithMasterTimeout(v time.Duration) func(*SnapshotCreateRepositoryRequest) { return func(r *SnapshotCreateRepositoryRequest) { @@ -183,6 +190,14 @@ func (f SnapshotCreateRepository) WithMasterTimeout(v time.Duration) func(*Snaps } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f SnapshotCreateRepository) WithClusterManagerTimeout(v time.Duration) func(*SnapshotCreateRepositoryRequest) { + return func(r *SnapshotCreateRepositoryRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f SnapshotCreateRepository) WithTimeout(v time.Duration) func(*SnapshotCreateRepositoryRequest) { diff --git a/opensearchapi/api.snapshot.delete.go b/opensearchapi/api.snapshot.delete.go index 6de65646b..376fcdb9e 100644 --- a/opensearchapi/api.snapshot.delete.go +++ b/opensearchapi/api.snapshot.delete.go @@ -56,7 +56,8 @@ type SnapshotDeleteRequest struct { Repository string Snapshot string - MasterTimeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -93,6 +94,10 @@ func (r SnapshotDeleteRequest) Do(ctx context.Context, transport Transport) (*Re params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -160,7 +165,9 @@ func (f SnapshotDelete) WithContext(v context.Context) func(*SnapshotDeleteReque } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f SnapshotDelete) WithMasterTimeout(v time.Duration) func(*SnapshotDeleteRequest) { return func(r *SnapshotDeleteRequest) { @@ -168,6 +175,14 @@ func (f SnapshotDelete) WithMasterTimeout(v time.Duration) func(*SnapshotDeleteR } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f SnapshotDelete) WithClusterManagerTimeout(v time.Duration) func(*SnapshotDeleteRequest) { + return func(r *SnapshotDeleteRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f SnapshotDelete) WithPretty() func(*SnapshotDeleteRequest) { diff --git a/opensearchapi/api.snapshot.delete_repository.go b/opensearchapi/api.snapshot.delete_repository.go index 261e14cb1..a9d919f29 100644 --- a/opensearchapi/api.snapshot.delete_repository.go +++ b/opensearchapi/api.snapshot.delete_repository.go @@ -55,8 +55,9 @@ type SnapshotDeleteRepository func(repository []string, o ...func(*SnapshotDelet type SnapshotDeleteRepositoryRequest struct { Repository []string - MasterTimeout time.Duration - Timeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -91,6 +92,10 @@ func (r SnapshotDeleteRepositoryRequest) Do(ctx context.Context, transport Trans params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -162,7 +167,9 @@ func (f SnapshotDeleteRepository) WithContext(v context.Context) func(*SnapshotD } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f SnapshotDeleteRepository) WithMasterTimeout(v time.Duration) func(*SnapshotDeleteRepositoryRequest) { return func(r *SnapshotDeleteRepositoryRequest) { @@ -170,6 +177,14 @@ func (f SnapshotDeleteRepository) WithMasterTimeout(v time.Duration) func(*Snaps } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f SnapshotDeleteRepository) WithClusterManagerTimeout(v time.Duration) func(*SnapshotDeleteRepositoryRequest) { + return func(r *SnapshotDeleteRepositoryRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f SnapshotDeleteRepository) WithTimeout(v time.Duration) func(*SnapshotDeleteRepositoryRequest) { diff --git a/opensearchapi/api.snapshot.get.go b/opensearchapi/api.snapshot.get.go index c6e3317a5..5a5b0e101 100644 --- a/opensearchapi/api.snapshot.get.go +++ b/opensearchapi/api.snapshot.get.go @@ -57,11 +57,12 @@ type SnapshotGetRequest struct { Repository string Snapshot []string - IgnoreUnavailable *bool - IncludeRepository *bool - IndexDetails *bool - MasterTimeout time.Duration - Verbose *bool + IgnoreUnavailable *bool + IncludeRepository *bool + IndexDetails *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Verbose *bool Pretty bool Human bool @@ -110,6 +111,10 @@ func (r SnapshotGetRequest) Do(ctx context.Context, transport Transport) (*Respo params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Verbose != nil { params["verbose"] = strconv.FormatBool(*r.Verbose) } @@ -205,7 +210,9 @@ func (f SnapshotGet) WithIndexDetails(v bool) func(*SnapshotGetRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f SnapshotGet) WithMasterTimeout(v time.Duration) func(*SnapshotGetRequest) { return func(r *SnapshotGetRequest) { @@ -213,6 +220,14 @@ func (f SnapshotGet) WithMasterTimeout(v time.Duration) func(*SnapshotGetRequest } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f SnapshotGet) WithClusterManagerTimeout(v time.Duration) func(*SnapshotGetRequest) { + return func(r *SnapshotGetRequest) { + r.ClusterManagerTimeout = v + } +} + // WithVerbose - whether to show verbose snapshot info or only show the basic info found in the repository index blob. // func (f SnapshotGet) WithVerbose(v bool) func(*SnapshotGetRequest) { diff --git a/opensearchapi/api.snapshot.get_repository.go b/opensearchapi/api.snapshot.get_repository.go index d03428648..3ad81f43f 100644 --- a/opensearchapi/api.snapshot.get_repository.go +++ b/opensearchapi/api.snapshot.get_repository.go @@ -56,8 +56,9 @@ type SnapshotGetRepository func(o ...func(*SnapshotGetRepositoryRequest)) (*Resp type SnapshotGetRepositoryRequest struct { Repository []string - Local *bool - MasterTimeout time.Duration + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -98,6 +99,10 @@ func (r SnapshotGetRepositoryRequest) Do(ctx context.Context, transport Transpor params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -173,7 +178,7 @@ func (f SnapshotGetRepository) WithRepository(v ...string) func(*SnapshotGetRepo } } -// WithLocal - return local information, do not retrieve the state from master node (default: false). +// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). // func (f SnapshotGetRepository) WithLocal(v bool) func(*SnapshotGetRepositoryRequest) { return func(r *SnapshotGetRepositoryRequest) { @@ -181,7 +186,9 @@ func (f SnapshotGetRepository) WithLocal(v bool) func(*SnapshotGetRepositoryRequ } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f SnapshotGetRepository) WithMasterTimeout(v time.Duration) func(*SnapshotGetRepositoryRequest) { return func(r *SnapshotGetRepositoryRequest) { @@ -189,6 +196,14 @@ func (f SnapshotGetRepository) WithMasterTimeout(v time.Duration) func(*Snapshot } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f SnapshotGetRepository) WithClusterManagerTimeout(v time.Duration) func(*SnapshotGetRepositoryRequest) { + return func(r *SnapshotGetRepositoryRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f SnapshotGetRepository) WithPretty() func(*SnapshotGetRepositoryRequest) { diff --git a/opensearchapi/api.snapshot.restore.go b/opensearchapi/api.snapshot.restore.go index d6e9fe5b3..56823d560 100644 --- a/opensearchapi/api.snapshot.restore.go +++ b/opensearchapi/api.snapshot.restore.go @@ -60,8 +60,9 @@ type SnapshotRestoreRequest struct { Repository string Snapshot string - MasterTimeout time.Duration - WaitForCompletion *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + WaitForCompletion *bool Pretty bool Human bool @@ -100,6 +101,10 @@ func (r SnapshotRestoreRequest) Do(ctx context.Context, transport Transport) (*R params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.WaitForCompletion != nil { params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) } @@ -183,7 +188,9 @@ func (f SnapshotRestore) WithBody(v io.Reader) func(*SnapshotRestoreRequest) { } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f SnapshotRestore) WithMasterTimeout(v time.Duration) func(*SnapshotRestoreRequest) { return func(r *SnapshotRestoreRequest) { @@ -191,6 +198,14 @@ func (f SnapshotRestore) WithMasterTimeout(v time.Duration) func(*SnapshotRestor } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f SnapshotRestore) WithClusterManagerTimeout(v time.Duration) func(*SnapshotRestoreRequest) { + return func(r *SnapshotRestoreRequest) { + r.ClusterManagerTimeout = v + } +} + // WithWaitForCompletion - should this request wait until the operation has completed before returning. // func (f SnapshotRestore) WithWaitForCompletion(v bool) func(*SnapshotRestoreRequest) { diff --git a/opensearchapi/api.snapshot.status.go b/opensearchapi/api.snapshot.status.go index d642c3c1a..b44e97b22 100644 --- a/opensearchapi/api.snapshot.status.go +++ b/opensearchapi/api.snapshot.status.go @@ -57,8 +57,9 @@ type SnapshotStatusRequest struct { Repository string Snapshot []string - IgnoreUnavailable *bool - MasterTimeout time.Duration + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration Pretty bool Human bool @@ -105,6 +106,10 @@ func (r SnapshotStatusRequest) Do(ctx context.Context, transport Transport) (*Re params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Pretty { params["pretty"] = "true" } @@ -196,7 +201,9 @@ func (f SnapshotStatus) WithIgnoreUnavailable(v bool) func(*SnapshotStatusReques } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f SnapshotStatus) WithMasterTimeout(v time.Duration) func(*SnapshotStatusRequest) { return func(r *SnapshotStatusRequest) { @@ -204,6 +211,14 @@ func (f SnapshotStatus) WithMasterTimeout(v time.Duration) func(*SnapshotStatusR } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f SnapshotStatus) WithClusterManagerTimeout(v time.Duration) func(*SnapshotStatusRequest) { + return func(r *SnapshotStatusRequest) { + r.ClusterManagerTimeout = v + } +} + // WithPretty makes the response body pretty-printed. // func (f SnapshotStatus) WithPretty() func(*SnapshotStatusRequest) { diff --git a/opensearchapi/api.snapshot.verify_repository.go b/opensearchapi/api.snapshot.verify_repository.go index bd71f3f09..cfd7152d4 100644 --- a/opensearchapi/api.snapshot.verify_repository.go +++ b/opensearchapi/api.snapshot.verify_repository.go @@ -55,8 +55,9 @@ type SnapshotVerifyRepository func(repository string, o ...func(*SnapshotVerifyR type SnapshotVerifyRepositoryRequest struct { Repository string - MasterTimeout time.Duration - Timeout time.Duration + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration Pretty bool Human bool @@ -93,6 +94,10 @@ func (r SnapshotVerifyRepositoryRequest) Do(ctx context.Context, transport Trans params["master_timeout"] = formatDuration(r.MasterTimeout) } + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + if r.Timeout != 0 { params["timeout"] = formatDuration(r.Timeout) } @@ -164,7 +169,9 @@ func (f SnapshotVerifyRepository) WithContext(v context.Context) func(*SnapshotV } } -// WithMasterTimeout - explicit operation timeout for connection to master node. +// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. +// +// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // func (f SnapshotVerifyRepository) WithMasterTimeout(v time.Duration) func(*SnapshotVerifyRepositoryRequest) { return func(r *SnapshotVerifyRepositoryRequest) { @@ -172,6 +179,14 @@ func (f SnapshotVerifyRepository) WithMasterTimeout(v time.Duration) func(*Snaps } } +// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. +// +func (f SnapshotVerifyRepository) WithClusterManagerTimeout(v time.Duration) func(*SnapshotVerifyRepositoryRequest) { + return func(r *SnapshotVerifyRepositoryRequest) { + r.ClusterManagerTimeout = v + } +} + // WithTimeout - explicit operation timeout. // func (f SnapshotVerifyRepository) WithTimeout(v time.Duration) func(*SnapshotVerifyRepositoryRequest) { diff --git a/opensearchtransport/discovery.go b/opensearchtransport/discovery.go index 1e3a3489c..37aafbef2 100644 --- a/opensearchtransport/discovery.go +++ b/opensearchtransport/discovery.go @@ -72,27 +72,27 @@ func (c *Client) DiscoverNodes() error { for _, node := range nodes { var ( - isMasterOnlyNode bool + isClusterManagerOnlyNode bool ) roles := append(node.Roles[:0:0], node.Roles...) sort.Strings(roles) - if len(roles) == 1 && roles[0] == "master" { - isMasterOnlyNode = true + if len(roles) == 1 && (roles[0] == "master" || roles[0] == "cluster_manager") { + isClusterManagerOnlyNode = true } if debugLogger != nil { var skip string - if isMasterOnlyNode { + if isClusterManagerOnlyNode { skip = "; [SKIP]" } debugLogger.Logf("Discovered node [%s]; %s; roles=%s%s\n", node.Name, node.URL, node.Roles, skip) } - // Skip master only nodes + // Skip cluster_manager only nodes // TODO: Move logic to Selector? - if isMasterOnlyNode { + if isClusterManagerOnlyNode { continue } diff --git a/opensearchtransport/discovery_internal_test.go b/opensearchtransport/discovery_internal_test.go index 40debed13..8218976a0 100644 --- a/opensearchtransport/discovery_internal_test.go +++ b/opensearchtransport/discovery_internal_test.go @@ -218,6 +218,138 @@ func TestDiscovery(t *testing.T) { args fields want wants }{ + { + "Default roles should allow every node to be selected", + fields{ + Nodes: map[string]Node{ + "es1": { + URL: "http://es1:9200", + Roles: []string{ + "data", + "data_cold", + "data_content", + "data_frozen", + "data_hot", + "data_warm", + "ingest", + "cluster_manager", + "ml", + "remote_cluster_client", + "transform", + }, + }, + "es2": { + URL: "http://es2:9200", + Roles: []string{ + "data", + "data_cold", + "data_content", + "data_frozen", + "data_hot", + "data_warm", + "ingest", + "cluster_manager", + "ml", + "remote_cluster_client", + "transform", + }, + }, + "es3": { + URL: "http://es3:9200", + Roles: []string{ + "data", + "data_cold", + "data_content", + "data_frozen", + "data_hot", + "data_warm", + "ingest", + "cluster_manager", + "ml", + "remote_cluster_client", + "transform", + }, + }, + }, + }, + wants{ + false, 3, + }, + }, + { + "Cluster manager only node should not be selected", + fields{ + Nodes: map[string]Node{ + "es1": { + URL: "http://es1:9200", + Roles: []string{ + "cluster_manager", + }, + }, + "es2": { + URL: "http://es2:9200", + Roles: []string{ + "data", + "data_cold", + "data_content", + "data_frozen", + "data_hot", + "data_warm", + "ingest", + "cluster_manager", + "ml", + "remote_cluster_client", + "transform", + }, + }, + "es3": { + URL: "http://es3:9200", + Roles: []string{ + "data", + "data_cold", + "data_content", + "data_frozen", + "data_hot", + "data_warm", + "ingest", + "cluster_manager", + "ml", + "remote_cluster_client", + "transform", + }, + }, + }, + }, + + wants{ + false, 2, + }, + }, + { + "Cluster manager and data only nodes should be selected", + fields{ + Nodes: map[string]Node{ + "es1": { + URL: "http://es1:9200", + Roles: []string{ + "data", + "cluster_manager", + }, + }, + "es2": { + URL: "http://es2:9200", + Roles: []string{ + "data", + "cluster_manager", + }, + }, + }, + }, + + wants{ + false, 2, + }, + }, { "Default roles should allow every node to be selected", fields{ diff --git a/opensearchtransport/testdata/nodes.info.json b/opensearchtransport/testdata/nodes.info.json index acbe46291..cc24f2fce 100644 --- a/opensearchtransport/testdata/nodes.info.json +++ b/opensearchtransport/testdata/nodes.info.json @@ -15,7 +15,7 @@ "build_flavor": "oss", "build_type": "tar", "build_hash": "2f90bbf7b93631e52bafb59b3b049cb44ec25e96", - "roles": ["ingest", "master", "data"], + "roles": ["ingest", "cluster_manager", "data"], "http": { "bound_address": [ "[::1]:10001", @@ -34,7 +34,7 @@ "build_flavor": "oss", "build_type": "tar", "build_hash": "2f90bbf7b93631e52bafb59b3b049cb44ec25e96", - "roles": ["ingest", "master", "data"], + "roles": ["ingest", "cluster_manager", "data"], "http": { "bound_address": [ "127.0.0.1:10002", @@ -54,7 +54,7 @@ "build_flavor": "oss", "build_type": "tar", "build_hash": "2f90bbf7b93631e52bafb59b3b049cb44ec25e96", - "roles": ["master"], + "roles": ["cluster_manager"], "http": { "bound_address": [ "[::1]:10003",