clone

package
v9.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Clone a snapshot. Clone part of all of a snapshot into another snapshot in the same repository.

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 Clone

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

func New

Clone a snapshot. Clone part of all of a snapshot into another snapshot in the same repository.

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-clone

func (Clone) Do

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

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

func (*Clone) ErrorTrace

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

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

func (*Clone) FilterPath

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

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

func (*Clone) Header

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

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

func (*Clone) HttpRequest

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

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

func (*Clone) Human

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

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 (*Clone) Indices

func (r *Clone) Indices(indices string) *Clone

A comma-separated list of indices to include in the snapshot. Multi-target syntax is supported. API name: indices

func (*Clone) MasterTimeout

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

MasterTimeout The period to wait for the master node. If the master node is not available before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to `-1`. API name: master_timeout

func (Clone) Perform

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

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

func (*Clone) Pretty

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

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

func (*Clone) Raw

func (r *Clone) Raw(raw io.Reader) *Clone

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*Clone) Request

func (r *Clone) Request(req *Request) *Clone

Request allows to set the request property with the appropriate payload.

type NewClone

type NewClone func(repository, snapshot, targetsnapshot string) *Clone

NewClone type alias for index.

func NewCloneFunc

func NewCloneFunc(tp elastictransport.Interface) NewClone

NewCloneFunc returns a new instance of Clone 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 {

	// Indices A comma-separated list of indices to include in the snapshot.
	// Multi-target syntax is supported.
	Indices string `json:"indices"`
}

Request holds the request body struct for the package clone

https://github.com/elastic/elasticsearch-specification/blob/907d11a72a6bfd37b777d526880c56202889609e/specification/snapshot/clone/SnapshotCloneRequest.ts#L24-L70

func NewRequest

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

type Response

type Response struct {

	// Acknowledged For a successful response, this value is always true. On failure, an
	// exception is returned instead.
	Acknowledged bool `json:"acknowledged"`
}

Response holds the response body struct for the package clone

https://github.com/elastic/elasticsearch-specification/blob/907d11a72a6bfd37b777d526880c56202889609e/specification/snapshot/clone/SnapshotCloneResponse.ts#L22-L25

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