Documentation
¶
Overview ¶
Creates a snapshot in a repository.
Index ¶
- Variables
- type Create
- func (r Create) Do(ctx context.Context) (*http.Response, error)
- func (r *Create) Header(key, value string) *Create
- func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *Create) MasterTimeout(value string) *Create
- func (r *Create) Raw(raw json.RawMessage) *Create
- func (r *Create) Repository(v string) *Create
- func (r *Create) Request(req *Request) *Create
- func (r *Create) Snapshot(v string) *Create
- func (r *Create) WaitForCompletion(b bool) *Create
- type NewCreate
- type Request
- type RequestBuilder
- func (rb *RequestBuilder) Build() *Request
- func (rb *RequestBuilder) FeatureStates(feature_states ...string) *RequestBuilder
- func (rb *RequestBuilder) FromJSON(data string) (*Request, error)
- func (rb *RequestBuilder) IgnoreUnavailable(ignoreunavailable bool) *RequestBuilder
- func (rb *RequestBuilder) IncludeGlobalState(includeglobalstate bool) *RequestBuilder
- func (rb *RequestBuilder) Indices(indices *types.IndicesBuilder) *RequestBuilder
- func (rb *RequestBuilder) Metadata(metadata *types.MetadataBuilder) *RequestBuilder
- func (rb *RequestBuilder) Partial(partial bool) *RequestBuilder
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 Create ¶
type Create struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Create
Creates a snapshot in a repository.
https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html
func (*Create) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*Create) MasterTimeout ¶
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 (*Create) Raw ¶
func (r *Create) Raw(raw json.RawMessage) *Create
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*Create) Repository ¶
Repository Repository for the snapshot. API Name: repository
func (*Create) Snapshot ¶
Snapshot Name of the snapshot. Must be unique in the repository. API Name: snapshot
func (*Create) WaitForCompletion ¶
WaitForCompletion If `true`, the request returns a response when the snapshot is complete. If `false`, the request returns a response when the snapshot initializes. API name: wait_for_completion
type NewCreate ¶
NewCreate type alias for index.
func NewCreateFunc ¶
func NewCreateFunc(tp elastictransport.Interface) NewCreate
NewCreateFunc returns a new instance of Create 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 {
// FeatureStates Feature states to include in the snapshot. Each feature state includes one or
// more system indices containing related data. You can view a list of eligible
// features using the get features API. If `include_global_state` is `true`, all
// current feature states are included by default. If `include_global_state` is
// `false`, no feature states are included by default.
FeatureStates []string `json:"feature_states,omitempty"`
// missing or closed. If `false`, the request returns an error for any data
// stream or index that is missing or closed.
IgnoreUnavailable *bool `json:"ignore_unavailable,omitempty"`
// IncludeGlobalState If `true`, the current cluster state is included in the snapshot. The cluster
// state includes persistent cluster settings, composable index templates,
// legacy index templates, ingest pipelines, and ILM policies. It also includes
// data stored in system indices, such as Watches and task records (configurable
// via `feature_states`).
IncludeGlobalState *bool `json:"include_global_state,omitempty"`
// Indices Data streams and indices to include in the snapshot. Supports multi-target
// syntax. Includes all data streams and indices by default.
Indices *types.Indices `json:"indices,omitempty"`
// Metadata Optional metadata for the snapshot. May have any contents. Must be less than
// 1024 bytes. This map is not automatically generated by Elasticsearch.
Metadata *types.Metadata `json:"metadata,omitempty"`
// Partial If `true`, allows restoring a partial snapshot of indices with unavailable
// shards. Only shards that were successfully included in the snapshot will be
// restored. All missing shards will be recreated as empty. If `false`, the
// entire restore operation will fail if one or more indices included in the
// snapshot do not have all primary shards available.
Partial *bool `json:"partial,omitempty"`
}
Request holds the request body struct for the package create
type RequestBuilder ¶
type RequestBuilder struct {
// contains filtered or unexported fields
}
RequestBuilder is the builder API for the create.Request
func NewRequestBuilder ¶
func NewRequestBuilder() *RequestBuilder
NewRequest returns a RequestBuilder which can be chained and built to retrieve a RequestBuilder
func (*RequestBuilder) Build ¶
func (rb *RequestBuilder) Build() *Request
Build finalize the chain and returns the Request struct.
func (*RequestBuilder) FeatureStates ¶
func (rb *RequestBuilder) FeatureStates(feature_states ...string) *RequestBuilder
func (*RequestBuilder) FromJSON ¶
func (rb *RequestBuilder) FromJSON(data string) (*Request, error)
FromJSON allows to load an arbitrary json into the request structure
func (*RequestBuilder) IgnoreUnavailable ¶
func (rb *RequestBuilder) IgnoreUnavailable(ignoreunavailable bool) *RequestBuilder
func (*RequestBuilder) IncludeGlobalState ¶
func (rb *RequestBuilder) IncludeGlobalState(includeglobalstate bool) *RequestBuilder
func (*RequestBuilder) Indices ¶
func (rb *RequestBuilder) Indices(indices *types.IndicesBuilder) *RequestBuilder
func (*RequestBuilder) Metadata ¶
func (rb *RequestBuilder) Metadata(metadata *types.MetadataBuilder) *RequestBuilder
func (*RequestBuilder) Partial ¶
func (rb *RequestBuilder) Partial(partial bool) *RequestBuilder