Documentation ¶
Overview ¶
Retrieves anomaly records for an anomaly detection job.
Index ¶
- Variables
- type GetRecords
- func (r *GetRecords) Desc(desc bool) *GetRecords
- func (r GetRecords) Do(providedCtx context.Context) (*Response, error)
- func (r *GetRecords) End(datetime types.DateTime) *GetRecords
- func (r *GetRecords) ExcludeInterim(excludeinterim bool) *GetRecords
- func (r *GetRecords) From(from int) *GetRecords
- func (r *GetRecords) Header(key, value string) *GetRecords
- func (r *GetRecords) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *GetRecords) Page(page *types.Page) *GetRecords
- func (r GetRecords) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *GetRecords) Raw(raw io.Reader) *GetRecords
- func (r *GetRecords) RecordScore(recordscore types.Float64) *GetRecords
- func (r *GetRecords) Request(req *Request) *GetRecords
- func (r *GetRecords) Size(size int) *GetRecords
- func (r *GetRecords) Sort(field string) *GetRecords
- func (r *GetRecords) Start(datetime types.DateTime) *GetRecords
- type NewGetRecords
- 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 GetRecords ¶
type GetRecords struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *GetRecords
Retrieves anomaly records for an anomaly detection job.
https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html
func (*GetRecords) Desc ¶
func (r *GetRecords) Desc(desc bool) *GetRecords
Desc Refer to the description for the `desc` query parameter. API name: desc
func (GetRecords) Do ¶
func (r GetRecords) Do(providedCtx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a getrecords.Response
func (*GetRecords) End ¶
func (r *GetRecords) End(datetime types.DateTime) *GetRecords
End Refer to the description for the `end` query parameter. API name: end
func (*GetRecords) ExcludeInterim ¶
func (r *GetRecords) ExcludeInterim(excludeinterim bool) *GetRecords
ExcludeInterim Refer to the description for the `exclude_interim` query parameter. API name: exclude_interim
func (*GetRecords) From ¶
func (r *GetRecords) From(from int) *GetRecords
From Skips the specified number of records. API name: from
func (*GetRecords) Header ¶
func (r *GetRecords) Header(key, value string) *GetRecords
Header set a key, value pair in the GetRecords headers map.
func (*GetRecords) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*GetRecords) Page ¶ added in v8.9.0
func (r *GetRecords) Page(page *types.Page) *GetRecords
API name: page
func (GetRecords) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*GetRecords) Raw ¶
func (r *GetRecords) Raw(raw io.Reader) *GetRecords
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*GetRecords) RecordScore ¶
func (r *GetRecords) RecordScore(recordscore types.Float64) *GetRecords
RecordScore Refer to the description for the `record_score` query parameter. API name: record_score
func (*GetRecords) Request ¶
func (r *GetRecords) Request(req *Request) *GetRecords
Request allows to set the request property with the appropriate payload.
func (*GetRecords) Size ¶
func (r *GetRecords) Size(size int) *GetRecords
Size Specifies the maximum number of records to obtain. API name: size
func (*GetRecords) Sort ¶
func (r *GetRecords) Sort(field string) *GetRecords
Sort Refer to the description for the `sort` query parameter. API name: sort
func (*GetRecords) Start ¶
func (r *GetRecords) Start(datetime types.DateTime) *GetRecords
Start Refer to the description for the `start` query parameter. API name: start
type NewGetRecords ¶
type NewGetRecords func(jobid string) *GetRecords
NewGetRecords type alias for index.
func NewGetRecordsFunc ¶
func NewGetRecordsFunc(tp elastictransport.Interface) NewGetRecords
NewGetRecordsFunc returns a new instance of GetRecords 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 { // Desc Refer to the description for the `desc` query parameter. Desc *bool `json:"desc,omitempty"` // End Refer to the description for the `end` query parameter. End types.DateTime `json:"end,omitempty"` // ExcludeInterim Refer to the description for the `exclude_interim` query parameter. ExcludeInterim *bool `json:"exclude_interim,omitempty"` Page *types.Page `json:"page,omitempty"` // RecordScore Refer to the description for the `record_score` query parameter. RecordScore *types.Float64 `json:"record_score,omitempty"` // Sort Refer to the description for the `sort` query parameter. Sort *string `json:"sort,omitempty"` // Start Refer to the description for the `start` query parameter. Start types.DateTime `json:"start,omitempty"` }
Request holds the request body struct for the package getrecords
func (*Request) FromJSON ¶ added in v8.5.0
FromJSON allows to load an arbitrary json into the request structure