Documentation
¶
Overview ¶
Promote a data stream. Promote a data stream from a replicated data stream managed by cross-cluster replication (CCR) to a regular data stream.
With CCR auto following, a data stream from a remote cluster can be replicated to the local cluster. These data streams can't be rolled over in the local cluster. These replicated data streams roll over only if the upstream data stream rolls over. In the event that the remote cluster is no longer available, the data stream in the local cluster can be promoted to a regular data stream, which allows these data streams to be rolled over in the local cluster.
NOTE: When promoting a data stream, ensure the local cluster has a data stream enabled index template that matches the data stream. If this is missing, the data stream will not be able to roll over until a matching index template is created. This will affect the lifecycle management of the data stream and interfere with the data stream size and retention.
Index ¶
- Variables
- type NewPromoteDataStream
- type PromoteDataStream
- func (r PromoteDataStream) Do(providedCtx context.Context) (Response, error)
- func (r *PromoteDataStream) ErrorTrace(errortrace bool) *PromoteDataStream
- func (r *PromoteDataStream) FilterPath(filterpaths ...string) *PromoteDataStream
- func (r *PromoteDataStream) Header(key, value string) *PromoteDataStream
- func (r *PromoteDataStream) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *PromoteDataStream) Human(human bool) *PromoteDataStream
- func (r PromoteDataStream) IsSuccess(providedCtx context.Context) (bool, error)
- func (r *PromoteDataStream) MasterTimeout(duration string) *PromoteDataStream
- func (r PromoteDataStream) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *PromoteDataStream) Pretty(pretty bool) *PromoteDataStream
- 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 NewPromoteDataStream ¶
type NewPromoteDataStream func(name string) *PromoteDataStream
NewPromoteDataStream type alias for index.
func NewPromoteDataStreamFunc ¶
func NewPromoteDataStreamFunc(tp elastictransport.Interface) NewPromoteDataStream
NewPromoteDataStreamFunc returns a new instance of PromoteDataStream with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type PromoteDataStream ¶
type PromoteDataStream struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *PromoteDataStream
Promote a data stream. Promote a data stream from a replicated data stream managed by cross-cluster replication (CCR) to a regular data stream.
With CCR auto following, a data stream from a remote cluster can be replicated to the local cluster. These data streams can't be rolled over in the local cluster. These replicated data streams roll over only if the upstream data stream rolls over. In the event that the remote cluster is no longer available, the data stream in the local cluster can be promoted to a regular data stream, which allows these data streams to be rolled over in the local cluster.
NOTE: When promoting a data stream, ensure the local cluster has a data stream enabled index template that matches the data stream. If this is missing, the data stream will not be able to roll over until a matching index template is created. This will affect the lifecycle management of the data stream and interfere with the data stream size and retention.
https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams.html
func (PromoteDataStream) Do ¶
func (r PromoteDataStream) Do(providedCtx context.Context) (Response, error)
Do runs the request through the transport, handle the response and returns a promotedatastream.Response
func (*PromoteDataStream) ErrorTrace ¶ added in v8.14.0
func (r *PromoteDataStream) ErrorTrace(errortrace bool) *PromoteDataStream
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*PromoteDataStream) FilterPath ¶ added in v8.14.0
func (r *PromoteDataStream) FilterPath(filterpaths ...string) *PromoteDataStream
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*PromoteDataStream) Header ¶
func (r *PromoteDataStream) Header(key, value string) *PromoteDataStream
Header set a key, value pair in the PromoteDataStream headers map.
func (*PromoteDataStream) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*PromoteDataStream) Human ¶ added in v8.14.0
func (r *PromoteDataStream) Human(human bool) *PromoteDataStream
Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_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 (PromoteDataStream) IsSuccess ¶
func (r PromoteDataStream) IsSuccess(providedCtx 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 (*PromoteDataStream) MasterTimeout ¶ added in v8.16.0
func (r *PromoteDataStream) MasterTimeout(duration string) *PromoteDataStream
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 (PromoteDataStream) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*PromoteDataStream) Pretty ¶ added in v8.14.0
func (r *PromoteDataStream) Pretty(pretty bool) *PromoteDataStream
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
type Response ¶ added in v8.7.0
type Response = json.RawMessage
func NewResponse ¶ added in v8.7.1
func NewResponse() *Response