postdata

package
v8.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Overview

Sends data to an anomaly detection job for analysis.

Index

Constants

This section is empty.

Variables

View Source
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 NewPostData

type NewPostData func(jobid string) *PostData

NewPostData type alias for index.

func NewPostDataFunc

func NewPostDataFunc(tp elastictransport.Interface) NewPostData

NewPostDataFunc returns a new instance of PostData with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

type PostData

type PostData struct {
	// contains filtered or unexported fields
}

func (PostData) Do

func (r PostData) Do(ctx context.Context) (*Response, error)

Do runs the request through the transport, handle the response and returns a postdata.Response

func (*PostData) Header

func (r *PostData) Header(key, value string) *PostData

Header set a key, value pair in the PostData headers map.

func (*PostData) HttpRequest

func (r *PostData) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*PostData) JobId

func (r *PostData) JobId(jobid string) *PostData

JobId Identifier for the anomaly detection job. The job must have a state of open to receive and process the data. API Name: jobid

func (PostData) Perform

func (r PostData) Perform(ctx context.Context) (*http.Response, error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*PostData) Raw

func (r *PostData) Raw(raw io.Reader) *PostData

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*PostData) Request

func (r *PostData) Request(req []json.RawMessage) *PostData

Request allows to set the request property with the appropriate payload.

func (*PostData) ResetEnd

func (r *PostData) ResetEnd(datetime string) *PostData

ResetEnd Specifies the end of the bucket resetting range. API name: reset_end

func (*PostData) ResetStart

func (r *PostData) ResetStart(datetime string) *PostData

ResetStart Specifies the start of the bucket resetting range. API name: reset_start

type Response

type Response struct {
	BucketCount              int64  `json:"bucket_count"`
	EarliestRecordTimestamp  int64  `json:"earliest_record_timestamp"`
	EmptyBucketCount         int64  `json:"empty_bucket_count"`
	InputBytes               int64  `json:"input_bytes"`
	InputFieldCount          int64  `json:"input_field_count"`
	InputRecordCount         int64  `json:"input_record_count"`
	InvalidDateCount         int64  `json:"invalid_date_count"`
	JobId                    string `json:"job_id"`
	LastDataTime             int    `json:"last_data_time"`
	LatestRecordTimestamp    int64  `json:"latest_record_timestamp"`
	MissingFieldCount        int64  `json:"missing_field_count"`
	OutOfOrderTimestampCount int64  `json:"out_of_order_timestamp_count"`
	ProcessedFieldCount      int64  `json:"processed_field_count"`
	ProcessedRecordCount     int64  `json:"processed_record_count"`
	SparseBucketCount        int64  `json:"sparse_bucket_count"`
}

func NewResponse

func NewResponse() *Response

NewResponse returns a Response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL