getstats

package
v8.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Overview

Returns global and policy-level statistics about actions taken by snapshot lifecycle management.

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 GetStats

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

func New

Returns global and policy-level statistics about actions taken by snapshot lifecycle management.

https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-stats.html

func (GetStats) Do

func (r GetStats) Do(providedCtx context.Context) (*Response, error)

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

func (*GetStats) ErrorTrace added in v8.14.0

func (r *GetStats) ErrorTrace(errortrace bool) *GetStats

ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace

func (*GetStats) FilterPath added in v8.14.0

func (r *GetStats) FilterPath(filterpaths ...string) *GetStats

FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path

func (*GetStats) Header

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

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

func (*GetStats) HttpRequest

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

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

func (*GetStats) Human added in v8.14.0

func (r *GetStats) Human(human bool) *GetStats

Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human

func (GetStats) IsSuccess

func (r GetStats) IsSuccess(providedCtx context.Context) (bool, error)

IsSuccess allows to run a query with a context and retrieve the result as a boolean. This only exists for endpoints without a request payload and allows for quick control flow.

func (GetStats) Perform added in v8.7.0

func (r GetStats) Perform(providedCtx context.Context) (*http.Response, error)

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

func (*GetStats) Pretty added in v8.14.0

func (r *GetStats) Pretty(pretty bool) *GetStats

Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty

type NewGetStats

type NewGetStats func() *GetStats

NewGetStats type alias for index.

func NewGetStatsFunc

func NewGetStatsFunc(tp elastictransport.Interface) NewGetStats

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

type Response added in v8.7.0

type Response struct {
	PolicyStats                   []string       `json:"policy_stats"`
	RetentionDeletionTime         types.Duration `json:"retention_deletion_time"`
	RetentionDeletionTimeMillis   int64          `json:"retention_deletion_time_millis"`
	RetentionFailed               int64          `json:"retention_failed"`
	RetentionRuns                 int64          `json:"retention_runs"`
	RetentionTimedOut             int64          `json:"retention_timed_out"`
	TotalSnapshotDeletionFailures int64          `json:"total_snapshot_deletion_failures"`
	TotalSnapshotsDeleted         int64          `json:"total_snapshots_deleted"`
	TotalSnapshotsFailed          int64          `json:"total_snapshots_failed"`
	TotalSnapshotsTaken           int64          `json:"total_snapshots_taken"`
}

Response holds the response body struct for the package getstats

https://github.com/elastic/elasticsearch-specification/blob/4fcf747dfafc951e1dcf3077327e3dcee9107db3/specification/slm/get_stats/GetSnapshotLifecycleStatsResponse.ts#L23-L36

func NewResponse added in v8.7.0

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