Documentation ¶
Overview ¶
Simulate resolving the given template name or body
Index ¶
- Variables
- type NewSimulateTemplate
- type Response
- type SimulateTemplate
- func (r *SimulateTemplate) Create(b bool) *SimulateTemplate
- func (r SimulateTemplate) Do(ctx context.Context) (*Response, error)
- func (r *SimulateTemplate) Header(key, value string) *SimulateTemplate
- func (r *SimulateTemplate) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *SimulateTemplate) MasterTimeout(v string) *SimulateTemplate
- func (r *SimulateTemplate) Name(v string) *SimulateTemplate
- func (r SimulateTemplate) Perform(ctx context.Context) (*http.Response, error)
- func (r *SimulateTemplate) Raw(raw io.Reader) *SimulateTemplate
- func (r *SimulateTemplate) Request(req *types.IndexTemplate) *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 Response ¶
type Response struct { Overlapping []types.Overlapping `json:"overlapping,omitempty"` Template types.Template `json:"template"` }
type SimulateTemplate ¶
type SimulateTemplate struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *SimulateTemplate
Simulate resolving the given template name or body
https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
func (*SimulateTemplate) Create ¶
func (r *SimulateTemplate) Create(b 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) Do ¶
func (r SimulateTemplate) Do(ctx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a simulatetemplate.Response
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) MasterTimeout ¶
func (r *SimulateTemplate) MasterTimeout(v 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) Name ¶
func (r *SimulateTemplate) Name(v 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) 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 *types.IndexTemplate) *SimulateTemplate
Request allows to set the request property with the appropriate payload.