Documentation
¶
Overview ¶
Create a snapshot. Take a snapshot of a cluster or of data streams and indices.
Index ¶
- Variables
- type Create
- func (r Create) Do(providedCtx context.Context) (*Response, error)
- func (r *Create) ErrorTrace(errortrace bool) *Create
- func (r *Create) ExpandWildcards(expandwildcards ...expandwildcard.ExpandWildcard) *Create
- func (r *Create) FeatureStates(featurestates ...string) *Create
- func (r *Create) FilterPath(filterpaths ...string) *Create
- func (r *Create) Header(key, value string) *Create
- func (r *Create) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *Create) Human(human bool) *Create
- func (r *Create) IgnoreUnavailable(ignoreunavailable bool) *Create
- func (r *Create) IncludeGlobalState(includeglobalstate bool) *Create
- func (r *Create) Indices(indices ...string) *Create
- func (r *Create) MasterTimeout(duration string) *Create
- func (r *Create) Metadata(metadata types.MetadataVariant) *Create
- func (r *Create) Partial(partial bool) *Create
- func (r Create) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *Create) Pretty(pretty bool) *Create
- func (r *Create) Raw(raw io.Reader) *Create
- func (r *Create) Request(req *Request) *Create
- func (r *Create) WaitForCompletion(waitforcompletion bool) *Create
- type NewCreate
- type Request
- 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 Create ¶
type Create struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Create
Create a snapshot. Take a snapshot of a cluster or of data streams and indices.
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-create
func (Create) Do ¶
Do runs the request through the transport, handle the response and returns a create.Response
func (*Create) ErrorTrace ¶
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*Create) ExpandWildcards ¶
func (r *Create) ExpandWildcards(expandwildcards ...expandwildcard.ExpandWildcard) *Create
Determines how wildcard patterns in the `indices` parameter match data streams and indices. It supports comma-separated values such as `open,hidden`. API name: expand_wildcards
func (*Create) FeatureStates ¶
The 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.
Note that specifying an empty array will result in the default behavior. To exclude all feature states, regardless of the `include_global_state` value, specify an array with only the value `none` (`["none"]`). API name: feature_states
func (*Create) FilterPath ¶
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*Create) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*Create) 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 (*Create) IgnoreUnavailable ¶
If `true`, the request ignores data streams and indices in `indices` that are missing or closed. If `false`, the request returns an error for any data stream or index that is missing or closed. API name: ignore_unavailable
func (*Create) 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`). API name: include_global_state
func (*Create) Indices ¶
A comma-separated list of data streams and indices to include in the snapshot. It supports a multi-target syntax. The default is an empty array (`[]`), which includes all regular data streams and regular indices. To exclude all data streams and indices, use `-*`.
You can't use this parameter to include or exclude system indices or system data streams from a snapshot. Use `feature_states` instead. API name: indices
func (*Create) 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 (*Create) Metadata ¶
func (r *Create) Metadata(metadata types.MetadataVariant) *Create
Arbitrary metadata to the snapshot, such as a record of who took the snapshot, why it was taken, or any other useful data. It can have any contents but it must be less than 1024 bytes. This information is not automatically generated by Elasticsearch. API name: metadata
func (*Create) Partial ¶
If `true`, it enables you to restore 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. API name: partial
func (Create) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Create) Pretty ¶
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*Create) Raw ¶
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) 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 { // ExpandWildcards Determines how wildcard patterns in the `indices` parameter match data // streams and indices. // It supports comma-separated values such as `open,hidden`. ExpandWildcards []expandwildcard.ExpandWildcard `json:"expand_wildcards,omitempty"` // FeatureStates The 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. // // Note that specifying an empty array will result in the default behavior. // To exclude all feature states, regardless of the `include_global_state` // value, specify an array with only the value `none` (`["none"]`). 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 A comma-separated list of data streams and indices to include in the // snapshot. // It supports a multi-target syntax. // The default is an empty array (`[]`), which includes all regular data streams // and regular indices. // To exclude all data streams and indices, use `-*`. // // You can't use this parameter to include or exclude system indices or system // data streams from a snapshot. // Use `feature_states` instead. Indices []string `json:"indices,omitempty"` // Metadata Arbitrary metadata to the snapshot, such as a record of who took the // snapshot, why it was taken, or any other useful data. // It can have any contents but it must be less than 1024 bytes. // This information is not automatically generated by Elasticsearch. Metadata types.Metadata `json:"metadata,omitempty"` // Partial If `true`, it enables you to restore 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
func (*Request) UnmarshalJSON ¶
type Response ¶
type Response struct { // Accepted Equals `true` if the snapshot was accepted. Present when the request had // `wait_for_completion` set to `false` Accepted *bool `json:"accepted,omitempty"` // Snapshot Snapshot information. Present when the request had `wait_for_completion` set // to `true` Snapshot *types.SnapshotInfo `json:"snapshot,omitempty"` }
Response holds the response body struct for the package create