get

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

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(v 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(ctx 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(v 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(b 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(b bool) *Get

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

func (*Get) IndexDetails

func (r *Get) IndexDetails(b 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(b 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(ctx 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(v 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(i 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(enum 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

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

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

func (*Get) Repository

func (r *Get) Repository(v string) *Get

Repository Comma-separated list of snapshot repository names used to limit the request. Wildcard (*) expressions are supported. API Name: repository

func (*Get) Size

func (r *Get) Size(i 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(v 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) Snapshot

func (r *Get) Snapshot(v string) *Get

Snapshot Comma-separated list of snapshot names to retrieve. Also accepts wildcards (*). - To get information about all snapshots in a registered repository, use a wildcard (*) or _all. - To get information about any snapshots that are currently running, use _current. API Name: snapshot

func (*Get) Sort

func (r *Get) Sort(enum 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(b 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

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"`
}

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