Documentation
¶
Overview ¶
Simulate an index template. Get the index configuration that would be applied by a particular index template.
Index ¶
- Variables
- type NewSimulateTemplate
- type Request
- type Response
- type SimulateTemplate
- func (r *SimulateTemplate) AllowAutoCreate(allowautocreate bool) *SimulateTemplate
- func (r *SimulateTemplate) Cause(cause string) *SimulateTemplate
- func (r *SimulateTemplate) ComposedOf(composedofs ...string) *SimulateTemplate
- func (r *SimulateTemplate) Create(create bool) *SimulateTemplate
- func (r *SimulateTemplate) DataStream(datastream types.DataStreamVisibilityVariant) *SimulateTemplate
- func (r *SimulateTemplate) Deprecated(deprecated bool) *SimulateTemplate
- func (r SimulateTemplate) Do(providedCtx context.Context) (*Response, error)
- func (r *SimulateTemplate) ErrorTrace(errortrace bool) *SimulateTemplate
- func (r *SimulateTemplate) FilterPath(filterpaths ...string) *SimulateTemplate
- func (r *SimulateTemplate) Header(key, value string) *SimulateTemplate
- func (r *SimulateTemplate) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *SimulateTemplate) Human(human bool) *SimulateTemplate
- func (r *SimulateTemplate) IgnoreMissingComponentTemplates(ignoremissingcomponenttemplates ...string) *SimulateTemplate
- func (r *SimulateTemplate) IncludeDefaults(includedefaults bool) *SimulateTemplate
- func (r *SimulateTemplate) IndexPatterns(indices ...string) *SimulateTemplate
- func (r *SimulateTemplate) MasterTimeout(duration string) *SimulateTemplate
- func (r *SimulateTemplate) Meta_(metadata types.MetadataVariant) *SimulateTemplate
- func (r *SimulateTemplate) Name(name string) *SimulateTemplate
- func (r SimulateTemplate) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *SimulateTemplate) Pretty(pretty bool) *SimulateTemplate
- func (r *SimulateTemplate) Priority(priority int64) *SimulateTemplate
- func (r *SimulateTemplate) Raw(raw io.Reader) *SimulateTemplate
- func (r *SimulateTemplate) Request(req *Request) *SimulateTemplate
- func (r *SimulateTemplate) Template(template types.IndexTemplateMappingVariant) *SimulateTemplate
- func (r *SimulateTemplate) Version(versionnumber int64) *SimulateTemplate
Constants ¶
This section is empty.
Variables ¶
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")
ErrBuildPath is returned in case of missing parameters within the build of the request.
Functions ¶
This section is empty.
Types ¶
type NewSimulateTemplate ¶
type NewSimulateTemplate func() *SimulateTemplate
NewSimulateTemplate type alias for index.
func NewSimulateTemplateFunc ¶
func NewSimulateTemplateFunc(tp elastictransport.Interface) NewSimulateTemplate
NewSimulateTemplateFunc returns a new instance of SimulateTemplate with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type Request ¶
type Request struct { // AllowAutoCreate This setting overrides the value of the `action.auto_create_index` cluster // setting. // If set to `true` in a template, then indices can be automatically created // using that template even if auto-creation of indices is disabled via // `actions.auto_create_index`. // If set to `false`, then indices or data streams matching the template must // always be explicitly created, and may never be automatically created. AllowAutoCreate *bool `json:"allow_auto_create,omitempty"` // ComposedOf An ordered list of component template names. // Component templates are merged in the order specified, meaning that the last // component template specified has the highest precedence. ComposedOf []string `json:"composed_of,omitempty"` // DataStream If this object is included, the template is used to create data streams and // their backing indices. // Supports an empty object. // Data streams require a matching index template with a `data_stream` object. DataStream *types.DataStreamVisibility `json:"data_stream,omitempty"` // Deprecated Marks this index template as deprecated. When creating or updating a // non-deprecated index template // that uses deprecated components, Elasticsearch will emit a deprecation // warning. Deprecated *bool `json:"deprecated,omitempty"` // IgnoreMissingComponentTemplates The configuration option ignore_missing_component_templates can be used when // an index template // references a component template that might not exist IgnoreMissingComponentTemplates []string `json:"ignore_missing_component_templates,omitempty"` // IndexPatterns Array of wildcard (`*`) expressions used to match the names of data streams // and indices during creation. IndexPatterns []string `json:"index_patterns,omitempty"` // Meta_ Optional user metadata about the index template. // May have any contents. // This map is not automatically generated by Elasticsearch. Meta_ types.Metadata `json:"_meta,omitempty"` // Priority Priority to determine index template precedence when a new data stream or // index is created. // The index template with the highest priority is chosen. // If no priority is specified the template is treated as though it is of // priority 0 (lowest priority). // This number is not automatically generated by Elasticsearch. Priority *int64 `json:"priority,omitempty"` // Template Template to be applied. // It may optionally include an `aliases`, `mappings`, or `settings` // configuration. Template *types.IndexTemplateMapping `json:"template,omitempty"` // Version Version number used to manage index templates externally. // This number is not automatically generated by Elasticsearch. Version *int64 `json:"version,omitempty"` }
Request holds the request body struct for the package simulatetemplate
func (*Request) UnmarshalJSON ¶
type Response ¶
type Response struct { Overlapping []types.Overlapping `json:"overlapping,omitempty"` Template types.Template `json:"template"` }
Response holds the response body struct for the package simulatetemplate
type SimulateTemplate ¶
type SimulateTemplate struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *SimulateTemplate
Simulate an index template. Get the index configuration that would be applied by a particular index template.
https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-simulate-template
func (*SimulateTemplate) AllowAutoCreate ¶
func (r *SimulateTemplate) AllowAutoCreate(allowautocreate bool) *SimulateTemplate
This setting overrides the value of the `action.auto_create_index` cluster setting. If set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`. If set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created. API name: allow_auto_create
func (*SimulateTemplate) Cause ¶
func (r *SimulateTemplate) Cause(cause string) *SimulateTemplate
Cause User defined reason for dry-run creating the new template for simulation purposes API name: cause
func (*SimulateTemplate) ComposedOf ¶
func (r *SimulateTemplate) ComposedOf(composedofs ...string) *SimulateTemplate
An ordered list of component template names. Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence. API name: composed_of
func (*SimulateTemplate) Create ¶
func (r *SimulateTemplate) Create(create bool) *SimulateTemplate
Create If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. API name: create
func (*SimulateTemplate) DataStream ¶
func (r *SimulateTemplate) DataStream(datastream types.DataStreamVisibilityVariant) *SimulateTemplate
If this object is included, the template is used to create data streams and their backing indices. Supports an empty object. Data streams require a matching index template with a `data_stream` object. API name: data_stream
func (*SimulateTemplate) Deprecated ¶
func (r *SimulateTemplate) Deprecated(deprecated bool) *SimulateTemplate
Marks this index template as deprecated. When creating or updating a non-deprecated index template that uses deprecated components, Elasticsearch will emit a deprecation warning. API name: deprecated
func (SimulateTemplate) Do ¶
func (r SimulateTemplate) Do(providedCtx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a simulatetemplate.Response
func (*SimulateTemplate) ErrorTrace ¶
func (r *SimulateTemplate) ErrorTrace(errortrace bool) *SimulateTemplate
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*SimulateTemplate) FilterPath ¶
func (r *SimulateTemplate) FilterPath(filterpaths ...string) *SimulateTemplate
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*SimulateTemplate) Header ¶
func (r *SimulateTemplate) Header(key, value string) *SimulateTemplate
Header set a key, value pair in the SimulateTemplate headers map.
func (*SimulateTemplate) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*SimulateTemplate) Human ¶
func (r *SimulateTemplate) Human(human bool) *SimulateTemplate
Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human
func (*SimulateTemplate) IgnoreMissingComponentTemplates ¶
func (r *SimulateTemplate) IgnoreMissingComponentTemplates(ignoremissingcomponenttemplates ...string) *SimulateTemplate
The configuration option ignore_missing_component_templates can be used when an index template references a component template that might not exist API name: ignore_missing_component_templates
func (*SimulateTemplate) IncludeDefaults ¶
func (r *SimulateTemplate) IncludeDefaults(includedefaults bool) *SimulateTemplate
IncludeDefaults If true, returns all relevant default configurations for the index template. API name: include_defaults
func (*SimulateTemplate) IndexPatterns ¶
func (r *SimulateTemplate) IndexPatterns(indices ...string) *SimulateTemplate
Array of wildcard (`*`) expressions used to match the names of data streams and indices during creation. API name: index_patterns
func (*SimulateTemplate) MasterTimeout ¶
func (r *SimulateTemplate) MasterTimeout(duration string) *SimulateTemplate
MasterTimeout Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. API name: master_timeout
func (*SimulateTemplate) Meta_ ¶
func (r *SimulateTemplate) Meta_(metadata types.MetadataVariant) *SimulateTemplate
Optional user metadata about the index template. May have any contents. This map is not automatically generated by Elasticsearch. API name: _meta
func (*SimulateTemplate) Name ¶
func (r *SimulateTemplate) Name(name string) *SimulateTemplate
Name Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit this parameter and specify the template configuration in the request body. API Name: name
func (SimulateTemplate) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*SimulateTemplate) Pretty ¶
func (r *SimulateTemplate) Pretty(pretty bool) *SimulateTemplate
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*SimulateTemplate) Priority ¶
func (r *SimulateTemplate) Priority(priority int64) *SimulateTemplate
Priority to determine index template precedence when a new data stream or index is created. The index template with the highest priority is chosen. If no priority is specified the template is treated as though it is of priority 0 (lowest priority). This number is not automatically generated by Elasticsearch. API name: priority
func (*SimulateTemplate) Raw ¶
func (r *SimulateTemplate) Raw(raw io.Reader) *SimulateTemplate
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*SimulateTemplate) Request ¶
func (r *SimulateTemplate) Request(req *Request) *SimulateTemplate
Request allows to set the request property with the appropriate payload.
func (*SimulateTemplate) Template ¶
func (r *SimulateTemplate) Template(template types.IndexTemplateMappingVariant) *SimulateTemplate
Template to be applied. It may optionally include an `aliases`, `mappings`, or `settings` configuration. API name: template
func (*SimulateTemplate) Version ¶
func (r *SimulateTemplate) Version(versionnumber int64) *SimulateTemplate
Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch. API name: version