get

package
v8.13.1 Latest Latest
Warning

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

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

Documentation

Overview

Returns information about a snapshot.

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 Get

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

func (*Get) After

func (r *Get) After(after string) *Get

After Offset identifier to start pagination from as returned by the next field in the response body. API name: after

func (Get) Do

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

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

func (*Get) FromSortValue

func (r *Get) FromSortValue(fromsortvalue string) *Get

FromSortValue Value of the current sort column at which to start retrieval. Can either be a string snapshot- or repository name when sorting by snapshot or repository name, a millisecond time value or a number when sorting by index- or shard count. API name: from_sort_value

func (*Get) Header

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

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

func (*Get) HttpRequest

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

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

func (*Get) IgnoreUnavailable

func (r *Get) IgnoreUnavailable(ignoreunavailable bool) *Get

IgnoreUnavailable If false, the request returns an error for any snapshots that are unavailable. API name: ignore_unavailable

func (*Get) IncludeRepository

func (r *Get) IncludeRepository(includerepository bool) *Get

IncludeRepository If true, returns the repository name in each snapshot. API name: include_repository

func (*Get) IndexDetails

func (r *Get) IndexDetails(indexdetails bool) *Get

IndexDetails If true, returns additional information about each index in the snapshot comprising the number of shards in the index, the total size of the index in bytes, and the maximum number of segments per shard in the index. Defaults to false, meaning that this information is omitted. API name: index_details

func (*Get) IndexNames

func (r *Get) IndexNames(indexnames bool) *Get

IndexNames If true, returns the name of each index in each snapshot. API name: index_names

func (Get) IsSuccess

func (r Get) 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 (*Get) MasterTimeout

func (r *Get) MasterTimeout(duration string) *Get

MasterTimeout Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. API name: master_timeout

func (*Get) Offset

func (r *Get) Offset(offset int) *Get

Offset Numeric offset to start pagination from based on the snapshots matching this request. Using a non-zero value for this parameter is mutually exclusive with using the after parameter. Defaults to 0. API name: offset

func (*Get) Order

func (r *Get) Order(order sortorder.SortOrder) *Get

Order Sort order. Valid values are asc for ascending and desc for descending order. Defaults to asc, meaning ascending order. API name: order

func (Get) Perform added in v8.7.0

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

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

func (*Get) Size

func (r *Get) Size(size int) *Get

Size Maximum number of snapshots to return. Defaults to 0 which means return all that match the request without limit. API name: size

func (*Get) SlmPolicyFilter

func (r *Get) SlmPolicyFilter(name string) *Get

SlmPolicyFilter Filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Also accepts wildcards (*) and combinations of wildcards followed by exclude patterns starting with -. To include snapshots not created by an SLM policy you can use the special pattern _none that will match all snapshots without an SLM policy. API name: slm_policy_filter

func (*Get) Sort

func (r *Get) Sort(sort snapshotsort.SnapshotSort) *Get

Sort Allows setting a sort order for the result. Defaults to start_time, i.e. sorting by snapshot start time stamp. API name: sort

func (*Get) Verbose

func (r *Get) Verbose(verbose bool) *Get

Verbose If true, returns additional information about each snapshot such as the version of Elasticsearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted. API name: verbose

type NewGet

type NewGet func(repository, snapshot string) *Get

NewGet type alias for index.

func NewGetFunc

func NewGetFunc(tp elastictransport.Interface) NewGet

NewGetFunc returns a new instance of Get 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 {

	// Remaining The number of remaining snapshots that were not returned due to size limits
	// and that can be fetched by additional requests using the next field value.
	Remaining int                          `json:"remaining"`
	Responses []types.SnapshotResponseItem `json:"responses,omitempty"`
	Snapshots []types.SnapshotInfo         `json:"snapshots,omitempty"`
	// Total The total number of snapshots that match the request when ignoring size limit
	// or after query parameter.
	Total int `json:"total"`
}

Response holds the response body struct for the package get

https://github.com/elastic/elasticsearch-specification/blob/5bf86339cd4bda77d07f6eaa6789b72f9c0279b1/specification/snapshot/get/SnapshotGetResponse.ts#L25-L42

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