Documentation
¶
Overview ¶
Get snapshot information.
NOTE: The `after` parameter and `next` field enable you to iterate through snapshots with some consistency guarantees regarding concurrent creation or deletion of snapshots. It is guaranteed that any snapshot that exists at the beginning of the iteration and is not concurrently deleted will be seen during the iteration. Snapshots concurrently created may be seen during an iteration.
Index ¶
- Variables
- type Get
- func (r *Get) After(after string) *Get
- func (r Get) Do(providedCtx context.Context) (*Response, error)
- func (r *Get) ErrorTrace(errortrace bool) *Get
- func (r *Get) FilterPath(filterpaths ...string) *Get
- func (r *Get) FromSortValue(fromsortvalue string) *Get
- func (r *Get) Header(key, value string) *Get
- func (r *Get) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *Get) Human(human bool) *Get
- func (r *Get) IgnoreUnavailable(ignoreunavailable bool) *Get
- func (r *Get) IncludeRepository(includerepository bool) *Get
- func (r *Get) IndexDetails(indexdetails bool) *Get
- func (r *Get) IndexNames(indexnames bool) *Get
- func (r Get) IsSuccess(providedCtx context.Context) (bool, error)
- func (r *Get) MasterTimeout(duration string) *Get
- func (r *Get) Offset(offset int) *Get
- func (r *Get) Order(order sortorder.SortOrder) *Get
- func (r Get) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *Get) Pretty(pretty bool) *Get
- func (r *Get) Size(size int) *Get
- func (r *Get) SlmPolicyFilter(name string) *Get
- func (r *Get) Sort(sort snapshotsort.SnapshotSort) *Get
- func (r *Get) State(states ...snapshotstate.SnapshotState) *Get
- func (r *Get) Verbose(verbose bool) *Get
- type NewGet
- type Response
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 Get ¶
type Get struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Get
Get snapshot information.
NOTE: The `after` parameter and `next` field enable you to iterate through snapshots with some consistency guarantees regarding concurrent creation or deletion of snapshots. It is guaranteed that any snapshot that exists at the beginning of the iteration and is not concurrently deleted will be seen during the iteration. Snapshots concurrently created may be seen during an iteration.
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-get
func (*Get) After ¶
After An offset identifier to start pagination from as returned by the next field in the response body. API name: after
func (Get) Do ¶
Do runs the request through the transport, handle the response and returns a get.Response
func (*Get) ErrorTrace ¶
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*Get) FilterPath ¶
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*Get) FromSortValue ¶
FromSortValue The value of the current sort column at which to start retrieval. It can be a string `snapshot-` or a repository name when sorting by snapshot or repository name. It can be a millisecond time value or a number when sorting by `index-` or shard count. API name: from_sort_value
func (*Get) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*Get) Human ¶
Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"exists_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 (*Get) IgnoreUnavailable ¶
IgnoreUnavailable If `false`, the request returns an error for any snapshots that are unavailable. API name: ignore_unavailable
func (*Get) IncludeRepository ¶
IncludeRepository If `true`, the response includes the repository name in each snapshot. API name: include_repository
func (*Get) IndexDetails ¶
IndexDetails If `true`, the response includes 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. The default is `false`, meaning that this information is omitted. API name: index_details
func (*Get) IndexNames ¶
IndexNames If `true`, the response includes the name of each index in each snapshot. API name: index_names
func (Get) IsSuccess ¶
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 ¶
MasterTimeout The 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 ¶
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 ¶
Order The sort order. Valid values are `asc` for ascending and `desc` for descending order. The default behavior is ascending order. API name: order
func (Get) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Get) Pretty ¶
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*Get) Size ¶
Size The maximum number of snapshots to return. The default is 0, which means to return all that match the request without limit. API name: size
func (*Get) SlmPolicyFilter ¶
SlmPolicyFilter Filter snapshots by a comma-separated list of snapshot lifecycle management (SLM) policy names that snapshots belong to.
You can use wildcards (`*`) and combinations of wildcards followed by exclude patterns starting with `-`. For example, the pattern `*,-policy-a-\*` will return all snapshots except for those that were created by an SLM policy with a name starting with `policy-a-`. Note that the wildcard pattern `*` matches all snapshots created by an SLM policy but not those snapshots that were not created by an SLM policy. To include snapshots that were 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 The sort order for the result. The default behavior is sorting by snapshot start time stamp. API name: sort
func (*Get) State ¶ added in v9.1.0
func (r *Get) State(states ...snapshotstate.SnapshotState) *Get
State Only return snapshots with a state found in the given comma-separated list of snapshot states. The default is all snapshot states. API name: state
func (*Get) Verbose ¶
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.
NOTE: The parameters `size`, `order`, `after`, `from_sort_value`, `offset`, `slm_policy_filter`, and `sort` are not supported when you set `verbose=false` and the sort order for requests with `verbose=false` is undefined. API name: verbose
type NewGet ¶
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 { // Next If the request contained a size limit and there might be more results, a // `next` field will be added to the response. // It can be used as the `after` query parameter to fetch additional results. Next *string `json:"next,omitempty"` // 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 the size // limit or `after` query parameter. Total int `json:"total"` }
Response holds the response body struct for the package get