Documentation ¶
Overview ¶
Forces the execution of a stored watch.
Index ¶
- Variables
- type ExecuteWatch
- func (r *ExecuteWatch) Debug(b bool) *ExecuteWatch
- func (r ExecuteWatch) Do(ctx context.Context) (*http.Response, error)
- func (r *ExecuteWatch) Header(key, value string) *ExecuteWatch
- func (r *ExecuteWatch) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *ExecuteWatch) Id(v string) *ExecuteWatch
- func (r *ExecuteWatch) Raw(raw json.RawMessage) *ExecuteWatch
- func (r *ExecuteWatch) Request(req *Request) *ExecuteWatch
- type NewExecuteWatch
- type Request
- type RequestBuilder
- func (rb *RequestBuilder) ActionModes(value map[string]actionexecutionmode.ActionExecutionMode) *RequestBuilder
- func (rb *RequestBuilder) AlternativeInput(value map[string]interface{}) *RequestBuilder
- func (rb *RequestBuilder) Build() *Request
- func (rb *RequestBuilder) FromJSON(data string) (*Request, error)
- func (rb *RequestBuilder) IgnoreCondition(ignorecondition bool) *RequestBuilder
- func (rb *RequestBuilder) RecordExecution(recordexecution bool) *RequestBuilder
- func (rb *RequestBuilder) SimulatedActions(simulatedactions *types.SimulatedActionsBuilder) *RequestBuilder
- func (rb *RequestBuilder) TriggerData(triggerdata *types.ScheduleTriggerEventBuilder) *RequestBuilder
- func (rb *RequestBuilder) Watch(watch *types.WatchBuilder) *RequestBuilder
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 ExecuteWatch ¶
type ExecuteWatch struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *ExecuteWatch
Forces the execution of a stored watch.
https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html
func (*ExecuteWatch) Debug ¶
func (r *ExecuteWatch) Debug(b bool) *ExecuteWatch
Debug Defines whether the watch runs in debug mode. API name: debug
func (*ExecuteWatch) Header ¶
func (r *ExecuteWatch) Header(key, value string) *ExecuteWatch
Header set a key, value pair in the ExecuteWatch headers map.
func (*ExecuteWatch) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*ExecuteWatch) Id ¶
func (r *ExecuteWatch) Id(v string) *ExecuteWatch
Id Identifier for the watch. API Name: id
func (*ExecuteWatch) Raw ¶
func (r *ExecuteWatch) Raw(raw json.RawMessage) *ExecuteWatch
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*ExecuteWatch) Request ¶
func (r *ExecuteWatch) Request(req *Request) *ExecuteWatch
Request allows to set the request property with the appropriate payload.
type NewExecuteWatch ¶
type NewExecuteWatch func() *ExecuteWatch
NewExecuteWatch type alias for index.
func NewExecuteWatchFunc ¶
func NewExecuteWatchFunc(tp elastictransport.Interface) NewExecuteWatch
NewExecuteWatchFunc returns a new instance of ExecuteWatch 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 { // ActionModes Determines how to handle the watch actions as part of the watch execution. ActionModes map[string]actionexecutionmode.ActionExecutionMode `json:"action_modes,omitempty"` // AlternativeInput When present, the watch uses this object as a payload instead of executing // its own input. AlternativeInput map[string]interface{} `json:"alternative_input,omitempty"` // IgnoreCondition When set to `true`, the watch execution uses the always condition. This can // also be specified as an HTTP parameter. IgnoreCondition *bool `json:"ignore_condition,omitempty"` // RecordExecution When set to `true`, the watch record representing the watch execution result // is persisted to the `.watcher-history` index for the current time. In // addition, the status of the watch is updated, possibly throttling subsequent // executions. This can also be specified as an HTTP parameter. RecordExecution *bool `json:"record_execution,omitempty"` SimulatedActions *types.SimulatedActions `json:"simulated_actions,omitempty"` // TriggerData This structure is parsed as the data of the trigger event that will be used // during the watch execution TriggerData *types.ScheduleTriggerEvent `json:"trigger_data,omitempty"` // Watch When present, this watch is used instead of the one specified in the request. // This watch is not persisted to the index and record_execution cannot be set. Watch *types.Watch `json:"watch,omitempty"` }
Request holds the request body struct for the package executewatch
type RequestBuilder ¶
type RequestBuilder struct {
// contains filtered or unexported fields
}
RequestBuilder is the builder API for the executewatch.Request
func NewRequestBuilder ¶
func NewRequestBuilder() *RequestBuilder
NewRequest returns a RequestBuilder which can be chained and built to retrieve a RequestBuilder
func (*RequestBuilder) ActionModes ¶
func (rb *RequestBuilder) ActionModes(value map[string]actionexecutionmode.ActionExecutionMode) *RequestBuilder
func (*RequestBuilder) AlternativeInput ¶
func (rb *RequestBuilder) AlternativeInput(value map[string]interface{}) *RequestBuilder
func (*RequestBuilder) Build ¶
func (rb *RequestBuilder) Build() *Request
Build finalize the chain and returns the Request struct.
func (*RequestBuilder) FromJSON ¶
func (rb *RequestBuilder) FromJSON(data string) (*Request, error)
FromJSON allows to load an arbitrary json into the request structure
func (*RequestBuilder) IgnoreCondition ¶
func (rb *RequestBuilder) IgnoreCondition(ignorecondition bool) *RequestBuilder
func (*RequestBuilder) RecordExecution ¶
func (rb *RequestBuilder) RecordExecution(recordexecution bool) *RequestBuilder
func (*RequestBuilder) SimulatedActions ¶
func (rb *RequestBuilder) SimulatedActions(simulatedactions *types.SimulatedActionsBuilder) *RequestBuilder
func (*RequestBuilder) TriggerData ¶
func (rb *RequestBuilder) TriggerData(triggerdata *types.ScheduleTriggerEventBuilder) *RequestBuilder
func (*RequestBuilder) Watch ¶
func (rb *RequestBuilder) Watch(watch *types.WatchBuilder) *RequestBuilder