Documentation ¶
Overview ¶
Creates a new watch, or updates an existing one.
Index ¶
- Variables
- type NewPutWatch
- type PutWatch
- func (r *PutWatch) Actions(actions map[string]types.WatcherAction) *PutWatch
- func (r *PutWatch) Active(active bool) *PutWatch
- func (r *PutWatch) Condition(condition *types.WatcherCondition) *PutWatch
- func (r PutWatch) Do(providedCtx context.Context) (*Response, error)
- func (r *PutWatch) ErrorTrace(errortrace bool) *PutWatch
- func (r *PutWatch) FilterPath(filterpaths ...string) *PutWatch
- func (r *PutWatch) Header(key, value string) *PutWatch
- func (r *PutWatch) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *PutWatch) Human(human bool) *PutWatch
- func (r *PutWatch) IfPrimaryTerm(ifprimaryterm string) *PutWatch
- func (r *PutWatch) IfSeqNo(sequencenumber string) *PutWatch
- func (r *PutWatch) Input(input *types.WatcherInput) *PutWatch
- func (r *PutWatch) Metadata(metadata types.Metadata) *PutWatch
- func (r PutWatch) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *PutWatch) Pretty(pretty bool) *PutWatch
- func (r *PutWatch) Raw(raw io.Reader) *PutWatch
- func (r *PutWatch) Request(req *Request) *PutWatch
- func (r *PutWatch) ThrottlePeriod(throttleperiod string) *PutWatch
- func (r *PutWatch) Transform(transform *types.TransformContainer) *PutWatch
- func (r *PutWatch) Trigger(trigger *types.TriggerContainer) *PutWatch
- func (r *PutWatch) Version(versionnumber string) *PutWatch
- 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 ¶
type NewPutWatch ¶
NewPutWatch type alias for index.
func NewPutWatchFunc ¶
func NewPutWatchFunc(tp elastictransport.Interface) NewPutWatch
NewPutWatchFunc returns a new instance of PutWatch with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type PutWatch ¶
type PutWatch struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *PutWatch
Creates a new watch, or updates an existing one.
https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html
func (*PutWatch) Actions ¶ added in v8.9.0
func (r *PutWatch) Actions(actions map[string]types.WatcherAction) *PutWatch
API name: actions
func (*PutWatch) Condition ¶ added in v8.9.0
func (r *PutWatch) Condition(condition *types.WatcherCondition) *PutWatch
API name: condition
func (PutWatch) Do ¶
Do runs the request through the transport, handle the response and returns a putwatch.Response
func (*PutWatch) ErrorTrace ¶ added in v8.14.0
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*PutWatch) FilterPath ¶ added in v8.14.0
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*PutWatch) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*PutWatch) Human ¶ added in v8.14.0
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 (*PutWatch) IfPrimaryTerm ¶
IfPrimaryTerm only update the watch if the last operation that has changed the watch has the specified primary term API name: if_primary_term
func (*PutWatch) IfSeqNo ¶
IfSeqNo only update the watch if the last operation that has changed the watch has the specified sequence number API name: if_seq_no
func (*PutWatch) Input ¶ added in v8.9.0
func (r *PutWatch) Input(input *types.WatcherInput) *PutWatch
API name: input
func (PutWatch) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*PutWatch) Pretty ¶ added in v8.14.0
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*PutWatch) Raw ¶
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*PutWatch) ThrottlePeriod ¶ added in v8.9.0
API name: throttle_period
func (*PutWatch) Transform ¶ added in v8.9.0
func (r *PutWatch) Transform(transform *types.TransformContainer) *PutWatch
API name: transform
type Request ¶
type Request struct { Actions map[string]types.WatcherAction `json:"actions,omitempty"` Condition *types.WatcherCondition `json:"condition,omitempty"` Input *types.WatcherInput `json:"input,omitempty"` Metadata types.Metadata `json:"metadata,omitempty"` ThrottlePeriod *string `json:"throttle_period,omitempty"` Transform *types.TransformContainer `json:"transform,omitempty"` Trigger *types.TriggerContainer `json:"trigger,omitempty"` }
Request holds the request body struct for the package putwatch
func (*Request) FromJSON ¶ added in v8.5.0
FromJSON allows to load an arbitrary json into the request structure