putautofollowpattern

package
v8.17.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Overview

Create or update auto-follow patterns. Create a collection of cross-cluster replication auto-follow patterns for a remote cluster. Newly created indices on the remote cluster that match any of the patterns are automatically configured as follower indices. Indices on the remote cluster that were created before the auto-follow pattern was created will not be auto-followed even if they match the pattern.

This API can also be used to update auto-follow patterns. NOTE: Follower indices that were configured automatically before updating an auto-follow pattern will remain unchanged even if they do not match against the new patterns.

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 NewPutAutoFollowPattern

type NewPutAutoFollowPattern func(name string) *PutAutoFollowPattern

NewPutAutoFollowPattern type alias for index.

func NewPutAutoFollowPatternFunc

func NewPutAutoFollowPatternFunc(tp elastictransport.Interface) NewPutAutoFollowPattern

NewPutAutoFollowPatternFunc returns a new instance of PutAutoFollowPattern with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

type PutAutoFollowPattern

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

func New

Create or update auto-follow patterns. Create a collection of cross-cluster replication auto-follow patterns for a remote cluster. Newly created indices on the remote cluster that match any of the patterns are automatically configured as follower indices. Indices on the remote cluster that were created before the auto-follow pattern was created will not be auto-followed even if they match the pattern.

This API can also be used to update auto-follow patterns. NOTE: Follower indices that were configured automatically before updating an auto-follow pattern will remain unchanged even if they do not match against the new patterns.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html

func (PutAutoFollowPattern) Do

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

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

func (*PutAutoFollowPattern) ErrorTrace added in v8.14.0

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

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

func (*PutAutoFollowPattern) FilterPath added in v8.14.0

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

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

func (*PutAutoFollowPattern) FollowIndexPattern added in v8.9.0

func (r *PutAutoFollowPattern) FollowIndexPattern(indexpattern string) *PutAutoFollowPattern

FollowIndexPattern The name of follower index. The template {{leader_index}} can be used to derive the name of the follower index from the name of the leader index. When following a data stream, use {{leader_index}}; CCR does not support changes to the names of a follower data stream’s backing indices. API name: follow_index_pattern

func (*PutAutoFollowPattern) Header

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

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

func (*PutAutoFollowPattern) HttpRequest

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

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

func (*PutAutoFollowPattern) Human added in v8.14.0

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 (*PutAutoFollowPattern) LeaderIndexExclusionPatterns added in v8.9.0

func (r *PutAutoFollowPattern) LeaderIndexExclusionPatterns(indexpatterns ...string) *PutAutoFollowPattern

LeaderIndexExclusionPatterns An array of simple index patterns that can be used to exclude indices from being auto-followed. Indices in the remote cluster whose names are matching one or more leader_index_patterns and one or more leader_index_exclusion_patterns won’t be followed. API name: leader_index_exclusion_patterns

func (*PutAutoFollowPattern) LeaderIndexPatterns added in v8.9.0

func (r *PutAutoFollowPattern) LeaderIndexPatterns(indexpatterns ...string) *PutAutoFollowPattern

LeaderIndexPatterns An array of simple index patterns to match against indices in the remote cluster specified by the remote_cluster field. API name: leader_index_patterns

func (*PutAutoFollowPattern) MaxOutstandingReadRequests added in v8.9.0

func (r *PutAutoFollowPattern) MaxOutstandingReadRequests(maxoutstandingreadrequests int) *PutAutoFollowPattern

MaxOutstandingReadRequests The maximum number of outstanding reads requests from the remote cluster. API name: max_outstanding_read_requests

func (*PutAutoFollowPattern) MaxOutstandingWriteRequests added in v8.9.0

func (r *PutAutoFollowPattern) MaxOutstandingWriteRequests(maxoutstandingwriterequests int) *PutAutoFollowPattern

MaxOutstandingWriteRequests The maximum number of outstanding reads requests from the remote cluster. API name: max_outstanding_write_requests

func (*PutAutoFollowPattern) MaxReadRequestOperationCount added in v8.9.0

func (r *PutAutoFollowPattern) MaxReadRequestOperationCount(maxreadrequestoperationcount int) *PutAutoFollowPattern

MaxReadRequestOperationCount The maximum number of operations to pull per read from the remote cluster. API name: max_read_request_operation_count

func (*PutAutoFollowPattern) MaxReadRequestSize added in v8.9.0

func (r *PutAutoFollowPattern) MaxReadRequestSize(bytesize types.ByteSize) *PutAutoFollowPattern

MaxReadRequestSize The maximum size in bytes of per read of a batch of operations pulled from the remote cluster. API name: max_read_request_size

func (*PutAutoFollowPattern) MaxRetryDelay added in v8.9.0

func (r *PutAutoFollowPattern) MaxRetryDelay(duration types.Duration) *PutAutoFollowPattern

MaxRetryDelay The maximum time to wait before retrying an operation that failed exceptionally. An exponential backoff strategy is employed when retrying. API name: max_retry_delay

func (*PutAutoFollowPattern) MaxWriteBufferCount added in v8.9.0

func (r *PutAutoFollowPattern) MaxWriteBufferCount(maxwritebuffercount int) *PutAutoFollowPattern

MaxWriteBufferCount The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the number of queued operations goes below the limit. API name: max_write_buffer_count

func (*PutAutoFollowPattern) MaxWriteBufferSize added in v8.9.0

func (r *PutAutoFollowPattern) MaxWriteBufferSize(bytesize types.ByteSize) *PutAutoFollowPattern

MaxWriteBufferSize The maximum total bytes of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the total bytes of queued operations goes below the limit. API name: max_write_buffer_size

func (*PutAutoFollowPattern) MaxWriteRequestOperationCount added in v8.9.0

func (r *PutAutoFollowPattern) MaxWriteRequestOperationCount(maxwriterequestoperationcount int) *PutAutoFollowPattern

MaxWriteRequestOperationCount The maximum number of operations per bulk write request executed on the follower. API name: max_write_request_operation_count

func (*PutAutoFollowPattern) MaxWriteRequestSize added in v8.9.0

func (r *PutAutoFollowPattern) MaxWriteRequestSize(bytesize types.ByteSize) *PutAutoFollowPattern

MaxWriteRequestSize The maximum total bytes of operations per bulk write request executed on the follower. API name: max_write_request_size

func (PutAutoFollowPattern) Perform added in v8.7.0

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

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

func (*PutAutoFollowPattern) Pretty added in v8.14.0

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

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

func (*PutAutoFollowPattern) 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 (*PutAutoFollowPattern) ReadPollTimeout added in v8.9.0

func (r *PutAutoFollowPattern) ReadPollTimeout(duration types.Duration) *PutAutoFollowPattern

ReadPollTimeout The maximum time to wait for new operations on the remote cluster when the follower index is synchronized with the leader index. When the timeout has elapsed, the poll for operations will return to the follower so that it can update some statistics. Then the follower will immediately attempt to read from the leader again. API name: read_poll_timeout

func (*PutAutoFollowPattern) RemoteCluster added in v8.9.0

func (r *PutAutoFollowPattern) RemoteCluster(remotecluster string) *PutAutoFollowPattern

RemoteCluster The remote cluster containing the leader indices to match against. API name: remote_cluster

func (*PutAutoFollowPattern) Request

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

func (*PutAutoFollowPattern) Settings added in v8.9.0

func (r *PutAutoFollowPattern) Settings(settings map[string]json.RawMessage) *PutAutoFollowPattern

Settings Settings to override from the leader index. Note that certain settings can not be overrode (e.g., index.number_of_shards). API name: settings

type Request

type Request struct {

	// FollowIndexPattern The name of follower index. The template {{leader_index}} can be used to
	// derive the name of the follower index from the name of the leader index. When
	// following a data stream, use {{leader_index}}; CCR does not support changes
	// to the names of a follower data stream’s backing indices.
	FollowIndexPattern *string `json:"follow_index_pattern,omitempty"`
	// LeaderIndexExclusionPatterns An array of simple index patterns that can be used to exclude indices from
	// being auto-followed. Indices in the remote cluster whose names are matching
	// one or more leader_index_patterns and one or more
	// leader_index_exclusion_patterns won’t be followed.
	LeaderIndexExclusionPatterns []string `json:"leader_index_exclusion_patterns,omitempty"`
	// LeaderIndexPatterns An array of simple index patterns to match against indices in the remote
	// cluster specified by the remote_cluster field.
	LeaderIndexPatterns []string `json:"leader_index_patterns,omitempty"`
	// MaxOutstandingReadRequests The maximum number of outstanding reads requests from the remote cluster.
	MaxOutstandingReadRequests *int `json:"max_outstanding_read_requests,omitempty"`
	// MaxOutstandingWriteRequests The maximum number of outstanding reads requests from the remote cluster.
	MaxOutstandingWriteRequests *int `json:"max_outstanding_write_requests,omitempty"`
	// MaxReadRequestOperationCount The maximum number of operations to pull per read from the remote cluster.
	MaxReadRequestOperationCount *int `json:"max_read_request_operation_count,omitempty"`
	// MaxReadRequestSize The maximum size in bytes of per read of a batch of operations pulled from
	// the remote cluster.
	MaxReadRequestSize types.ByteSize `json:"max_read_request_size,omitempty"`
	// MaxRetryDelay The maximum time to wait before retrying an operation that failed
	// exceptionally. An exponential backoff strategy is employed when retrying.
	MaxRetryDelay types.Duration `json:"max_retry_delay,omitempty"`
	// MaxWriteBufferCount The maximum number of operations that can be queued for writing. When this
	// limit is reached, reads from the remote cluster will be deferred until the
	// number of queued operations goes below the limit.
	MaxWriteBufferCount *int `json:"max_write_buffer_count,omitempty"`
	// MaxWriteBufferSize The maximum total bytes of operations that can be queued for writing. When
	// this limit is reached, reads from the remote cluster will be deferred until
	// the total bytes of queued operations goes below the limit.
	MaxWriteBufferSize types.ByteSize `json:"max_write_buffer_size,omitempty"`
	// MaxWriteRequestOperationCount The maximum number of operations per bulk write request executed on the
	// follower.
	MaxWriteRequestOperationCount *int `json:"max_write_request_operation_count,omitempty"`
	// MaxWriteRequestSize The maximum total bytes of operations per bulk write request executed on the
	// follower.
	MaxWriteRequestSize types.ByteSize `json:"max_write_request_size,omitempty"`
	// ReadPollTimeout The maximum time to wait for new operations on the remote cluster when the
	// follower index is synchronized with the leader index. When the timeout has
	// elapsed, the poll for operations will return to the follower so that it can
	// update some statistics. Then the follower will immediately attempt to read
	// from the leader again.
	ReadPollTimeout types.Duration `json:"read_poll_timeout,omitempty"`
	// RemoteCluster The remote cluster containing the leader indices to match against.
	RemoteCluster string `json:"remote_cluster"`
	// Settings Settings to override from the leader index. Note that certain settings can
	// not be overrode (e.g., index.number_of_shards).
	Settings map[string]json.RawMessage `json:"settings,omitempty"`
}

Request holds the request body struct for the package putautofollowpattern

https://github.com/elastic/elasticsearch-specification/blob/2f823ff6fcaa7f3f0f9b990dc90512d8901e5d64/specification/ccr/put_auto_follow_pattern/PutAutoFollowPatternRequest.ts#L27-L120

func NewRequest added in v8.5.0

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON added in v8.5.0

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

FromJSON allows to load an arbitrary json into the request structure

func (*Request) UnmarshalJSON added in v8.12.1

func (s *Request) UnmarshalJSON(data []byte) error

type Response added in v8.7.0

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 putautofollowpattern

https://github.com/elastic/elasticsearch-specification/blob/2f823ff6fcaa7f3f0f9b990dc90512d8901e5d64/specification/ccr/put_auto_follow_pattern/PutAutoFollowPatternResponse.ts#L22-L24

func NewResponse added in v8.7.0

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