putautofollowpattern

package
v8.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Overview

Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices.

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

Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices.

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) 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) 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) 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/5bf86339cd4bda77d07f6eaa6789b72f9c0279b1/specification/ccr/put_auto_follow_pattern/PutAutoFollowPatternRequest.ts#L27-L112

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/5bf86339cd4bda77d07f6eaa6789b72f9c0279b1/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