Documentation ¶
Overview ¶
Creates a rollup job.
Index ¶
- Variables
- type NewPutJob
- type PutJob
- func (r PutJob) Do(ctx context.Context) (*http.Response, error)
- func (r *PutJob) Header(key, value string) *PutJob
- func (r *PutJob) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *PutJob) Id(v string) *PutJob
- func (r *PutJob) Raw(raw json.RawMessage) *PutJob
- func (r *PutJob) Request(req *Request) *PutJob
- type Request
- type RequestBuilder
- func (rb *RequestBuilder) Build() *Request
- func (rb *RequestBuilder) Cron(cron string) *RequestBuilder
- func (rb *RequestBuilder) FromJSON(data string) (*Request, error)
- func (rb *RequestBuilder) Groups(groups *types.GroupingsBuilder) *RequestBuilder
- func (rb *RequestBuilder) Headers(headers *types.HttpHeadersBuilder) *RequestBuilder
- func (rb *RequestBuilder) IndexPattern(indexpattern string) *RequestBuilder
- func (rb *RequestBuilder) Metrics(metrics []types.FieldMetricBuilder) *RequestBuilder
- func (rb *RequestBuilder) PageSize(pagesize int) *RequestBuilder
- func (rb *RequestBuilder) RollupIndex(rollupindex types.IndexName) *RequestBuilder
- func (rb *RequestBuilder) Timeout(timeout *types.DurationBuilder) *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 NewPutJob ¶
NewPutJob type alias for index.
func NewPutJobFunc ¶
func NewPutJobFunc(tp elastictransport.Interface) NewPutJob
NewPutJobFunc returns a new instance of PutJob with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type PutJob ¶
type PutJob struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *PutJob
Creates a rollup job.
https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-put-job.html
func (*PutJob) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*PutJob) Id ¶
Id Identifier for the rollup job. This can be any alphanumeric string and uniquely identifies the data that is associated with the rollup job. The ID is persistent; it is stored with the rolled up data. If you create a job, let it run for a while, then delete the job, the data that the job rolled up is still be associated with this job ID. You cannot create a new job with the same ID since that could lead to problems with mismatched job configurations. API Name: id
type Request ¶
type Request struct { // Cron A cron string which defines the intervals when the rollup job should be // executed. When the interval // triggers, the indexer attempts to rollup the data in the index pattern. The // cron pattern is unrelated // to the time interval of the data being rolled up. For example, you may wish // to create hourly rollups // of your document but to only run the indexer on a daily basis at midnight, as // defined by the cron. The // cron pattern is defined just like a Watcher cron schedule. Cron string `json:"cron"` // Groups Defines the grouping fields and aggregations that are defined for this rollup // job. These fields will then be // available later for aggregating into buckets. These aggs and fields can be // used in any combination. Think of // the groups configuration as defining a set of tools that can later be used in // aggregations to partition the // data. Unlike raw data, we have to think ahead to which fields and // aggregations might be used. Rollups provide // enough flexibility that you simply need to determine which fields are needed, // not in what order they are needed. Groups types.Groupings `json:"groups"` Headers *types.HttpHeaders `json:"headers,omitempty"` // IndexPattern The index or index pattern to roll up. Supports wildcard-style patterns // (`logstash-*`). The job attempts to // rollup the entire index or index-pattern. IndexPattern string `json:"index_pattern"` // Metrics Defines the metrics to collect for each grouping tuple. By default, only the // doc_counts are collected for each // group. To make rollup useful, you will often add metrics like averages, mins, // maxes, etc. Metrics are defined // on a per-field basis and for each field you configure which metric should be // collected. Metrics []types.FieldMetric `json:"metrics,omitempty"` // PageSize The number of bucket results that are processed on each iteration of the // rollup indexer. A larger value tends // to execute faster, but requires more memory during processing. This value has // no effect on how the data is // rolled up; it is merely used for tweaking the speed or memory cost of the // indexer. PageSize int `json:"page_size"` // RollupIndex The index that contains the rollup results. The index can be shared with // other rollup jobs. The data is stored so that it doesn’t interfere with // unrelated jobs. RollupIndex types.IndexName `json:"rollup_index"` // Timeout Time to wait for the request to complete. Timeout *types.Duration `json:"timeout,omitempty"` }
Request holds the request body struct for the package putjob
type RequestBuilder ¶
type RequestBuilder struct {
// contains filtered or unexported fields
}
RequestBuilder is the builder API for the putjob.Request
func NewRequestBuilder ¶
func NewRequestBuilder() *RequestBuilder
NewRequest returns a RequestBuilder which can be chained and built to retrieve a RequestBuilder
func (*RequestBuilder) Build ¶
func (rb *RequestBuilder) Build() *Request
Build finalize the chain and returns the Request struct.
func (*RequestBuilder) Cron ¶
func (rb *RequestBuilder) Cron(cron string) *RequestBuilder
func (*RequestBuilder) FromJSON ¶
func (rb *RequestBuilder) FromJSON(data string) (*Request, error)
FromJSON allows to load an arbitrary json into the request structure
func (*RequestBuilder) Groups ¶
func (rb *RequestBuilder) Groups(groups *types.GroupingsBuilder) *RequestBuilder
func (*RequestBuilder) Headers ¶
func (rb *RequestBuilder) Headers(headers *types.HttpHeadersBuilder) *RequestBuilder
func (*RequestBuilder) IndexPattern ¶
func (rb *RequestBuilder) IndexPattern(indexpattern string) *RequestBuilder
func (*RequestBuilder) Metrics ¶
func (rb *RequestBuilder) Metrics(metrics []types.FieldMetricBuilder) *RequestBuilder
func (*RequestBuilder) PageSize ¶
func (rb *RequestBuilder) PageSize(pagesize int) *RequestBuilder
func (*RequestBuilder) RollupIndex ¶
func (rb *RequestBuilder) RollupIndex(rollupindex types.IndexName) *RequestBuilder
func (*RequestBuilder) Timeout ¶
func (rb *RequestBuilder) Timeout(timeout *types.DurationBuilder) *RequestBuilder