ingest
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Simulate data ingestion.Run ingest pipelines against a set of provided documents, optionally withsubstitute pipeline definitions, to simulate ingesting data into an index.
This API is meant to be used for troubleshooting or pipeline development, asit does not actually index any data into Elasticsearch.
The API runs the default and final pipeline for that index against a set ofdocuments provided in the body of the request.If a pipeline contains a reroute processor, it follows that reroute processorto the new index, running that index's pipelines as well the same way that anon-simulated ingest would.No data is indexed into Elasticsearch.Instead, the transformed document is returned, along with the list ofpipelines that have been run and the name of the index where the documentwould have been indexed if this were not a simulation.The transformed document is validated against the mappings that would applyto this index, and any validation error is reported in the result.
This API differs from the simulate pipeline API in that you specify a singlepipeline for that API, and it runs only that one pipeline.The simulate pipeline API is more useful for developing a single pipeline,while the simulate ingest API is more useful for troubleshooting theinteraction of the various pipelines that get applied when ingesting into anindex.
By default, the pipeline definitions that are currently in the system areused.However, you can supply substitute pipeline definitions in the body of therequest.These will be used in place of the pipeline definitions that are already inthe system. This can be used to replace existing pipeline definitions or tocreate new ones. The pipeline substitutions are used only within thisrequest.
Index¶
- Variables
- type Ingest
- func (r *Ingest) ComponentTemplateSubstitutions(componenttemplatesubstitutions map[string]types.ComponentTemplateNode) *Ingest
- func (r Ingest) Do(providedCtx context.Context) (*Response, error)
- func (r *Ingest) Docs(docs ...types.Document) *Ingest
- func (r *Ingest) ErrorTrace(errortrace bool) *Ingest
- func (r *Ingest) FilterPath(filterpaths ...string) *Ingest
- func (r *Ingest) Header(key, value string) *Ingest
- func (r *Ingest) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *Ingest) Human(human bool) *Ingest
- func (r *Ingest) Index(index string) *Ingest
- func (r *Ingest) IndexTemplateSubstitutions(indextemplatesubstitutions map[string]types.IndexTemplate) *Ingest
- func (r *Ingest) MappingAddition(mappingaddition *types.TypeMapping) *Ingest
- func (r Ingest) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *Ingest) Pipeline(pipelinename string) *Ingest
- func (r *Ingest) PipelineSubstitutions(pipelinesubstitutions map[string]types.IngestPipeline) *Ingest
- func (r *Ingest) Pretty(pretty bool) *Ingest
- func (r *Ingest) Raw(raw io.Reader) *Ingest
- func (r *Ingest) Request(req *Request) *Ingest
- type NewIngest
- type Request
- type Response
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¶
typeIngest¶
type Ingest struct {// contains filtered or unexported fields}funcNew¶
func New(tpelastictransport.Interface) *Ingest
Simulate data ingestion.Run ingest pipelines against a set of provided documents, optionally withsubstitute pipeline definitions, to simulate ingesting data into an index.
This API is meant to be used for troubleshooting or pipeline development, asit does not actually index any data into Elasticsearch.
The API runs the default and final pipeline for that index against a set ofdocuments provided in the body of the request.If a pipeline contains a reroute processor, it follows that reroute processorto the new index, running that index's pipelines as well the same way that anon-simulated ingest would.No data is indexed into Elasticsearch.Instead, the transformed document is returned, along with the list ofpipelines that have been run and the name of the index where the documentwould have been indexed if this were not a simulation.The transformed document is validated against the mappings that would applyto this index, and any validation error is reported in the result.
This API differs from the simulate pipeline API in that you specify a singlepipeline for that API, and it runs only that one pipeline.The simulate pipeline API is more useful for developing a single pipeline,while the simulate ingest API is more useful for troubleshooting theinteraction of the various pipelines that get applied when ingesting into anindex.
By default, the pipeline definitions that are currently in the system areused.However, you can supply substitute pipeline definitions in the body of therequest.These will be used in place of the pipeline definitions that are already inthe system. This can be used to replace existing pipeline definitions or tocreate new ones. The pipeline substitutions are used only within thisrequest.
https://www.elastic.co/guide/en/elasticsearch/reference/current/simulate-ingest-api.html
func (*Ingest)ComponentTemplateSubstitutions¶
func (r *Ingest) ComponentTemplateSubstitutions(componenttemplatesubstitutions map[string]types.ComponentTemplateNode) *Ingest
ComponentTemplateSubstitutions A map of component template names to substitute component template definitionobjects.API name: component_template_substitutions
func (Ingest)Do¶
Do runs the request through the transport, handle the response and returns a ingest.Response
func (*Ingest)ErrorTrace¶
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errorswhen they occur.API name: error_trace
func (*Ingest)FilterPath¶
FilterPath Comma-separated list of filters in dot notation which reduce the responsereturned by Elasticsearch.API name: filter_path
func (*Ingest)HttpRequest¶
HttpRequest returns the http.Request object built from thegiven parameters.
func (*Ingest)Human¶
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 humanreadable values will be omitted. This makes sense for responses beingconsumedonly by machines.API name: human
func (*Ingest)Index¶
Index The index to simulate ingesting into.This value can be overridden by specifying an index on each document.If you specify this parameter in the request path, it is used for anydocuments that do not explicitly specify an index argument.API Name: index
func (*Ingest)IndexTemplateSubstitutions¶
func (r *Ingest) IndexTemplateSubstitutions(indextemplatesubstitutions map[string]types.IndexTemplate) *Ingest
IndexTemplateSubstitutions A map of index template names to substitute index template definitionobjects.API name: index_template_substitutions
func (*Ingest)MappingAddition¶
func (r *Ingest) MappingAddition(mappingaddition *types.TypeMapping) *Ingest
API name: mapping_addition
func (Ingest)Perform¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Ingest)Pipeline¶
Pipeline The pipeline to use as the default pipeline.This value can be used to override the default pipeline of the index.API name: pipeline
func (*Ingest)PipelineSubstitutions¶
func (r *Ingest) PipelineSubstitutions(pipelinesubstitutions map[string]types.IngestPipeline) *Ingest
PipelineSubstitutions Pipelines to test.If you don’t specify the `pipeline` request path parameter, this parameter isrequired.If you specify both this and the request path parameter, the API only usesthe request path parameter.API name: pipeline_substitutions
func (*Ingest)Pretty¶
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only usethis option for debugging only.API name: pretty
typeNewIngest¶
type NewIngest func() *Ingest
NewIngest type alias for index.
funcNewIngestFunc¶
func NewIngestFunc(tpelastictransport.Interface)NewIngest
NewIngestFunc returns a new instance of Ingest with the provided transport.Used in the index of the library this allows to retrieve every apis in once place.
typeRequest¶
type Request struct {// ComponentTemplateSubstitutions A map of component template names to substitute component template definition// objects.ComponentTemplateSubstitutions map[string]types.ComponentTemplateNode `json:"component_template_substitutions,omitempty"`// Docs Sample documents to test in the pipeline.Docs []types.Document `json:"docs"`// IndexTemplateSubstitutions A map of index template names to substitute index template definition// objects.IndexTemplateSubstitutions map[string]types.IndexTemplate `json:"index_template_substitutions,omitempty"`MappingAddition *types.TypeMapping `json:"mapping_addition,omitempty"`// PipelineSubstitutions Pipelines to test.// If you don’t specify the `pipeline` request path parameter, this parameter is// required.// If you specify both this and the request path parameter, the API only uses// the request path parameter.PipelineSubstitutions map[string]types.IngestPipeline `json:"pipeline_substitutions,omitempty"`}Request holds the request body struct for the package ingest
typeResponse¶
type Response struct {Docs []types.SimulateIngestDocumentResult `json:"docs"`}Response holds the response body struct for the package ingest