Documentation ¶
Overview ¶
Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle.
Index ¶
- Variables
- type CloseJob
- func (r *CloseJob) AllowNoMatch(b bool) *CloseJob
- func (r CloseJob) Do(ctx context.Context) (*http.Response, error)
- func (r *CloseJob) Force(b bool) *CloseJob
- func (r *CloseJob) Header(key, value string) *CloseJob
- func (r *CloseJob) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *CloseJob) JobId(v string) *CloseJob
- func (r *CloseJob) Raw(raw json.RawMessage) *CloseJob
- func (r *CloseJob) Request(req *Request) *CloseJob
- func (r *CloseJob) Timeout(value string) *CloseJob
- type NewCloseJob
- type Request
- type RequestBuilder
- func (rb *RequestBuilder) AllowNoMatch(allownomatch bool) *RequestBuilder
- func (rb *RequestBuilder) Build() *Request
- func (rb *RequestBuilder) Force(force bool) *RequestBuilder
- func (rb *RequestBuilder) FromJSON(data string) (*Request, error)
- 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 CloseJob ¶
type CloseJob struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *CloseJob
Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle.
https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/ml-close-job.html
func (*CloseJob) AllowNoMatch ¶
AllowNoMatch Specifies what to do when the request: contains wildcard expressions and there are no jobs that match; contains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and there are only partial matches. By default, it returns an empty jobs array when there are no matches and the subset of results when there are partial matches. If `false`, the request returns a 404 status code when there are no matches or only partial matches. API name: allow_no_match
func (*CloseJob) Force ¶
Force Use to close a failed job, or to forcefully close a job which has not responded to its initial close request; the request returns without performing the associated actions such as flushing buffers and persisting the model snapshots. If you want the job to be in a consistent state after the close job API returns, do not set to `true`. This parameter should be used only in situations where the job has already failed or where you are not interested in results the job might have recently produced or might produce in the future. API name: force
func (*CloseJob) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*CloseJob) JobId ¶
JobId Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. You can close multiple anomaly detection jobs in a single API request by using a group name, a comma-separated list of jobs, or a wildcard expression. You can close all jobs by using `_all` or by specifying `*` as the job identifier. API Name: jobid
func (*CloseJob) Raw ¶
func (r *CloseJob) Raw(raw json.RawMessage) *CloseJob
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
type NewCloseJob ¶
NewCloseJob type alias for index.
func NewCloseJobFunc ¶
func NewCloseJobFunc(tp elastictransport.Interface) NewCloseJob
NewCloseJobFunc returns a new instance of CloseJob 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 { // AllowNoMatch Refer to the description for the `allow_no_match` query parameter. AllowNoMatch *bool `json:"allow_no_match,omitempty"` // Force Refer to the descriptiion for the `force` query parameter. Force *bool `json:"force,omitempty"` // Timeout Refer to the description for the `timeout` query parameter. Timeout *types.Duration `json:"timeout,omitempty"` }
Request holds the request body struct for the package closejob
type RequestBuilder ¶
type RequestBuilder struct {
// contains filtered or unexported fields
}
RequestBuilder is the builder API for the closejob.Request
func NewRequestBuilder ¶
func NewRequestBuilder() *RequestBuilder
NewRequest returns a RequestBuilder which can be chained and built to retrieve a RequestBuilder
func (*RequestBuilder) AllowNoMatch ¶
func (rb *RequestBuilder) AllowNoMatch(allownomatch bool) *RequestBuilder
func (*RequestBuilder) Build ¶
func (rb *RequestBuilder) Build() *Request
Build finalize the chain and returns the Request struct.
func (*RequestBuilder) Force ¶
func (rb *RequestBuilder) Force(force bool) *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) Timeout ¶
func (rb *RequestBuilder) Timeout(timeout *types.DurationBuilder) *RequestBuilder