api

package
v9.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package api contains the service interfaces and implementations for the Elasticsearch REST API.

Each Elasticsearch API group (documents, search, indices, cluster, etc.) is exposed as a service interface with a default implementation backed by a resty HTTP client. Services are constructed by the root github.com/disaster37/elasticsearch/v9 package and accessed via the [Client] interface.

Request and response types for each service live in the matching *_model.go file. Request types carry validate tags (processed by go-playground/validator) and Params types provide ToMap() to serialize query parameters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddBlockParams

type AddBlockParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
	Timeout           string
}

AddBlockParams are the query parameters for the add_block endpoint.

func (*AddBlockParams) ToMap

func (p *AddBlockParams) ToMap() map[string]string

ToMap converts AddBlockParams to a query-parameter map.

type AddBlockRequest

type AddBlockRequest struct {
	Indices []string `validate:"required,min=1"`
	Block   string   `validate:"required"`
	Params  *AddBlockParams
}

AddBlockRequest is the request for PUT /{index}/_block/{block}.

func (*AddBlockRequest) Validate

func (r *AddBlockRequest) Validate() error

Validate validates the AddBlockRequest.

type AliasInfo

type AliasInfo struct {
	Filter        map[string]any `json:"filter,omitempty"`
	IndexRouting  string         `json:"index_routing,omitempty"`
	SearchRouting string         `json:"search_routing,omitempty"`
	IsWriteIndex  *bool          `json:"is_write_index,omitempty"`
	IsHidden      *bool          `json:"is_hidden,omitempty"`
}

AliasInfo describes a single alias.

type AliasParams

type AliasParams struct {
	Common  *CommonParams
	Timeout string
}

AliasParams are the query parameters for put/delete alias.

func (*AliasParams) ToMap

func (p *AliasParams) ToMap() map[string]string

ToMap converts AliasParams to a query-parameter map.

type AnalyzeToken

type AnalyzeToken struct {
	Token          string `json:"token"`
	StartOffset    int    `json:"start_offset"`
	EndOffset      int    `json:"end_offset"`
	Position       int    `json:"position"`
	Type           string `json:"type,omitempty"`
	PositionLength int    `json:"position_length,omitempty"`
	Bytes          string `json:"bytes,omitempty"`
	Keyword        bool   `json:"keyword,omitempty"`
}

AnalyzeToken describes a single analysis token.

type AsyncSearchGetParams

type AsyncSearchGetParams struct {
	Common                   *CommonParams
	KeepAlive                string
	TypedKeys                *bool
	WaitForCompletionTimeout string
}

AsyncSearchGetParams are the query parameters for async_search.get.

func (*AsyncSearchGetParams) ToMap

func (p *AsyncSearchGetParams) ToMap() map[string]string

ToMap converts AsyncSearchGetParams to a query-parameter map.

type AsyncSearchResponse

type AsyncSearchResponse struct {
	Id                     string                 `json:"id,omitempty"`
	IsPartial              bool                   `json:"is_partial"`
	IsRunning              bool                   `json:"is_running"`
	StartTimeInMillis      int64                  `json:"start_time_in_millis,omitempty"`
	ExpirationTimeInMillis int64                  `json:"expiration_time_in_millis,omitempty"`
	Response               *querydsl.SearchResult `json:"response,omitempty"`
}

AsyncSearchResponse is the response from async_search submit/get.

type AsyncSearchService

AsyncSearchService provides access to the async search APIs.

func NewAsyncSearchService

func NewAsyncSearchService(client *resty.Client, logger *logrus.Entry) AsyncSearchService

NewAsyncSearchService creates a new AsyncSearchService.

type AsyncSearchStatusResponse

type AsyncSearchStatusResponse struct {
	Id                     string `json:"id,omitempty"`
	IsRunning              bool   `json:"is_running"`
	IsPartial              bool   `json:"is_partial"`
	StartTimeInMillis      int64  `json:"start_time_in_millis,omitempty"`
	ExpirationTimeInMillis int64  `json:"expiration_time_in_millis,omitempty"`
	Shards                 *struct {
		Total      int `json:"total"`
		Successful int `json:"successful"`
		Skipped    int `json:"skipped"`
		Failed     int `json:"failed"`
	} `json:"_shards,omitempty"`
}

AsyncSearchStatusResponse is the response from async_search.status.

type AsyncSearchSubmitParams

type AsyncSearchSubmitParams struct {
	Common                    *CommonParams
	AllowNoIndices            *bool
	AllowPartialSearchResults *bool
	Analyzer                  string
	AnalyzeWildcard           *bool
	BatchedReduceSize         *int
	DefaultOperator           DefaultOperator
	Df                        string
	ExpandWildcards           ExpandWildcards
	Explain                   *bool
	From                      *int
	IgnoreThrottled           *bool
	IgnoreUnavailable         *bool
	KeepAlive                 string
	KeepOnCompletion          *bool
	Lenient                   *bool
	Preference                string
	Q                         string
	RequestCache              *bool
	Routing                   string
	SearchType                SearchType
	Size                      *int
	Sort                      []string
	Source                    string
	SourceExcludes            []string
	SourceIncludes            []string
	Stats                     []string
	StoredFields              []string
	SuggestField              string
	SuggestMode               SuggestMode
	SuggestSize               *int
	SuggestText               string
	TerminateAfter            *int
	Timeout                   string
	TrackScores               *bool
	TrackTotalHits            string
	TypedKeys                 *bool
	WaitForCompletionTimeout  string
}

AsyncSearchSubmitParams are the query parameters for async_search.submit.

func (*AsyncSearchSubmitParams) ToMap

func (p *AsyncSearchSubmitParams) ToMap() map[string]string

ToMap converts AsyncSearchSubmitParams to a query-parameter map.

type AsyncSearchSubmitRequest

type AsyncSearchSubmitRequest struct {
	Indices []string
	Body    any
	Params  *AsyncSearchSubmitParams
}

AsyncSearchSubmitRequest is the request for POST /{index}/_async_search.

type AutoscalingService

type AutoscalingService interface {
	GetCapacity(ctx context.Context) (json.RawMessage, error)
	GetPolicy(ctx context.Context, name string) (json.RawMessage, error)
	PutPolicy(ctx context.Context, name string, body any) (*types.AcknowledgedResponse, error)
	DeletePolicy(ctx context.Context, name string) (*types.AcknowledgedResponse, error)
}

AutoscalingService provides access to the autoscaling APIs.

func NewAutoscalingService

func NewAutoscalingService(client *resty.Client, logger *logrus.Entry) AutoscalingService

NewAutoscalingService creates a new AutoscalingService.

type BulkIndexByScrollResponse

type BulkIndexByScrollResponse struct {
	Header           http.Header `json:"-"`
	Took             int64       `json:"took"`
	SliceId          *int64      `json:"slice_id,omitempty"`
	TimedOut         bool        `json:"timed_out"`
	Total            int64       `json:"total"`
	Updated          int64       `json:"updated,omitempty"`
	Created          int64       `json:"created,omitempty"`
	Deleted          int64       `json:"deleted"`
	Batches          int64       `json:"batches"`
	VersionConflicts int64       `json:"version_conflicts"`
	Noops            int64       `json:"noops"`
	Retries          struct {
		Bulk   int64 `json:"bulk"`
		Search int64 `json:"search"`
	} `json:"retries,omitempty"`
	Throttled            string           `json:"throttled"`
	ThrottledMillis      int64            `json:"throttled_millis"`
	RequestsPerSecond    float64          `json:"requests_per_second"`
	Canceled             string           `json:"canceled,omitempty"`
	ThrottledUntil       string           `json:"throttled_until"`
	ThrottledUntilMillis int64            `json:"throttled_until_millis"`
	Failures             []map[string]any `json:"failures"`
}

BulkIndexByScrollResponse represents the result of delete-by-query, update-by-query, and reindex operations.

type BulkParams

type BulkParams struct {
	Common                *CommonParams
	ListExecutedPipelines []string
	Pipeline              string
	Refresh               Refresh
	RequireAlias          *bool
	Routing               string
	Source                string
	SourceExcludes        []string
	SourceIncludes        []string
	Timeout               string
	WaitForActiveShards   string
}

BulkParams are the query parameters for the bulk endpoint.

func (*BulkParams) ToMap

func (p *BulkParams) ToMap() map[string]string

ToMap converts BulkParams to a query-parameter map.

type BulkRequest

type BulkRequest struct {
	Index  string
	Body   string `validate:"required"`
	Params *BulkParams
}

BulkRequest is the request for POST /_bulk | /{index}/_bulk (NDJSON body).

func (*BulkRequest) Validate

func (r *BulkRequest) Validate() error

Validate validates the BulkRequest.

type BulkResponse

type BulkResponse struct {
	Took   int64                          `json:"took,omitempty"`
	Errors bool                           `json:"errors,omitempty"`
	Items  []map[string]*BulkResponseItem `json:"items,omitempty"`
}

BulkResponse represents the result of a bulk API request.

type BulkResponseItem

type BulkResponseItem struct {
	Index         string                           `json:"_index,omitempty"`
	Id            string                           `json:"_id,omitempty"`
	Version       int64                            `json:"_version,omitempty"`
	Result        string                           `json:"result,omitempty"`
	Shards        *types.ShardsInfo                `json:"_shards,omitempty"`
	SeqNo         int64                            `json:"_seq_no,omitempty"`
	PrimaryTerm   int64                            `json:"_primary_term,omitempty"`
	Status        int                              `json:"status,omitempty"`
	ForcedRefresh bool                             `json:"forced_refresh,omitempty"`
	Error         *types.ElasticsearchErrorDetails `json:"error,omitempty"`
}

BulkResponseItem represents the result of a single operation within a bulk request.

type BytesFormat

type BytesFormat string

BytesFormat values for cat/size endpoints.

const (
	BytesB  BytesFormat = "b"
	BytesKb BytesFormat = "kb"
	BytesMb BytesFormat = "mb"
	BytesGb BytesFormat = "gb"
	BytesTb BytesFormat = "tb"
	BytesPb BytesFormat = "pb"
)

type CapabilitiesRequest

type CapabilitiesRequest struct {
	Method     string
	Path       string
	Parameters []string
	Local      *bool
	Common     *CommonParams
}

CapabilitiesRequest is the request for GET /_capabilities.

type CapabilitiesResponse

type CapabilitiesResponse struct {
	Capabilities map[string]any `json:"capabilities,omitempty"`
}

CapabilitiesResponse is the response from GET /_capabilities.

type CatAliasesParams

type CatAliasesParams struct {
	ExpandWildcards ExpandWildcards
	// contains filtered or unexported fields
}

CatAliasesParams are the query parameters for cat.aliases.

func (*CatAliasesParams) ToMap

func (p *CatAliasesParams) ToMap() map[string]string

ToMap converts CatAliasesParams to a query-parameter map.

type CatAliasesResponse

type CatAliasesResponse []CatAliasesRow

CatAliasesResponse is a slice of cat.aliases rows.

type CatAliasesRow

type CatAliasesRow struct {
	Alias         string `json:"alias"`
	Index         string `json:"index"`
	Filter        string `json:"filter"`
	RoutingIndex  string `json:"routing.index"`
	RoutingSearch string `json:"routing.search"`
	IsWriteIndex  string `json:"is_write_index"`
}

CatAliasesRow is a single cat.aliases row.

type CatAllocationParams

type CatAllocationParams struct {
	Bytes BytesFormat
	// contains filtered or unexported fields
}

CatAllocationParams are the query parameters for cat.allocation.

func (*CatAllocationParams) ToMap

func (p *CatAllocationParams) ToMap() map[string]string

ToMap converts CatAllocationParams to a query-parameter map.

type CatAllocationResponse

type CatAllocationResponse []CatAllocationRow

CatAllocationResponse is a slice of cat.allocation rows.

type CatAllocationRow

type CatAllocationRow struct {
	Shards      int    `json:"shards"`
	Disk        string `json:"disk"`
	DiskIndex   string `json:"disk.indices"`
	DiskUsed    string `json:"disk.used"`
	DiskAvail   string `json:"disk.avail"`
	DiskTotal   string `json:"disk.total"`
	DiskPercent string `json:"disk.percent"`
	Host        string `json:"host"`
	IP          string `json:"ip"`
	Node        string `json:"node"`
}

CatAllocationRow is a single cat.allocation row.

type CatCircuitBreakerParams

type CatCircuitBreakerParams struct {
	Bytes BytesFormat
	// contains filtered or unexported fields
}

CatCircuitBreakerParams are the query parameters for cat.circuit_breaker.

func (*CatCircuitBreakerParams) ToMap

func (p *CatCircuitBreakerParams) ToMap() map[string]string

ToMap converts CatCircuitBreakerParams to a query-parameter map.

type CatCircuitBreakerResponse

type CatCircuitBreakerResponse []CatCircuitBreakerRow

CatCircuitBreakerResponse is a slice of cat.circuit_breaker rows.

type CatCircuitBreakerRow

type CatCircuitBreakerRow struct {
	Node          string `json:"node"`
	Field         string `json:"field"`
	Breaker       string `json:"breaker"`
	EstimatedSize string `json:"estimated_size"`
	LimitSize     string `json:"limit_size"`
	Overhead      string `json:"overhead"`
	Tripped       string `json:"tripped"`
	Limit         string `json:"limit"`
}

CatCircuitBreakerRow is a single cat.circuit_breaker row.

type CatComponentTemplatesParams

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

CatComponentTemplatesParams are the query parameters for cat.component_templates.

func (*CatComponentTemplatesParams) ToMap

func (p *CatComponentTemplatesParams) ToMap() map[string]string

ToMap converts CatComponentTemplatesParams to a query-parameter map.

type CatComponentTemplatesResponse

type CatComponentTemplatesResponse []CatComponentTemplatesRow

CatComponentTemplatesResponse is a slice of cat.component_templates rows.

type CatComponentTemplatesRow

type CatComponentTemplatesRow struct {
	Name    string `json:"name"`
	Version string `json:"version,omitempty"`
}

CatComponentTemplatesRow is a single cat.component_templates row.

type CatCountParams

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

CatCountParams are the query parameters for cat.count.

func (*CatCountParams) ToMap

func (p *CatCountParams) ToMap() map[string]string

ToMap converts CatCountParams to a query-parameter map.

type CatCountResponse

type CatCountResponse []CatCountRow

CatCountResponse is a slice of cat.count rows.

type CatCountRow

type CatCountRow struct {
	Epoch     string `json:"epoch"`
	Timestamp string `json:"timestamp"`
	Count     string `json:"count"`
}

CatCountRow is a single cat.count row.

type CatFielddataParams

type CatFielddataParams struct {
	Bytes BytesFormat
	// contains filtered or unexported fields
}

CatFielddataParams are the query parameters for cat.fielddata.

func (*CatFielddataParams) ToMap

func (p *CatFielddataParams) ToMap() map[string]string

ToMap converts CatFielddataParams to a query-parameter map.

type CatFielddataResponse

type CatFielddataResponse []CatFielddataRow

CatFielddataResponse is a slice of cat.fielddata rows.

type CatFielddataRow

type CatFielddataRow struct {
	Node  string `json:"node"`
	Field string `json:"field"`
	Size  string `json:"size"`
}

CatFielddataRow is a single cat.fielddata row.

type CatFormat

type CatFormat string

CatFormat values. The client always requests JSON.

const (
	CatFormatJSON CatFormat = "json"
	CatFormatText CatFormat = "text"
)

type CatHealthParams

type CatHealthParams struct {
	Ts *bool
	// contains filtered or unexported fields
}

CatHealthParams are the query parameters for cat.health.

func (*CatHealthParams) ToMap

func (p *CatHealthParams) ToMap() map[string]string

ToMap converts CatHealthParams to a query-parameter map.

type CatHealthResponse

type CatHealthResponse []CatHealthRow

CatHealthResponse is a slice of cat.health rows.

type CatHealthRow

type CatHealthRow struct {
	Epoch               string `json:"epoch"`
	Timestamp           string `json:"timestamp"`
	Cluster             string `json:"cluster"`
	Status              string `json:"status"`
	NodeTotal           string `json:"node.total"`
	NodeData            string `json:"node.data"`
	Shards              string `json:"shards"`
	Pri                 string `json:"pri"`
	Relo                string `json:"relo"`
	Init                string `json:"init"`
	Unassign            string `json:"unassign"`
	PendingTasks        string `json:"pending_tasks"`
	MaxTaskWait         string `json:"max_task_wait"`
	ActiveShardsPercent string `json:"active_shards_percent"`
}

CatHealthRow is a single cat.health row.

type CatIndicesParams

type CatIndicesParams struct {
	Bytes                   BytesFormat
	ExpandWildcards         ExpandWildcards
	Health                  HealthStatus
	IncludeUnloadedSegments *bool
	Pri                     *bool
	// contains filtered or unexported fields
}

CatIndicesParams are the query parameters for cat.indices.

func (*CatIndicesParams) ToMap

func (p *CatIndicesParams) ToMap() map[string]string

ToMap converts CatIndicesParams to a query-parameter map.

type CatIndicesResponse

type CatIndicesResponse []CatIndicesRow

CatIndicesResponse is a slice of cat.indices rows.

type CatIndicesRow

type CatIndicesRow struct {
	Health       string `json:"health"`
	Status       string `json:"status"`
	Index        string `json:"index"`
	UUID         string `json:"uuid"`
	Pri          string `json:"pri"`
	Rep          string `json:"rep"`
	DocsCount    string `json:"docs.count"`
	DocsDeleted  string `json:"docs.deleted"`
	StoreSize    string `json:"store.size"`
	PriStoreSize string `json:"pri.store.size"`
}

CatIndicesRow is a single cat.indices row.

type CatMLDataFrameAnalyticsParams

type CatMLDataFrameAnalyticsParams struct {
	AllowNoMatch *bool
	Bytes        BytesFormat
	From         *int
	Size         *int
	Time         string
	// contains filtered or unexported fields
}

CatMLDataFrameAnalyticsParams are the query parameters for cat.ml_data_frame_analytics.

func (*CatMLDataFrameAnalyticsParams) ToMap

ToMap converts CatMLDataFrameAnalyticsParams to a query-parameter map.

type CatMLDataFrameAnalyticsResponse

type CatMLDataFrameAnalyticsResponse []CatMLDataFrameAnalyticsRow

CatMLDataFrameAnalyticsResponse is a slice of cat.ml_data_frame_analytics rows.

type CatMLDataFrameAnalyticsRow

type CatMLDataFrameAnalyticsRow struct {
	ID       string `json:"id"`
	State    string `json:"state"`
	Progress string `json:"progress"`
}

CatMLDataFrameAnalyticsRow is a single cat.ml_data_frame_analytics row.

type CatMLDatafeedsParams

type CatMLDatafeedsParams struct {
	AllowNoMatch *bool
	From         *int
	Size         *int
	Time         string
	// contains filtered or unexported fields
}

CatMLDatafeedsParams are the query parameters for cat.ml_datafeeds.

func (*CatMLDatafeedsParams) ToMap

func (p *CatMLDatafeedsParams) ToMap() map[string]string

ToMap converts CatMLDatafeedsParams to a query-parameter map.

type CatMLDatafeedsResponse

type CatMLDatafeedsResponse []CatMLDatafeedsRow

CatMLDatafeedsResponse is a slice of cat.ml_datafeeds rows.

type CatMLDatafeedsRow

type CatMLDatafeedsRow struct {
	ID         string `json:"id"`
	State      string `json:"state"`
	Assignment string `json:"node.assignment"`
}

CatMLDatafeedsRow is a single cat.ml_datafeeds row.

type CatMLJobsParams

type CatMLJobsParams struct {
	AllowNoMatch *bool
	Bytes        BytesFormat
	From         *int
	Size         *int
	// contains filtered or unexported fields
}

CatMLJobsParams are the query parameters for cat.ml_jobs.

func (*CatMLJobsParams) ToMap

func (p *CatMLJobsParams) ToMap() map[string]string

ToMap converts CatMLJobsParams to a query-parameter map.

type CatMLJobsResponse

type CatMLJobsResponse []CatMLJobsRow

CatMLJobsResponse is a slice of cat.ml_jobs rows.

type CatMLJobsRow

type CatMLJobsRow struct {
	ID         string `json:"id"`
	State      string `json:"state"`
	OpenedTime string `json:"opened_time"`
}

CatMLJobsRow is a single cat.ml_jobs row.

type CatMLTrainedModelsParams

type CatMLTrainedModelsParams struct {
	AllowNoMatch *bool
	Bytes        BytesFormat
	From         *int
	Size         *int
	// contains filtered or unexported fields
}

CatMLTrainedModelsParams are the query parameters for cat.ml_trained_models.

func (*CatMLTrainedModelsParams) ToMap

func (p *CatMLTrainedModelsParams) ToMap() map[string]string

ToMap converts CatMLTrainedModelsParams to a query-parameter map.

type CatMLTrainedModelsResponse

type CatMLTrainedModelsResponse []CatMLTrainedModelsRow

CatMLTrainedModelsResponse is a slice of cat.ml_trained_models rows.

type CatMLTrainedModelsRow

type CatMLTrainedModelsRow struct {
	ID        string `json:"id"`
	Type      string `json:"type"`
	Algorithm string `json:"algorithm"`
}

CatMLTrainedModelsRow is a single cat.ml_trained_models row.

type CatMasterParams

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

CatMasterParams are the query parameters for cat.master.

func (*CatMasterParams) ToMap

func (p *CatMasterParams) ToMap() map[string]string

ToMap converts CatMasterParams to a query-parameter map.

type CatMasterResponse

type CatMasterResponse []CatMasterRow

CatMasterResponse is a slice of cat.master rows.

type CatMasterRow

type CatMasterRow struct {
	ID   string `json:"id"`
	Host string `json:"host"`
	IP   string `json:"ip"`
	Node string `json:"node"`
}

CatMasterRow is a single cat.master row.

type CatNodeAttrsParams

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

CatNodeAttrsParams are the query parameters for cat.nodeattrs.

func (*CatNodeAttrsParams) ToMap

func (p *CatNodeAttrsParams) ToMap() map[string]string

ToMap converts CatNodeAttrsParams to a query-parameter map.

type CatNodeAttrsResponse

type CatNodeAttrsResponse []CatNodeAttrsRow

CatNodeAttrsResponse is a slice of cat.nodeattrs rows.

type CatNodeAttrsRow

type CatNodeAttrsRow struct {
	Node  string `json:"node"`
	Attr  string `json:"attr"`
	Value string `json:"value"`
}

CatNodeAttrsRow is a single cat.nodeattrs row.

type CatNodesParams

type CatNodesParams struct {
	Bytes  BytesFormat
	FullId *bool
	Time   string
	// contains filtered or unexported fields
}

CatNodesParams are the query parameters for cat.nodes.

func (*CatNodesParams) ToMap

func (p *CatNodesParams) ToMap() map[string]string

ToMap converts CatNodesParams to a query-parameter map.

type CatNodesResponse

type CatNodesResponse []CatNodesRow

CatNodesResponse is a slice of cat.nodes rows.

type CatNodesRow

type CatNodesRow struct {
	IP          string `json:"ip"`
	HeapPercent string `json:"heap.percent"`
	RamPercent  string `json:"ram.percent"`
	CPU         string `json:"cpu"`
	Load1m      string `json:"load_1m"`
	Load5m      string `json:"load_5m"`
	Load15m     string `json:"load_15m"`
	NodeRole    string `json:"node.role"`
	Master      string `json:"master"`
	Name        string `json:"name"`
}

CatNodesRow is a single cat.nodes row.

type CatPendingTasksParams

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

CatPendingTasksParams are the query parameters for cat.pending_tasks.

func (*CatPendingTasksParams) ToMap

func (p *CatPendingTasksParams) ToMap() map[string]string

ToMap converts CatPendingTasksParams to a query-parameter map.

type CatPendingTasksResponse

type CatPendingTasksResponse []CatPendingTasksRow

CatPendingTasksResponse is a slice of cat.pending_tasks rows.

type CatPendingTasksRow

type CatPendingTasksRow struct {
	InsertOrder string `json:"insert_order"`
	TimeInQueue string `json:"time_in_queue"`
	Priority    string `json:"priority"`
	Source      string `json:"source"`
}

CatPendingTasksRow is a single cat.pending_tasks row.

type CatPluginsParams

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

CatPluginsParams are the query parameters for cat.plugins.

func (*CatPluginsParams) ToMap

func (p *CatPluginsParams) ToMap() map[string]string

ToMap converts CatPluginsParams to a query-parameter map.

type CatPluginsResponse

type CatPluginsResponse []CatPluginsRow

CatPluginsResponse is a slice of cat.plugins rows.

type CatPluginsRow

type CatPluginsRow struct {
	Name                 string `json:"name"`
	Version              string `json:"version"`
	ElasticsearchVersion string `json:"elasticsearch_version"`
	Description          string `json:"description"`
}

CatPluginsRow is a single cat.plugins row.

type CatRecoveryParams

type CatRecoveryParams struct {
	ActiveOnly *bool
	Bytes      BytesFormat
	Detailed   *bool
	// contains filtered or unexported fields
}

CatRecoveryParams are the query parameters for cat.recovery.

func (*CatRecoveryParams) ToMap

func (p *CatRecoveryParams) ToMap() map[string]string

ToMap converts CatRecoveryParams to a query-parameter map.

type CatRecoveryResponse

type CatRecoveryResponse []CatRecoveryRow

CatRecoveryResponse is a slice of cat.recovery rows.

type CatRecoveryRow

type CatRecoveryRow struct {
	Index           string `json:"index"`
	Shard           string `json:"shard"`
	StartTime       string `json:"start_time"`
	StartTimeMillis string `json:"start_time_millis"`
	StopTime        string `json:"stop_time"`
	StopTimeMillis  string `json:"stop_time_millis"`
	TotalTime       string `json:"total_time"`
	TotalTimeMillis string `json:"total_time_millis"`
	Source          string `json:"source"`
	Target          string `json:"target"`
	Type            string `json:"type"`
	Stage           string `json:"stage"`
	Repository      string `json:"repository"`
	Snapshot        string `json:"snapshot"`
	Files           string `json:"files"`
	FilesRecovered  string `json:"files_recovered"`
	FilesPercent    string `json:"files_percent"`
	Bytes           string `json:"bytes"`
	BytesRecovered  string `json:"bytes_recovered"`
	BytesPercent    string `json:"bytes_percent"`
}

CatRecoveryRow is a single cat.recovery row.

type CatRepositoriesParams

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

CatRepositoriesParams are the query parameters for cat.repositories.

func (*CatRepositoriesParams) ToMap

func (p *CatRepositoriesParams) ToMap() map[string]string

ToMap converts CatRepositoriesParams to a query-parameter map.

type CatRepositoriesResponse

type CatRepositoriesResponse []CatRepositoriesRow

CatRepositoriesResponse is a slice of cat.repositories rows.

type CatRepositoriesRow

type CatRepositoriesRow struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

CatRepositoriesRow is a single cat.repositories row.

type CatSegmentsParams

type CatSegmentsParams struct {
	Bytes   BytesFormat
	Verbose *bool
	// contains filtered or unexported fields
}

CatSegmentsParams are the query parameters for cat.segments.

func (*CatSegmentsParams) ToMap

func (p *CatSegmentsParams) ToMap() map[string]string

ToMap converts CatSegmentsParams to a query-parameter map.

type CatSegmentsResponse

type CatSegmentsResponse []CatSegmentsRow

CatSegmentsResponse is a slice of cat.segments rows.

type CatSegmentsRow

type CatSegmentsRow struct {
	Index       string `json:"index"`
	Shard       string `json:"shard"`
	Prirep      string `json:"prirep"`
	IP          string `json:"ip"`
	Segment     string `json:"segment"`
	Generation  string `json:"generation"`
	DocsCount   string `json:"docs.count"`
	DocsDeleted string `json:"docs.deleted"`
	Size        string `json:"size"`
	SizeMemory  string `json:"size.memory"`
	Committed   string `json:"committed"`
	Searchable  string `json:"searchable"`
	Version     string `json:"version"`
	Compound    string `json:"compound"`
}

CatSegmentsRow is a single cat.segments row.

type CatService

type CatService interface {
	Aliases(ctx context.Context, names []string, p *CatAliasesParams) (CatAliasesResponse, error)
	Allocation(ctx context.Context, nodeIds []string, p *CatAllocationParams) (CatAllocationResponse, error)
	CircuitBreaker(ctx context.Context, p *CatCircuitBreakerParams) (CatCircuitBreakerResponse, error)
	ComponentTemplates(ctx context.Context, name string, p *CatComponentTemplatesParams) (CatComponentTemplatesResponse, error)
	Count(ctx context.Context, indices []string, p *CatCountParams) (CatCountResponse, error)
	Fielddata(ctx context.Context, fields []string, p *CatFielddataParams) (CatFielddataResponse, error)
	Health(ctx context.Context, p *CatHealthParams) (CatHealthResponse, error)
	Help(ctx context.Context) (string, error)
	Indices(ctx context.Context, indices []string, p *CatIndicesParams) (CatIndicesResponse, error)
	Master(ctx context.Context, p *CatMasterParams) (CatMasterResponse, error)
	MLDataFrameAnalytics(ctx context.Context, id string, p *CatMLDataFrameAnalyticsParams) (CatMLDataFrameAnalyticsResponse, error)
	MLDatafeeds(ctx context.Context, datafeedId string, p *CatMLDatafeedsParams) (CatMLDatafeedsResponse, error)
	MLJobs(ctx context.Context, jobId string, p *CatMLJobsParams) (CatMLJobsResponse, error)
	MLTrainedModels(ctx context.Context, modelId string, p *CatMLTrainedModelsParams) (CatMLTrainedModelsResponse, error)
	NodeAttrs(ctx context.Context, p *CatNodeAttrsParams) (CatNodeAttrsResponse, error)
	Nodes(ctx context.Context, p *CatNodesParams) (CatNodesResponse, error)
	PendingTasks(ctx context.Context, p *CatPendingTasksParams) (CatPendingTasksResponse, error)
	Plugins(ctx context.Context, p *CatPluginsParams) (CatPluginsResponse, error)
	Recovery(ctx context.Context, indices []string, p *CatRecoveryParams) (CatRecoveryResponse, error)
	Repositories(ctx context.Context, p *CatRepositoriesParams) (CatRepositoriesResponse, error)
	Segments(ctx context.Context, indices []string, p *CatSegmentsParams) (CatSegmentsResponse, error)
	Shards(ctx context.Context, indices []string, p *CatShardsParams) (CatShardsResponse, error)
	Snapshots(ctx context.Context, repository string, p *CatSnapshotsParams) (CatSnapshotsResponse, error)
	Tasks(ctx context.Context, p *CatTasksParams) (CatTasksResponse, error)
	Templates(ctx context.Context, name string, p *CatTemplatesParams) (CatTemplatesResponse, error)
	ThreadPool(ctx context.Context, patterns []string, p *CatThreadPoolParams) (CatThreadPoolResponse, error)
	Transforms(ctx context.Context, transformId string, p *CatTransformsParams) (CatTransformsResponse, error)
}

CatService provides access to the cat APIs. All methods request format=json and decode into typed row slices.

func NewCatService

func NewCatService(client *resty.Client, logger *logrus.Entry) CatService

NewCatService creates a new CatService.

type CatShardsParams

type CatShardsParams struct {
	Bytes BytesFormat
	// contains filtered or unexported fields
}

CatShardsParams are the query parameters for cat.shards.

func (*CatShardsParams) ToMap

func (p *CatShardsParams) ToMap() map[string]string

ToMap converts CatShardsParams to a query-parameter map.

type CatShardsResponse

type CatShardsResponse []CatShardsRow

CatShardsResponse is a slice of cat.shards rows.

type CatShardsRow

type CatShardsRow struct {
	Index  string `json:"index"`
	Shard  string `json:"shard"`
	Prirep string `json:"prirep"`
	State  string `json:"state"`
	Docs   string `json:"docs"`
	Store  string `json:"store"`
	IP     string `json:"ip"`
	Node   string `json:"node"`
}

CatShardsRow is a single cat.shards row.

type CatSnapshotsParams

type CatSnapshotsParams struct {
	IgnoreUnavailable *bool
	Time              string
	// contains filtered or unexported fields
}

CatSnapshotsParams are the query parameters for cat.snapshots.

func (*CatSnapshotsParams) ToMap

func (p *CatSnapshotsParams) ToMap() map[string]string

ToMap converts CatSnapshotsParams to a query-parameter map.

type CatSnapshotsResponse

type CatSnapshotsResponse []CatSnapshotsRow

CatSnapshotsResponse is a slice of cat.snapshots rows.

type CatSnapshotsRow

type CatSnapshotsRow struct {
	ID         string `json:"id"`
	Repository string `json:"repository"`
	Status     string `json:"status"`
	StartEpoch string `json:"start_epoch"`
	StartTime  string `json:"start_time"`
	EndEpoch   string `json:"end_epoch"`
	EndTime    string `json:"end_time"`
	Duration   string `json:"duration"`
	Indices    string `json:"indices"`
}

CatSnapshotsRow is a single cat.snapshots row.

type CatTasksParams

type CatTasksParams struct {
	Actions      []string
	Detailed     *bool
	NodeId       []string
	ParentTaskId string
	// contains filtered or unexported fields
}

CatTasksParams are the query parameters for cat.tasks.

func (*CatTasksParams) ToMap

func (p *CatTasksParams) ToMap() map[string]string

ToMap converts CatTasksParams to a query-parameter map.

type CatTasksResponse

type CatTasksResponse []CatTasksRow

CatTasksResponse is a slice of cat.tasks rows.

type CatTasksRow

type CatTasksRow struct {
	ID         string `json:"id"`
	Action     string `json:"action"`
	TaskType   string `json:"type"`
	Parent     string `json:"parent"`
	StartEpoch string `json:"start_epoch"`
	StartTime  string `json:"start_time"`
	Node       string `json:"node"`
}

CatTasksRow is a single cat.tasks row.

type CatTemplatesParams

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

CatTemplatesParams are the query parameters for cat.templates.

func (*CatTemplatesParams) ToMap

func (p *CatTemplatesParams) ToMap() map[string]string

ToMap converts CatTemplatesParams to a query-parameter map.

type CatTemplatesResponse

type CatTemplatesResponse []CatTemplatesRow

CatTemplatesResponse is a slice of cat.templates rows.

type CatTemplatesRow

type CatTemplatesRow struct {
	Name          string `json:"name"`
	IndexPatterns string `json:"index_patterns"`
	Order         string `json:"order"`
	Version       string `json:"version,omitempty"`
}

CatTemplatesRow is a single cat.templates row.

type CatThreadPoolParams

type CatThreadPoolParams struct {
	Size *int
	Time string
	// contains filtered or unexported fields
}

CatThreadPoolParams are the query parameters for cat.thread_pool.

func (*CatThreadPoolParams) ToMap

func (p *CatThreadPoolParams) ToMap() map[string]string

ToMap converts CatThreadPoolParams to a query-parameter map.

type CatThreadPoolResponse

type CatThreadPoolResponse []CatThreadPoolRow

CatThreadPoolResponse is a slice of cat.thread_pool rows.

type CatThreadPoolRow

type CatThreadPoolRow struct {
	NodeName  string `json:"node_name"`
	Name      string `json:"name"`
	Active    string `json:"active"`
	Queue     string `json:"queue"`
	Rejected  string `json:"rejected"`
	Completed string `json:"completed"`
}

CatThreadPoolRow is a single cat.thread_pool row.

type CatTransformsParams

type CatTransformsParams struct {
	AllowNoMatch *bool
	From         *int
	Size         *int
	Time         string
	// contains filtered or unexported fields
}

CatTransformsParams are the query parameters for cat.transforms.

func (*CatTransformsParams) ToMap

func (p *CatTransformsParams) ToMap() map[string]string

ToMap converts CatTransformsParams to a query-parameter map.

type CatTransformsResponse

type CatTransformsResponse []CatTransformsRow

CatTransformsResponse is a slice of cat.transforms rows.

type CatTransformsRow

type CatTransformsRow struct {
	ID         string `json:"id"`
	State      string `json:"state"`
	Checkpoint string `json:"checkpoint"`
}

CatTransformsRow is a single cat.transforms row.

type CcrFollowInfoResponse

type CcrFollowInfoResponse struct {
	Indices []struct {
		Index         string `json:"index"`
		FollowIndex   string `json:"follow_index"`
		RemoteCluster string `json:"remote_cluster"`
		LeaderIndex   string `json:"leader_index"`
	} `json:"follower_indices"`
}

CcrFollowInfoResponse is the response from follow info.

type CcrFollowParams

type CcrFollowParams struct {
	Common              *CommonParams
	WaitForActiveShards string
}

CcrFollowParams are the query parameters for CCR follow.

func (*CcrFollowParams) ToMap

func (p *CcrFollowParams) ToMap() map[string]string

ToMap converts CcrFollowParams to a query-parameter map.

type CcrFollowResponse

type CcrFollowResponse struct {
	FollowIndex                   string `json:"follow_index"`
	ShardsAcknowledged            bool   `json:"shards_acknowledged"`
	FollowIndexCreated            bool   `json:"follow_index_created"`
	FollowIndexShardsAcknowledged bool   `json:"follow_index_shards_acknowledged"`
}

CcrFollowResponse is the response from follow index.

type CcrFollowStatsResponse

type CcrFollowStatsResponse struct {
	Indices []struct {
		Index  string         `json:"index"`
		Status map[string]any `json:"shards"`
	} `json:"indices"`
}

CcrFollowStatsResponse is the response from follow stats.

type CcrForgetFollowerResponse

type CcrForgetFollowerResponse struct {
	Shards *types.ShardsInfo `json:"_shards,omitempty"`
}

CcrForgetFollowerResponse is the response from forget follower.

type CcrGetAutoFollowPatternResponse

type CcrGetAutoFollowPatternResponse struct {
	Patterns []struct {
		Name    string         `json:"name"`
		Pattern map[string]any `json:"pattern"`
	} `json:"patterns"`
}

CcrGetAutoFollowPatternResponse is the response from get auto-follow pattern.

type CcrService

type CcrService interface {
	PutAutoFollowPattern(ctx context.Context, name string, body any) (*types.AcknowledgedResponse, error)
	GetAutoFollowPattern(ctx context.Context, names []string) (*CcrGetAutoFollowPatternResponse, error)
	DeleteAutoFollowPattern(ctx context.Context, name string) (*types.AcknowledgedResponse, error)
	PauseAutoFollowPattern(ctx context.Context, name string) (*types.AcknowledgedResponse, error)
	ResumeAutoFollowPattern(ctx context.Context, name string) (*types.AcknowledgedResponse, error)
	Follow(ctx context.Context, index string, body any, params *CcrFollowParams) (*CcrFollowResponse, error)
	PauseFollow(ctx context.Context, index string) (*types.AcknowledgedResponse, error)
	ResumeFollow(ctx context.Context, index string, body any) (*types.AcknowledgedResponse, error)
	Unfollow(ctx context.Context, index string) (*types.AcknowledgedResponse, error)
	ForgetFollower(ctx context.Context, index string, body any) (*CcrForgetFollowerResponse, error)
	FollowInfo(ctx context.Context, indices []string) (*CcrFollowInfoResponse, error)
	FollowStats(ctx context.Context, indices []string) (*CcrFollowStatsResponse, error)
	Stats(ctx context.Context) (*CcrStatsResponse, error)
}

CcrService provides access to the cross-cluster replication APIs.

func NewCcrService

func NewCcrService(client *resty.Client, logger *logrus.Entry) CcrService

NewCcrService creates a new CcrService.

type CcrStatsResponse

type CcrStatsResponse struct {
	AutoFollowStats map[string]any `json:"auto_follow_stats"`
	FollowStats     map[string]any `json:"follow_stats"`
}

CcrStatsResponse is the response from CCR stats.

type CloneParams

type CloneParams = ShrinkParams

CloneParams are the query parameters for the clone endpoint.

type CloneRequest

type CloneRequest struct {
	Source string `validate:"required"`
	Target string `validate:"required"`
	Body   any
	Params *CloneParams
}

CloneRequest is the request for PUT /{index}/_clone/{target}.

func (*CloneRequest) Validate

func (r *CloneRequest) Validate() error

Validate validates the CloneRequest.

type ClosePITResponse

type ClosePITResponse struct {
	Succeeded bool `json:"succeeded"`
	NumFreed  int  `json:"num_freed"`
}

ClosePITResponse is the response from DELETE /_pit.

type ClusterAllocationExplainParams

type ClusterAllocationExplainParams struct {
	Common              *CommonParams
	IncludeDiskInfo     *bool
	IncludeYesDecisions *bool
}

ClusterAllocationExplainParams are the query parameters for allocation/explain.

func (*ClusterAllocationExplainParams) ToMap

ToMap converts ClusterAllocationExplainParams to a query-parameter map.

type ClusterAllocationExplainResponse

type ClusterAllocationExplainResponse struct {
	Index                   string         `json:"index,omitempty"`
	Shard                   int            `json:"shard,omitempty"`
	Primary                 bool           `json:"primary"`
	CurrentState            string         `json:"current_state"`
	UnassignedInfo          map[string]any `json:"unassigned_info,omitempty"`
	CanAllocate             string         `json:"can_allocate,omitempty"`
	AllocateExplanation     string         `json:"allocate_explanation,omitempty"`
	ConfiguredDelay         string         `json:"configured_delay,omitempty"`
	ConfiguredDelayInMillis int64          `json:"configured_delay_in_millis,omitempty"`
	CurrentNode             map[string]any `json:"current_node,omitempty"`
	RemainingDelay          string         `json:"remaining_delay,omitempty"`
	AllocationDelay         string         `json:"allocation_delay,omitempty"`
	AllocationDelayInMillis int64          `json:"allocation_delay_in_millis,omitempty"`
}

ClusterAllocationExplainResponse is the response from allocation/explain.

type ClusterDeleteComponentTemplateParams

type ClusterDeleteComponentTemplateParams struct {
	Common  *CommonParams
	Timeout string
}

ClusterDeleteComponentTemplateParams are the query parameters for delete component template.

func (*ClusterDeleteComponentTemplateParams) ToMap

ToMap converts ClusterDeleteComponentTemplateParams to a query-parameter map.

type ClusterDeleteVotingConfigExclusionsParams

type ClusterDeleteVotingConfigExclusionsParams struct {
	Common         *CommonParams
	WaitForRemoval *bool
}

ClusterDeleteVotingConfigExclusionsParams are the query parameters for delete voting_config_exclusions.

func (*ClusterDeleteVotingConfigExclusionsParams) ToMap

ToMap converts ClusterDeleteVotingConfigExclusionsParams to a query-parameter map.

type ClusterGetComponentTemplateParams

type ClusterGetComponentTemplateParams struct {
	Common       *CommonParams
	FlatSettings *bool
	Local        *bool
}

ClusterGetComponentTemplateParams are the query parameters for get component templates.

func (*ClusterGetComponentTemplateParams) ToMap

ToMap converts ClusterGetComponentTemplateParams to a query-parameter map.

type ClusterGetComponentTemplateResponse

type ClusterGetComponentTemplateResponse struct {
	ComponentTemplates []struct {
		Name              string       `json:"name"`
		ComponentTemplate TemplateBody `json:"component_template"`
	} `json:"component_templates"`
}

ClusterGetComponentTemplateResponse is the response from get component templates.

type ClusterGetSettingsParams

type ClusterGetSettingsParams struct {
	Common          *CommonParams
	FlatSettings    *bool
	IncludeDefaults *bool
	Timeout         string
}

ClusterGetSettingsParams are the query parameters for GET /_cluster/settings.

func (*ClusterGetSettingsParams) ToMap

func (p *ClusterGetSettingsParams) ToMap() map[string]string

ToMap converts ClusterGetSettingsParams to a query-parameter map.

type ClusterGetSettingsResponse

type ClusterGetSettingsResponse struct {
	Persistent map[string]any `json:"persistent"`
	Transient  map[string]any `json:"transient"`
	Defaults   map[string]any `json:"defaults,omitempty"`
}

ClusterGetSettingsResponse is the response from GET /_cluster/settings.

type ClusterHealthParams

type ClusterHealthParams struct {
	Common                      *CommonParams
	Level                       Level
	Local                       *bool
	Timeout                     string
	WaitForActiveShards         string
	WaitForEvents               string
	WaitForNoInitializingShards *bool
	WaitForNoRelocatingShards   *bool
	WaitForNodes                string
	WaitForStatus               WaitForStatus
}

ClusterHealthParams are the query parameters for GET /_cluster/health.

func (*ClusterHealthParams) ToMap

func (p *ClusterHealthParams) ToMap() map[string]string

ToMap converts ClusterHealthParams to a query-parameter map.

type ClusterHealthResponse

type ClusterHealthResponse struct {
	ClusterName                 string                        `json:"cluster_name"`
	Status                      string                        `json:"status"`
	TimedOut                    bool                          `json:"timed_out"`
	NumberOfNodes               int                           `json:"number_of_nodes"`
	NumberOfDataNodes           int                           `json:"number_of_data_nodes"`
	ActivePrimaryShards         int                           `json:"active_primary_shards"`
	ActiveShards                int                           `json:"active_shards"`
	RelocatingShards            int                           `json:"relocating_shards"`
	InitializingShards          int                           `json:"initializing_shards"`
	UnassignedShards            int                           `json:"unassigned_shards"`
	DelayedUnassignedShards     int                           `json:"delayed_unassigned_shards"`
	NumberOfPendingTasks        int                           `json:"number_of_pending_tasks"`
	NumberOfInFlightFetch       int                           `json:"number_of_in_flight_fetch"`
	TaskMaxWaitingInQueueMillis int                           `json:"task_max_waiting_in_queue_millis"`
	ActiveShardsPercentAsNumber float64                       `json:"active_shards_percent_as_number"`
	Indices                     map[string]ClusterIndexHealth `json:"indices,omitempty"`
}

ClusterHealthResponse is the response from GET /_cluster/health.

type ClusterIndexHealth

type ClusterIndexHealth struct {
	Status              string `json:"status"`
	NumberOfShards      int    `json:"number_of_shards"`
	NumberOfReplicas    int    `json:"number_of_replicas"`
	ActivePrimaryShards int    `json:"active_primary_shards"`
	ActiveShards        int    `json:"active_shards"`
	RelocatingShards    int    `json:"relocating_shards"`
	InitializingShards  int    `json:"initializing_shards"`
	UnassignedShards    int    `json:"unassigned_shards"`
}

ClusterIndexHealth is the per-index health.

type ClusterInfoResponse

type ClusterInfoResponse map[string]any

ClusterInfoResponse is the response from GET /_cluster/info/{feature}.

type ClusterPendingTasksParams

type ClusterPendingTasksParams struct {
	Common *CommonParams
	Local  *bool
}

ClusterPendingTasksParams are the query parameters for pending_tasks.

func (*ClusterPendingTasksParams) ToMap

func (p *ClusterPendingTasksParams) ToMap() map[string]string

ToMap converts ClusterPendingTasksParams to a query-parameter map.

type ClusterPendingTasksResponse

type ClusterPendingTasksResponse struct {
	Tasks []struct {
		InsertOrder       int    `json:"insert_order"`
		Priority          string `json:"priority"`
		Source            string `json:"source"`
		TimeInQueueMillis int    `json:"time_in_queue_millis"`
		Executing         bool   `json:"executing"`
	} `json:"tasks"`
}

ClusterPendingTasksResponse is the response from pending_tasks.

type ClusterPutSettingsParams

type ClusterPutSettingsParams struct {
	Common       *CommonParams
	FlatSettings *bool
	Timeout      string
}

ClusterPutSettingsParams are the query parameters for PUT /_cluster/settings.

func (*ClusterPutSettingsParams) ToMap

func (p *ClusterPutSettingsParams) ToMap() map[string]string

ToMap converts ClusterPutSettingsParams to a query-parameter map.

type ClusterPutSettingsResponse

type ClusterPutSettingsResponse struct {
	Acknowledged bool           `json:"acknowledged"`
	Persistent   map[string]any `json:"persistent,omitempty"`
	Transient    map[string]any `json:"transient,omitempty"`
}

ClusterPutSettingsResponse is the response from PUT /_cluster/settings.

type ClusterRemoteInfoResponse

type ClusterRemoteInfoResponse map[string]struct {
	Connected          bool     `json:"connected"`
	Mode               string   `json:"mode"`
	Seeds              []string `json:"seeds"`
	SkipUnavailable    bool     `json:"skip_unavailable"`
	ClusterCredentials string   `json:"cluster_credentials,omitempty"`
}

ClusterRemoteInfoResponse is the response from GET /_remote/info.

type ClusterRerouteParams

type ClusterRerouteParams struct {
	Common      *CommonParams
	DryRun      *bool
	Explain     *bool
	Metric      []string
	RetryFailed *bool
	Timeout     string
}

ClusterRerouteParams are the query parameters for cluster.reroute.

func (*ClusterRerouteParams) ToMap

func (p *ClusterRerouteParams) ToMap() map[string]string

ToMap converts ClusterRerouteParams to a query-parameter map.

type ClusterRerouteResponse

type ClusterRerouteResponse struct {
	Acknowledged bool             `json:"acknowledged"`
	State        map[string]any   `json:"state,omitempty"`
	Explanations []map[string]any `json:"explanations,omitempty"`
}

ClusterRerouteResponse is the response from cluster.reroute.

type ClusterService

type ClusterService interface {
	Health(ctx context.Context, indices []string, params *ClusterHealthParams) (*ClusterHealthResponse, error)
	State(ctx context.Context, req *ClusterStateRequest) (*ClusterStateResponse, error)
	Stats(ctx context.Context, nodeIds []string, params *ClusterStatsParams) (*ClusterStatsResponse, error)
	GetSettings(ctx context.Context, params *ClusterGetSettingsParams) (*ClusterGetSettingsResponse, error)
	PutSettings(ctx context.Context, body any, params *ClusterPutSettingsParams) (*ClusterPutSettingsResponse, error)
	AllocationExplain(ctx context.Context, body any, params *ClusterAllocationExplainParams) (*ClusterAllocationExplainResponse, error)
	Reroute(ctx context.Context, body any, params *ClusterRerouteParams) (*ClusterRerouteResponse, error)
	PendingTasks(ctx context.Context, params *ClusterPendingTasksParams) (*ClusterPendingTasksResponse, error)
	RemoteInfo(ctx context.Context) (*ClusterRemoteInfoResponse, error)
	Info(ctx context.Context, features []string) (*ClusterInfoResponse, error)
	PostVotingConfigExclusions(ctx context.Context, params *ClusterVotingConfigExclusionsParams) error
	DeleteVotingConfigExclusions(ctx context.Context, params *ClusterDeleteVotingConfigExclusionsParams) error
	GetComponentTemplate(ctx context.Context, names []string, params *ClusterGetComponentTemplateParams) (*ClusterGetComponentTemplateResponse, error)
	PutComponentTemplate(ctx context.Context, req *PutComponentTemplateRequest) (*types.AcknowledgedResponse, error)
	ExistsComponentTemplate(ctx context.Context, name string) (bool, error)
	DeleteComponentTemplate(ctx context.Context, name string, params *ClusterDeleteComponentTemplateParams) (*types.AcknowledgedResponse, error)
}

ClusterService provides access to the cluster APIs.

func NewClusterService

func NewClusterService(client *resty.Client, logger *logrus.Entry) ClusterService

NewClusterService creates a new ClusterService.

type ClusterStateParams

type ClusterStateParams struct {
	Common                 *CommonParams
	AllowNoIndices         *bool
	ExpandWildcards        ExpandWildcards
	FlatSettings           *bool
	IgnoreUnavailable      *bool
	Local                  *bool
	WaitForMetadataVersion *int64
	WaitForTimeout         string
}

ClusterStateParams are the query parameters for cluster.state.

func (*ClusterStateParams) ToMap

func (p *ClusterStateParams) ToMap() map[string]string

ToMap converts ClusterStateParams to a query-parameter map.

type ClusterStateRequest

type ClusterStateRequest struct {
	Metrics []string
	Indices []string
	Params  *ClusterStateParams
}

ClusterStateRequest is the request for GET /_cluster/state.

type ClusterStateResponse

type ClusterStateResponse struct {
	ClusterName  string         `json:"cluster_name"`
	ClusterUUID  string         `json:"cluster_uuid"`
	Version      int64          `json:"version"`
	StateUUID    string         `json:"state_uuid"`
	MasterNode   string         `json:"master_node"`
	Metadata     map[string]any `json:"metadata,omitempty"`
	Nodes        map[string]any `json:"nodes,omitempty"`
	RoutingTable map[string]any `json:"routing_table,omitempty"`
	RoutingNodes map[string]any `json:"routing_nodes,omitempty"`
	Blocks       map[string]any `json:"blocks,omitempty"`
}

ClusterStateResponse is the response from GET /_cluster/state.

type ClusterStatsParams

type ClusterStatsParams struct {
	Common       *CommonParams
	FlatSettings *bool
	Timeout      string
}

ClusterStatsParams are the query parameters for cluster.stats.

func (*ClusterStatsParams) ToMap

func (p *ClusterStatsParams) ToMap() map[string]string

ToMap converts ClusterStatsParams to a query-parameter map.

type ClusterStatsResponse

type ClusterStatsResponse struct {
	ClusterName string         `json:"cluster_name"`
	ClusterUUID string         `json:"cluster_uuid"`
	Timestamp   int64          `json:"timestamp"`
	Status      string         `json:"status"`
	Indices     map[string]any `json:"indices"`
	Nodes       map[string]any `json:"nodes"`
}

ClusterStatsResponse is the response from GET /_cluster/stats.

type ClusterVotingConfigExclusionsParams

type ClusterVotingConfigExclusionsParams struct {
	Common    *CommonParams
	NodeIds   []string
	NodeNames []string
	Timeout   string
}

ClusterVotingConfigExclusionsParams are the query parameters for voting_config_exclusions.

func (*ClusterVotingConfigExclusionsParams) ToMap

ToMap converts ClusterVotingConfigExclusionsParams to a query-parameter map.

type CommonParams

type CommonParams = types.CommonParams

CommonParams is an alias for types.CommonParams, embedded by every endpoint's Params struct so the common query parameters (pretty, human, error_trace, filter_path) are available everywhere.

type Conflicts

type Conflicts string

Conflicts values for by-query operations.

const (
	ConflictsAbort   Conflicts = "abort"
	ConflictsProceed Conflicts = "proceed"
)

type CountParams

type CountParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	Analyzer          string
	AnalyzeWildcard   *bool
	DefaultOperator   DefaultOperator
	Df                string
	ExpandWildcards   ExpandWildcards
	IgnoreThrottled   *bool
	IgnoreUnavailable *bool
	Lenient           *bool
	MinScore          *float64
	Preference        string
	Q                 string
	Routing           string
	TerminateAfter    *int
}

CountParams are the query parameters for the count endpoint.

func (*CountParams) ToMap

func (p *CountParams) ToMap() map[string]string

ToMap converts CountParams to a query-parameter map.

type CountRequest

type CountRequest struct {
	Indices []string
	Body    any
	Params  *CountParams
}

CountRequest is the request for GET|POST /_count.

type CreateParams

type CreateParams = IndexParams

CreateParams are the query parameters for the create endpoint (index params minus op_type).

type CreateRequest

type CreateRequest struct {
	Index  string `validate:"required"`
	Id     string `validate:"required"`
	Body   any    `validate:"required"`
	Params *CreateParams
}

CreateRequest is the request for PUT /{index}/_doc/{id}/_create.

func (*CreateRequest) Validate

func (r *CreateRequest) Validate() error

Validate validates the CreateRequest.

type DanglingIndicesImportParams

type DanglingIndicesImportParams struct {
	Common         *CommonParams
	AcceptDataLoss *bool `validate:"required"`
}

DanglingIndicesImportParams are the query parameters for import.

func (*DanglingIndicesImportParams) ToMap

func (p *DanglingIndicesImportParams) ToMap() map[string]string

ToMap converts DanglingIndicesImportParams to a query-parameter map.

type DanglingIndicesListResponse

type DanglingIndicesListResponse struct {
	DanglingIndices []struct {
		IndexUUID    string `json:"index_uuid"`
		IndexName    string `json:"index_name"`
		CreationDate int64  `json:"creation_date,omitempty"`
	} `json:"dangling_indices"`
}

DanglingIndicesListResponse is the response from GET /_dangling.

type DanglingIndicesService

type DanglingIndicesService interface {
	List(ctx context.Context) (*DanglingIndicesListResponse, error)
	Import(ctx context.Context, indexUUID string, params *DanglingIndicesImportParams) (*types.AcknowledgedResponse, error)
	Delete(ctx context.Context, indexUUID string, params *DanglingIndicesImportParams) (*types.AcknowledgedResponse, error)
}

DanglingIndicesService provides access to the dangling indices APIs.

func NewDanglingIndicesService

func NewDanglingIndicesService(client *resty.Client, logger *logrus.Entry) DanglingIndicesService

NewDanglingIndicesService creates a new DanglingIndicesService.

type DataStream

type DataStream struct {
	Name               string            `json:"name"`
	TimestampField     DataStreamField   `json:"timestamp_field"`
	Indices            []DataStreamIndex `json:"indices"`
	Generation         int               `json:"generation"`
	Status             string            `json:"status,omitempty"`
	Replicated         bool              `json:"replicated,omitempty"`
	Hidden             bool              `json:"hidden,omitempty"`
	System             bool              `json:"system,omitempty"`
	AllowCustomRouting bool              `json:"allow_custom_routing,omitempty"`
	Template           string            `json:"template,omitempty"`
}

DataStream describes a data stream.

type DataStreamField

type DataStreamField struct {
	Field string `json:"name"`
}

DataStreamField names the timestamp field.

type DataStreamIndex

type DataStreamIndex struct {
	Index          string `json:"index_name"`
	IndexUUID      string `json:"index_uuid"`
	IsHidden       bool   `json:"is_hidden"`
	IsBackingIndex bool   `json:"is_backing_index"`
}

DataStreamIndex identifies a backing index.

type DefaultAsyncSearchService

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

DefaultAsyncSearchService is the default AsyncSearchService implementation.

func (*DefaultAsyncSearchService) Delete

func (*DefaultAsyncSearchService) Get

func (*DefaultAsyncSearchService) Status

func (*DefaultAsyncSearchService) Submit

type DefaultAutoscalingService

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

DefaultAutoscalingService is the default AutoscalingService implementation.

func (*DefaultAutoscalingService) DeletePolicy

func (*DefaultAutoscalingService) GetCapacity

func (*DefaultAutoscalingService) GetPolicy

func (*DefaultAutoscalingService) PutPolicy

type DefaultCatService

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

DefaultCatService is the default CatService implementation.

func (*DefaultCatService) Aliases

func (*DefaultCatService) Allocation

func (*DefaultCatService) CircuitBreaker

func (*DefaultCatService) ComponentTemplates

func (*DefaultCatService) Count

func (*DefaultCatService) Fielddata

func (*DefaultCatService) Health

func (*DefaultCatService) Help

func (s *DefaultCatService) Help(ctx context.Context) (string, error)

func (*DefaultCatService) Indices

func (*DefaultCatService) MLDataFrameAnalytics

func (*DefaultCatService) MLDatafeeds

func (*DefaultCatService) MLJobs

func (*DefaultCatService) MLTrainedModels

func (*DefaultCatService) Master

func (*DefaultCatService) NodeAttrs

func (*DefaultCatService) Nodes

func (*DefaultCatService) PendingTasks

func (*DefaultCatService) Plugins

func (*DefaultCatService) Recovery

func (*DefaultCatService) Repositories

func (*DefaultCatService) Segments

func (*DefaultCatService) Shards

func (*DefaultCatService) Snapshots

func (*DefaultCatService) Tasks

func (*DefaultCatService) Templates

func (*DefaultCatService) ThreadPool

func (*DefaultCatService) Transforms

type DefaultCcrService

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

DefaultCcrService is the default CcrService implementation.

func (*DefaultCcrService) DeleteAutoFollowPattern

func (s *DefaultCcrService) DeleteAutoFollowPattern(ctx context.Context, name string) (*types.AcknowledgedResponse, error)

func (*DefaultCcrService) Follow

func (s *DefaultCcrService) Follow(ctx context.Context, index string, body any, params *CcrFollowParams) (*CcrFollowResponse, error)

func (*DefaultCcrService) FollowInfo

func (s *DefaultCcrService) FollowInfo(ctx context.Context, indices []string) (*CcrFollowInfoResponse, error)

func (*DefaultCcrService) FollowStats

func (s *DefaultCcrService) FollowStats(ctx context.Context, indices []string) (*CcrFollowStatsResponse, error)

func (*DefaultCcrService) ForgetFollower

func (s *DefaultCcrService) ForgetFollower(ctx context.Context, index string, body any) (*CcrForgetFollowerResponse, error)

func (*DefaultCcrService) GetAutoFollowPattern

func (s *DefaultCcrService) GetAutoFollowPattern(ctx context.Context, names []string) (*CcrGetAutoFollowPatternResponse, error)

func (*DefaultCcrService) PauseAutoFollowPattern

func (s *DefaultCcrService) PauseAutoFollowPattern(ctx context.Context, name string) (*types.AcknowledgedResponse, error)

func (*DefaultCcrService) PauseFollow

func (s *DefaultCcrService) PauseFollow(ctx context.Context, index string) (*types.AcknowledgedResponse, error)

func (*DefaultCcrService) PutAutoFollowPattern

func (s *DefaultCcrService) PutAutoFollowPattern(ctx context.Context, name string, body any) (*types.AcknowledgedResponse, error)

func (*DefaultCcrService) ResumeAutoFollowPattern

func (s *DefaultCcrService) ResumeAutoFollowPattern(ctx context.Context, name string) (*types.AcknowledgedResponse, error)

func (*DefaultCcrService) ResumeFollow

func (s *DefaultCcrService) ResumeFollow(ctx context.Context, index string, body any) (*types.AcknowledgedResponse, error)

func (*DefaultCcrService) Stats

func (*DefaultCcrService) Unfollow

type DefaultClusterService

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

DefaultClusterService is the default ClusterService implementation.

func (*DefaultClusterService) AllocationExplain

func (*DefaultClusterService) DeleteComponentTemplate

func (*DefaultClusterService) DeleteVotingConfigExclusions

func (s *DefaultClusterService) DeleteVotingConfigExclusions(ctx context.Context, params *ClusterDeleteVotingConfigExclusionsParams) error

func (*DefaultClusterService) ExistsComponentTemplate

func (s *DefaultClusterService) ExistsComponentTemplate(ctx context.Context, name string) (bool, error)

func (*DefaultClusterService) GetComponentTemplate

func (*DefaultClusterService) GetSettings

func (*DefaultClusterService) Health

func (*DefaultClusterService) Info

func (*DefaultClusterService) PendingTasks

func (*DefaultClusterService) PostVotingConfigExclusions

func (s *DefaultClusterService) PostVotingConfigExclusions(ctx context.Context, params *ClusterVotingConfigExclusionsParams) error

func (*DefaultClusterService) PutComponentTemplate

func (*DefaultClusterService) PutSettings

func (*DefaultClusterService) RemoteInfo

func (*DefaultClusterService) Reroute

func (*DefaultClusterService) State

func (*DefaultClusterService) Stats

type DefaultDanglingIndicesService

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

DefaultDanglingIndicesService is the default DanglingIndicesService implementation.

func (*DefaultDanglingIndicesService) Delete

func (*DefaultDanglingIndicesService) Import

func (*DefaultDanglingIndicesService) List

type DefaultDocumentService

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

DefaultDocumentService is the default DocumentService implementation.

func (*DefaultDocumentService) Bulk

func (*DefaultDocumentService) Create

func (*DefaultDocumentService) Delete

func (*DefaultDocumentService) DeleteByQuery

func (*DefaultDocumentService) DeleteByQueryRethrottle

func (s *DefaultDocumentService) DeleteByQueryRethrottle(ctx context.Context, req *RethrottleRequest) (*TasksListResponse, error)

func (*DefaultDocumentService) Exists

func (s *DefaultDocumentService) Exists(ctx context.Context, index, id string, params *GetParams) (bool, error)

func (*DefaultDocumentService) ExistsSource

func (s *DefaultDocumentService) ExistsSource(ctx context.Context, index, id string, params *GetSourceParams) (bool, error)

func (*DefaultDocumentService) Explain

func (*DefaultDocumentService) Get

func (*DefaultDocumentService) GetSource

func (*DefaultDocumentService) Index

func (*DefaultDocumentService) MultiGet

func (*DefaultDocumentService) MultiTermVectors

func (*DefaultDocumentService) Reindex

func (*DefaultDocumentService) ReindexRethrottle

func (s *DefaultDocumentService) ReindexRethrottle(ctx context.Context, req *RethrottleRequest) (*TasksListResponse, error)

func (*DefaultDocumentService) TermVectors

func (*DefaultDocumentService) TermsEnum

func (*DefaultDocumentService) Update

func (*DefaultDocumentService) UpdateByQuery

func (*DefaultDocumentService) UpdateByQueryRethrottle

func (s *DefaultDocumentService) UpdateByQueryRethrottle(ctx context.Context, req *RethrottleRequest) (*TasksListResponse, error)

type DefaultEnrichService

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

DefaultEnrichService is the default EnrichService implementation.

func (*DefaultEnrichService) DeletePolicy

func (*DefaultEnrichService) ExecutePolicy

func (*DefaultEnrichService) GetPolicy

func (s *DefaultEnrichService) GetPolicy(ctx context.Context, names []string) (json.RawMessage, error)

func (*DefaultEnrichService) PutPolicy

func (s *DefaultEnrichService) PutPolicy(ctx context.Context, name string, body any) (*types.AcknowledgedResponse, error)

func (*DefaultEnrichService) Stats

type DefaultEqlService

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

DefaultEqlService is the default EqlService implementation.

func (*DefaultEqlService) Delete

func (*DefaultEqlService) Get

func (*DefaultEqlService) GetStatus

func (s *DefaultEqlService) GetStatus(ctx context.Context, id string) (json.RawMessage, error)

func (*DefaultEqlService) Search

func (s *DefaultEqlService) Search(ctx context.Context, index string, body any, params *EqlSearchParams) (*EqlSearchResponse, error)

type DefaultFeaturesService

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

DefaultFeaturesService is the default FeaturesService implementation.

func (*DefaultFeaturesService) GetFeatures

func (*DefaultFeaturesService) ResetFeatures

type DefaultFleetService

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

DefaultFleetService is the default FleetService implementation.

func (*DefaultFleetService) GlobalCheckpoints

type DefaultGraphService

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

DefaultGraphService is the default GraphService implementation.

func (*DefaultGraphService) Explore

func (s *DefaultGraphService) Explore(ctx context.Context, index string, body any, params *GraphExploreParams) (*GraphExploreResponse, error)

type DefaultHealthReportService

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

DefaultHealthReportService is the default HealthReportService implementation.

func (*DefaultHealthReportService) Get

type DefaultIlmService

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

DefaultIlmService is the default IlmService implementation.

func (*DefaultIlmService) DeleteLifecycle

func (s *DefaultIlmService) DeleteLifecycle(ctx context.Context, policy string) (*types.AcknowledgedResponse, error)

func (*DefaultIlmService) ExplainLifecycle

func (s *DefaultIlmService) ExplainLifecycle(ctx context.Context, indices []string, params *IlmExplainParams) (*IlmExplainResponse, error)

func (*DefaultIlmService) GetLifecycle

func (s *DefaultIlmService) GetLifecycle(ctx context.Context, policies []string) (map[string]*IlmPolicy, error)

func (*DefaultIlmService) GetStatus

func (*DefaultIlmService) MigrateToDataTiers deprecated

func (s *DefaultIlmService) MigrateToDataTiers(ctx context.Context, dryRun *bool) (*IlmMigrateToDataTiersResponse, error)

MigrateToDataTiers migrates ILM policies to data tiers.

Deprecated: use the data tiers APIs directly.

func (*DefaultIlmService) MoveToStep

func (s *DefaultIlmService) MoveToStep(ctx context.Context, index string, body any) (*types.AcknowledgedResponse, error)

func (*DefaultIlmService) PutLifecycle

func (s *DefaultIlmService) PutLifecycle(ctx context.Context, policy string, body any) (*types.AcknowledgedResponse, error)

func (*DefaultIlmService) RemovePolicy

func (s *DefaultIlmService) RemovePolicy(ctx context.Context, indices []string) (*IlmRemovePolicyResponse, error)

func (*DefaultIlmService) Retry

func (*DefaultIlmService) Start

func (*DefaultIlmService) Stop

type DefaultIndicesService

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

DefaultIndicesService is the default IndicesService implementation.

func (*DefaultIndicesService) AddBlock

func (*DefaultIndicesService) Analyze

func (s *DefaultIndicesService) Analyze(ctx context.Context, index string, body any) (*IndicesAnalyzeResponse, error)

func (*DefaultIndicesService) ClearCache

func (*DefaultIndicesService) Clone

func (*DefaultIndicesService) Close

func (*DefaultIndicesService) Create

func (*DefaultIndicesService) CreateDataStream

func (*DefaultIndicesService) DataStreamStats

func (*DefaultIndicesService) Delete

func (*DefaultIndicesService) DeleteAlias

func (*DefaultIndicesService) DeleteDataStream

func (*DefaultIndicesService) DeleteIndexTemplate

func (*DefaultIndicesService) DeleteTemplate

func (*DefaultIndicesService) Downsample

func (s *DefaultIndicesService) Downsample(ctx context.Context, index, targetIndex string, body any) (*types.AcknowledgedResponse, error)

func (*DefaultIndicesService) Exists

func (s *DefaultIndicesService) Exists(ctx context.Context, indices []string, params *IndicesExistsParams) (bool, error)

func (*DefaultIndicesService) ExistsAlias

func (s *DefaultIndicesService) ExistsAlias(ctx context.Context, req *ExistsAliasRequest) (bool, error)

func (*DefaultIndicesService) ExistsIndexTemplate

func (s *DefaultIndicesService) ExistsIndexTemplate(ctx context.Context, name string) (bool, error)

func (*DefaultIndicesService) ExistsTemplate

func (s *DefaultIndicesService) ExistsTemplate(ctx context.Context, name string) (bool, error)

func (*DefaultIndicesService) Flush

func (*DefaultIndicesService) ForceMerge

func (*DefaultIndicesService) Get

func (*DefaultIndicesService) GetAlias

func (*DefaultIndicesService) GetDataStream

func (*DefaultIndicesService) GetFieldMapping

func (s *DefaultIndicesService) GetFieldMapping(ctx context.Context, req *GetFieldMappingRequest) (map[string]any, error)

func (*DefaultIndicesService) GetIndexTemplate

func (*DefaultIndicesService) GetMapping

func (*DefaultIndicesService) GetSettings

func (*DefaultIndicesService) GetTemplate

func (*DefaultIndicesService) MigrateToDataStream

func (s *DefaultIndicesService) MigrateToDataStream(ctx context.Context, name string) (*types.AcknowledgedResponse, error)

func (*DefaultIndicesService) ModifyDataStream

func (*DefaultIndicesService) Open

func (*DefaultIndicesService) PromoteDataStream

func (s *DefaultIndicesService) PromoteDataStream(ctx context.Context, name string) (*types.AcknowledgedResponse, error)

func (*DefaultIndicesService) PutAlias

func (*DefaultIndicesService) PutIndexTemplate

func (*DefaultIndicesService) PutMapping

func (*DefaultIndicesService) PutSettings

func (s *DefaultIndicesService) PutSettings(ctx context.Context, indices []string, body any, params *IndicesPutSettingsParams) (*types.AcknowledgedResponse, error)

func (*DefaultIndicesService) PutTemplate

func (*DefaultIndicesService) Recovery

func (*DefaultIndicesService) Refresh

func (s *DefaultIndicesService) Refresh(ctx context.Context, indices []string, params *IndicesRefreshParams) (*RefreshResult, error)

func (*DefaultIndicesService) ReloadSearchAnalyzers

func (*DefaultIndicesService) ResolveCluster

func (s *DefaultIndicesService) ResolveCluster(ctx context.Context, names []string, params *IndicesResolveClusterParams) (map[string]*ResolveClusterInfo, error)

func (*DefaultIndicesService) ResolveIndex

func (*DefaultIndicesService) Rollover

func (*DefaultIndicesService) Segments

func (*DefaultIndicesService) ShardStores

func (*DefaultIndicesService) Shrink

func (*DefaultIndicesService) SimulateIndexTemplate

func (*DefaultIndicesService) SimulateTemplate

func (*DefaultIndicesService) Split

func (*DefaultIndicesService) Stats

func (*DefaultIndicesService) UpdateAliases

type DefaultInferenceService

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

DefaultInferenceService is the default InferenceService implementation.

func (*DefaultInferenceService) Completion

func (s *DefaultInferenceService) Completion(ctx context.Context, inferenceId string, body any) (json.RawMessage, error)

func (*DefaultInferenceService) Delete

func (s *DefaultInferenceService) Delete(ctx context.Context, taskType, inferenceId string, params *InferenceDeleteParams) (*types.AcknowledgedResponse, error)

func (*DefaultInferenceService) Get

func (s *DefaultInferenceService) Get(ctx context.Context, inferenceId, taskType string) (json.RawMessage, error)

func (*DefaultInferenceService) Inference

func (s *DefaultInferenceService) Inference(ctx context.Context, inferenceId string, body any) (json.RawMessage, error)

func (*DefaultInferenceService) Put

func (s *DefaultInferenceService) Put(ctx context.Context, taskType, inferenceId string, body any) (*types.AcknowledgedResponse, error)

func (*DefaultInferenceService) Rerank

func (s *DefaultInferenceService) Rerank(ctx context.Context, inferenceId string, body any) (json.RawMessage, error)

func (*DefaultInferenceService) Update

func (s *DefaultInferenceService) Update(ctx context.Context, inferenceId string, body any) (*types.AcknowledgedResponse, error)

type DefaultInfoService

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

DefaultInfoService is the default InfoService implementation.

func (*DefaultInfoService) Capabilities

func (*DefaultInfoService) Info

func (*DefaultInfoService) Ping

func (s *DefaultInfoService) Ping(ctx context.Context) (bool, error)

type DefaultIngestService

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

DefaultIngestService is the default IngestService implementation.

func (*DefaultIngestService) DeletePipeline

func (*DefaultIngestService) GetPipeline

func (s *DefaultIngestService) GetPipeline(ctx context.Context, ids []string, params *IngestGetPipelineParams) (map[string]*IngestPipeline, error)

func (*DefaultIngestService) ProcessorGrok

func (s *DefaultIngestService) ProcessorGrok(ctx context.Context) (*IngestGrokResponse, error)

func (*DefaultIngestService) PutPipeline

func (*DefaultIngestService) Simulate

type DefaultLicenseService

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

DefaultLicenseService is the default LicenseService implementation.

func (*DefaultLicenseService) Delete

func (*DefaultLicenseService) Get

func (*DefaultLicenseService) GetBasicStatus

func (s *DefaultLicenseService) GetBasicStatus(ctx context.Context) (json.RawMessage, error)

func (*DefaultLicenseService) GetTrialStatus

func (s *DefaultLicenseService) GetTrialStatus(ctx context.Context) (json.RawMessage, error)

func (*DefaultLicenseService) Post

func (*DefaultLicenseService) PostStartBasic

func (s *DefaultLicenseService) PostStartBasic(ctx context.Context, params *LicensePostParams) (json.RawMessage, error)

func (*DefaultLicenseService) PostStartTrial

type DefaultLogstashService

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

DefaultLogstashService is the default LogstashService implementation.

func (*DefaultLogstashService) DeletePipeline

func (*DefaultLogstashService) GetPipeline

func (s *DefaultLogstashService) GetPipeline(ctx context.Context, ids []string) (map[string]map[string]any, error)

func (*DefaultLogstashService) PutPipeline

func (s *DefaultLogstashService) PutPipeline(ctx context.Context, id string, body any) (*types.AcknowledgedResponse, error)

type DefaultMigrationService

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

DefaultMigrationService is the default MigrationService implementation.

func (*DefaultMigrationService) Deprecations

func (*DefaultMigrationService) GetFeatureUpgradeStatus

func (*DefaultMigrationService) PostFeatureUpgrade

func (s *DefaultMigrationService) PostFeatureUpgrade(ctx context.Context) (json.RawMessage, error)

type DefaultMlService

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

DefaultMlService is the default MlService implementation.

func (*DefaultMlService) CloseJob

func (s *DefaultMlService) CloseJob(ctx context.Context, jobId string, params *MlCloseJobParams) (*MlCloseJobResponse, error)

func (*DefaultMlService) DeleteDatafeed

func (s *DefaultMlService) DeleteDatafeed(ctx context.Context, datafeedId string, params *MlDeleteDatafeedParams) (*types.AcknowledgedResponse, error)

func (*DefaultMlService) DeleteJob

func (s *DefaultMlService) DeleteJob(ctx context.Context, jobId string, params *MlDeleteJobParams) (*MlDeleteJobResponse, error)

func (*DefaultMlService) FlushJob

func (s *DefaultMlService) FlushJob(ctx context.Context, jobId string, body any, params *MlFlushJobParams) (*MlFlushJobResponse, error)

func (*DefaultMlService) GetDatafeeds

func (s *DefaultMlService) GetDatafeeds(ctx context.Context, datafeedIds []string, params *MlGetDatafeedsParams) (*MlGetDatafeedsResponse, error)

func (*DefaultMlService) GetFilters

func (s *DefaultMlService) GetFilters(ctx context.Context, filterId string, params *MlGetFiltersParams) (*MlGetFiltersResponse, error)

func (*DefaultMlService) GetJobs

func (s *DefaultMlService) GetJobs(ctx context.Context, jobIds []string, params *MlGetJobsParams) (*MlGetJobsResponse, error)

func (*DefaultMlService) GetTrainedModels

func (s *DefaultMlService) GetTrainedModels(ctx context.Context, modelIds []string, params *MlGetTrainedModelsParams) (*MlGetTrainedModelsResponse, error)

func (*DefaultMlService) InferTrainedModel

func (s *DefaultMlService) InferTrainedModel(ctx context.Context, modelId string, body any, params *MlInferTrainedModelParams) (json.RawMessage, error)

func (*DefaultMlService) OpenJob

func (s *DefaultMlService) OpenJob(ctx context.Context, jobId string, params *MlOpenJobParams) (*MlOpenJobResponse, error)

func (*DefaultMlService) PutDatafeed

func (s *DefaultMlService) PutDatafeed(ctx context.Context, datafeedId string, body any) (*MlDatafeedConfig, error)

func (*DefaultMlService) PutJob

func (s *DefaultMlService) PutJob(ctx context.Context, jobId string, body any) (*MlJobConfig, error)

func (*DefaultMlService) ResetJob

func (*DefaultMlService) StartDatafeed

func (s *DefaultMlService) StartDatafeed(ctx context.Context, datafeedId string, body any, params *MlStartDatafeedParams) (*MlStartDatafeedResponse, error)

func (*DefaultMlService) StopDatafeed

func (s *DefaultMlService) StopDatafeed(ctx context.Context, datafeedId string, params *MlStopDatafeedParams) (*MlStopDatafeedResponse, error)

type DefaultNodesService

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

DefaultNodesService is the default NodesService implementation.

func (*DefaultNodesService) HotThreads

func (s *DefaultNodesService) HotThreads(ctx context.Context, nodeIds []string, params *NodesHotThreadsParams) (string, error)

func (*DefaultNodesService) Info

func (*DefaultNodesService) ReloadSecureSettings

func (s *DefaultNodesService) ReloadSecureSettings(ctx context.Context, nodeIds []string, body any, params *NodesReloadSecureSettingsParams) (*NodesReloadSecureSettingsResponse, error)

func (*DefaultNodesService) Stats

func (*DefaultNodesService) Usage

type DefaultOperator

type DefaultOperator string

DefaultOperator values.

const (
	DefaultOperatorAnd DefaultOperator = "AND"
	DefaultOperatorOr  DefaultOperator = "OR"
)

type DefaultQueryRulesService

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

DefaultQueryRulesService is the default QueryRulesService implementation.

func (*DefaultQueryRulesService) DeleteRuleset

func (s *DefaultQueryRulesService) DeleteRuleset(ctx context.Context, rulesetId string) (*types.AcknowledgedResponse, error)

func (*DefaultQueryRulesService) GetRuleset

func (s *DefaultQueryRulesService) GetRuleset(ctx context.Context, rulesetId string) (json.RawMessage, error)

func (*DefaultQueryRulesService) ListRulesets

func (*DefaultQueryRulesService) PutRuleset

func (s *DefaultQueryRulesService) PutRuleset(ctx context.Context, rulesetId string, body any) (*types.AcknowledgedResponse, error)

func (*DefaultQueryRulesService) Test

func (s *DefaultQueryRulesService) Test(ctx context.Context, rulesetId string, body any, params *QueryRulesTestParams) (json.RawMessage, error)

type DefaultScriptService

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

DefaultScriptService is the default ScriptService implementation.

func (*DefaultScriptService) Delete

func (*DefaultScriptService) Get

func (*DefaultScriptService) GetContext

func (*DefaultScriptService) GetLanguages

func (*DefaultScriptService) Put

type DefaultSearchApplicationService

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

DefaultSearchApplicationService is the default SearchApplicationService implementation.

func (*DefaultSearchApplicationService) Delete

func (*DefaultSearchApplicationService) DeleteBehavioralAnalytics

func (s *DefaultSearchApplicationService) DeleteBehavioralAnalytics(ctx context.Context, name string) (*types.AcknowledgedResponse, error)

func (*DefaultSearchApplicationService) Get

func (*DefaultSearchApplicationService) GetBehavioralAnalytics

func (s *DefaultSearchApplicationService) GetBehavioralAnalytics(ctx context.Context, name string) (json.RawMessage, error)

func (*DefaultSearchApplicationService) List

func (*DefaultSearchApplicationService) Put

func (*DefaultSearchApplicationService) PutBehavioralAnalytics

func (s *DefaultSearchApplicationService) PutBehavioralAnalytics(ctx context.Context, name string, body any) (*types.AcknowledgedResponse, error)

func (*DefaultSearchApplicationService) Search

type DefaultSearchService

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

DefaultSearchService is the default SearchService implementation.

func (*DefaultSearchService) ClearScroll

func (s *DefaultSearchService) ClearScroll(ctx context.Context, scrollIds []string) (*querydsl.ClearScrollResponse, error)

func (*DefaultSearchService) ClosePointInTime

func (s *DefaultSearchService) ClosePointInTime(ctx context.Context, pitIds []string) (*ClosePITResponse, error)

func (*DefaultSearchService) Count

func (*DefaultSearchService) FieldCaps

func (*DefaultSearchService) MultiSearch

func (*DefaultSearchService) MultiSearchTemplate

func (*DefaultSearchService) OpenPointInTime

func (s *DefaultSearchService) OpenPointInTime(ctx context.Context, req *OpenPITRequest) (*OpenPITResponse, error)

func (*DefaultSearchService) RankEval

func (*DefaultSearchService) RenderSearchTemplate

func (*DefaultSearchService) ScriptsPainlessExec

func (s *DefaultSearchService) ScriptsPainlessExec(ctx context.Context, body any) (json.RawMessage, error)

func (*DefaultSearchService) Scroll

func (*DefaultSearchService) Search

func (*DefaultSearchService) SearchMVT

func (*DefaultSearchService) SearchShards

func (*DefaultSearchService) SearchTemplate

func (*DefaultSearchService) Validate

type DefaultSearchableSnapshotsService

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

DefaultSearchableSnapshotsService is the default SearchableSnapshotsService implementation.

func (*DefaultSearchableSnapshotsService) CacheStats

func (s *DefaultSearchableSnapshotsService) CacheStats(ctx context.Context, nodeIds []string) (json.RawMessage, error)

func (*DefaultSearchableSnapshotsService) ClearCache

func (*DefaultSearchableSnapshotsService) Mount

func (s *DefaultSearchableSnapshotsService) Mount(ctx context.Context, repository, snapshot string, body any, params *SearchableSnapshotsMountParams) (json.RawMessage, error)

func (*DefaultSearchableSnapshotsService) RepositoryStats

func (s *DefaultSearchableSnapshotsService) RepositoryStats(ctx context.Context, repository string) (json.RawMessage, error)

func (*DefaultSearchableSnapshotsService) Stats

type DefaultSecurityService

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

DefaultSecurityService is the default SecurityService implementation.

func (*DefaultSecurityService) Authenticate

func (*DefaultSecurityService) ChangePassword

func (s *DefaultSecurityService) ChangePassword(ctx context.Context, username string, body any) (*types.AcknowledgedResponse, error)

func (*DefaultSecurityService) ClearRealmCache

func (*DefaultSecurityService) ClearRoleCache

func (s *DefaultSecurityService) ClearRoleCache(ctx context.Context, names []string) (*types.AcknowledgedResponse, error)

func (*DefaultSecurityService) CreateAPIKey

func (*DefaultSecurityService) DeletePrivileges

func (s *DefaultSecurityService) DeletePrivileges(ctx context.Context, application, name string) (*types.AcknowledgedResponse, error)

func (*DefaultSecurityService) DeleteRole

func (*DefaultSecurityService) DeleteRoleMapping

func (s *DefaultSecurityService) DeleteRoleMapping(ctx context.Context, name string) (*types.AcknowledgedResponse, error)

func (*DefaultSecurityService) DeleteUser

func (s *DefaultSecurityService) DeleteUser(ctx context.Context, username string) (*types.AcknowledgedResponse, error)

func (*DefaultSecurityService) DisableUser

func (s *DefaultSecurityService) DisableUser(ctx context.Context, username string) (*types.AcknowledgedResponse, error)

func (*DefaultSecurityService) EnableUser

func (s *DefaultSecurityService) EnableUser(ctx context.Context, username string) (*types.AcknowledgedResponse, error)

func (*DefaultSecurityService) GetAPIKey

func (*DefaultSecurityService) GetPrivileges

func (s *DefaultSecurityService) GetPrivileges(ctx context.Context, application, name string) (map[string]any, error)

func (*DefaultSecurityService) GetRole

func (s *DefaultSecurityService) GetRole(ctx context.Context, names []string) (map[string]*SecurityRole, error)

func (*DefaultSecurityService) GetRoleMapping

func (s *DefaultSecurityService) GetRoleMapping(ctx context.Context, names []string) (map[string]*SecurityRoleMapping, error)

func (*DefaultSecurityService) GetToken

func (*DefaultSecurityService) GetUser

func (s *DefaultSecurityService) GetUser(ctx context.Context, usernames []string) (map[string]*SecurityUser, error)

func (*DefaultSecurityService) GetUserPrivileges

func (s *DefaultSecurityService) GetUserPrivileges(ctx context.Context) (map[string]any, error)

func (*DefaultSecurityService) HasPrivileges

func (*DefaultSecurityService) InvalidateAPIKey

func (*DefaultSecurityService) InvalidateToken

func (*DefaultSecurityService) PutPrivileges

func (*DefaultSecurityService) PutRole

func (*DefaultSecurityService) PutRoleMapping

func (*DefaultSecurityService) PutUser

func (s *DefaultSecurityService) PutUser(ctx context.Context, username string, body any) (*SecurityCreateResponse, error)

func (*DefaultSecurityService) UpdateAPIKey

type DefaultShutdownService

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

DefaultShutdownService is the default ShutdownService implementation.

func (*DefaultShutdownService) DeleteNode

func (*DefaultShutdownService) GetNode

func (*DefaultShutdownService) PutNode

func (s *DefaultShutdownService) PutNode(ctx context.Context, nodeId string, body any) (*types.AcknowledgedResponse, error)

type DefaultSlmService

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

DefaultSlmService is the default SlmService implementation.

func (*DefaultSlmService) DeleteLifecycle

func (s *DefaultSlmService) DeleteLifecycle(ctx context.Context, policyId string) (*types.AcknowledgedResponse, error)

func (*DefaultSlmService) ExecuteLifecycle

func (s *DefaultSlmService) ExecuteLifecycle(ctx context.Context, policyId string) (*SlmExecuteResponse, error)

func (*DefaultSlmService) ExecuteRetention

func (s *DefaultSlmService) ExecuteRetention(ctx context.Context) (*types.AcknowledgedResponse, error)

func (*DefaultSlmService) GetLifecycle

func (s *DefaultSlmService) GetLifecycle(ctx context.Context, policyIds []string) (map[string]*SlmPolicy, error)

func (*DefaultSlmService) GetStats

func (*DefaultSlmService) GetStatus

func (*DefaultSlmService) PutLifecycle

func (s *DefaultSlmService) PutLifecycle(ctx context.Context, policyId string, body any) (*types.AcknowledgedResponse, error)

func (*DefaultSlmService) Start

func (*DefaultSlmService) Stop

type DefaultSnapshotService

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

DefaultSnapshotService is the default SnapshotService implementation.

func (*DefaultSnapshotService) CleanupRepository

func (*DefaultSnapshotService) Clone

func (*DefaultSnapshotService) Create

func (*DefaultSnapshotService) CreateRepository

func (*DefaultSnapshotService) Delete

func (*DefaultSnapshotService) DeleteRepository

func (*DefaultSnapshotService) Get

func (*DefaultSnapshotService) GetRepository

func (*DefaultSnapshotService) RepositoryAnalyze

func (*DefaultSnapshotService) Restore

func (*DefaultSnapshotService) Status

func (*DefaultSnapshotService) VerifyRepository

type DefaultSqlService

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

DefaultSqlService is the default SqlService implementation.

func (*DefaultSqlService) ClearCursor

func (s *DefaultSqlService) ClearCursor(ctx context.Context, body any) (*SqlClearCursorResponse, error)

func (*DefaultSqlService) DeleteAsync

func (*DefaultSqlService) GetAsync

func (*DefaultSqlService) GetAsyncStatus

func (s *DefaultSqlService) GetAsyncStatus(ctx context.Context, id string) (*SqlAsyncStatusResponse, error)

func (*DefaultSqlService) Query

func (s *DefaultSqlService) Query(ctx context.Context, body any, params *SqlQueryParams) (*SqlQueryResponse, error)

func (*DefaultSqlService) Translate

func (s *DefaultSqlService) Translate(ctx context.Context, body any) (*SqlTranslateResponse, error)

type DefaultSslService

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

DefaultSslService is the default SslService implementation.

func (*DefaultSslService) Certificates

type DefaultStreamsService

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

DefaultStreamsService is the default StreamsService implementation.

func (*DefaultStreamsService) LogsDisable

func (*DefaultStreamsService) LogsEnable

func (*DefaultStreamsService) Status

type DefaultSynonymsService

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

DefaultSynonymsService is the default SynonymsService implementation.

func (*DefaultSynonymsService) DeleteSynonym

func (*DefaultSynonymsService) DeleteSynonymRule

func (s *DefaultSynonymsService) DeleteSynonymRule(ctx context.Context, id, ruleId string) (*types.AcknowledgedResponse, error)

func (*DefaultSynonymsService) GetSynonym

func (*DefaultSynonymsService) GetSynonymRule

func (s *DefaultSynonymsService) GetSynonymRule(ctx context.Context, id, ruleId string) (*SynonymRule, error)

func (*DefaultSynonymsService) GetSynonymsSets

func (*DefaultSynonymsService) PutSynonym

func (*DefaultSynonymsService) PutSynonymRule

func (s *DefaultSynonymsService) PutSynonymRule(ctx context.Context, id, ruleId string, body any) (*types.AcknowledgedResponse, error)

type DefaultTasksService

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

DefaultTasksService is the default TasksService implementation.

func (*DefaultTasksService) Cancel

func (*DefaultTasksService) Get

func (*DefaultTasksService) List

type DefaultTextStructureService

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

DefaultTextStructureService is the default TextStructureService implementation.

func (*DefaultTextStructureService) FindFieldStructure

func (s *DefaultTextStructureService) FindFieldStructure(ctx context.Context, index, field string, params *TextStructureFindParams) (json.RawMessage, error)

func (*DefaultTextStructureService) FindMessageStructure

func (s *DefaultTextStructureService) FindMessageStructure(ctx context.Context, index string, params *TextStructureFindParams) (json.RawMessage, error)

func (*DefaultTextStructureService) FindStructure

func (*DefaultTextStructureService) TestGrokPattern

func (s *DefaultTextStructureService) TestGrokPattern(ctx context.Context, body any, params *TextStructureFindParams) (json.RawMessage, error)

type DefaultTransformService

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

DefaultTransformService is the default TransformService implementation.

func (*DefaultTransformService) Delete

func (*DefaultTransformService) Get

func (*DefaultTransformService) GetNodeStats

func (*DefaultTransformService) GetStats

func (*DefaultTransformService) Preview

func (*DefaultTransformService) Put

func (s *DefaultTransformService) Put(ctx context.Context, transformId string, body any, params *TransformPutParams) (*TransformPutResponse, error)

func (*DefaultTransformService) Reset

func (*DefaultTransformService) ScheduleNow

func (s *DefaultTransformService) ScheduleNow(ctx context.Context, transformId string) (*types.AcknowledgedResponse, error)

func (*DefaultTransformService) Start

func (*DefaultTransformService) Stop

func (*DefaultTransformService) Upgrade

type DefaultWatcherService

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

DefaultWatcherService is the default WatcherService implementation.

func (*DefaultWatcherService) AckWatch

func (s *DefaultWatcherService) AckWatch(ctx context.Context, id, actionId string) (*WatcherAckWatchResponse, error)

func (*DefaultWatcherService) ActivateWatch

func (*DefaultWatcherService) DeactivateWatch

func (*DefaultWatcherService) DeleteWatch

func (*DefaultWatcherService) ExecuteWatch

func (*DefaultWatcherService) GetWatch

func (*DefaultWatcherService) PutWatch

func (*DefaultWatcherService) QueryWatches

func (*DefaultWatcherService) Start

func (*DefaultWatcherService) Stats

func (*DefaultWatcherService) Stop

type DefaultXpackService

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

DefaultXpackService is the default XpackService implementation.

func (*DefaultXpackService) Info

func (*DefaultXpackService) Usage

type DeleteAliasRequest

type DeleteAliasRequest struct {
	Indices []string `validate:"required,min=1"`
	Names   []string `validate:"required,min=1"`
	Params  *AliasParams
}

DeleteAliasRequest is the request for DELETE /{index}/_alias/{name}.

func (*DeleteAliasRequest) Validate

func (r *DeleteAliasRequest) Validate() error

Validate validates the DeleteAliasRequest.

type DeleteByQueryParams

type DeleteByQueryParams struct {
	Common              *CommonParams
	Analyzer            string
	AnalyzeWildcard     *bool
	Conflicts           Conflicts
	DefaultOperator     DefaultOperator
	Df                  string
	ExpandWildcards     ExpandWildcards
	From                *int
	IgnoreUnavailable   *bool
	Lenient             *bool
	MaxDocs             *int
	Preference          string
	Q                   string
	Refresh             *bool
	RequestCache        *bool
	RequestsPerSecond   *float64
	Routing             string
	Scroll              string
	ScrollSize          *int
	SearchTimeout       string
	SearchType          SearchType
	SliceId             string
	SliceMax            *int
	Slices              string
	Sort                []string
	Stats               []string
	TerminateAfter      *int
	Timeout             string
	Version             *bool
	WaitForActiveShards string
	WaitForCompletion   *bool
}

DeleteByQueryParams are the query parameters for delete_by_query.

func (*DeleteByQueryParams) ToMap

func (p *DeleteByQueryParams) ToMap() map[string]string

ToMap converts DeleteByQueryParams to a query-parameter map.

type DeleteByQueryRequest

type DeleteByQueryRequest struct {
	Indices []string `validate:"required,min=1"`
	Body    any
	Params  *DeleteByQueryParams
}

DeleteByQueryRequest is the request for POST /{index}/_delete_by_query.

func (*DeleteByQueryRequest) Validate

func (r *DeleteByQueryRequest) Validate() error

Validate validates the DeleteByQueryRequest.

type DeleteParams

type DeleteParams struct {
	Common        *CommonParams
	IfPrimaryTerm *int64
	IfSeqNo       *int64
	Refresh       Refresh
	Routing       string
	Timeout       string
	Version       *int64
	VersionType   VersionType
}

DeleteParams are the query parameters for the delete endpoint.

func (*DeleteParams) ToMap

func (p *DeleteParams) ToMap() map[string]string

ToMap converts DeleteParams to a query-parameter map.

type DeleteRequest

type DeleteRequest struct {
	Index  string `validate:"required"`
	Id     string `validate:"required"`
	Params *DeleteParams
}

DeleteRequest is the request for DELETE /{index}/_doc/{id}.

func (*DeleteRequest) Validate

func (r *DeleteRequest) Validate() error

Validate validates the DeleteRequest.

type DeleteResponse

type DeleteResponse struct {
	Index         string            `json:"_index,omitempty"`
	Id            string            `json:"_id,omitempty"`
	Version       int64             `json:"_version,omitempty"`
	Result        string            `json:"result,omitempty"`
	Shards        *types.ShardsInfo `json:"_shards,omitempty"`
	SeqNo         int64             `json:"_seq_no,omitempty"`
	PrimaryTerm   int64             `json:"_primary_term,omitempty"`
	Status        int               `json:"status,omitempty"`
	ForcedRefresh bool              `json:"forced_refresh,omitempty"`
}

DeleteResponse represents the result of a delete document operation.

type DocumentService

type DocumentService interface {
	Index(ctx context.Context, req *IndexRequest) (*IndexResponse, error)
	Create(ctx context.Context, req *CreateRequest) (*IndexResponse, error)
	Get(ctx context.Context, req *GetRequest) (*GetResult, error)
	GetSource(ctx context.Context, req *GetSourceRequest) (json.RawMessage, error)
	Exists(ctx context.Context, index, id string, params *GetParams) (bool, error)
	ExistsSource(ctx context.Context, index, id string, params *GetSourceParams) (bool, error)
	Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error)
	MultiGet(ctx context.Context, req *MgetRequest) (*MgetResponse, error)
	Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error)
	Bulk(ctx context.Context, req *BulkRequest) (*BulkResponse, error)
	DeleteByQuery(ctx context.Context, req *DeleteByQueryRequest) (*BulkIndexByScrollResponse, error)
	DeleteByQueryRethrottle(ctx context.Context, req *RethrottleRequest) (*TasksListResponse, error)
	UpdateByQuery(ctx context.Context, req *UpdateByQueryRequest) (*BulkIndexByScrollResponse, error)
	UpdateByQueryRethrottle(ctx context.Context, req *RethrottleRequest) (*TasksListResponse, error)
	Reindex(ctx context.Context, req *ReindexRequest) (*BulkIndexByScrollResponse, error)
	ReindexRethrottle(ctx context.Context, req *RethrottleRequest) (*TasksListResponse, error)
	Explain(ctx context.Context, req *ExplainRequest) (*ExplainResponse, error)
	TermVectors(ctx context.Context, req *TermVectorsRequest) (*TermvectorsResponse, error)
	MultiTermVectors(ctx context.Context, req *MtermvectorsRequest) (*MultiTermvectorResponse, error)
	TermsEnum(ctx context.Context, req *TermsEnumRequest) (*TermsEnumResponse, error)
}

DocumentService provides access to the document APIs.

func NewDocumentService

func NewDocumentService(client *resty.Client, logger *logrus.Entry) DocumentService

NewDocumentService creates a new DocumentService.

type EnrichService

type EnrichService interface {
	GetPolicy(ctx context.Context, names []string) (json.RawMessage, error)
	PutPolicy(ctx context.Context, name string, body any) (*types.AcknowledgedResponse, error)
	DeletePolicy(ctx context.Context, name string) (*types.AcknowledgedResponse, error)
	ExecutePolicy(ctx context.Context, name string, params *EnrichWaitForCompletionParams) (*types.AcknowledgedResponse, error)
	Stats(ctx context.Context) (json.RawMessage, error)
}

EnrichService provides access to the enrich APIs.

func NewEnrichService

func NewEnrichService(client *resty.Client, logger *logrus.Entry) EnrichService

NewEnrichService creates a new EnrichService.

type EnrichWaitForCompletionParams

type EnrichWaitForCompletionParams struct {
	Common            *CommonParams
	WaitForCompletion *bool
}

EnrichWaitForCompletionParams are the query parameters for execute policy.

func (*EnrichWaitForCompletionParams) ToMap

ToMap converts EnrichWaitForCompletionParams to a query-parameter map.

type EqlSearchParams

type EqlSearchParams struct {
	Common                   *CommonParams
	KeepAlive                string
	KeepOnCompletion         *bool
	WaitForCompletionTimeout string
}

EqlSearchParams are the query parameters for EQL search.

func (*EqlSearchParams) ToMap

func (p *EqlSearchParams) ToMap() map[string]string

ToMap converts EqlSearchParams to a query-parameter map.

type EqlSearchResponse

type EqlSearchResponse struct {
	ID        string         `json:"id,omitempty"`
	IsPartial bool           `json:"is_partial"`
	IsRunning bool           `json:"is_running"`
	TimedOut  bool           `json:"timed_out"`
	Took      int64          `json:"took"`
	Hits      map[string]any `json:"hits,omitempty"`
}

EqlSearchResponse is the response from EQL search.

type EqlService

type EqlService interface {
	Search(ctx context.Context, index string, body any, params *EqlSearchParams) (*EqlSearchResponse, error)
	Get(ctx context.Context, id string) (*EqlSearchResponse, error)
	GetStatus(ctx context.Context, id string) (json.RawMessage, error)
	Delete(ctx context.Context, id string) (*types.AcknowledgedResponse, error)
}

EqlService provides access to the EQL APIs.

func NewEqlService

func NewEqlService(client *resty.Client, logger *logrus.Entry) EqlService

NewEqlService creates a new EqlService.

type ExistsAliasRequest

type ExistsAliasRequest struct {
	Indices []string
	Names   []string `validate:"required,min=1"`
	Params  *GetAliasParams
}

ExistsAliasRequest is the request for HEAD /_alias/{name}.

func (*ExistsAliasRequest) Validate

func (r *ExistsAliasRequest) Validate() error

Validate validates the ExistsAliasRequest.

type ExpandWildcards

type ExpandWildcards string

ExpandWildcards values. Can be combined (e.g. "open,hidden").

const (
	ExpandWildcardOpen   ExpandWildcards = "open"
	ExpandWildcardClosed ExpandWildcards = "closed"
	ExpandWildcardHidden ExpandWildcards = "hidden"
	ExpandWildcardNone   ExpandWildcards = "none"
	ExpandWildcardAll    ExpandWildcards = "all"
)

type ExplainParams

type ExplainParams struct {
	Common          *CommonParams
	Analyzer        string
	AnalyzeWildcard *bool
	DefaultOperator DefaultOperator
	Df              string
	Lenient         *bool
	Preference      string
	Q               string
	Routing         string
	Source          string
	SourceExcludes  []string
	SourceIncludes  []string
	StoredFields    []string
}

ExplainParams are the query parameters for the explain endpoint.

func (*ExplainParams) ToMap

func (p *ExplainParams) ToMap() map[string]string

ToMap converts ExplainParams to a query-parameter map.

type ExplainRequest

type ExplainRequest struct {
	Index  string `validate:"required"`
	Id     string `validate:"required"`
	Body   any
	Params *ExplainParams
}

ExplainRequest is the request for GET|POST /{index}/_explain/{id}.

func (*ExplainRequest) Validate

func (r *ExplainRequest) Validate() error

Validate validates the ExplainRequest.

type ExplainResponse

type ExplainResponse struct {
	Index       string         `json:"_index"`
	Id          string         `json:"_id"`
	Matched     bool           `json:"matched"`
	Explanation map[string]any `json:"explanation"`
}

ExplainResponse represents the result of an explain API request.

type FeaturesGetResponse

type FeaturesGetResponse struct {
	Features []struct {
		Name        string `json:"name"`
		Description string `json:"description,omitempty"`
	} `json:"features"`
}

FeaturesGetResponse is the response from GET /_features.

type FeaturesService

type FeaturesService interface {
	GetFeatures(ctx context.Context) (*FeaturesGetResponse, error)
	ResetFeatures(ctx context.Context) (*types.AcknowledgedResponse, error)
}

FeaturesService provides access to the features APIs.

func NewFeaturesService

func NewFeaturesService(client *resty.Client, logger *logrus.Entry) FeaturesService

NewFeaturesService creates a new FeaturesService.

type FieldCapsParams

type FieldCapsParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	Fields            []string
	IgnoreUnavailable *bool
	IncludeUnmapped   *bool
}

FieldCapsParams are the query parameters for the field_caps endpoint.

func (*FieldCapsParams) ToMap

func (p *FieldCapsParams) ToMap() map[string]string

ToMap converts FieldCapsParams to a query-parameter map.

type FieldCapsRequest

type FieldCapsRequest struct {
	Indices []string
	Body    any
	Params  *FieldCapsParams
}

FieldCapsRequest is the request for GET|POST /_field_caps.

type FieldStatistics

type FieldStatistics struct {
	DocCount   int64 `json:"doc_count"`
	SumDocFreq int64 `json:"sum_doc_freq"`
	SumTtf     int64 `json:"sum_ttf"`
}

FieldStatistics contains aggregate statistics for all terms in a field.

type FleetGlobalCheckpointsParams

type FleetGlobalCheckpointsParams struct {
	Common         *CommonParams
	Checkpoints    []string
	WaitForAdvance *bool
	WaitForIndex   *bool
	Timeout        string
}

FleetGlobalCheckpointsParams are the query parameters for fleet global checkpoints.

func (*FleetGlobalCheckpointsParams) ToMap

ToMap converts FleetGlobalCheckpointsParams to a query-parameter map.

type FleetGlobalCheckpointsResponse

type FleetGlobalCheckpointsResponse struct {
	GlobalCheckpoints []int64 `json:"global_checkpoints"`
	TimedOut          bool    `json:"timed_out"`
}

FleetGlobalCheckpointsResponse is the response from fleet global checkpoints.

type FleetService

type FleetService interface {
	GlobalCheckpoints(ctx context.Context, index string, params *FleetGlobalCheckpointsParams) (*FleetGlobalCheckpointsResponse, error)
}

FleetService provides access to the fleet APIs.

func NewFleetService

func NewFleetService(client *resty.Client, logger *logrus.Entry) FleetService

NewFleetService creates a new FleetService.

type GetAliasParams

type GetAliasParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
	Local             *bool
}

GetAliasParams are the query parameters for get/exists alias.

func (*GetAliasParams) ToMap

func (p *GetAliasParams) ToMap() map[string]string

ToMap converts GetAliasParams to a query-parameter map.

type GetAliasRequest

type GetAliasRequest struct {
	Indices []string
	Names   []string
	Params  *GetAliasParams
}

GetAliasRequest is the request for GET /_alias.

type GetFieldMappingParams

type GetFieldMappingParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
	IncludeDefaults   *bool
	Local             *bool
}

GetFieldMappingParams are the query parameters for get_field_mapping.

func (*GetFieldMappingParams) ToMap

func (p *GetFieldMappingParams) ToMap() map[string]string

ToMap converts GetFieldMappingParams to a query-parameter map.

type GetFieldMappingRequest

type GetFieldMappingRequest struct {
	Indices []string
	Fields  []string `validate:"required,min=1"`
	Params  *GetFieldMappingParams
}

GetFieldMappingRequest is the request for GET /_mapping/field/{fields}.

func (*GetFieldMappingRequest) Validate

func (r *GetFieldMappingRequest) Validate() error

Validate validates the GetFieldMappingRequest.

type GetParams

type GetParams struct {
	Common               *CommonParams
	ForceSyntheticSource *bool
	Preference           string
	Realtime             *bool
	Refresh              *bool
	Routing              string
	Source               string
	SourceExcludes       []string
	SourceIncludes       []string
	StoredFields         []string
	Version              *int64
	VersionType          VersionType
}

GetParams are the query parameters for the get endpoint.

func (*GetParams) ToMap

func (p *GetParams) ToMap() map[string]string

ToMap converts GetParams to a query-parameter map.

type GetRequest

type GetRequest struct {
	Index  string `validate:"required"`
	Id     string `validate:"required"`
	Params *GetParams
}

GetRequest is the request for GET /{index}/_doc/{id}.

func (*GetRequest) Validate

func (r *GetRequest) Validate() error

Validate validates the GetRequest.

type GetResult

type GetResult struct {
	Index       string                           `json:"_index"`
	Id          string                           `json:"_id"`
	Version     *int64                           `json:"_version"`
	SeqNo       *int64                           `json:"_seq_no"`
	PrimaryTerm *int64                           `json:"_primary_term"`
	Source      json.RawMessage                  `json:"_source,omitempty"`
	Found       bool                             `json:"found,omitempty"`
	Fields      map[string]any                   `json:"fields,omitempty"`
	Error       *types.ElasticsearchErrorDetails `json:"error,omitempty"`
}

GetResult represents the result of a get document operation.

type GetSettingsParams

type GetSettingsParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	FlatSettings      *bool
	IgnoreUnavailable *bool
	IncludeDefaults   *bool
	Local             *bool
}

GetSettingsParams are the query parameters for get_settings.

func (*GetSettingsParams) ToMap

func (p *GetSettingsParams) ToMap() map[string]string

ToMap converts GetSettingsParams to a query-parameter map.

type GetSettingsRequest

type GetSettingsRequest struct {
	Indices []string
	Names   []string
	Params  *GetSettingsParams
}

GetSettingsRequest is the request for GET /_settings.

type GetSourceParams

type GetSourceParams = GetParams

GetSourceParams are the query parameters for the get_source endpoint.

type GetSourceRequest

type GetSourceRequest struct {
	Index  string `validate:"required"`
	Id     string `validate:"required"`
	Params *GetSourceParams
}

GetSourceRequest is the request for GET /{index}/_source/{id}.

func (*GetSourceRequest) Validate

func (r *GetSourceRequest) Validate() error

Validate validates the GetSourceRequest.

type GraphExploreParams

type GraphExploreParams struct {
	Common  *CommonParams
	Routing string
	Timeout string
}

GraphExploreParams are the query parameters for graph explore.

func (*GraphExploreParams) ToMap

func (p *GraphExploreParams) ToMap() map[string]string

ToMap converts GraphExploreParams to a query-parameter map.

type GraphExploreResponse

type GraphExploreResponse struct {
	Took        int64            `json:"took"`
	TimeOut     bool             `json:"timed_out"`
	Failures    []map[string]any `json:"failures,omitempty"`
	Vertices    []map[string]any `json:"vertices"`
	Connections []map[string]any `json:"connections"`
}

GraphExploreResponse is the response from graph explore.

type GraphService

type GraphService interface {
	Explore(ctx context.Context, index string, body any, params *GraphExploreParams) (*GraphExploreResponse, error)
}

GraphService provides access to the graph APIs.

func NewGraphService

func NewGraphService(client *resty.Client, logger *logrus.Entry) GraphService

NewGraphService creates a new GraphService.

type GroupBy

type GroupBy string

GroupBy values for tasks listing.

const (
	GroupByNodes   GroupBy = "nodes"
	GroupByParents GroupBy = "parents"
	GroupByNone    GroupBy = "none"
)

type HealthIndicator

type HealthIndicator struct {
	Status      string `json:"status"`
	Summary     string `json:"summary"`
	Detail      string `json:"detail,omitempty"`
	UserActions []struct {
		Action  string `json:"action"`
		HelpURL string `json:"help_url,omitempty"`
	} `json:"user_actions,omitempty"`
	Impacts []struct {
		ID          string   `json:"id"`
		Severity    string   `json:"severity"`
		Description string   `json:"description"`
		ImpactAreas []string `json:"impact_areas"`
	} `json:"impacts,omitempty"`
	Diagnoses []struct {
		ID                string              `json:"id"`
		Cause             string              `json:"cause"`
		Action            string              `json:"action"`
		HelpURL           string              `json:"help_url,omitempty"`
		AffectedResources map[string][]string `json:"affected_resources,omitempty"`
	} `json:"diagnoses,omitempty"`
}

HealthIndicator describes a health indicator.

type HealthReportParams

type HealthReportParams struct {
	Common  *CommonParams
	Size    *int
	Time    string
	Verbose *bool
}

HealthReportParams are the query parameters for GET /_health_report.

func (*HealthReportParams) ToMap

func (p *HealthReportParams) ToMap() map[string]string

ToMap converts HealthReportParams to a query-parameter map.

type HealthReportResponse

type HealthReportResponse struct {
	ClusterName string                     `json:"cluster_name"`
	Status      string                     `json:"status"`
	Indicators  map[string]HealthIndicator `json:"indicators"`
}

HealthReportResponse is the response from GET /_health_report.

type HealthReportService

type HealthReportService interface {
	Get(ctx context.Context, feature string, params *HealthReportParams) (*HealthReportResponse, error)
}

HealthReportService provides access to the health report APIs.

func NewHealthReportService

func NewHealthReportService(client *resty.Client, logger *logrus.Entry) HealthReportService

NewHealthReportService creates a new HealthReportService.

type HealthStatus

type HealthStatus string

HealthStatus values.

const (
	HealthStatusGreen  HealthStatus = "green"
	HealthStatusYellow HealthStatus = "yellow"
	HealthStatusRed    HealthStatus = "red"
)

type IlmExplainParams

type IlmExplainParams struct {
	Common      *CommonParams
	OnlyErrors  *bool
	OnlyManaged *bool
}

IlmExplainParams are the query parameters for ILM explain.

func (*IlmExplainParams) ToMap

func (p *IlmExplainParams) ToMap() map[string]string

ToMap converts IlmExplainParams to a query-parameter map.

type IlmExplainResponse

type IlmExplainResponse struct {
	Indices map[string]struct {
		Index                string         `json:"index"`
		Managed              bool           `json:"managed"`
		Phase                string         `json:"phase,omitempty"`
		Action               string         `json:"action,omitempty"`
		Step                 string         `json:"step,omitempty"`
		StepInfo             map[string]any `json:"step_info,omitempty"`
		FailedStep           string         `json:"failed_step,omitempty"`
		FailedStepRetryable  *bool          `json:"failed_step_retryable,omitempty"`
		StepTime             int64          `json:"step_time_millis,omitempty"`
		PhaseTime            int64          `json:"phase_time_millis,omitempty"`
		ActionTime           int64          `json:"action_time_millis,omitempty"`
		IsAutoRetryableError *bool          `json:"is_auto_retryable_error,omitempty"`
	} `json:"indices"`
}

IlmExplainResponse is the response from ILM explain.

type IlmMigrateToDataTiersResponse

type IlmMigrateToDataTiersResponse struct {
	DryRun                      bool     `json:"dry_run"`
	MigratedComponentTemplates  []string `json:"migrated_component_templates"`
	MigratedComposableTemplates []string `json:"migrated_composable_templates"`
	MigratedIndices             []string `json:"migrated_indices"`
	MigratedIlmPolicies         []string `json:"migrated_ilm_policies"`
	MigratedLegacyTemplates     []string `json:"migrated_legacy_templates"`
	RemovedLegacyTemplate       []string `json:"removed_legacy_template,omitempty"`
	RemovedIndexSettings        []string `json:"removed_index_settings,omitempty"`
	RemovedClusterSettings      []string `json:"removed_cluster_settings,omitempty"`
}

IlmMigrateToDataTiersResponse is the response from migrate_to_data_tiers.

type IlmPolicy

type IlmPolicy struct {
	Version            int            `json:"version,omitempty"`
	ModifiedDate       string         `json:"modified_date,omitempty"`
	ModifiedDateMillis int64          `json:"modified_date_millis,omitempty"`
	Policy             map[string]any `json:"policy,omitempty"`
	InUse              bool           `json:"in_use,omitempty"`
}

IlmPolicy describes an ILM policy.

type IlmRemovePolicyResponse

type IlmRemovePolicyResponse struct {
	HasFailures   bool     `json:"has_failures"`
	FailedIndexes []string `json:"failed_indexes"`
}

IlmRemovePolicyResponse is the response from ILM remove.

type IlmService

type IlmService interface {
	GetLifecycle(ctx context.Context, policies []string) (map[string]*IlmPolicy, error)
	PutLifecycle(ctx context.Context, policy string, body any) (*types.AcknowledgedResponse, error)
	DeleteLifecycle(ctx context.Context, policy string) (*types.AcknowledgedResponse, error)
	GetStatus(ctx context.Context) (*IlmStatusResponse, error)
	Start(ctx context.Context) (*types.AcknowledgedResponse, error)
	Stop(ctx context.Context) (*types.AcknowledgedResponse, error)
	ExplainLifecycle(ctx context.Context, indices []string, params *IlmExplainParams) (*IlmExplainResponse, error)
	MoveToStep(ctx context.Context, index string, body any) (*types.AcknowledgedResponse, error)
	RemovePolicy(ctx context.Context, indices []string) (*IlmRemovePolicyResponse, error)
	Retry(ctx context.Context, indices []string) (*types.AcknowledgedResponse, error)
	MigrateToDataTiers(ctx context.Context, dryRun *bool) (*IlmMigrateToDataTiersResponse, error)
}

IlmService provides access to the index lifecycle management APIs.

func NewIlmService

func NewIlmService(client *resty.Client, logger *logrus.Entry) IlmService

NewIlmService creates a new IlmService.

type IlmStatusResponse

type IlmStatusResponse struct {
	OperationMode string `json:"operation_mode"`
}

IlmStatusResponse is the response from ILM status.

type IndexParams

type IndexParams struct {
	Common              *CommonParams
	IfPrimaryTerm       *int64
	IfSeqNo             *int64
	OpType              OpType
	Pipeline            string
	Refresh             Refresh
	RequireAlias        *bool
	Timeout             string
	Version             *int64
	VersionType         VersionType
	WaitForActiveShards string
}

IndexParams are the query parameters for the index endpoint.

func (*IndexParams) ToMap

func (p *IndexParams) ToMap() map[string]string

ToMap converts IndexParams to a query-parameter map.

type IndexRecovery

type IndexRecovery struct {
	Shards []ShardRecovery `json:"shards"`
}

IndexRecovery holds recovery info for an index.

type IndexRequest

type IndexRequest struct {
	Index  string `validate:"required"`
	Id     string
	Body   any
	Params *IndexParams
}

IndexRequest is the request for PUT /{index}/_doc/{id} | POST /{index}/_doc.

func (*IndexRequest) Validate

func (r *IndexRequest) Validate() error

Validate validates the IndexRequest.

type IndexResponse

type IndexResponse struct {
	Index         string            `json:"_index,omitempty"`
	Id            string            `json:"_id,omitempty"`
	Version       int64             `json:"_version,omitempty"`
	Result        string            `json:"result,omitempty"`
	Shards        *types.ShardsInfo `json:"_shards,omitempty"`
	SeqNo         int64             `json:"_seq_no,omitempty"`
	PrimaryTerm   int64             `json:"_primary_term,omitempty"`
	Status        int               `json:"status,omitempty"`
	ForcedRefresh bool              `json:"forced_refresh,omitempty"`
}

IndexResponse represents the result of an index document operation.

type IndexSegmentRouting

type IndexSegmentRouting struct {
	State   string `json:"state"`
	Primary bool   `json:"primary"`
	Node    string `json:"node"`
}

IndexSegmentRouting describes shard routing.

type IndexSegmentShard

type IndexSegmentShard struct {
	Routing              IndexSegmentRouting `json:"routing"`
	NumCommittedSegments int                 `json:"num_committed_segments"`
	NumSearchSegments    int                 `json:"num_search_segments"`
	Segments             map[string]Segment  `json:"segments"`
}

IndexSegmentShard describes a shard's segments.

type IndexShardStores

type IndexShardStores struct {
	Stores []ShardStore `json:"stores"`
}

IndexShardStores holds shard store info.

type IndexStats

type IndexStats struct {
	Primaries *IndexStatsDetail `json:"primaries,omitempty"`
	Total     *IndexStatsDetail `json:"total,omitempty"`
}

IndexStats holds per-index or aggregate stats.

type IndexStatsDetail

type IndexStatsDetail struct {
	Docs         map[string]any `json:"docs,omitempty"`
	Store        map[string]any `json:"store,omitempty"`
	Indexing     map[string]any `json:"indexing,omitempty"`
	Search       map[string]any `json:"search,omitempty"`
	Get          map[string]any `json:"get,omitempty"`
	Merges       map[string]any `json:"merges,omitempty"`
	Refresh      map[string]any `json:"refresh,omitempty"`
	Flush        map[string]any `json:"flush,omitempty"`
	Warmer       map[string]any `json:"warmer,omitempty"`
	QueryCache   map[string]any `json:"query_cache,omitempty"`
	Fielddata    map[string]any `json:"fielddata,omitempty"`
	Completion   map[string]any `json:"completion,omitempty"`
	Segments     map[string]any `json:"segments,omitempty"`
	Translog     map[string]any `json:"translog,omitempty"`
	RequestCache map[string]any `json:"request_cache,omitempty"`
	Recovery     map[string]any `json:"recovery,omitempty"`
}

IndexStatsDetail holds the detailed stats sections.

type IndexTemplate

type IndexTemplate struct {
	IndexPatterns   []string       `json:"index_patterns"`
	Template        TemplateBody   `json:"template"`
	Priority        *int           `json:"priority,omitempty"`
	Version         *int           `json:"version,omitempty"`
	ComposedOf      []string       `json:"composed_of,omitempty"`
	DataStream      map[string]any `json:"data_stream,omitempty"`
	AllowAutoCreate *bool          `json:"allow_auto_create,omitempty"`
}

IndexTemplate is a composable index template.

type IndexTemplateItem

type IndexTemplateItem struct {
	Name          string        `json:"name"`
	IndexTemplate IndexTemplate `json:"index_template"`
}

IndexTemplateItem wraps a composable index template.

type IndicesAnalyzeResponse

type IndicesAnalyzeResponse struct {
	Tokens []AnalyzeToken `json:"tokens"`
}

IndicesAnalyzeResponse is the response from GET|POST /_analyze.

type IndicesBlockResponse

type IndicesBlockResponse struct {
	Shards       *types.ShardsInfo `json:"_shards,omitempty"`
	Acknowledged bool              `json:"acknowledged"`
	Indices      []map[string]any  `json:"indices,omitempty"`
}

IndicesBlockResponse is the response from add_block.

type IndicesClearCacheParams

type IndicesClearCacheParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	Fielddata         *bool
	Fields            []string
	IgnoreUnavailable *bool
	Query             *bool
}

IndicesClearCacheParams are the query parameters for POST /_cache/clear.

func (*IndicesClearCacheParams) ToMap

func (p *IndicesClearCacheParams) ToMap() map[string]string

ToMap converts IndicesClearCacheParams to a query-parameter map.

type IndicesCloseParams

type IndicesCloseParams = IndicesOpenParams

IndicesCloseParams are the query parameters for POST /{index}/_close.

type IndicesCreateDataStreamParams

type IndicesCreateDataStreamParams struct {
	Common  *CommonParams
	Timeout string
}

IndicesCreateDataStreamParams are the query parameters for create_data_stream.

func (*IndicesCreateDataStreamParams) ToMap

ToMap converts IndicesCreateDataStreamParams to a query-parameter map.

type IndicesCreateParams

type IndicesCreateParams struct {
	Common              *CommonParams
	WaitForActiveShards string
}

IndicesCreateParams are the query parameters for PUT /{index}.

func (*IndicesCreateParams) ToMap

func (p *IndicesCreateParams) ToMap() map[string]string

ToMap converts IndicesCreateParams to a query-parameter map.

type IndicesDataStreamGetResponse

type IndicesDataStreamGetResponse struct {
	DataStreams []DataStream `json:"data_streams"`
}

IndicesDataStreamGetResponse is the response from get_data_stream.

type IndicesDataStreamsStatsResponse

type IndicesDataStreamsStatsResponse struct {
	Shards              *types.ShardsInfo `json:"_shards,omitempty"`
	DataStreamCount     int               `json:"data_stream_count"`
	BackingIndices      int               `json:"backing_indices"`
	TotalStoreSizeBytes int64             `json:"total_store_size_bytes"`
	DataStreams         []struct {
		DataStream       string `json:"data_stream"`
		BackingIndices   int    `json:"backing_indices"`
		StoreSizeBytes   int64  `json:"store_size_bytes"`
		MaximumRetention string `json:"maximum_retention"`
	} `json:"data_streams"`
}

IndicesDataStreamsStatsResponse is the response from data_stream_stats.

type IndicesDeleteDataStreamParams

type IndicesDeleteDataStreamParams struct {
	Common          *CommonParams
	ExpandWildcards ExpandWildcards
}

IndicesDeleteDataStreamParams are the query parameters for delete_data_stream.

func (*IndicesDeleteDataStreamParams) ToMap

ToMap converts IndicesDeleteDataStreamParams to a query-parameter map.

type IndicesDeleteIndexTemplateParams

type IndicesDeleteIndexTemplateParams struct {
	Common  *CommonParams
	Timeout string
}

IndicesDeleteIndexTemplateParams are the query parameters for delete_index_template.

func (*IndicesDeleteIndexTemplateParams) ToMap

ToMap converts IndicesDeleteIndexTemplateParams to a query-parameter map.

type IndicesDeleteParams

type IndicesDeleteParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
}

IndicesDeleteParams are the query parameters for DELETE /{index}.

func (*IndicesDeleteParams) ToMap

func (p *IndicesDeleteParams) ToMap() map[string]string

ToMap converts IndicesDeleteParams to a query-parameter map.

type IndicesDeleteTemplateParams

type IndicesDeleteTemplateParams struct {
	Common  *CommonParams
	Timeout string
}

IndicesDeleteTemplateParams are the query parameters for delete legacy template.

func (*IndicesDeleteTemplateParams) ToMap

func (p *IndicesDeleteTemplateParams) ToMap() map[string]string

ToMap converts IndicesDeleteTemplateParams to a query-parameter map.

type IndicesExistsParams

type IndicesExistsParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	FlatSettings      *bool
	IgnoreUnavailable *bool
	IncludeDefaults   *bool
	Local             *bool
}

IndicesExistsParams are the query parameters for HEAD /{index}.

func (*IndicesExistsParams) ToMap

func (p *IndicesExistsParams) ToMap() map[string]string

ToMap converts IndicesExistsParams to a query-parameter map.

type IndicesFlushParams

type IndicesFlushParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	Force             *bool
	IgnoreUnavailable *bool
	WaitIfOngoing     *bool
}

IndicesFlushParams are the query parameters for POST /_flush.

func (*IndicesFlushParams) ToMap

func (p *IndicesFlushParams) ToMap() map[string]string

ToMap converts IndicesFlushParams to a query-parameter map.

type IndicesForceMergeParams

type IndicesForceMergeParams struct {
	Common             *CommonParams
	AllowNoIndices     *bool
	ExpandWildcards    ExpandWildcards
	Flush              *bool
	IgnoreUnavailable  *bool
	MaxNumSegments     *int
	OnlyExpungeDeletes *bool
}

IndicesForceMergeParams are the query parameters for POST /_forcemerge.

func (*IndicesForceMergeParams) ToMap

func (p *IndicesForceMergeParams) ToMap() map[string]string

ToMap converts IndicesForceMergeParams to a query-parameter map.

type IndicesGetAliasResponse

type IndicesGetAliasResponse struct {
	Aliases map[string]AliasInfo `json:"aliases"`
}

IndicesGetAliasResponse is the per-index alias info.

type IndicesGetDataStreamParams

type IndicesGetDataStreamParams struct {
	Common          *CommonParams
	ExpandWildcards ExpandWildcards
	IncludeDefaults *bool
}

IndicesGetDataStreamParams are the query parameters for get_data_stream.

func (*IndicesGetDataStreamParams) ToMap

func (p *IndicesGetDataStreamParams) ToMap() map[string]string

ToMap converts IndicesGetDataStreamParams to a query-parameter map.

type IndicesGetIndexTemplateParams

type IndicesGetIndexTemplateParams struct {
	Common       *CommonParams
	FlatSettings *bool
	Local        *bool
}

IndicesGetIndexTemplateParams are the query parameters for get_index_template.

func (*IndicesGetIndexTemplateParams) ToMap

ToMap converts IndicesGetIndexTemplateParams to a query-parameter map.

type IndicesGetIndexTemplateResponse

type IndicesGetIndexTemplateResponse struct {
	IndexTemplates []IndexTemplateItem `json:"index_templates"`
}

IndicesGetIndexTemplateResponse is the response from get_index_template.

type IndicesGetMappingParams

type IndicesGetMappingParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
	Local             *bool
}

IndicesGetMappingParams are the query parameters for GET /_mapping.

func (*IndicesGetMappingParams) ToMap

func (p *IndicesGetMappingParams) ToMap() map[string]string

ToMap converts IndicesGetMappingParams to a query-parameter map.

type IndicesGetMappingResponse

type IndicesGetMappingResponse struct {
	Mappings map[string]any `json:"mappings"`
}

IndicesGetMappingResponse is the per-index mapping.

type IndicesGetParams

type IndicesGetParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	Features          []string
	FlatSettings      *bool
	IgnoreUnavailable *bool
	IncludeDefaults   *bool
	Local             *bool
}

IndicesGetParams are the query parameters for GET /{index}.

func (*IndicesGetParams) ToMap

func (p *IndicesGetParams) ToMap() map[string]string

ToMap converts IndicesGetParams to a query-parameter map.

type IndicesGetResponse

type IndicesGetResponse struct {
	Aliases    map[string]AliasInfo `json:"aliases,omitempty"`
	Mappings   map[string]any       `json:"mappings,omitempty"`
	Settings   map[string]any       `json:"settings,omitempty"`
	Defaults   map[string]any       `json:"defaults,omitempty"`
	DataStream string               `json:"data_stream,omitempty"`
	System     bool                 `json:"system,omitempty"`
}

IndicesGetResponse is the per-index info returned by GET /{index}.

type IndicesGetSettingsResponse

type IndicesGetSettingsResponse struct {
	Settings map[string]any `json:"settings,omitempty"`
	Defaults map[string]any `json:"defaults,omitempty"`
}

IndicesGetSettingsResponse is the per-index settings.

type IndicesGetTemplateParams

type IndicesGetTemplateParams struct {
	Common       *CommonParams
	FlatSettings *bool
	Local        *bool
}

IndicesGetTemplateParams are the query parameters for the legacy get_template.

func (*IndicesGetTemplateParams) ToMap

func (p *IndicesGetTemplateParams) ToMap() map[string]string

ToMap converts IndicesGetTemplateParams to a query-parameter map.

type IndicesGetTemplateResponse

type IndicesGetTemplateResponse struct {
	Order         int            `json:"order,omitempty"`
	Version       int            `json:"version,omitempty"`
	IndexPatterns []string       `json:"index_patterns,omitempty"`
	Settings      map[string]any `json:"settings,omitempty"`
	Mappings      map[string]any `json:"mappings,omitempty"`
	Aliases       map[string]any `json:"aliases,omitempty"`
	Deprecated    bool           `json:"deprecated,omitempty"`
}

IndicesGetTemplateResponse is the legacy index template.

type IndicesOpenParams

type IndicesOpenParams struct {
	Common              *CommonParams
	AllowNoIndices      *bool
	ExpandWildcards     ExpandWildcards
	IgnoreUnavailable   *bool
	Timeout             string
	WaitForActiveShards string
}

IndicesOpenParams are the query parameters for POST /{index}/_open.

func (*IndicesOpenParams) ToMap

func (p *IndicesOpenParams) ToMap() map[string]string

ToMap converts IndicesOpenParams to a query-parameter map.

type IndicesPutSettingsParams

type IndicesPutSettingsParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	FlatSettings      *bool
	IgnoreUnavailable *bool
	PreserveExisting  *bool
	Timeout           string
}

IndicesPutSettingsParams are the query parameters for PUT /_settings.

func (*IndicesPutSettingsParams) ToMap

func (p *IndicesPutSettingsParams) ToMap() map[string]string

ToMap converts IndicesPutSettingsParams to a query-parameter map.

type IndicesRecoveryParams

type IndicesRecoveryParams struct {
	Common     *CommonParams
	ActiveOnly *bool
	Detailed   *bool
}

IndicesRecoveryParams are the query parameters for GET /_recovery.

func (*IndicesRecoveryParams) ToMap

func (p *IndicesRecoveryParams) ToMap() map[string]string

ToMap converts IndicesRecoveryParams to a query-parameter map.

type IndicesRecoveryResponse

type IndicesRecoveryResponse map[string]IndexRecovery

IndicesRecoveryResponse is the response from GET /_recovery.

type IndicesRefreshParams

type IndicesRefreshParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
}

IndicesRefreshParams are the query parameters for POST /_refresh.

func (*IndicesRefreshParams) ToMap

func (p *IndicesRefreshParams) ToMap() map[string]string

ToMap converts IndicesRefreshParams to a query-parameter map.

type IndicesReloadAnalyzersParams

type IndicesReloadAnalyzersParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
}

IndicesReloadAnalyzersParams are the query parameters for reload_search_analyzers.

func (*IndicesReloadAnalyzersParams) ToMap

ToMap converts IndicesReloadAnalyzersParams to a query-parameter map.

type IndicesReloadAnalyzersResponse

type IndicesReloadAnalyzersResponse struct {
	Shards        *types.ShardsInfo `json:"_shards,omitempty"`
	ReloadDetails []ReloadDetails   `json:"reload_details,omitempty"`
}

IndicesReloadAnalyzersResponse is the response from reload_search_analyzers.

type IndicesResolveClusterParams

type IndicesResolveClusterParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
}

IndicesResolveClusterParams are the query parameters for resolve_cluster.

func (*IndicesResolveClusterParams) ToMap

func (p *IndicesResolveClusterParams) ToMap() map[string]string

ToMap converts IndicesResolveClusterParams to a query-parameter map.

type IndicesResolveIndexParams

type IndicesResolveIndexParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
}

IndicesResolveIndexParams are the query parameters for resolve_index.

func (*IndicesResolveIndexParams) ToMap

func (p *IndicesResolveIndexParams) ToMap() map[string]string

ToMap converts IndicesResolveIndexParams to a query-parameter map.

type IndicesResolveIndexResponse

type IndicesResolveIndexResponse struct {
	Indices     []ResolveIndexInfo      `json:"indices,omitempty"`
	Aliases     []ResolveAliasInfo      `json:"aliases,omitempty"`
	DataStreams []ResolveDataStreamInfo `json:"data_streams,omitempty"`
}

IndicesResolveIndexResponse is the response from resolve_index.

type IndicesRolloverResponse

type IndicesRolloverResponse struct {
	OldIndex           string            `json:"old_index"`
	NewIndex           string            `json:"new_index"`
	RolledOver         bool              `json:"rolled_over"`
	DryRun             bool              `json:"dry_run"`
	Acknowledged       bool              `json:"acknowledged"`
	ShardsAcknowledged bool              `json:"shards_acknowledged"`
	Conditions         map[string]bool   `json:"conditions,omitempty"`
	Shards             *types.ShardsInfo `json:"shards,omitempty"`
}

IndicesRolloverResponse is the response from the rollover endpoint.

type IndicesSegmentsParams

type IndicesSegmentsParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
	Verbose           *bool
}

IndicesSegmentsParams are the query parameters for GET /_segments.

func (*IndicesSegmentsParams) ToMap

func (p *IndicesSegmentsParams) ToMap() map[string]string

ToMap converts IndicesSegmentsParams to a query-parameter map.

type IndicesSegmentsResponse

type IndicesSegmentsResponse struct {
	Shards  *types.ShardsInfo `json:"_shards,omitempty"`
	Indices map[string]struct {
		Shards map[string][]IndexSegmentShard `json:"shards"`
	} `json:"indices,omitempty"`
}

IndicesSegmentsResponse is the response from GET /_segments.

type IndicesService

type IndicesService interface {
	Create(ctx context.Context, index string, body any, params *IndicesCreateParams) (*types.AcknowledgedResponse, error)
	Delete(ctx context.Context, indices []string, params *IndicesDeleteParams) (*types.AcknowledgedResponse, error)
	Get(ctx context.Context, indices []string, params *IndicesGetParams) (map[string]*IndicesGetResponse, error)
	Exists(ctx context.Context, indices []string, params *IndicesExistsParams) (bool, error)
	Open(ctx context.Context, indices []string, params *IndicesOpenParams) (*types.AcknowledgedResponse, error)
	Close(ctx context.Context, indices []string, params *IndicesCloseParams) (*types.AcknowledgedResponse, error)
	Rollover(ctx context.Context, req *RolloverRequest) (*IndicesRolloverResponse, error)
	Shrink(ctx context.Context, req *ShrinkRequest) (*types.AcknowledgedResponse, error)
	Split(ctx context.Context, req *SplitRequest) (*types.AcknowledgedResponse, error)
	Clone(ctx context.Context, req *CloneRequest) (*types.AcknowledgedResponse, error)
	Refresh(ctx context.Context, indices []string, params *IndicesRefreshParams) (*RefreshResult, error)
	Flush(ctx context.Context, indices []string, params *IndicesFlushParams) (*types.BroadcastResponse, error)
	ForceMerge(ctx context.Context, indices []string, params *IndicesForceMergeParams) (*types.BroadcastResponse, error)
	ClearCache(ctx context.Context, indices []string, params *IndicesClearCacheParams) (*types.BroadcastResponse, error)
	Analyze(ctx context.Context, index string, body any) (*IndicesAnalyzeResponse, error)
	Stats(ctx context.Context, req *IndicesStatsRequest) (*IndicesStatsResponse, error)
	Segments(ctx context.Context, indices []string, params *IndicesSegmentsParams) (*IndicesSegmentsResponse, error)
	Recovery(ctx context.Context, indices []string, params *IndicesRecoveryParams) (*IndicesRecoveryResponse, error)
	ShardStores(ctx context.Context, indices []string, params *IndicesShardStoresParams) (*IndicesShardStoresResponse, error)
	ReloadSearchAnalyzers(ctx context.Context, indices []string, params *IndicesReloadAnalyzersParams) (*IndicesReloadAnalyzersResponse, error)
	Downsample(ctx context.Context, index, targetIndex string, body any) (*types.AcknowledgedResponse, error)
	AddBlock(ctx context.Context, req *AddBlockRequest) (*IndicesBlockResponse, error)
	PutAlias(ctx context.Context, req *PutAliasRequest) (*types.AcknowledgedResponse, error)
	GetAlias(ctx context.Context, req *GetAliasRequest) (map[string]*IndicesGetAliasResponse, error)
	ExistsAlias(ctx context.Context, req *ExistsAliasRequest) (bool, error)
	DeleteAlias(ctx context.Context, req *DeleteAliasRequest) (*types.AcknowledgedResponse, error)
	UpdateAliases(ctx context.Context, body any, params *IndicesUpdateAliasesParams) (*types.AcknowledgedResponse, error)
	GetSettings(ctx context.Context, req *GetSettingsRequest) (map[string]*IndicesGetSettingsResponse, error)
	PutSettings(ctx context.Context, indices []string, body any, params *IndicesPutSettingsParams) (*types.AcknowledgedResponse, error)
	GetMapping(ctx context.Context, indices []string, params *IndicesGetMappingParams) (map[string]*IndicesGetMappingResponse, error)
	PutMapping(ctx context.Context, req *PutMappingRequest) (*types.AcknowledgedResponse, error)
	GetFieldMapping(ctx context.Context, req *GetFieldMappingRequest) (map[string]any, error)
	GetTemplate(ctx context.Context, names []string, params *IndicesGetTemplateParams) (map[string]*IndicesGetTemplateResponse, error)
	PutTemplate(ctx context.Context, req *PutTemplateRequest) (*types.AcknowledgedResponse, error)
	ExistsTemplate(ctx context.Context, name string) (bool, error)
	DeleteTemplate(ctx context.Context, name string, params *IndicesDeleteTemplateParams) (*types.AcknowledgedResponse, error)
	GetIndexTemplate(ctx context.Context, names []string, params *IndicesGetIndexTemplateParams) (*IndicesGetIndexTemplateResponse, error)
	PutIndexTemplate(ctx context.Context, req *PutIndexTemplateRequest) (*types.AcknowledgedResponse, error)
	ExistsIndexTemplate(ctx context.Context, name string) (bool, error)
	DeleteIndexTemplate(ctx context.Context, name string, params *IndicesDeleteIndexTemplateParams) (*types.AcknowledgedResponse, error)
	SimulateIndexTemplate(ctx context.Context, req *SimulateIndexTemplateRequest) (*IndicesSimulateTemplateResponse, error)
	SimulateTemplate(ctx context.Context, req *SimulateTemplateRequest) (*IndicesSimulateTemplateResponse, error)
	CreateDataStream(ctx context.Context, name string, body any, params *IndicesCreateDataStreamParams) (*types.AcknowledgedResponse, error)
	GetDataStream(ctx context.Context, names []string, params *IndicesGetDataStreamParams) (*IndicesDataStreamGetResponse, error)
	DeleteDataStream(ctx context.Context, names []string, params *IndicesDeleteDataStreamParams) (*types.AcknowledgedResponse, error)
	DataStreamStats(ctx context.Context, names []string) (*IndicesDataStreamsStatsResponse, error)
	MigrateToDataStream(ctx context.Context, name string) (*types.AcknowledgedResponse, error)
	ModifyDataStream(ctx context.Context, req *ModifyDataStreamRequest) (*types.AcknowledgedResponse, error)
	PromoteDataStream(ctx context.Context, name string) (*types.AcknowledgedResponse, error)
	ResolveIndex(ctx context.Context, name string, params *IndicesResolveIndexParams) (*IndicesResolveIndexResponse, error)
	ResolveCluster(ctx context.Context, names []string, params *IndicesResolveClusterParams) (map[string]*ResolveClusterInfo, error)
}

IndicesService provides access to the indices APIs.

func NewIndicesService

func NewIndicesService(client *resty.Client, logger *logrus.Entry) IndicesService

NewIndicesService creates a new IndicesService.

type IndicesShardStoresParams

type IndicesShardStoresParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
	Status            []string
}

IndicesShardStoresParams are the query parameters for GET /_shard_stores.

func (*IndicesShardStoresParams) ToMap

func (p *IndicesShardStoresParams) ToMap() map[string]string

ToMap converts IndicesShardStoresParams to a query-parameter map.

type IndicesShardStoresResponse

type IndicesShardStoresResponse struct {
	Indices map[string]struct {
		Shards map[string]IndexShardStores `json:"shards"`
	} `json:"indices"`
}

IndicesShardStoresResponse is the response from GET /_shard_stores.

type IndicesSimulateTemplateResponse

type IndicesSimulateTemplateResponse struct {
	Template    TemplateBody `json:"template"`
	Overlapping []struct {
		Name          string   `json:"name"`
		IndexPatterns []string `json:"index_patterns"`
	} `json:"overlapping,omitempty"`
}

IndicesSimulateTemplateResponse is the response from simulate template.

type IndicesStatsParams

type IndicesStatsParams struct {
	Common                  *CommonParams
	CompletionFields        []string
	ExpandWildcards         ExpandWildcards
	FielddataFields         []string
	Fields                  []string
	ForbidClosedIndices     *bool
	Groups                  []string
	IncludeSegmentFileSizes *bool
	IncludeUnloadedSegments *bool
	Level                   Level
}

IndicesStatsParams are the query parameters for the stats endpoint.

func (*IndicesStatsParams) ToMap

func (p *IndicesStatsParams) ToMap() map[string]string

ToMap converts IndicesStatsParams to a query-parameter map.

type IndicesStatsRequest

type IndicesStatsRequest struct {
	Indices []string
	Metrics []string
	Params  *IndicesStatsParams
}

IndicesStatsRequest is the request for GET /_stats.

type IndicesStatsResponse

type IndicesStatsResponse struct {
	Shards      *types.ShardsInfo      `json:"_shards,omitempty"`
	All         *IndexStats            `json:"_all,omitempty"`
	Indices     map[string]*IndexStats `json:"indices,omitempty"`
	DataStreams map[string]any         `json:"data_streams,omitempty"`
}

IndicesStatsResponse is the response from GET /_stats.

type IndicesUpdateAliasesParams

type IndicesUpdateAliasesParams struct {
	Common  *CommonParams
	Timeout string
}

IndicesUpdateAliasesParams are the query parameters for POST /_aliases.

func (*IndicesUpdateAliasesParams) ToMap

func (p *IndicesUpdateAliasesParams) ToMap() map[string]string

ToMap converts IndicesUpdateAliasesParams to a query-parameter map.

type InferenceDeleteParams

type InferenceDeleteParams struct {
	Common *CommonParams
	Force  *bool
	DryRun *bool
}

InferenceDeleteParams are the query parameters for delete.

func (*InferenceDeleteParams) ToMap

func (p *InferenceDeleteParams) ToMap() map[string]string

ToMap converts InferenceDeleteParams to a query-parameter map.

type InferenceGetResponse

type InferenceGetResponse struct {
	InferenceID     string         `json:"inference_id"`
	TaskType        string         `json:"task_type"`
	Service         string         `json:"service"`
	ServiceSettings map[string]any `json:"service_settings"`
	TaskSettings    map[string]any `json:"task_settings"`
}

InferenceGetResponse is the response from GET /_inference.

type InferenceService

type InferenceService interface {
	Get(ctx context.Context, inferenceId, taskType string) (json.RawMessage, error)
	Put(ctx context.Context, taskType, inferenceId string, body any) (*types.AcknowledgedResponse, error)
	Delete(ctx context.Context, taskType, inferenceId string, params *InferenceDeleteParams) (*types.AcknowledgedResponse, error)
	Update(ctx context.Context, inferenceId string, body any) (*types.AcknowledgedResponse, error)
	Inference(ctx context.Context, inferenceId string, body any) (json.RawMessage, error)
	Completion(ctx context.Context, inferenceId string, body any) (json.RawMessage, error)
	Rerank(ctx context.Context, inferenceId string, body any) (json.RawMessage, error)
}

InferenceService provides access to the inference APIs.

func NewInferenceService

func NewInferenceService(client *resty.Client, logger *logrus.Entry) InferenceService

NewInferenceService creates a new InferenceService.

type InfoResponse

type InfoResponse struct {
	Name        string       `json:"name"`
	ClusterName string       `json:"cluster_name"`
	ClusterUUID string       `json:"cluster_uuid"`
	Version     *InfoVersion `json:"version,omitempty"`
	Tagline     string       `json:"tagline"`
}

InfoResponse represents the cluster info returned by the root endpoint.

type InfoService

type InfoService interface {
	Info(ctx context.Context) (*InfoResponse, error)
	Ping(ctx context.Context) (bool, error)
	Capabilities(ctx context.Context, req *CapabilitiesRequest) (*CapabilitiesResponse, error)
}

InfoService provides access to cluster-level info, ping, and capabilities endpoints.

func NewInfoService

func NewInfoService(client *resty.Client, logger *logrus.Entry) InfoService

NewInfoService creates a new InfoService.

type InfoVersion

type InfoVersion struct {
	Number             string `json:"number"`
	BuildFlavor        string `json:"build_flavor,omitempty"`
	BuildType          string `json:"build_type,omitempty"`
	BuildHash          string `json:"build_hash,omitempty"`
	BuildDate          string `json:"build_date,omitempty"`
	BuildSnapshot      bool   `json:"build_snapshot,omitempty"`
	LuceneVersion      string `json:"lucene_version,omitempty"`
	MinimumWireCompat  string `json:"minimum_wire_compatibility_version,omitempty"`
	MinimumIndexCompat string `json:"minimum_index_compatibility_version,omitempty"`
}

InfoVersion contains the Elasticsearch version details.

type IngestDeletePipelineParams

type IngestDeletePipelineParams struct {
	Common  *CommonParams
	Timeout string
}

IngestDeletePipelineParams are the query parameters for delete pipeline.

func (*IngestDeletePipelineParams) ToMap

func (p *IngestDeletePipelineParams) ToMap() map[string]string

ToMap converts IngestDeletePipelineParams to a query-parameter map.

type IngestGetPipelineParams

type IngestGetPipelineParams struct {
	Common  *CommonParams
	Summary *bool
}

IngestGetPipelineParams are the query parameters for GET /_ingest/pipeline.

func (*IngestGetPipelineParams) ToMap

func (p *IngestGetPipelineParams) ToMap() map[string]string

ToMap converts IngestGetPipelineParams to a query-parameter map.

type IngestGrokResponse

type IngestGrokResponse struct {
	Patterns map[string]string `json:"patterns"`
}

IngestGrokResponse is the response from GET /_ingest/processor/grok.

type IngestPipeline

type IngestPipeline struct {
	Description string           `json:"description,omitempty"`
	Version     int              `json:"version,omitempty"`
	Processors  []map[string]any `json:"processors"`
	OnFailure   []map[string]any `json:"on_failure,omitempty"`
	Deprecated  bool             `json:"deprecated,omitempty"`
}

IngestPipeline describes a stored ingest pipeline.

type IngestPutPipelineParams

type IngestPutPipelineParams struct {
	Common    *CommonParams
	IfVersion *int
	Timeout   string
}

IngestPutPipelineParams are the query parameters for put pipeline.

func (*IngestPutPipelineParams) ToMap

func (p *IngestPutPipelineParams) ToMap() map[string]string

ToMap converts IngestPutPipelineParams to a query-parameter map.

type IngestPutPipelineRequest

type IngestPutPipelineRequest struct {
	Id     string `validate:"required"`
	Body   any    `validate:"required"`
	Params *IngestPutPipelineParams
}

IngestPutPipelineRequest is the request for PUT /_ingest/pipeline/{id}.

func (*IngestPutPipelineRequest) Validate

func (r *IngestPutPipelineRequest) Validate() error

Validate validates the IngestPutPipelineRequest.

type IngestService

type IngestService interface {
	GetPipeline(ctx context.Context, ids []string, params *IngestGetPipelineParams) (map[string]*IngestPipeline, error)
	PutPipeline(ctx context.Context, req *IngestPutPipelineRequest) (*types.AcknowledgedResponse, error)
	DeletePipeline(ctx context.Context, id string, params *IngestDeletePipelineParams) (*types.AcknowledgedResponse, error)
	Simulate(ctx context.Context, req *IngestSimulatePipelineRequest) (*IngestSimulateResponse, error)
	ProcessorGrok(ctx context.Context) (*IngestGrokResponse, error)
}

IngestService provides access to the ingest APIs.

func NewIngestService

func NewIngestService(client *resty.Client, logger *logrus.Entry) IngestService

NewIngestService creates a new IngestService.

type IngestSimulatePipelineParams

type IngestSimulatePipelineParams struct {
	Common  *CommonParams
	Verbose *bool
}

IngestSimulatePipelineParams are the query parameters for simulate.

func (*IngestSimulatePipelineParams) ToMap

ToMap converts IngestSimulatePipelineParams to a query-parameter map.

type IngestSimulatePipelineRequest

type IngestSimulatePipelineRequest struct {
	Id     string
	Body   any `validate:"required"`
	Params *IngestSimulatePipelineParams
}

IngestSimulatePipelineRequest is the request for POST /_ingest/pipeline/_simulate.

func (*IngestSimulatePipelineRequest) Validate

func (r *IngestSimulatePipelineRequest) Validate() error

Validate validates the IngestSimulatePipelineRequest.

type IngestSimulateResponse

type IngestSimulateResponse struct {
	Docs []struct {
		Doc              map[string]any `json:"doc"`
		ProcessorResults []struct {
			Processor map[string]any `json:"processor_type"`
			Status    string         `json:"status"`
			Doc       map[string]any `json:"doc"`
			Tag       string         `json:"tag,omitempty"`
			Error     map[string]any `json:"error,omitempty"`
		} `json:"processor_results"`
	} `json:"docs"`
}

IngestSimulateResponse is the response from simulate pipeline.

type Level

type Level string

Level values for stats endpoints.

const (
	LevelCluster Level = "cluster"
	LevelIndices Level = "indices"
	LevelShards  Level = "shards"
)

type LicenseGetParams

type LicenseGetParams struct {
	Common *CommonParams
	Local  *bool
}

LicenseGetParams are the query parameters for GET /_license.

func (*LicenseGetParams) ToMap

func (p *LicenseGetParams) ToMap() map[string]string

ToMap converts LicenseGetParams to a query-parameter map.

type LicenseGetResponse

type LicenseGetResponse struct {
	License LicenseInfo `json:"license"`
}

LicenseGetResponse is the response from GET /_license.

type LicenseInfo

type LicenseInfo struct {
	UID                string `json:"uid"`
	Type               string `json:"type"`
	Status             string `json:"status"`
	IssueDate          string `json:"issue_date,omitempty"`
	IssueDateInMillis  int64  `json:"issue_dateInMillis,omitempty"`
	ExpiryDate         string `json:"expiry_date,omitempty"`
	ExpiryDateInMillis int64  `json:"expiry_dateInMillis,omitempty"`
	MaxNodes           int    `json:"max_nodes,omitempty"`
	IssuedTo           string `json:"issued_to,omitempty"`
	Issuer             string `json:"issuer,omitempty"`
	StartDate          string `json:"start_date,omitempty"`
	StartDateInMillis  int64  `json:"start_dateInMillis,omitempty"`
	Signature          string `json:"signature,omitempty"`
}

LicenseInfo describes a license.

type LicensePostParams

type LicensePostParams struct {
	Common      *CommonParams
	Acknowledge *bool
}

LicensePostParams are the query parameters for PUT /_license.

func (*LicensePostParams) ToMap

func (p *LicensePostParams) ToMap() map[string]string

ToMap converts LicensePostParams to a query-parameter map.

type LicenseService

type LicenseService interface {
	Get(ctx context.Context, params *LicenseGetParams) (*LicenseGetResponse, error)
	Delete(ctx context.Context) (*types.AcknowledgedResponse, error)
	Post(ctx context.Context, body any, params *LicensePostParams) (*types.AcknowledgedResponse, error)
	GetBasicStatus(ctx context.Context) (json.RawMessage, error)
	PostStartBasic(ctx context.Context, params *LicensePostParams) (json.RawMessage, error)
	GetTrialStatus(ctx context.Context) (json.RawMessage, error)
	PostStartTrial(ctx context.Context, params *LicenseStartTrialParams) (json.RawMessage, error)
}

LicenseService provides access to the license APIs.

func NewLicenseService

func NewLicenseService(client *resty.Client, logger *logrus.Entry) LicenseService

NewLicenseService creates a new LicenseService.

type LicenseStartTrialParams

type LicenseStartTrialParams struct {
	Common      *CommonParams
	Acknowledge *bool
	Type        string
}

LicenseStartTrialParams are the query parameters for start trial.

func (*LicenseStartTrialParams) ToMap

func (p *LicenseStartTrialParams) ToMap() map[string]string

ToMap converts LicenseStartTrialParams to a query-parameter map.

type LogstashService

type LogstashService interface {
	GetPipeline(ctx context.Context, ids []string) (map[string]map[string]any, error)
	PutPipeline(ctx context.Context, id string, body any) (*types.AcknowledgedResponse, error)
	DeletePipeline(ctx context.Context, id string) (*types.AcknowledgedResponse, error)
}

LogstashService provides access to the logstash APIs.

func NewLogstashService

func NewLogstashService(client *resty.Client, logger *logrus.Entry) LogstashService

NewLogstashService creates a new LogstashService.

type MgetParams

type MgetParams struct {
	Common               *CommonParams
	ForceSyntheticSource *bool
	Preference           string
	Realtime             *bool
	Refresh              *bool
	Routing              string
	Source               string
	SourceExcludes       []string
	SourceIncludes       []string
	StoredFields         []string
}

MgetParams are the query parameters for the mget endpoint.

func (*MgetParams) ToMap

func (p *MgetParams) ToMap() map[string]string

ToMap converts MgetParams to a query-parameter map.

type MgetRequest

type MgetRequest struct {
	Index  string
	Body   any `validate:"required"`
	Params *MgetParams
}

MgetRequest is the request for POST /_mget | /{index}/_mget.

func (*MgetRequest) Validate

func (r *MgetRequest) Validate() error

Validate validates the MgetRequest.

type MgetResponse

type MgetResponse struct {
	Docs []*GetResult `json:"docs,omitempty"`
}

MgetResponse represents the result of a multi-get request.

type MigrationDeprecationsResponse

type MigrationDeprecationsResponse struct {
	ClusterSettings []map[string]any            `json:"cluster_settings"`
	NodeSettings    []map[string]any            `json:"node_settings"`
	IndexSettings   map[string][]map[string]any `json:"index_settings"`
	MLSettings      []map[string]any            `json:"ml_settings"`
}

MigrationDeprecationsResponse is the response from deprecations.

type MigrationFeatureUpgradeStatusResponse

type MigrationFeatureUpgradeStatusResponse struct {
	Features []struct {
		FeatureName         string `json:"feature_name"`
		FeatureStatus       string `json:"feature_status"`
		MinimumIndexVersion int    `json:"minimum_index_version"`
		Indices             []struct {
			IndexName string `json:"index_name"`
		} `json:"indices"`
	} `json:"features"`
}

MigrationFeatureUpgradeStatusResponse is the response from feature_upgrade status.

type MigrationService

type MigrationService interface {
	Deprecations(ctx context.Context, index string) (*MigrationDeprecationsResponse, error)
	GetFeatureUpgradeStatus(ctx context.Context) (*MigrationFeatureUpgradeStatusResponse, error)
	PostFeatureUpgrade(ctx context.Context) (json.RawMessage, error)
}

MigrationService provides access to the migration APIs.

func NewMigrationService

func NewMigrationService(client *resty.Client, logger *logrus.Entry) MigrationService

NewMigrationService creates a new MigrationService.

type MlCloseJobParams

type MlCloseJobParams struct {
	Common       *CommonParams
	AllowNoMatch *bool
	Force        *bool
	Timeout      string
}

MlCloseJobParams are the query parameters for close job.

func (*MlCloseJobParams) ToMap

func (p *MlCloseJobParams) ToMap() map[string]string

ToMap converts MlCloseJobParams to a query-parameter map.

type MlCloseJobResponse

type MlCloseJobResponse struct {
	Closed bool `json:"closed"`
}

MlCloseJobResponse is the response from close job.

type MlDatafeedConfig

type MlDatafeedConfig struct {
	DatafeedId     string         `json:"datafeed_id,omitempty"`
	JobId          string         `json:"job_id,omitempty"`
	Indices        []string       `json:"indices,omitempty"`
	Query          map[string]any `json:"query,omitempty"`
	Frequency      *int           `json:"frequency,omitempty"`
	ChunkingConfig map[string]any `json:"chunking_config,omitempty"`
}

MlDatafeedConfig describes an ML datafeed configuration.

type MlDeleteDatafeedParams

type MlDeleteDatafeedParams struct {
	Common *CommonParams
	Force  *bool
}

MlDeleteDatafeedParams are the query parameters for delete datafeed.

func (*MlDeleteDatafeedParams) ToMap

func (p *MlDeleteDatafeedParams) ToMap() map[string]string

ToMap converts MlDeleteDatafeedParams to a query-parameter map.

type MlDeleteJobParams

type MlDeleteJobParams struct {
	Common            *CommonParams
	Force             *bool
	WaitForCompletion *bool
}

MlDeleteJobParams are the query parameters for delete job.

func (*MlDeleteJobParams) ToMap

func (p *MlDeleteJobParams) ToMap() map[string]string

ToMap converts MlDeleteJobParams to a query-parameter map.

type MlDeleteJobResponse

type MlDeleteJobResponse struct {
	Acknowledged bool `json:"acknowledged"`
}

MlDeleteJobResponse is the response from delete job.

type MlFilter

type MlFilter struct {
	FilterId    string   `json:"filter_id,omitempty"`
	Items       []string `json:"items,omitempty"`
	Description string   `json:"description,omitempty"`
}

MlFilter describes an ML filter.

type MlFlushJobParams

type MlFlushJobParams struct {
	Common      *CommonParams
	AdvanceTime string
	CalcInterim *bool
	End         string
	SkipTime    string
	Start       string
}

MlFlushJobParams are the query parameters for flush job.

func (*MlFlushJobParams) ToMap

func (p *MlFlushJobParams) ToMap() map[string]string

ToMap converts MlFlushJobParams to a query-parameter map.

type MlFlushJobResponse

type MlFlushJobResponse struct {
	Flushed bool   `json:"flushed"`
	Last    string `json:"last,omitempty"`
}

MlFlushJobResponse is the response from flush job.

type MlGetDatafeedsParams

type MlGetDatafeedsParams struct {
	Common           *CommonParams
	AllowNoMatch     *bool
	ExcludeGenerated *bool
}

MlGetDatafeedsParams are the query parameters for get datafeeds.

func (*MlGetDatafeedsParams) ToMap

func (p *MlGetDatafeedsParams) ToMap() map[string]string

ToMap converts MlGetDatafeedsParams to a query-parameter map.

type MlGetDatafeedsResponse

type MlGetDatafeedsResponse struct {
	Count     int                `json:"count"`
	Datafeeds []MlDatafeedConfig `json:"datafeeds"`
}

MlGetDatafeedsResponse is the response from get datafeeds.

type MlGetFiltersParams

type MlGetFiltersParams struct {
	Common *CommonParams
	From   *int
	Size   *int
}

MlGetFiltersParams are the query parameters for get filters.

func (*MlGetFiltersParams) ToMap

func (p *MlGetFiltersParams) ToMap() map[string]string

ToMap converts MlGetFiltersParams to a query-parameter map.

type MlGetFiltersResponse

type MlGetFiltersResponse struct {
	Count   int        `json:"count"`
	Filters []MlFilter `json:"filters"`
}

MlGetFiltersResponse is the response from get filters.

type MlGetJobsParams

type MlGetJobsParams struct {
	Common           *CommonParams
	AllowNoMatch     *bool
	ExcludeGenerated *bool
}

MlGetJobsParams are the query parameters for get jobs.

func (*MlGetJobsParams) ToMap

func (p *MlGetJobsParams) ToMap() map[string]string

ToMap converts MlGetJobsParams to a query-parameter map.

type MlGetJobsResponse

type MlGetJobsResponse struct {
	Count int           `json:"count"`
	Jobs  []MlJobConfig `json:"jobs"`
}

MlGetJobsResponse is the response from get jobs.

type MlGetTrainedModelsParams

type MlGetTrainedModelsParams struct {
	Common               *CommonParams
	AllowNoMatch         *bool
	DecompressDefinition *bool
	ExcludeGenerated     *bool
	From                 *int
	Include              string
	Size                 *int
	Tags                 []string
}

MlGetTrainedModelsParams are the query parameters for get trained models.

func (*MlGetTrainedModelsParams) ToMap

func (p *MlGetTrainedModelsParams) ToMap() map[string]string

ToMap converts MlGetTrainedModelsParams to a query-parameter map.

type MlGetTrainedModelsResponse

type MlGetTrainedModelsResponse struct {
	Count         int                    `json:"count"`
	TrainedModels []MlTrainedModelConfig `json:"trained_model_configs"`
}

MlGetTrainedModelsResponse is the response from get trained models.

type MlInferTrainedModelParams

type MlInferTrainedModelParams struct {
	Common  *CommonParams
	Timeout string
}

MlInferTrainedModelParams are the query parameters for infer trained model.

func (*MlInferTrainedModelParams) ToMap

func (p *MlInferTrainedModelParams) ToMap() map[string]string

ToMap converts MlInferTrainedModelParams to a query-parameter map.

type MlJobConfig

type MlJobConfig struct {
	JobId                      string         `json:"job_id,omitempty"`
	Description                string         `json:"description,omitempty"`
	AnalysisConfig             map[string]any `json:"analysis_config,omitempty"`
	DataDescription            map[string]any `json:"data_description,omitempty"`
	AnalysisLimits             map[string]any `json:"analysis_limits,omitempty"`
	ModelSnapshotRetentionDays *int           `json:"model_snapshot_retention_days,omitempty"`
	ResultsRetentionDays       *int           `json:"results_retention_days,omitempty"`
	CustomSettings             map[string]any `json:"custom_settings,omitempty"`
	AllowLazyOpen              *bool          `json:"allow_lazy_open,omitempty"`
	MaxModelMemory             string         `json:"max_model_memory,omitempty"`
}

MlJobConfig describes an ML job configuration.

type MlOpenJobParams

type MlOpenJobParams struct {
	Common  *CommonParams
	Timeout string
}

MlOpenJobParams are the query parameters for open job.

func (*MlOpenJobParams) ToMap

func (p *MlOpenJobParams) ToMap() map[string]string

ToMap converts MlOpenJobParams to a query-parameter map.

type MlOpenJobResponse

type MlOpenJobResponse struct {
	Opened bool `json:"opened"`
}

MlOpenJobResponse is the response from open job.

type MlResetJobParams

type MlResetJobParams struct {
	Common            *CommonParams
	WaitForCompletion *bool
}

MlResetJobParams are the query parameters for reset job.

func (*MlResetJobParams) ToMap

func (p *MlResetJobParams) ToMap() map[string]string

ToMap converts MlResetJobParams to a query-parameter map.

type MlService

type MlService interface {
	// Jobs
	PutJob(ctx context.Context, jobId string, body any) (*MlJobConfig, error)
	GetJobs(ctx context.Context, jobIds []string, params *MlGetJobsParams) (*MlGetJobsResponse, error)
	DeleteJob(ctx context.Context, jobId string, params *MlDeleteJobParams) (*MlDeleteJobResponse, error)
	OpenJob(ctx context.Context, jobId string, params *MlOpenJobParams) (*MlOpenJobResponse, error)
	CloseJob(ctx context.Context, jobId string, params *MlCloseJobParams) (*MlCloseJobResponse, error)
	ResetJob(ctx context.Context, jobId string, params *MlResetJobParams) (*types.AcknowledgedResponse, error)
	FlushJob(ctx context.Context, jobId string, body any, params *MlFlushJobParams) (*MlFlushJobResponse, error)
	// Datafeeds
	PutDatafeed(ctx context.Context, datafeedId string, body any) (*MlDatafeedConfig, error)
	GetDatafeeds(ctx context.Context, datafeedIds []string, params *MlGetDatafeedsParams) (*MlGetDatafeedsResponse, error)
	DeleteDatafeed(ctx context.Context, datafeedId string, params *MlDeleteDatafeedParams) (*types.AcknowledgedResponse, error)
	StartDatafeed(ctx context.Context, datafeedId string, body any, params *MlStartDatafeedParams) (*MlStartDatafeedResponse, error)
	StopDatafeed(ctx context.Context, datafeedId string, params *MlStopDatafeedParams) (*MlStopDatafeedResponse, error)
	// Info
	GetFilters(ctx context.Context, filterId string, params *MlGetFiltersParams) (*MlGetFiltersResponse, error)
	// Trained models
	GetTrainedModels(ctx context.Context, modelIds []string, params *MlGetTrainedModelsParams) (*MlGetTrainedModelsResponse, error)
	InferTrainedModel(ctx context.Context, modelId string, body any, params *MlInferTrainedModelParams) (json.RawMessage, error)
}

MlService provides access to the machine learning APIs. The ML surface is large; this implementation covers the core job, datafeed, calendar, filter, data-frame-analytics, and trained-model endpoints. Bodies are passed as `any` and serialized by resty.

func NewMlService

func NewMlService(client *resty.Client, logger *logrus.Entry) MlService

NewMlService creates a new MlService.

type MlStartDatafeedParams

type MlStartDatafeedParams struct {
	Common  *CommonParams
	End     string
	Start   string
	Timeout string
}

MlStartDatafeedParams are the query parameters for start datafeed.

func (*MlStartDatafeedParams) ToMap

func (p *MlStartDatafeedParams) ToMap() map[string]string

ToMap converts MlStartDatafeedParams to a query-parameter map.

type MlStartDatafeedResponse

type MlStartDatafeedResponse struct {
	Started bool `json:"started"`
}

MlStartDatafeedResponse is the response from start datafeed.

type MlStopDatafeedParams

type MlStopDatafeedParams struct {
	Common       *CommonParams
	AllowNoMatch *bool
	Force        *bool
	Timeout      string
}

MlStopDatafeedParams are the query parameters for stop datafeed.

func (*MlStopDatafeedParams) ToMap

func (p *MlStopDatafeedParams) ToMap() map[string]string

ToMap converts MlStopDatafeedParams to a query-parameter map.

type MlStopDatafeedResponse

type MlStopDatafeedResponse struct {
	Stopped bool `json:"stopped"`
}

MlStopDatafeedResponse is the response from stop datafeed.

type MlTrainedModelConfig

type MlTrainedModelConfig struct {
	ModelId    string         `json:"model_id,omitempty"`
	Type       string         `json:"type,omitempty"`
	Input      map[string]any `json:"input,omitempty"`
	Definition map[string]any `json:"definition,omitempty"`
}

MlTrainedModelConfig describes a trained model.

type ModifyDataStreamAction

type ModifyDataStreamAction struct {
	Type       string `validate:"required,oneof=add_backing_index remove_backing_index"`
	DataStream string `validate:"required"`
	Index      string `validate:"required"`
}

ModifyDataStreamAction describes a single add/remove backing-index action.

type ModifyDataStreamParams

type ModifyDataStreamParams struct {
	Common  *CommonParams
	Timeout string
}

ModifyDataStreamParams are the query parameters for modify_data_stream.

func (*ModifyDataStreamParams) ToMap

func (p *ModifyDataStreamParams) ToMap() map[string]string

ToMap converts ModifyDataStreamParams to a query-parameter map.

type ModifyDataStreamRequest

type ModifyDataStreamRequest struct {
	Actions []*ModifyDataStreamAction `validate:"required,min=1,dive"`
	Params  *ModifyDataStreamParams
}

ModifyDataStreamRequest is the request for POST /_data_stream/_modify.

func (*ModifyDataStreamRequest) Validate

func (r *ModifyDataStreamRequest) Validate() error

Validate validates the ModifyDataStreamRequest.

type MtermvectorsParams

type MtermvectorsParams = TermVectorsParams

MtermvectorsParams are the query parameters for the mtermvectors endpoint.

type MtermvectorsRequest

type MtermvectorsRequest struct {
	Index  string
	Body   any
	Params *MtermvectorsParams
}

MtermvectorsRequest is the request for GET|POST /_mtermvectors.

type MultiSearchParams

type MultiSearchParams struct {
	Common                     *CommonParams
	CcsMinimizeRoundtrips      *bool
	MaxConcurrentSearches      *int
	MaxConcurrentShardRequests *int
	PreFilterShardSize         *int
	RestTotalHitsAsInt         *bool
	SearchType                 SearchType
	TypedKeys                  *bool
}

MultiSearchParams are the query parameters for the msearch endpoint.

func (*MultiSearchParams) ToMap

func (p *MultiSearchParams) ToMap() map[string]string

ToMap converts MultiSearchParams to a query-parameter map.

type MultiSearchRequest

type MultiSearchRequest struct {
	Indices []string
	Body    string `validate:"required"`
	Params  *MultiSearchParams
}

MultiSearchRequest is the request for GET|POST /_msearch (NDJSON body).

func (*MultiSearchRequest) Validate

func (r *MultiSearchRequest) Validate() error

Validate validates the MultiSearchRequest.

type MultiSearchTemplateParams

type MultiSearchTemplateParams struct {
	Common                *CommonParams
	CcsMinimizeRoundtrips *bool
	MaxConcurrentSearches *int
	RestTotalHitsAsInt    *bool
	SearchType            SearchType
	TypedKeys             *bool
}

MultiSearchTemplateParams are the query parameters for msearch_template.

func (*MultiSearchTemplateParams) ToMap

func (p *MultiSearchTemplateParams) ToMap() map[string]string

ToMap converts MultiSearchTemplateParams to a query-parameter map.

type MultiSearchTemplateRequest

type MultiSearchTemplateRequest struct {
	Indices []string
	Body    string `validate:"required"`
	Params  *MultiSearchTemplateParams
}

MultiSearchTemplateRequest is the request for the msearch_template endpoint.

func (*MultiSearchTemplateRequest) Validate

func (r *MultiSearchTemplateRequest) Validate() error

Validate validates the MultiSearchTemplateRequest.

type MultiTermvectorResponse

type MultiTermvectorResponse struct {
	Docs []*TermvectorsResponse `json:"docs"`
}

MultiTermvectorResponse represents the result of a multi-term-vectors request.

type NodeInfo

type NodeInfo struct {
	Name             string            `json:"name"`
	TransportAddress string            `json:"transport_address"`
	Host             string            `json:"host"`
	IP               string            `json:"ip"`
	Version          string            `json:"version"`
	BuildHash        string            `json:"build_hash"`
	BuildType        string            `json:"build_type"`
	BuildDate        string            `json:"build_date"`
	Roles            []string          `json:"roles"`
	Attributes       map[string]string `json:"attributes,omitempty"`
	Settings         map[string]any    `json:"settings,omitempty"`
	OS               map[string]any    `json:"os,omitempty"`
	Process          map[string]any    `json:"process,omitempty"`
	JVM              map[string]any    `json:"jvm,omitempty"`
	ThreadPool       map[string]any    `json:"thread_pool,omitempty"`
	Transport        map[string]any    `json:"transport,omitempty"`
	HTTP             map[string]any    `json:"http,omitempty"`
	Plugins          []PluginInfo      `json:"plugins,omitempty"`
	Modules          []PluginInfo      `json:"modules,omitempty"`
	Ingest           map[string]any    `json:"ingest,omitempty"`
	Aggregations     map[string]any    `json:"aggregations,omitempty"`
}

NodeInfo describes a node.

type NodeStats

type NodeStats struct {
	Timestamp         int64             `json:"timestamp"`
	Name              string            `json:"name"`
	TransportAddress  string            `json:"transport_address"`
	Host              string            `json:"host"`
	IP                string            `json:"ip"`
	Roles             []string          `json:"roles"`
	Attributes        map[string]string `json:"attributes,omitempty"`
	Indices           map[string]any    `json:"indices,omitempty"`
	OS                map[string]any    `json:"os,omitempty"`
	Process           map[string]any    `json:"process,omitempty"`
	JVM               map[string]any    `json:"jvm,omitempty"`
	ThreadPool        map[string]any    `json:"thread_pool,omitempty"`
	FS                map[string]any    `json:"fs,omitempty"`
	Transport         map[string]any    `json:"transport,omitempty"`
	HTTP              map[string]any    `json:"http,omitempty"`
	Breakers          map[string]any    `json:"breakers,omitempty"`
	Script            map[string]any    `json:"script,omitempty"`
	Discovery         map[string]any    `json:"discovery,omitempty"`
	Ingest            map[string]any    `json:"ingest,omitempty"`
	AdaptiveSelection map[string]any    `json:"adaptive_selection,omitempty"`
	IndexingPressure  map[string]any    `json:"indexing_pressure,omitempty"`
}

NodeStats describes per-node stats.

type NodesHotThreadsParams

type NodesHotThreadsParams struct {
	Common            *CommonParams
	IgnoreIdleThreads *bool
	Interval          string
	Snapshots         *int
	Sort              string
	Threads           *int
	Timeout           string
	Type              string
}

NodesHotThreadsParams are the query parameters for hot_threads.

func (*NodesHotThreadsParams) ToMap

func (p *NodesHotThreadsParams) ToMap() map[string]string

ToMap converts NodesHotThreadsParams to a query-parameter map.

type NodesInfoParams

type NodesInfoParams struct {
	Common       *CommonParams
	FlatSettings *bool
	Timeout      string
}

NodesInfoParams are the query parameters for nodes.info.

func (*NodesInfoParams) ToMap

func (p *NodesInfoParams) ToMap() map[string]string

ToMap converts NodesInfoParams to a query-parameter map.

type NodesInfoRequest

type NodesInfoRequest struct {
	NodeIds []string
	Metrics []string
	Params  *NodesInfoParams
}

NodesInfoRequest is the request for GET /_nodes.

type NodesInfoResponse

type NodesInfoResponse struct {
	ClusterName string              `json:"cluster_name"`
	Nodes       map[string]NodeInfo `json:"nodes"`
}

NodesInfoResponse is the response from GET /_nodes.

type NodesReloadSecureSettingsParams

type NodesReloadSecureSettingsParams struct {
	Common  *CommonParams
	Timeout string
}

NodesReloadSecureSettingsParams are the query parameters for reload_secure_settings.

func (*NodesReloadSecureSettingsParams) ToMap

ToMap converts NodesReloadSecureSettingsParams to a query-parameter map.

type NodesReloadSecureSettingsResponse

type NodesReloadSecureSettingsResponse struct {
	ClusterName string                       `json:"cluster_name"`
	Nodes       map[string]any               `json:"nodes"`
	Failures    []*types.FailedNodeException `json:"failures,omitempty"`
}

NodesReloadSecureSettingsResponse is the response from reload_secure_settings.

type NodesService

type NodesService interface {
	Info(ctx context.Context, req *NodesInfoRequest) (*NodesInfoResponse, error)
	Stats(ctx context.Context, req *NodesStatsRequest) (*NodesStatsResponse, error)
	Usage(ctx context.Context, req *NodesUsageRequest) (*NodesUsageResponse, error)
	HotThreads(ctx context.Context, nodeIds []string, params *NodesHotThreadsParams) (string, error)
	ReloadSecureSettings(ctx context.Context, nodeIds []string, body any, params *NodesReloadSecureSettingsParams) (*NodesReloadSecureSettingsResponse, error)
}

NodesService provides access to the nodes APIs.

func NewNodesService

func NewNodesService(client *resty.Client, logger *logrus.Entry) NodesService

NewNodesService creates a new NodesService.

type NodesStatsParams

type NodesStatsParams struct {
	Common                  *CommonParams
	CompletionFields        []string
	FielddataFields         []string
	Fields                  []string
	Groups                  []string
	IncludeSegmentFileSizes *bool
	Level                   Level
	Timeout                 string
	Types                   []string
}

NodesStatsParams are the query parameters for nodes.stats.

func (*NodesStatsParams) ToMap

func (p *NodesStatsParams) ToMap() map[string]string

ToMap converts NodesStatsParams to a query-parameter map.

type NodesStatsRequest

type NodesStatsRequest struct {
	NodeIds      []string
	Metrics      []string
	IndexMetrics []string
	Params       *NodesStatsParams
}

NodesStatsRequest is the request for GET /_nodes/stats.

type NodesStatsResponse

type NodesStatsResponse struct {
	ClusterName string               `json:"cluster_name"`
	Nodes       map[string]NodeStats `json:"nodes"`
}

NodesStatsResponse is the response from GET /_nodes/stats.

type NodesUsageParams

type NodesUsageParams struct {
	Common  *CommonParams
	Timeout string
}

NodesUsageParams are the query parameters for nodes.usage.

func (*NodesUsageParams) ToMap

func (p *NodesUsageParams) ToMap() map[string]string

ToMap converts NodesUsageParams to a query-parameter map.

type NodesUsageRequest

type NodesUsageRequest struct {
	NodeIds []string
	Metrics []string
	Params  *NodesUsageParams
}

NodesUsageRequest is the request for GET /_nodes/usage.

type NodesUsageResponse

type NodesUsageResponse struct {
	ClusterName string `json:"cluster_name"`
	Nodes       map[string]struct {
		Timestamp   int64          `json:"timestamp"`
		Since       int64          `json:"since"`
		RestActions map[string]int `json:"rest_actions"`
	} `json:"nodes"`
}

NodesUsageResponse is the response from GET /_nodes/usage.

type OpType

type OpType string

OpType controls the operation type for index/create operations.

const (
	OpTypeIndex  OpType = "index"
	OpTypeCreate OpType = "create"
)

type OpenPITParams

type OpenPITParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
	KeepAlive         string `validate:"required"`
	Preference        string
	Routing           string
}

OpenPITParams are the query parameters for the open_point_in_time endpoint.

func (*OpenPITParams) ToMap

func (p *OpenPITParams) ToMap() map[string]string

ToMap converts OpenPITParams to a query-parameter map.

type OpenPITRequest

type OpenPITRequest struct {
	Indices []string `validate:"required,min=1"`
	Params  *OpenPITParams
}

OpenPITRequest is the request for POST /{index}/_pit.

func (*OpenPITRequest) Validate

func (r *OpenPITRequest) Validate() error

Validate validates the OpenPITRequest.

type OpenPITResponse

type OpenPITResponse struct {
	Id string `json:"id"`
}

OpenPITResponse is the response from POST /{index}/_pit.

type PluginInfo

type PluginInfo struct {
	Name                 string   `json:"name"`
	Version              string   `json:"version"`
	ElasticsearchVersion string   `json:"elasticsearch_version"`
	JavaVersion          string   `json:"java_version,omitempty"`
	Description          string   `json:"description"`
	Classname            string   `json:"classname,omitempty"`
	ExtendedPlugins      []string `json:"extended_plugins,omitempty"`
	HasNativeController  bool     `json:"has_native_controller"`
}

PluginInfo describes an installed plugin or module.

type PutAliasRequest

type PutAliasRequest struct {
	Index  string `validate:"required"`
	Alias  string `validate:"required"`
	Body   any
	Params *AliasParams
}

PutAliasRequest is the request for PUT|POST /{index}/_alias/{name}.

func (*PutAliasRequest) Validate

func (r *PutAliasRequest) Validate() error

Validate validates the PutAliasRequest.

type PutComponentTemplateParams

type PutComponentTemplateParams struct {
	Common  *CommonParams
	Cause   string
	Create  *bool
	Timeout string
}

PutComponentTemplateParams are the query parameters for put component template.

func (*PutComponentTemplateParams) ToMap

func (p *PutComponentTemplateParams) ToMap() map[string]string

ToMap converts PutComponentTemplateParams to a query-parameter map.

type PutComponentTemplateRequest

type PutComponentTemplateRequest struct {
	Name   string `validate:"required"`
	Body   any    `validate:"required"`
	Params *PutComponentTemplateParams
}

PutComponentTemplateRequest is the request for PUT /_component_template/{name}.

func (*PutComponentTemplateRequest) Validate

func (r *PutComponentTemplateRequest) Validate() error

Validate validates the PutComponentTemplateRequest.

type PutIndexTemplateParams

type PutIndexTemplateParams struct {
	Common *CommonParams
	Cause  string
	Create *bool
}

PutIndexTemplateParams are the query parameters for put_index_template.

func (*PutIndexTemplateParams) ToMap

func (p *PutIndexTemplateParams) ToMap() map[string]string

ToMap converts PutIndexTemplateParams to a query-parameter map.

type PutIndexTemplateRequest

type PutIndexTemplateRequest struct {
	Name   string `validate:"required"`
	Body   any    `validate:"required"`
	Params *PutIndexTemplateParams
}

PutIndexTemplateRequest is the request for PUT /_index_template/{name}.

func (*PutIndexTemplateRequest) Validate

func (r *PutIndexTemplateRequest) Validate() error

Validate validates the PutIndexTemplateRequest.

type PutMappingParams

type PutMappingParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
	Timeout           string
	WriteIndexOnly    *bool
}

PutMappingParams are the query parameters for put_mapping.

func (*PutMappingParams) ToMap

func (p *PutMappingParams) ToMap() map[string]string

ToMap converts PutMappingParams to a query-parameter map.

type PutMappingRequest

type PutMappingRequest struct {
	Indices []string `validate:"required,min=1"`
	Body    any      `validate:"required"`
	Params  *PutMappingParams
}

PutMappingRequest is the request for PUT /{index}/_mapping.

func (*PutMappingRequest) Validate

func (r *PutMappingRequest) Validate() error

Validate validates the PutMappingRequest.

type PutTemplateParams

type PutTemplateParams struct {
	Common       *CommonParams
	Create       *bool
	FlatSettings *bool
	Order        *int
	Timeout      string
}

PutTemplateParams are the query parameters for the legacy put_template.

func (*PutTemplateParams) ToMap

func (p *PutTemplateParams) ToMap() map[string]string

ToMap converts PutTemplateParams to a query-parameter map.

type PutTemplateRequest

type PutTemplateRequest struct {
	Name   string `validate:"required"`
	Body   any    `validate:"required"`
	Params *PutTemplateParams
}

PutTemplateRequest is the request for the legacy PUT /_template/{name}.

func (*PutTemplateRequest) Validate

func (r *PutTemplateRequest) Validate() error

Validate validates the PutTemplateRequest.

type QueryRulesListParams

type QueryRulesListParams struct {
	Common *CommonParams
	From   *int
	Size   *int
}

QueryRulesListParams are the query parameters for list rulesets.

func (*QueryRulesListParams) ToMap

func (p *QueryRulesListParams) ToMap() map[string]string

ToMap converts QueryRulesListParams to a query-parameter map.

type QueryRulesService

type QueryRulesService interface {
	ListRulesets(ctx context.Context, params *QueryRulesListParams) (json.RawMessage, error)
	GetRuleset(ctx context.Context, rulesetId string) (json.RawMessage, error)
	PutRuleset(ctx context.Context, rulesetId string, body any) (*types.AcknowledgedResponse, error)
	DeleteRuleset(ctx context.Context, rulesetId string) (*types.AcknowledgedResponse, error)
	Test(ctx context.Context, rulesetId string, body any, params *QueryRulesTestParams) (json.RawMessage, error)
}

QueryRulesService provides access to the query rules APIs.

func NewQueryRulesService

func NewQueryRulesService(client *resty.Client, logger *logrus.Entry) QueryRulesService

NewQueryRulesService creates a new QueryRulesService.

type QueryRulesTestParams

type QueryRulesTestParams struct {
	Common      *CommonParams
	QueryText   string
	QueryParams []string
}

QueryRulesTestParams are the query parameters for test ruleset.

func (*QueryRulesTestParams) ToMap

func (p *QueryRulesTestParams) ToMap() map[string]string

ToMap converts QueryRulesTestParams to a query-parameter map.

type RankEvalParams

type RankEvalParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
	SearchType        SearchType
}

RankEvalParams are the query parameters for the rank_eval endpoint.

func (*RankEvalParams) ToMap

func (p *RankEvalParams) ToMap() map[string]string

ToMap converts RankEvalParams to a query-parameter map.

type RankEvalRequest

type RankEvalRequest struct {
	Indices []string
	Body    any `validate:"required"`
	Params  *RankEvalParams
}

RankEvalRequest is the request for POST /_rank_eval.

func (*RankEvalRequest) Validate

func (r *RankEvalRequest) Validate() error

Validate validates the RankEvalRequest.

type RecoveryNode

type RecoveryNode struct {
	Host             string `json:"host"`
	TransportAddress string `json:"transport_address"`
	Name             string `json:"name"`
}

RecoveryNode identifies a recovery source/target node.

type Refresh

type Refresh string

Refresh controls when changes become visible to search. Valid values: RefreshTrue, RefreshFalse, RefreshWaitFor.

const (
	RefreshTrue    Refresh = "true"
	RefreshFalse   Refresh = "false"
	RefreshWaitFor Refresh = "wait_for"
)

type RefreshResult

type RefreshResult struct {
	Shards *types.ShardsInfo `json:"_shards,omitempty"`
}

RefreshResult is the response from POST /_refresh.

type ReindexParams

type ReindexParams struct {
	Common              *CommonParams
	MaxDocs             *int
	Refresh             *bool
	RequestsPerSecond   *float64
	RequireAlias        *bool
	Scroll              string
	Slices              string
	Timeout             string
	WaitForActiveShards string
	WaitForCompletion   *bool
}

ReindexParams are the query parameters for reindex.

func (*ReindexParams) ToMap

func (p *ReindexParams) ToMap() map[string]string

ToMap converts ReindexParams to a query-parameter map.

type ReindexRequest

type ReindexRequest struct {
	Body   any
	Params *ReindexParams
}

ReindexRequest is the request for POST /_reindex.

type ReloadDetails

type ReloadDetails struct {
	Index             string   `json:"index"`
	Node              string   `json:"node"`
	ReloadedAnalyzers []string `json:"reloaded_analyzers"`
}

ReloadDetails describes per-node analyzer reload results.

type RenderSearchTemplateRequest

type RenderSearchTemplateRequest struct {
	Id   string
	Body any
}

RenderSearchTemplateRequest is the request for POST /_render/template.

type ResolveAliasInfo

type ResolveAliasInfo struct {
	Name    string   `json:"name"`
	Indices []string `json:"indices"`
}

ResolveAliasInfo describes a resolved alias.

type ResolveClusterInfo

type ResolveClusterInfo struct {
	Connected          bool     `json:"connected"`
	Mode               string   `json:"mode"`
	Seeds              []string `json:"seeds"`
	SkipUnavailable    bool     `json:"skip_unavailable"`
	ClusterCredentials string   `json:"cluster_credentials,omitempty"`
}

ResolveClusterInfo describes a remote cluster.

type ResolveDataStreamInfo

type ResolveDataStreamInfo struct {
	Name           string   `json:"name"`
	BackingIndices []string `json:"backing_indices"`
	Aliases        []string `json:"aliases,omitempty"`
}

ResolveDataStreamInfo describes a resolved data stream.

type ResolveIndexInfo

type ResolveIndexInfo struct {
	Name       string   `json:"name"`
	Attributes []string `json:"attributes,omitempty"`
	Aliases    []string `json:"aliases,omitempty"`
}

ResolveIndexInfo describes a resolved index.

type RethrottleParams

type RethrottleParams struct {
	Common            *CommonParams
	RequestsPerSecond *float64
}

RethrottleParams are the query parameters for rethrottle endpoints.

func (*RethrottleParams) ToMap

func (p *RethrottleParams) ToMap() map[string]string

ToMap converts RethrottleParams to a query-parameter map.

type RethrottleRequest

type RethrottleRequest struct {
	TaskId            string `validate:"required"`
	RequestsPerSecond float64
	Params            *RethrottleParams
}

RethrottleRequest is the request for the *_rethrottle endpoints.

func (*RethrottleRequest) Validate

func (r *RethrottleRequest) Validate() error

Validate validates the RethrottleRequest.

type RolloverParams

type RolloverParams struct {
	Common              *CommonParams
	DryRun              *bool
	Timeout             string
	WaitForActiveShards string
}

RolloverParams are the query parameters for the rollover endpoint.

func (*RolloverParams) ToMap

func (p *RolloverParams) ToMap() map[string]string

ToMap converts RolloverParams to a query-parameter map.

type RolloverRequest

type RolloverRequest struct {
	Alias    string `validate:"required"`
	NewIndex string
	Body     any
	Params   *RolloverParams
}

RolloverRequest is the request for POST /{alias}/_rollover.

func (*RolloverRequest) Validate

func (r *RolloverRequest) Validate() error

Validate validates the RolloverRequest.

type Script

type Script struct {
	Lang    string         `json:"lang,omitempty"`
	Source  string         `json:"source,omitempty"`
	Options map[string]any `json:"options,omitempty"`
}

Script is the stored script body.

type ScriptContextInfo

type ScriptContextInfo struct {
	Context string                `json:"context"`
	Methods []ScriptContextMethod `json:"methods"`
}

ScriptContextInfo describes a script context.

type ScriptContextMethod

type ScriptContextMethod struct {
	Name   string   `json:"name"`
	Params []string `json:"params"`
}

ScriptContextMethod describes a method available in a script context.

type ScriptContextResponse

type ScriptContextResponse struct {
	Contexts []ScriptContextInfo `json:"contexts"`
}

ScriptContextResponse is the response from GET /_script_context.

type ScriptDeleteParams

type ScriptDeleteParams struct {
	Common  *CommonParams
	Timeout string
}

ScriptDeleteParams are the query parameters for DELETE /_scripts/{id}.

func (*ScriptDeleteParams) ToMap

func (p *ScriptDeleteParams) ToMap() map[string]string

ToMap converts ScriptDeleteParams to a query-parameter map.

type ScriptGetParams

type ScriptGetParams struct {
	Common  *CommonParams
	Timeout string
}

ScriptGetParams are the query parameters for GET /_scripts/{id}.

func (*ScriptGetParams) ToMap

func (p *ScriptGetParams) ToMap() map[string]string

ToMap converts ScriptGetParams to a query-parameter map.

type ScriptGetResponse

type ScriptGetResponse struct {
	Id     string  `json:"_id,omitempty"`
	Found  bool    `json:"found"`
	Script *Script `json:"script,omitempty"`
}

ScriptGetResponse is the response from GET /_scripts/{id}.

type ScriptLanguageContext

type ScriptLanguageContext struct {
	Language string   `json:"language"`
	Contexts []string `json:"contexts"`
}

ScriptLanguageContext describes a language and its contexts.

type ScriptLanguagesResponse

type ScriptLanguagesResponse struct {
	TypesAllowed     []string                `json:"types_allowed"`
	LanguageContexts []ScriptLanguageContext `json:"language_contexts"`
}

ScriptLanguagesResponse is the response from GET /_script_language.

type ScriptPutParams

type ScriptPutParams struct {
	Common  *CommonParams
	Context string
	Timeout string
}

ScriptPutParams are the query parameters for PUT /_scripts/{id}.

func (*ScriptPutParams) ToMap

func (p *ScriptPutParams) ToMap() map[string]string

ToMap converts ScriptPutParams to a query-parameter map.

type ScriptPutRequest

type ScriptPutRequest struct {
	Id     string `validate:"required"`
	Body   any    `validate:"required"`
	Params *ScriptPutParams
}

ScriptPutRequest is the request for PUT|POST /_scripts/{id}.

func (*ScriptPutRequest) Validate

func (r *ScriptPutRequest) Validate() error

Validate validates the ScriptPutRequest.

type ScriptService

ScriptService provides access to the stored script APIs.

func NewScriptService

func NewScriptService(client *resty.Client, logger *logrus.Entry) ScriptService

NewScriptService creates a new ScriptService.

type ScrollParams

type ScrollParams struct {
	Common             *CommonParams
	Scroll             string
	ScrollId           string
	RestTotalHitsAsInt *bool
}

ScrollParams are the query parameters for the scroll endpoint.

func (*ScrollParams) ToMap

func (p *ScrollParams) ToMap() map[string]string

ToMap converts ScrollParams to a query-parameter map.

type ScrollRequest

type ScrollRequest struct {
	ScrollId string
	Scroll   string
	Params   *ScrollParams
}

ScrollRequest is the request for GET|POST /_search/scroll.

type SearchApplicationListParams

type SearchApplicationListParams struct {
	Common *CommonParams
	From   *int
	Size   *int
}

SearchApplicationListParams are the query parameters for list.

func (*SearchApplicationListParams) ToMap

func (p *SearchApplicationListParams) ToMap() map[string]string

ToMap converts SearchApplicationListParams to a query-parameter map.

type SearchApplicationPutParams

type SearchApplicationPutParams struct {
	Common *CommonParams
	Create *bool
}

SearchApplicationPutParams are the query parameters for put.

func (*SearchApplicationPutParams) ToMap

func (p *SearchApplicationPutParams) ToMap() map[string]string

ToMap converts SearchApplicationPutParams to a query-parameter map.

type SearchApplicationService

type SearchApplicationService interface {
	List(ctx context.Context, params *SearchApplicationListParams) (json.RawMessage, error)
	Get(ctx context.Context, name string) (json.RawMessage, error)
	Put(ctx context.Context, name string, body any, params *SearchApplicationPutParams) (*types.AcknowledgedResponse, error)
	Delete(ctx context.Context, name string) (*types.AcknowledgedResponse, error)
	Search(ctx context.Context, name string, body any) (*querydsl.SearchResult, error)
	GetBehavioralAnalytics(ctx context.Context, name string) (json.RawMessage, error)
	PutBehavioralAnalytics(ctx context.Context, name string, body any) (*types.AcknowledgedResponse, error)
	DeleteBehavioralAnalytics(ctx context.Context, name string) (*types.AcknowledgedResponse, error)
}

SearchApplicationService provides access to the search application APIs.

func NewSearchApplicationService

func NewSearchApplicationService(client *resty.Client, logger *logrus.Entry) SearchApplicationService

NewSearchApplicationService creates a new SearchApplicationService.

type SearchMVTParams

type SearchMVTParams struct {
	Common         *CommonParams
	ExactBounds    *bool
	Extent         *int
	GridAgg        string
	GridPrecision  *int
	GridType       string
	Size           *int
	TrackTotalHits string
	WithLabels     *bool
}

SearchMVTParams are the query parameters for the search_mvt endpoint.

func (*SearchMVTParams) ToMap

func (p *SearchMVTParams) ToMap() map[string]string

ToMap converts SearchMVTParams to a query-parameter map.

type SearchMVTRequest

type SearchMVTRequest struct {
	Index  string `validate:"required"`
	Field  string `validate:"required"`
	Zoom   *int   `validate:"required"`
	X      *int   `validate:"required"`
	Y      *int   `validate:"required"`
	Body   any
	Params *SearchMVTParams
}

SearchMVTRequest is the request for GET /{index}/_mvt/{field}/{zoom}/{x}/{y}. Zoom, X and Y are pointers because 0 is a valid tile coordinate/zoom level and required-ness must be distinguishable from the zero value.

func (*SearchMVTRequest) Validate

func (r *SearchMVTRequest) Validate() error

Validate validates the SearchMVTRequest.

type SearchParams

type SearchParams struct {
	Common                     *CommonParams
	AllowNoIndices             *bool
	AllowPartialSearchResults  *bool
	Analyzer                   string
	AnalyzeWildcard            *bool
	BatchedReduceSize          *int
	CcsMinimizeRoundtrips      *bool
	DefaultOperator            DefaultOperator
	Df                         string
	DocvalueFields             []string
	ExpandWildcards            ExpandWildcards
	Explain                    *bool
	From                       *int
	IgnoreThrottled            *bool
	IgnoreUnavailable          *bool
	Lenient                    *bool
	MaxConcurrentShardRequests *int
	MinCompatibleShardNode     string
	PreFilterShardSize         *int
	Preference                 string
	Q                          string
	RequestCache               *bool
	RestTotalHitsAsInt         *bool
	Routing                    string
	Scroll                     string
	SearchType                 SearchType
	SeqNoPrimaryTerm           *bool
	Size                       *int
	Sort                       []string
	Source                     string
	SourceExcludes             []string
	SourceIncludes             []string
	Stats                      []string
	StoredFields               []string
	SuggestField               string
	SuggestMode                SuggestMode
	SuggestSize                *int
	SuggestText                string
	TerminateAfter             *int
	Timeout                    string
	TrackScores                *bool
	TrackTotalHits             string
	TypedKeys                  *bool
	Version                    *bool
}

SearchParams are the query parameters for the search endpoint.

func (*SearchParams) ToMap

func (p *SearchParams) ToMap() map[string]string

ToMap converts SearchParams to a query-parameter map.

type SearchRequest

type SearchRequest struct {
	Indices   []string
	Body      any
	Params    *SearchParams
	RequestId string
}

SearchRequest is the request for GET|POST /_search | /{index}/_search.

func NewSearchRequest

func NewSearchRequest(r *querydsl.SearchRequest) (*SearchRequest, error)

NewSearchRequest creates a SearchRequest from a *querydsl.SearchRequest.

type SearchService

SearchService provides access to the search APIs.

func NewSearchService

func NewSearchService(client *resty.Client, logger *logrus.Entry) SearchService

NewSearchService creates a new SearchService.

type SearchShardsParams

type SearchShardsParams struct {
	Common            *CommonParams
	AllowNoIndices    *bool
	ExpandWildcards   ExpandWildcards
	IgnoreUnavailable *bool
	Local             *bool
	Preference        string
	Routing           string
}

SearchShardsParams are the query parameters for the search_shards endpoint.

func (*SearchShardsParams) ToMap

func (p *SearchShardsParams) ToMap() map[string]string

ToMap converts SearchShardsParams to a query-parameter map.

type SearchShardsRequest

type SearchShardsRequest struct {
	Indices []string
	Params  *SearchShardsParams
}

SearchShardsRequest is the request for GET /{index}/_search_shards.

type SearchTemplateParams

type SearchTemplateParams struct {
	Common                *CommonParams
	AllowNoIndices        *bool
	CcsMinimizeRoundtrips *bool
	Explain               *bool
	IgnoreThrottled       *bool
	IgnoreUnavailable     *bool
	Preference            string
	Profile               *bool
	RestTotalHitsAsInt    *bool
	Routing               string
	Scroll                string
	SearchType            SearchType
	TypedKeys             *bool
}

SearchTemplateParams are the query parameters for the search_template endpoint.

func (*SearchTemplateParams) ToMap

func (p *SearchTemplateParams) ToMap() map[string]string

ToMap converts SearchTemplateParams to a query-parameter map.

type SearchTemplateRequest

type SearchTemplateRequest struct {
	Indices []string
	Body    any `validate:"required"`
	Params  *SearchTemplateParams
}

SearchTemplateRequest is the request for the search_template endpoint.

func (*SearchTemplateRequest) Validate

func (r *SearchTemplateRequest) Validate() error

Validate validates the SearchTemplateRequest.

type SearchType

type SearchType string

SearchType controls how distributed term frequencies affect scoring.

const (
	SearchTypeQueryThenFetch    SearchType = "query_then_fetch"
	SearchTypeDfsQueryThenFetch SearchType = "dfs_query_then_fetch"
)

type SearchableSnapshotsMountParams

type SearchableSnapshotsMountParams struct {
	Common              *CommonParams
	WaitForCompletion   *bool
	WaitForActiveShards string
}

SearchableSnapshotsMountParams are the query parameters for mount.

func (*SearchableSnapshotsMountParams) ToMap

ToMap converts SearchableSnapshotsMountParams to a query-parameter map.

type SearchableSnapshotsService

type SearchableSnapshotsService interface {
	Mount(ctx context.Context, repository, snapshot string, body any, params *SearchableSnapshotsMountParams) (json.RawMessage, error)
	Stats(ctx context.Context, indices []string, params *SearchableSnapshotsStatsParams) (json.RawMessage, error)
	CacheStats(ctx context.Context, nodeIds []string) (json.RawMessage, error)
	ClearCache(ctx context.Context, indices []string) (*types.AcknowledgedResponse, error)
	RepositoryStats(ctx context.Context, repository string) (json.RawMessage, error)
}

SearchableSnapshotsService provides access to the searchable snapshots APIs.

func NewSearchableSnapshotsService

func NewSearchableSnapshotsService(client *resty.Client, logger *logrus.Entry) SearchableSnapshotsService

NewSearchableSnapshotsService creates a new SearchableSnapshotsService.

type SearchableSnapshotsStatsParams

type SearchableSnapshotsStatsParams struct {
	Common *CommonParams
	Level  Level
}

SearchableSnapshotsStatsParams are the query parameters for stats.

func (*SearchableSnapshotsStatsParams) ToMap

ToMap converts SearchableSnapshotsStatsParams to a query-parameter map.

type SecurityAPIKey

type SecurityAPIKey struct {
	ID          string           `json:"id"`
	Name        string           `json:"name"`
	Type        string           `json:"type,omitempty"`
	Creation    int64            `json:"creation,omitempty"`
	Expiration  int64            `json:"expiration,omitempty"`
	Invalidated bool             `json:"invalidated,omitempty"`
	Username    string           `json:"username,omitempty"`
	Realm       string           `json:"realm,omitempty"`
	Descriptors []map[string]any `json:"role_descriptors,omitempty"`
}

SecurityAPIKey describes an API key.

type SecurityAuthenticateResponse

type SecurityAuthenticateResponse struct {
	Username            string         `json:"username"`
	Roles               []string       `json:"roles"`
	FullName            string         `json:"full_name,omitempty"`
	Email               string         `json:"email,omitempty"`
	Metadata            map[string]any `json:"metadata,omitempty"`
	AuthenticationRealm struct {
		Name string `json:"name"`
		Type string `json:"type"`
	} `json:"authentication_realm"`
	LookupRealm struct {
		Name string `json:"name"`
		Type string `json:"type"`
	} `json:"lookup_realm"`
	AuthenticationType string `json:"authentication_type"`
}

SecurityAuthenticateResponse is the response from authenticate.

type SecurityClearRealmCacheParams

type SecurityClearRealmCacheParams struct {
	Common    *CommonParams
	Usernames []string
}

SecurityClearRealmCacheParams are the query parameters for clear realm cache.

func (*SecurityClearRealmCacheParams) ToMap

ToMap converts SecurityClearRealmCacheParams to a query-parameter map.

type SecurityCreateAPIKeyResponse

type SecurityCreateAPIKeyResponse struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	APIKey     string `json:"api_key,omitempty"`
	Expiration int64  `json:"expiration,omitempty"`
	Encoded    string `json:"encoded,omitempty"`
}

SecurityCreateAPIKeyResponse is the response from create API key.

type SecurityCreateResponse

type SecurityCreateResponse struct {
	Created bool `json:"created"`
}

SecurityCreateResponse is the response from create user/role.

type SecurityGetAPIKeyParams

type SecurityGetAPIKeyParams struct {
	Common                *CommonParams
	ID                    string
	Name                  string
	RealmName             string
	Username              string
	Owner                 *bool
	ActiveOnly            *bool
	WithLimitedPrivileges *bool
	WithProfileUid        *bool
}

SecurityGetAPIKeyParams are the query parameters for get API key.

func (*SecurityGetAPIKeyParams) ToMap

func (p *SecurityGetAPIKeyParams) ToMap() map[string]string

ToMap converts SecurityGetAPIKeyParams to a query-parameter map.

type SecurityGetAPIKeyResponse

type SecurityGetAPIKeyResponse struct {
	APIKeys []SecurityAPIKey `json:"api_keys"`
}

SecurityGetAPIKeyResponse is the response from get API key.

type SecurityGetTokenResponse

type SecurityGetTokenResponse struct {
	AccessToken  string `json:"access_token"`
	Type         string `json:"type"`
	ExpiresIn    int    `json:"expires_in,omitempty"`
	RefreshToken string `json:"refresh_token,omitempty"`
	Scope        string `json:"scope,omitempty"`
}

SecurityGetTokenResponse is the response from get token.

type SecurityHasPrivilegesResponse

type SecurityHasPrivilegesResponse struct {
	Username     string         `json:"username,omitempty"`
	HasPrivilege map[string]any `json:"has_privilege"`
}

SecurityHasPrivilegesResponse is the response from has privileges.

type SecurityInvalidateAPIKeyResponse

type SecurityInvalidateAPIKeyResponse struct {
	InvalidatedAPIKeys           []string         `json:"invalidated_api_keys"`
	PreviouslyInvalidatedAPIKeys []string         `json:"previously_invalidated_api_keys"`
	Errors                       []map[string]any `json:"errors,omitempty"`
}

SecurityInvalidateAPIKeyResponse is the response from invalidate API key.

type SecurityInvalidateTokenResponse

type SecurityInvalidateTokenResponse struct {
	CreatedTokens               []string `json:"created_tokens,omitempty"`
	InvalidatedTokens           int      `json:"invalidated_tokens"`
	PreviouslyInvalidatedTokens int      `json:"previously_invalidated_tokens"`
	ErrorsCount                 int      `json:"errors_count,omitempty"`
}

SecurityInvalidateTokenResponse is the response from invalidate token.

type SecurityPutPrivilegesResponse

type SecurityPutPrivilegesResponse struct {
	Created map[string]map[string]bool `json:"created"`
}

SecurityPutPrivilegesResponse is the response from put privileges.

type SecurityRole

type SecurityRole struct {
	Cluster           []string                  `json:"cluster,omitempty"`
	Indices           []SecurityRoleIndex       `json:"indices,omitempty"`
	Applications      []SecurityRoleApplication `json:"applications,omitempty"`
	RunAs             []string                  `json:"run_as,omitempty"`
	Metadata          map[string]any            `json:"metadata,omitempty"`
	TransientMetadata map[string]any            `json:"transient_metadata,omitempty"`
}

SecurityRole describes a security role.

type SecurityRoleApplication

type SecurityRoleApplication struct {
	Application string   `json:"application"`
	Privileges  []string `json:"privileges"`
	Resources   []string `json:"resources"`
}

SecurityRoleApplication describes application role permissions.

type SecurityRoleIndex

type SecurityRoleIndex struct {
	Names                  []string       `json:"names"`
	Privileges             []string       `json:"privileges"`
	FieldSecurity          map[string]any `json:"field_security,omitempty"`
	Query                  string         `json:"query,omitempty"`
	AllowRestrictedIndices *bool          `json:"allow_restricted_indices,omitempty"`
}

SecurityRoleIndex describes per-index role permissions.

type SecurityRoleMapping

type SecurityRoleMapping struct {
	Enabled       bool             `json:"enabled"`
	Roles         []string         `json:"roles,omitempty"`
	RoleTemplates []map[string]any `json:"role_templates,omitempty"`
	Rules         map[string]any   `json:"rules,omitempty"`
	Metadata      map[string]any   `json:"metadata,omitempty"`
}

SecurityRoleMapping describes a role mapping.

type SecurityRoleMappingCreateResponse

type SecurityRoleMappingCreateResponse struct {
	Created bool `json:"created"`
}

SecurityRoleMappingCreateResponse is the response from create role mapping.

type SecurityService

type SecurityService interface {
	GetUser(ctx context.Context, usernames []string) (map[string]*SecurityUser, error)
	PutUser(ctx context.Context, username string, body any) (*SecurityCreateResponse, error)
	DeleteUser(ctx context.Context, username string) (*types.AcknowledgedResponse, error)
	ChangePassword(ctx context.Context, username string, body any) (*types.AcknowledgedResponse, error)
	DisableUser(ctx context.Context, username string) (*types.AcknowledgedResponse, error)
	EnableUser(ctx context.Context, username string) (*types.AcknowledgedResponse, error)
	GetRole(ctx context.Context, names []string) (map[string]*SecurityRole, error)
	PutRole(ctx context.Context, name string, body any) (*SecurityCreateResponse, error)
	DeleteRole(ctx context.Context, name string) (*types.AcknowledgedResponse, error)
	ClearRoleCache(ctx context.Context, names []string) (*types.AcknowledgedResponse, error)
	GetRoleMapping(ctx context.Context, names []string) (map[string]*SecurityRoleMapping, error)
	PutRoleMapping(ctx context.Context, name string, body any) (*SecurityRoleMappingCreateResponse, error)
	DeleteRoleMapping(ctx context.Context, name string) (*types.AcknowledgedResponse, error)
	GetPrivileges(ctx context.Context, application, name string) (map[string]any, error)
	PutPrivileges(ctx context.Context, body any) (*SecurityPutPrivilegesResponse, error)
	DeletePrivileges(ctx context.Context, application, name string) (*types.AcknowledgedResponse, error)
	HasPrivileges(ctx context.Context, body any) (*SecurityHasPrivilegesResponse, error)
	GetUserPrivileges(ctx context.Context) (map[string]any, error)
	CreateAPIKey(ctx context.Context, body any) (*SecurityCreateAPIKeyResponse, error)
	GetAPIKey(ctx context.Context, params *SecurityGetAPIKeyParams) (*SecurityGetAPIKeyResponse, error)
	InvalidateAPIKey(ctx context.Context, body any) (*SecurityInvalidateAPIKeyResponse, error)
	UpdateAPIKey(ctx context.Context, id string, body any) (*SecurityUpdateAPIKeyResponse, error)
	Authenticate(ctx context.Context) (*SecurityAuthenticateResponse, error)
	ClearRealmCache(ctx context.Context, realms []string, params *SecurityClearRealmCacheParams) (*types.AcknowledgedResponse, error)
	GetToken(ctx context.Context, body any) (*SecurityGetTokenResponse, error)
	InvalidateToken(ctx context.Context, body any) (*SecurityInvalidateTokenResponse, error)
}

SecurityService provides access to the security APIs. Covers users, roles, role mappings, privileges, API keys, tokens, authentication, and service accounts.

func NewSecurityService

func NewSecurityService(client *resty.Client, logger *logrus.Entry) SecurityService

NewSecurityService creates a new SecurityService.

type SecurityUpdateAPIKeyResponse

type SecurityUpdateAPIKeyResponse struct {
	Updated bool `json:"updated"`
}

SecurityUpdateAPIKeyResponse is the response from update API key.

type SecurityUser

type SecurityUser struct {
	Username string         `json:"username"`
	Roles    []string       `json:"roles"`
	FullName string         `json:"full_name,omitempty"`
	Email    string         `json:"email,omitempty"`
	Metadata map[string]any `json:"metadata,omitempty"`
	Enabled  bool           `json:"enabled"`
}

SecurityUser describes a security user.

type Segment

type Segment struct {
	Generation  int               `json:"generation"`
	NumDocs     int               `json:"num_docs"`
	DeletedDocs int               `json:"deleted_docs"`
	SizeInBytes int64             `json:"size_in_bytes"`
	Committed   bool              `json:"committed"`
	Search      bool              `json:"search"`
	Version     string            `json:"version"`
	Compound    bool              `json:"compound"`
	Attributes  map[string]string `json:"attributes,omitempty"`
}

Segment describes a single Lucene segment.

type ShardRecovery

type ShardRecovery struct {
	Type              string         `json:"type"`
	Stage             string         `json:"stage"`
	Primary           bool           `json:"primary"`
	StartTimeInMillis int64          `json:"start_time_in_millis"`
	StopTimeInMillis  int64          `json:"stop_time_in_millis,omitempty"`
	TotalTimeInMillis int64          `json:"total_time_in_millis"`
	Source            RecoveryNode   `json:"source"`
	Target            RecoveryNode   `json:"target"`
	Index             map[string]any `json:"index"`
}

ShardRecovery describes a single shard recovery.

type ShardStore

type ShardStore struct {
	ID             string `json:"id"`
	Path           string `json:"path"`
	Allocation     string `json:"allocation"`
	StoreException *struct {
		Type   string `json:"type"`
		Reason string `json:"reason"`
	} `json:"store_exception,omitempty"`
}

ShardStore describes a single shard store.

type ShrinkParams

type ShrinkParams struct {
	Common              *CommonParams
	Timeout             string
	WaitForActiveShards string
}

ShrinkParams are the query parameters for shrink/split/clone.

func (*ShrinkParams) ToMap

func (p *ShrinkParams) ToMap() map[string]string

ToMap converts ShrinkParams to a query-parameter map.

type ShrinkRequest

type ShrinkRequest struct {
	Source string `validate:"required"`
	Target string `validate:"required"`
	Body   any
	Params *ShrinkParams
}

ShrinkRequest is the request for PUT /{index}/_shrink/{target}.

func (*ShrinkRequest) Validate

func (r *ShrinkRequest) Validate() error

Validate validates the ShrinkRequest.

type ShutdownGetNodeResponse

type ShutdownGetNodeResponse struct {
	Nodes []struct {
		NodeID            string         `json:"node_id"`
		Type              string         `json:"type"`
		Reason            string         `json:"reason"`
		ShutdownStarted   string         `json:"shutdown_started,omitempty"`
		ShutdownCompleted string         `json:"shutdown_completed,omitempty"`
		AllocationDelay   string         `json:"allocation_delay,omitempty"`
		TargetNodeName    string         `json:"target_node_name,omitempty"`
		Status            map[string]any `json:"status,omitempty"`
	} `json:"nodes"`
}

ShutdownGetNodeResponse is the response from GET /_nodes/shutdown.

type ShutdownService

type ShutdownService interface {
	GetNode(ctx context.Context, nodeId string) (*ShutdownGetNodeResponse, error)
	PutNode(ctx context.Context, nodeId string, body any) (*types.AcknowledgedResponse, error)
	DeleteNode(ctx context.Context, nodeId string) (*types.AcknowledgedResponse, error)
}

ShutdownService provides access to the shutdown APIs.

func NewShutdownService

func NewShutdownService(client *resty.Client, logger *logrus.Entry) ShutdownService

NewShutdownService creates a new ShutdownService.

type SimulateIndexTemplateParams

type SimulateIndexTemplateParams struct {
	Common *CommonParams
	Cause  string
	Create *bool
}

SimulateIndexTemplateParams are the query parameters for simulate_index_template.

func (*SimulateIndexTemplateParams) ToMap

func (p *SimulateIndexTemplateParams) ToMap() map[string]string

ToMap converts SimulateIndexTemplateParams to a query-parameter map.

type SimulateIndexTemplateRequest

type SimulateIndexTemplateRequest struct {
	Name   string `validate:"required"`
	Body   any
	Params *SimulateIndexTemplateParams
}

SimulateIndexTemplateRequest is the request for POST /_index_template/_simulate_index.

func (*SimulateIndexTemplateRequest) Validate

func (r *SimulateIndexTemplateRequest) Validate() error

Validate validates the SimulateIndexTemplateRequest.

type SimulateTemplateParams

type SimulateTemplateParams = SimulateIndexTemplateParams

SimulateTemplateParams are the query parameters for simulate_template.

type SimulateTemplateRequest

type SimulateTemplateRequest struct {
	Name   string
	Body   any
	Params *SimulateTemplateParams
}

SimulateTemplateRequest is the request for POST /_index_template/_simulate.

type SlmExecuteResponse

type SlmExecuteResponse struct {
	SnapshotName string `json:"snapshot_name"`
}

SlmExecuteResponse is the response from execute lifecycle.

type SlmPolicy

type SlmPolicy struct {
	Version             int            `json:"version,omitempty"`
	ModifiedDate        string         `json:"modified_date,omitempty"`
	ModifiedDateMillis  int64          `json:"modified_date_millis,omitempty"`
	Policy              map[string]any `json:"policy,omitempty"`
	Config              map[string]any `json:"config,omitempty"`
	Name                string         `json:"name,omitempty"`
	Uuid                string         `json:"uuid,omitempty"`
	SnapshotName        string         `json:"snapshot_name,omitempty"`
	Retention           map[string]any `json:"retention,omitempty"`
	NextExecutionMillis int64          `json:"next_execution_millis,omitempty"`
}

SlmPolicy describes a snapshot lifecycle management policy.

type SlmService

type SlmService interface {
	GetLifecycle(ctx context.Context, policyIds []string) (map[string]*SlmPolicy, error)
	PutLifecycle(ctx context.Context, policyId string, body any) (*types.AcknowledgedResponse, error)
	DeleteLifecycle(ctx context.Context, policyId string) (*types.AcknowledgedResponse, error)
	ExecuteLifecycle(ctx context.Context, policyId string) (*SlmExecuteResponse, error)
	ExecuteRetention(ctx context.Context) (*types.AcknowledgedResponse, error)
	GetStats(ctx context.Context) (*SlmStatsResponse, error)
	GetStatus(ctx context.Context) (*SlmStatusResponse, error)
	Start(ctx context.Context) (*types.AcknowledgedResponse, error)
	Stop(ctx context.Context) (*types.AcknowledgedResponse, error)
}

SlmService provides access to the snapshot lifecycle management APIs.

func NewSlmService

func NewSlmService(client *resty.Client, logger *logrus.Entry) SlmService

NewSlmService creates a new SlmService.

type SlmStatsResponse

type SlmStatsResponse struct {
	RetentionRuns                 int64            `json:"retention_runs"`
	RetentionFailed               int64            `json:"retention_failed"`
	RetentionTimedOut             int64            `json:"retention_timed_out"`
	RetentionDeletionTime         string           `json:"retention_deletion_time"`
	RetentionDeletionTimeMillis   int64            `json:"retention_deletion_time_millis"`
	TotalSnapshotsTaken           int64            `json:"total_snapshots_taken"`
	TotalSnapshotsFailed          int64            `json:"total_snapshots_failed"`
	TotalSnapshotDeletions        int64            `json:"total_snapshot_deletions"`
	TotalSnapshotDeletionFailures int64            `json:"total_snapshot_deletion_failures"`
	PolicyStats                   []map[string]any `json:"policy_stats,omitempty"`
}

SlmStatsResponse is the response from SLM stats.

type SlmStatusResponse

type SlmStatusResponse struct {
	OperationMode string `json:"operation_mode"`
}

SlmStatusResponse is the response from SLM status.

type SnapshotCleanupRepositoryParams

type SnapshotCleanupRepositoryParams struct {
	Common  *CommonParams
	Timeout string
}

SnapshotCleanupRepositoryParams are the query parameters for cleanup repository.

func (*SnapshotCleanupRepositoryParams) ToMap

ToMap converts SnapshotCleanupRepositoryParams to a query-parameter map.

type SnapshotCleanupRepositoryResponse

type SnapshotCleanupRepositoryResponse struct {
	DeletedBytes int64 `json:"deleted_bytes"`
	DeletedBlobs int64 `json:"deleted_blobs"`
}

SnapshotCleanupRepositoryResponse is the response from cleanup repository.

type SnapshotCloneRequest

type SnapshotCloneRequest struct {
	Repository     string `validate:"required"`
	Snapshot       string `validate:"required"`
	TargetSnapshot string `validate:"required"`
	Body           any
}

SnapshotCloneRequest is the request for PUT /_snapshot/{repository}/{snapshot}/_clone.

func (*SnapshotCloneRequest) Validate

func (r *SnapshotCloneRequest) Validate() error

Validate validates the SnapshotCloneRequest.

type SnapshotCreateParams

type SnapshotCreateParams struct {
	Common            *CommonParams
	WaitForCompletion *bool
}

SnapshotCreateParams are the query parameters for create snapshot.

func (*SnapshotCreateParams) ToMap

func (p *SnapshotCreateParams) ToMap() map[string]string

ToMap converts SnapshotCreateParams to a query-parameter map.

type SnapshotCreateRepositoryParams

type SnapshotCreateRepositoryParams struct {
	Common  *CommonParams
	Timeout string
	Verify  *bool
}

SnapshotCreateRepositoryParams are the query parameters for create repository.

func (*SnapshotCreateRepositoryParams) ToMap

ToMap converts SnapshotCreateRepositoryParams to a query-parameter map.

type SnapshotCreateRequest

type SnapshotCreateRequest struct {
	Repository string `validate:"required"`
	Snapshot   string `validate:"required"`
	Body       any
	Params     *SnapshotCreateParams
}

SnapshotCreateRequest is the request for PUT /_snapshot/{repository}/{snapshot}.

func (*SnapshotCreateRequest) Validate

func (r *SnapshotCreateRequest) Validate() error

Validate validates the SnapshotCreateRequest.

type SnapshotCreateResponse

type SnapshotCreateResponse struct {
	Snapshot SnapshotInfo `json:"snapshot"`
}

SnapshotCreateResponse is the response from create snapshot.

type SnapshotDeleteRepositoryParams

type SnapshotDeleteRepositoryParams struct {
	Common  *CommonParams
	Timeout string
}

SnapshotDeleteRepositoryParams are the query parameters for delete repository.

func (*SnapshotDeleteRepositoryParams) ToMap

ToMap converts SnapshotDeleteRepositoryParams to a query-parameter map.

type SnapshotDeleteRequest

type SnapshotDeleteRequest struct {
	Repository string `validate:"required"`
	Snapshot   string `validate:"required"`
}

SnapshotDeleteRequest is the request for DELETE /_snapshot/{repository}/{snapshot}.

func (*SnapshotDeleteRequest) Validate

func (r *SnapshotDeleteRequest) Validate() error

Validate validates the SnapshotDeleteRequest.

type SnapshotGetParams

type SnapshotGetParams struct {
	Common            *CommonParams
	IgnoreUnavailable *bool
	IncludeRepository *bool
	IndexDetails      *bool
}

SnapshotGetParams are the query parameters for get snapshot.

func (*SnapshotGetParams) ToMap

func (p *SnapshotGetParams) ToMap() map[string]string

ToMap converts SnapshotGetParams to a query-parameter map.

type SnapshotGetRepositoryParams

type SnapshotGetRepositoryParams struct {
	Common *CommonParams
	Local  *bool
}

SnapshotGetRepositoryParams are the query parameters for get repository.

func (*SnapshotGetRepositoryParams) ToMap

func (p *SnapshotGetRepositoryParams) ToMap() map[string]string

ToMap converts SnapshotGetRepositoryParams to a query-parameter map.

type SnapshotGetRequest

type SnapshotGetRequest struct {
	Repository string `validate:"required"`
	Snapshots  []string
	Params     *SnapshotGetParams
}

SnapshotGetRequest is the request for GET /_snapshot/{repository}/{snapshot}.

func (*SnapshotGetRequest) Validate

func (r *SnapshotGetRequest) Validate() error

Validate validates the SnapshotGetRequest.

type SnapshotGetResponse

type SnapshotGetResponse struct {
	Snapshots []SnapshotInfo `json:"snapshots"`
	Total     int            `json:"total,omitempty"`
}

SnapshotGetResponse is the response from get snapshot.

type SnapshotIndexStatus

type SnapshotIndexStatus struct {
	Shards *types.ShardsInfo `json:"shards,omitempty"`
	Stats  SnapshotStats     `json:"stats,omitempty"`
}

SnapshotIndexStatus is the per-index snapshot status.

type SnapshotInfo

type SnapshotInfo struct {
	Snapshot           string            `json:"snapshot"`
	UUID               string            `json:"uuid,omitempty"`
	Repository         string            `json:"repository,omitempty"`
	Indices            []string          `json:"indices,omitempty"`
	DataStreams        []string          `json:"data_streams,omitempty"`
	State              string            `json:"state,omitempty"`
	StartTime          string            `json:"start_time,omitempty"`
	StartTimeInMillis  int64             `json:"start_time_in_millis,omitempty"`
	EndTime            string            `json:"end_time,omitempty"`
	EndTimeInMillis    int64             `json:"end_time_in_millis,omitempty"`
	DurationInMillis   int64             `json:"duration_in_millis,omitempty"`
	Failures           []map[string]any  `json:"failures,omitempty"`
	Shards             *types.ShardsInfo `json:"shards,omitempty"`
	VersionId          string            `json:"version_id,omitempty"`
	Version            string            `json:"version,omitempty"`
	IncludeGlobalState *bool             `json:"include_global_state,omitempty"`
}

SnapshotInfo describes a single snapshot.

type SnapshotRepository

type SnapshotRepository struct {
	Type     string            `json:"type"`
	Settings map[string]string `json:"settings,omitempty"`
	UUID     string            `json:"uuid,omitempty"`
}

SnapshotRepository describes a snapshot repository.

type SnapshotRepositoryAnalyzeParams

type SnapshotRepositoryAnalyzeParams struct {
	Common           *CommonParams
	BlobCount        *int
	Concurrency      *int
	Detailed         *bool
	MaxBlobSize      string
	MaxTotalDataSize string
	Seed             *int
	Timeout          string
}

SnapshotRepositoryAnalyzeParams are the query parameters for repository analyze.

func (*SnapshotRepositoryAnalyzeParams) ToMap

ToMap converts SnapshotRepositoryAnalyzeParams to a query-parameter map.

type SnapshotRepositoryAnalyzeResponse

type SnapshotRepositoryAnalyzeResponse struct {
	BlobCount        int              `json:"blob_count"`
	Concurrency      int              `json:"concurrency"`
	ReadNodeCount    int              `json:"read_node_count"`
	CoordinatingNode string           `json:"coordinating_node"`
	Summary          map[string]any   `json:"summary,omitempty"`
	Details          []map[string]any `json:"details,omitempty"`
}

SnapshotRepositoryAnalyzeResponse is the response from repository analyze.

type SnapshotRepositoryVerifyIntegrityParams

type SnapshotRepositoryVerifyIntegrityParams struct {
	Common                    *CommonParams
	IndexSnapshotVerification *bool
	SnapshotVerification      *bool
	Timeout                   string
}

SnapshotRepositoryVerifyIntegrityParams are the query parameters for verify_integrity.

func (*SnapshotRepositoryVerifyIntegrityParams) ToMap

ToMap converts SnapshotRepositoryVerifyIntegrityParams to a query-parameter map.

type SnapshotRepositoryVerifyIntegrityResponse

type SnapshotRepositoryVerifyIntegrityResponse struct {
	Repositories []struct {
		Repository string `json:"repository"`
		Verified   bool   `json:"verified"`
	} `json:"repositories"`
}

SnapshotRepositoryVerifyIntegrityResponse is the response from verify_integrity.

type SnapshotRestoreParams

type SnapshotRestoreParams struct {
	Common            *CommonParams
	WaitForCompletion *bool
}

SnapshotRestoreParams are the query parameters for restore.

func (*SnapshotRestoreParams) ToMap

func (p *SnapshotRestoreParams) ToMap() map[string]string

ToMap converts SnapshotRestoreParams to a query-parameter map.

type SnapshotRestoreRequest

type SnapshotRestoreRequest struct {
	Repository string `validate:"required"`
	Snapshot   string `validate:"required"`
	Body       any
	Params     *SnapshotRestoreParams
}

SnapshotRestoreRequest is the request for POST /_snapshot/{repository}/{snapshot}/_restore.

func (*SnapshotRestoreRequest) Validate

func (r *SnapshotRestoreRequest) Validate() error

Validate validates the SnapshotRestoreRequest.

type SnapshotRestoreResponse

type SnapshotRestoreResponse struct {
	Accepted bool `json:"accepted,omitempty"`
	Snapshot struct {
		Snapshot string            `json:"snapshot"`
		Indices  []string          `json:"indices"`
		Shards   *types.ShardsInfo `json:"shards,omitempty"`
	} `json:"snapshot"`
}

SnapshotRestoreResponse is the response from restore.

type SnapshotService

type SnapshotService interface {
	CreateRepository(ctx context.Context, name string, body any, params *SnapshotCreateRepositoryParams) (*types.AcknowledgedResponse, error)
	GetRepository(ctx context.Context, names []string, params *SnapshotGetRepositoryParams) (map[string]*SnapshotRepository, error)
	DeleteRepository(ctx context.Context, names []string, params *SnapshotDeleteRepositoryParams) (*types.AcknowledgedResponse, error)
	VerifyRepository(ctx context.Context, name string, params *SnapshotVerifyRepositoryParams) (*SnapshotVerifyRepositoryResponse, error)
	RepositoryAnalyze(ctx context.Context, name string, params *SnapshotRepositoryAnalyzeParams) (*SnapshotRepositoryAnalyzeResponse, error)
	RepositoryVerifyIntegrity(ctx context.Context, name string, params *SnapshotRepositoryVerifyIntegrityParams) (*SnapshotRepositoryVerifyIntegrityResponse, error)
	Create(ctx context.Context, req *SnapshotCreateRequest) (*SnapshotCreateResponse, error)
	Get(ctx context.Context, req *SnapshotGetRequest) (*SnapshotGetResponse, error)
	Delete(ctx context.Context, req *SnapshotDeleteRequest) (*types.AcknowledgedResponse, error)
	Restore(ctx context.Context, req *SnapshotRestoreRequest) (*SnapshotRestoreResponse, error)
	Status(ctx context.Context, req *SnapshotStatusRequest) (*SnapshotStatusResponse, error)
	Clone(ctx context.Context, req *SnapshotCloneRequest) (*types.AcknowledgedResponse, error)
	CleanupRepository(ctx context.Context, name string, params *SnapshotCleanupRepositoryParams) (*SnapshotCleanupRepositoryResponse, error)
}

SnapshotService provides access to the snapshot APIs.

func NewSnapshotService

func NewSnapshotService(client *resty.Client, logger *logrus.Entry) SnapshotService

NewSnapshotService creates a new SnapshotService.

type SnapshotStats

type SnapshotStats struct {
	Incremental       SnapshotStatsCount `json:"incremental,omitempty"`
	Total             SnapshotStatsCount `json:"total,omitempty"`
	StartTimeInMillis int64              `json:"start_time_in_millis,omitempty"`
	TimeInMillis      int64              `json:"time_in_millis,omitempty"`
}

SnapshotStats holds snapshot statistics.

type SnapshotStatsCount

type SnapshotStatsCount struct {
	FileCount   int   `json:"file_count"`
	SizeInBytes int64 `json:"size_in_bytes"`
}

SnapshotStatsCount holds file/size counts.

type SnapshotStatus

type SnapshotStatus struct {
	Snapshot           string                         `json:"snapshot"`
	Repository         string                         `json:"repository"`
	UUID               string                         `json:"uuid,omitempty"`
	State              string                         `json:"state"`
	IncludeGlobalState *bool                          `json:"include_global_state,omitempty"`
	Shards             *types.ShardsInfo              `json:"shards,omitempty"`
	Indices            map[string]SnapshotIndexStatus `json:"indices,omitempty"`
}

SnapshotStatus describes a snapshot's status.

type SnapshotStatusParams

type SnapshotStatusParams struct {
	Common            *CommonParams
	IgnoreUnavailable *bool
}

SnapshotStatusParams are the query parameters for snapshot status.

func (*SnapshotStatusParams) ToMap

func (p *SnapshotStatusParams) ToMap() map[string]string

ToMap converts SnapshotStatusParams to a query-parameter map.

type SnapshotStatusRequest

type SnapshotStatusRequest struct {
	Repository string
	Snapshots  []string
	Params     *SnapshotStatusParams
}

SnapshotStatusRequest is the request for GET /_snapshot/status.

type SnapshotStatusResponse

type SnapshotStatusResponse struct {
	Snapshots []SnapshotStatus `json:"snapshots"`
}

SnapshotStatusResponse is the response from snapshot status.

type SnapshotVerifyRepositoryParams

type SnapshotVerifyRepositoryParams struct {
	Common  *CommonParams
	Timeout string
}

SnapshotVerifyRepositoryParams are the query parameters for verify repository.

func (*SnapshotVerifyRepositoryParams) ToMap

ToMap converts SnapshotVerifyRepositoryParams to a query-parameter map.

type SnapshotVerifyRepositoryResponse

type SnapshotVerifyRepositoryResponse struct {
	Nodes map[string]struct {
		Name string `json:"name"`
	} `json:"nodes"`
}

SnapshotVerifyRepositoryResponse is the response from verify repository.

type SortOrder

type SortOrder string

SortOrder values.

const (
	SortOrderAsc  SortOrder = "asc"
	SortOrderDesc SortOrder = "desc"
)

type SplitParams

type SplitParams = ShrinkParams

SplitParams are the query parameters for the split endpoint.

type SplitRequest

type SplitRequest struct {
	Source string `validate:"required"`
	Target string `validate:"required"`
	Body   any
	Params *SplitParams
}

SplitRequest is the request for PUT /{index}/_split/{target}.

func (*SplitRequest) Validate

func (r *SplitRequest) Validate() error

Validate validates the SplitRequest.

type SqlAsyncStatusResponse

type SqlAsyncStatusResponse struct {
	ID                 string `json:"id"`
	IsRunning          bool   `json:"is_running"`
	IsPartial          bool   `json:"is_partial"`
	StartInMillis      int64  `json:"start_in_millis,omitempty"`
	ExpirationInMillis int64  `json:"expiration_in_millis,omitempty"`
	CompletionStatus   int    `json:"completion_status,omitempty"`
}

SqlAsyncStatusResponse is the response from GET /_sql/async/status/{id}.

type SqlClearCursorResponse

type SqlClearCursorResponse struct {
	Succeeded bool `json:"succeeded"`
}

SqlClearCursorResponse is the response from POST /_sql/close.

type SqlGetAsyncParams

type SqlGetAsyncParams struct {
	Common                   *CommonParams
	Delimiter                string
	Format                   string
	KeepAlive                string
	WaitForCompletionTimeout string
}

SqlGetAsyncParams are the query parameters for GET /_sql/async/{id}.

func (*SqlGetAsyncParams) ToMap

func (p *SqlGetAsyncParams) ToMap() map[string]string

ToMap converts SqlGetAsyncParams to a query-parameter map.

type SqlQueryParams

type SqlQueryParams struct {
	Common *CommonParams
	Format string
}

SqlQueryParams are the query parameters for POST /_sql.

func (*SqlQueryParams) ToMap

func (p *SqlQueryParams) ToMap() map[string]string

ToMap converts SqlQueryParams to a query-parameter map.

type SqlQueryResponse

type SqlQueryResponse struct {
	Columns []struct {
		Name string `json:"name"`
		Type string `json:"type"`
	} `json:"columns,omitempty"`
	Rows      [][]any `json:"rows,omitempty"`
	Cursor    string  `json:"cursor,omitempty"`
	IsRunning bool    `json:"is_running,omitempty"`
}

SqlQueryResponse is the response from POST /_sql.

type SqlService

type SqlService interface {
	Query(ctx context.Context, body any, params *SqlQueryParams) (*SqlQueryResponse, error)
	Translate(ctx context.Context, body any) (*SqlTranslateResponse, error)
	ClearCursor(ctx context.Context, body any) (*SqlClearCursorResponse, error)
	GetAsync(ctx context.Context, id string, params *SqlGetAsyncParams) (*SqlQueryResponse, error)
	GetAsyncStatus(ctx context.Context, id string) (*SqlAsyncStatusResponse, error)
	DeleteAsync(ctx context.Context, id string) (*types.AcknowledgedResponse, error)
}

SqlService provides access to the SQL APIs.

func NewSqlService

func NewSqlService(client *resty.Client, logger *logrus.Entry) SqlService

NewSqlService creates a new SqlService.

type SqlTranslateResponse

type SqlTranslateResponse struct {
	Size  int              `json:"size,omitempty"`
	Query map[string]any   `json:"query,omitempty"`
	Sort  []map[string]any `json:"sort,omitempty"`
}

SqlTranslateResponse is the response from POST /_sql/translate.

type SslCertificate

type SslCertificate struct {
	Path          string `json:"path"`
	SubjectDN     string `json:"subject_dn"`
	SerialNumber  string `json:"serial_number"`
	HasPrivateKey bool   `json:"has_private_key"`
	Alias         string `json:"alias,omitempty"`
	IssuerDN      string `json:"issuer_dn,omitempty"`
	Version       string `json:"version,omitempty"`
	NotBefore     string `json:"not_before,omitempty"`
	NotAfter      string `json:"not_after,omitempty"`
}

SslCertificate describes a single SSL certificate.

type SslCertificatesResponse

type SslCertificatesResponse []SslCertificate

SslCertificatesResponse is the response from GET /_ssl/certificates.

type SslService

type SslService interface {
	Certificates(ctx context.Context) (SslCertificatesResponse, error)
}

SslService provides access to the SSL APIs.

func NewSslService

func NewSslService(client *resty.Client, logger *logrus.Entry) SslService

NewSslService creates a new SslService.

type StreamsService

type StreamsService interface {
	LogsEnable(ctx context.Context, body any) (*types.AcknowledgedResponse, error)
	LogsDisable(ctx context.Context) (*types.AcknowledgedResponse, error)
	Status(ctx context.Context) (json.RawMessage, error)
}

StreamsService provides access to the streams APIs (Elasticsearch 9.x). These endpoints are beta/experimental and may not exist in every 9.x patch; the speccheck allow-list accounts for their conditional presence.

func NewStreamsService

func NewStreamsService(client *resty.Client, logger *logrus.Entry) StreamsService

NewStreamsService creates a new StreamsService.

type SuggestMode

type SuggestMode string

SuggestMode values.

const (
	SuggestModeMissing SuggestMode = "missing"
	SuggestModePopular SuggestMode = "popular"
	SuggestModeAlways  SuggestMode = "always"
)

type SynonymRule

type SynonymRule struct {
	ID       string `json:"id,omitempty"`
	Type     string `json:"type,omitempty"`
	Synonyms string `json:"synonyms"`
}

SynonymRule describes a single synonym rule.

type SynonymRulesResponse

type SynonymRulesResponse struct {
	Count int           `json:"count"`
	Rules []SynonymRule `json:"rules"`
}

SynonymRulesResponse is the response from GET /_synonyms/{id}.

type SynonymSetItem

type SynonymSetItem struct {
	SynonymSet string `json:"synonym_set"`
	Count      int    `json:"count"`
}

SynonymSetItem describes a synonym set.

type SynonymsGetParams

type SynonymsGetParams struct {
	Common *CommonParams
	From   *int
	Size   *int
}

SynonymsGetParams are the query parameters for get synonym.

func (*SynonymsGetParams) ToMap

func (p *SynonymsGetParams) ToMap() map[string]string

ToMap converts SynonymsGetParams to a query-parameter map.

type SynonymsListParams

type SynonymsListParams struct {
	Common *CommonParams
	From   *int
	Size   *int
}

SynonymsListParams are the query parameters for list synonyms sets.

func (*SynonymsListParams) ToMap

func (p *SynonymsListParams) ToMap() map[string]string

ToMap converts SynonymsListParams to a query-parameter map.

type SynonymsService

type SynonymsService interface {
	GetSynonymsSets(ctx context.Context, params *SynonymsListParams) (*SynonymsSetsResponse, error)
	GetSynonym(ctx context.Context, id string, params *SynonymsGetParams) (*SynonymRulesResponse, error)
	PutSynonym(ctx context.Context, id string, body any) (*types.AcknowledgedResponse, error)
	DeleteSynonym(ctx context.Context, id string) (*types.AcknowledgedResponse, error)
	GetSynonymRule(ctx context.Context, id, ruleId string) (*SynonymRule, error)
	PutSynonymRule(ctx context.Context, id, ruleId string, body any) (*types.AcknowledgedResponse, error)
	DeleteSynonymRule(ctx context.Context, id, ruleId string) (*types.AcknowledgedResponse, error)
}

SynonymsService provides access to the synonyms APIs.

func NewSynonymsService

func NewSynonymsService(client *resty.Client, logger *logrus.Entry) SynonymsService

NewSynonymsService creates a new SynonymsService.

type SynonymsSetsResponse

type SynonymsSetsResponse struct {
	Count   int              `json:"count"`
	Results []SynonymSetItem `json:"results"`
}

SynonymsSetsResponse is the response from GET /_synonyms.

type TaskGetResponse

type TaskGetResponse struct {
	Completed bool                             `json:"completed"`
	Task      TaskInfo                         `json:"task"`
	Error     *types.ElasticsearchErrorDetails `json:"error,omitempty"`
	Response  map[string]any                   `json:"response,omitempty"`
}

TaskGetResponse represents the result of GET /_tasks/{task_id}.

type TaskInfo

type TaskInfo struct {
	Node               string            `json:"node"`
	Id                 int64             `json:"id"`
	Type               string            `json:"type"`
	Action             string            `json:"action"`
	Status             map[string]any    `json:"status,omitempty"`
	Description        string            `json:"description,omitempty"`
	StartTimeInMillis  int64             `json:"start_time_in_millis"`
	RunningTimeInNanos int64             `json:"running_time_in_nanos"`
	Cancellable        bool              `json:"cancellable"`
	Cancelled          bool              `json:"cancelled,omitempty"`
	ParentTaskId       string            `json:"parent_task_id,omitempty"`
	Headers            map[string]string `json:"headers,omitempty"`
}

TaskInfo describes a single task.

type TaskNode

type TaskNode struct {
	NodeID           string              `json:"node_id"`
	TransportAddress string              `json:"transport_address"`
	Host             string              `json:"host"`
	IP               string              `json:"ip"`
	Name             string              `json:"name"`
	Tasks            map[string]TaskInfo `json:"tasks"`
}

TaskNode describes a node and the tasks it is running.

type TasksCancelParams

type TasksCancelParams struct {
	Common            *CommonParams
	Actions           []string
	Nodes             []string
	ParentTaskId      string
	WaitForCompletion *bool
}

TasksCancelParams are the query parameters for POST /_tasks/_cancel.

func (*TasksCancelParams) ToMap

func (p *TasksCancelParams) ToMap() map[string]string

ToMap converts TasksCancelParams to a query-parameter map.

type TasksGetParams

type TasksGetParams struct {
	Common            *CommonParams
	Timeout           string
	WaitForCompletion *bool
}

TasksGetParams are the query parameters for GET /_tasks/{task_id}.

func (*TasksGetParams) ToMap

func (p *TasksGetParams) ToMap() map[string]string

ToMap converts TasksGetParams to a query-parameter map.

type TasksListParams

type TasksListParams struct {
	Common            *CommonParams
	Actions           []string
	Detailed          *bool
	GroupBy           GroupBy
	Nodes             []string
	ParentTaskId      string
	Timeout           string
	WaitForCompletion *bool
}

TasksListParams are the query parameters for GET /_tasks.

func (*TasksListParams) ToMap

func (p *TasksListParams) ToMap() map[string]string

ToMap converts TasksListParams to a query-parameter map.

type TasksListResponse

type TasksListResponse struct {
	Nodes map[string]TaskNode `json:"nodes"`
}

TasksListResponse represents the result of GET /_tasks.

type TasksService

type TasksService interface {
	List(ctx context.Context, params *TasksListParams) (*TasksListResponse, error)
	Get(ctx context.Context, taskId string, params *TasksGetParams) (*TaskGetResponse, error)
	Cancel(ctx context.Context, taskId string, params *TasksCancelParams) (*TasksListResponse, error)
}

TasksService provides access to the tasks APIs.

func NewTasksService

func NewTasksService(client *resty.Client, logger *logrus.Entry) TasksService

NewTasksService creates a new TasksService.

type TemplateBody

type TemplateBody struct {
	Settings map[string]any `json:"settings,omitempty"`
	Mappings map[string]any `json:"mappings,omitempty"`
	Aliases  map[string]any `json:"aliases,omitempty"`
}

TemplateBody is the settings/mappings/aliases template body.

type TermVectorsFieldInfo

type TermVectorsFieldInfo struct {
	FieldStatistics FieldStatistics      `json:"field_statistics"`
	Terms           map[string]TermsInfo `json:"terms"`
}

TermVectorsFieldInfo holds the term vector data for a single field.

type TermVectorsParams

type TermVectorsParams struct {
	Common          *CommonParams
	FieldStatistics *bool
	Fields          []string
	Offsets         *bool
	Payloads        *bool
	Positions       *bool
	Preference      string
	Realtime        *bool
	Routing         string
	TermStatistics  *bool
	Version         *int64
	VersionType     VersionType
}

TermVectorsParams are the query parameters for the termvectors endpoint.

func (*TermVectorsParams) ToMap

func (p *TermVectorsParams) ToMap() map[string]string

ToMap converts TermVectorsParams to a query-parameter map.

type TermVectorsRequest

type TermVectorsRequest struct {
	Index  string `validate:"required"`
	Id     string
	Body   any
	Params *TermVectorsParams
}

TermVectorsRequest is the request for GET|POST /{index}/_termvectors/{id}.

func (*TermVectorsRequest) Validate

func (r *TermVectorsRequest) Validate() error

Validate validates the TermVectorsRequest.

type TermsEnumParams

type TermsEnumParams struct {
	Common          *CommonParams
	CaseInsensitive *bool
}

TermsEnumParams are the query parameters for the terms_enum endpoint.

func (*TermsEnumParams) ToMap

func (p *TermsEnumParams) ToMap() map[string]string

ToMap converts TermsEnumParams to a query-parameter map.

type TermsEnumRequest

type TermsEnumRequest struct {
	Index  string `validate:"required"`
	Body   any
	Params *TermsEnumParams
}

TermsEnumRequest is the request for POST /{index}/_terms_enum.

func (*TermsEnumRequest) Validate

func (r *TermsEnumRequest) Validate() error

Validate validates the TermsEnumRequest.

type TermsEnumResponse

type TermsEnumResponse struct {
	Shards   *types.ShardsInfo `json:"_shards,omitempty"`
	Terms    []string          `json:"terms,omitempty"`
	Complete bool              `json:"complete,omitempty"`
}

TermsEnumResponse represents the result of a terms_enum request.

type TermsInfo

type TermsInfo struct {
	DocFreq  int64       `json:"doc_freq"`
	Score    float64     `json:"score"`
	TermFreq int64       `json:"term_freq"`
	Ttf      int64       `json:"ttf"`
	Tokens   []TokenInfo `json:"tokens"`
}

TermsInfo provides per-term statistics within a field's term vector.

type TermvectorsResponse

type TermvectorsResponse struct {
	Index       string                          `json:"_index"`
	Id          string                          `json:"_id,omitempty"`
	Version     int                             `json:"_version"`
	Found       bool                            `json:"found"`
	Took        int64                           `json:"took"`
	TermVectors map[string]TermVectorsFieldInfo `json:"term_vectors"`
}

TermvectorsResponse represents the result of a term vectors request.

type TextStructureFindParams

type TextStructureFindParams struct {
	Common             *CommonParams
	Charset            string
	ColumnNames        []string
	Delimiter          string
	Explain            *bool
	Format             string
	GrokPattern        string
	HasHeaderRow       *bool
	LineMergeSizeLimit *int
	LinesToSample      *int
	Quote              string
	ShouldTrimFields   *bool
	TimestampField     string
	TimestampFormat    string
}

TextStructureFindParams are the shared query parameters for text structure endpoints.

func (*TextStructureFindParams) ToMap

func (p *TextStructureFindParams) ToMap() map[string]string

ToMap converts TextStructureFindParams to a query-parameter map.

type TextStructureResponse

type TextStructureResponse struct {
	NDJSON              bool           `json:"ndjson"`
	NeedClientTimezone  bool           `json:"need_client_timezone"`
	HasHeaderRow        bool           `json:"has_header_row"`
	HasByteOrderMarker  bool           `json:"has_byte_order_marker"`
	LinesMerged         int            `json:"lines_merged"`
	Format              string         `json:"format"`
	Charset             string         `json:"charset"`
	Delimiter           string         `json:"delimiter,omitempty"`
	Quote               string         `json:"quote,omitempty"`
	OriginalQuote       string         `json:"original_quote,omitempty"`
	ColumnNames         []string       `json:"column_names,omitempty"`
	GrokPattern         string         `json:"grok_pattern,omitempty"`
	TimestampField      string         `json:"timestamp_field,omitempty"`
	TimestampFormat     string         `json:"timestamp_format,omitempty"`
	ShouldTrimFields    bool           `json:"should_trim_fields"`
	Mappings            map[string]any `json:"mappings,omitempty"`
	IngestPipeline      map[string]any `json:"ingest_pipeline,omitempty"`
	Explanation         []string       `json:"explanation,omitempty"`
	SampleStart         string         `json:"sample_start,omitempty"`
	SampleSize          int            `json:"sample_size,omitempty"`
	NumLinesAnalyzed    int            `json:"num_lines_analyzed,omitempty"`
	NumMessagesAnalyzed int            `json:"num_messages_analyzed,omitempty"`
}

TextStructureResponse is the response from find_structure.

type TextStructureService

type TextStructureService interface {
	FindStructure(ctx context.Context, body any, params *TextStructureFindParams) (*TextStructureResponse, error)
	FindFieldStructure(ctx context.Context, index, field string, params *TextStructureFindParams) (json.RawMessage, error)
	FindMessageStructure(ctx context.Context, index string, params *TextStructureFindParams) (json.RawMessage, error)
	TestGrokPattern(ctx context.Context, body any, params *TextStructureFindParams) (json.RawMessage, error)
}

TextStructureService provides access to the text structure APIs.

func NewTextStructureService

func NewTextStructureService(client *resty.Client, logger *logrus.Entry) TextStructureService

NewTextStructureService creates a new TextStructureService.

type TimeType

type TimeType string

TimeType is a generic string alias for time/duration values ("30s", "1m").

type TokenInfo

type TokenInfo struct {
	StartOffset int64  `json:"start_offset"`
	EndOffset   int64  `json:"end_offset"`
	Position    int64  `json:"position"`
	Payload     string `json:"payload"`
}

TokenInfo describes a single token occurrence within a term vector response.

type TransformConfig

type TransformConfig struct {
	ID          string         `json:"id,omitempty"`
	Description string         `json:"description,omitempty"`
	Source      map[string]any `json:"source,omitempty"`
	Dest        map[string]any `json:"dest,omitempty"`
	Frequency   string         `json:"frequency,omitempty"`
	Sync        map[string]any `json:"sync,omitempty"`
	Pivot       map[string]any `json:"pivot,omitempty"`
	Latest      map[string]any `json:"latest,omitempty"`
	Settings    map[string]any `json:"settings,omitempty"`
	Meta        map[string]any `json:"_meta,omitempty"`
	Version     *int           `json:"version,omitempty"`
	CreateTime  int64          `json:"create_time,omitempty"`
}

TransformConfig describes a transform configuration.

type TransformDeleteParams

type TransformDeleteParams struct {
	Common  *CommonParams
	Force   *bool
	Timeout string
}

TransformDeleteParams are the query parameters for transform delete.

func (*TransformDeleteParams) ToMap

func (p *TransformDeleteParams) ToMap() map[string]string

ToMap converts TransformDeleteParams to a query-parameter map.

type TransformGetParams

type TransformGetParams struct {
	Common           *CommonParams
	AllowNoMatch     *bool
	ExcludeGenerated *bool
	From             *int
	Size             *int
}

TransformGetParams are the query parameters for transform get.

func (*TransformGetParams) ToMap

func (p *TransformGetParams) ToMap() map[string]string

ToMap converts TransformGetParams to a query-parameter map.

type TransformGetResponse

type TransformGetResponse struct {
	Count      int               `json:"count"`
	Transforms []TransformConfig `json:"transforms"`
}

TransformGetResponse is the response from transform get.

type TransformGetStatsParams

type TransformGetStatsParams struct {
	Common       *CommonParams
	AllowNoMatch *bool
	From         *int
	Size         *int
	Timeout      string
}

TransformGetStatsParams are the query parameters for transform get stats.

func (*TransformGetStatsParams) ToMap

func (p *TransformGetStatsParams) ToMap() map[string]string

ToMap converts TransformGetStatsParams to a query-parameter map.

type TransformNodeStatsResponse

type TransformNodeStatsResponse struct {
	Nodes map[string]struct {
		Transforms map[string]any `json:"transforms"`
	} `json:"nodes"`
}

TransformNodeStatsResponse is the response from transform node stats.

type TransformPreviewParams

type TransformPreviewParams struct {
	Common  *CommonParams
	Timeout string
}

TransformPreviewParams are the query parameters for transform preview.

func (*TransformPreviewParams) ToMap

func (p *TransformPreviewParams) ToMap() map[string]string

ToMap converts TransformPreviewParams to a query-parameter map.

type TransformPreviewResponse

type TransformPreviewResponse struct {
	Preview []map[string]any `json:"preview"`
}

TransformPreviewResponse is the response from transform preview.

type TransformPutParams

type TransformPutParams struct {
	Common          *CommonParams
	DeferValidation *bool
	Timeout         string
}

TransformPutParams are the query parameters for transform put.

func (*TransformPutParams) ToMap

func (p *TransformPutParams) ToMap() map[string]string

ToMap converts TransformPutParams to a query-parameter map.

type TransformPutResponse

type TransformPutResponse struct {
	Acknowledged bool `json:"acknowledged"`
	Created      bool `json:"created"`
}

TransformPutResponse is the response from transform put.

type TransformResetParams

type TransformResetParams struct {
	Common  *CommonParams
	Force   *bool
	Timeout string
}

TransformResetParams are the query parameters for transform reset.

func (*TransformResetParams) ToMap

func (p *TransformResetParams) ToMap() map[string]string

ToMap converts TransformResetParams to a query-parameter map.

type TransformService

type TransformService interface {
	Get(ctx context.Context, transformIds []string, params *TransformGetParams) (*TransformGetResponse, error)
	GetStats(ctx context.Context, transformIds []string, params *TransformGetStatsParams) (*TransformStatsResponse, error)
	Put(ctx context.Context, transformId string, body any, params *TransformPutParams) (*TransformPutResponse, error)
	Preview(ctx context.Context, transformId string, body any, params *TransformPreviewParams) (*TransformPreviewResponse, error)
	Delete(ctx context.Context, transformId string, params *TransformDeleteParams) (*types.AcknowledgedResponse, error)
	Start(ctx context.Context, transformId string, params *TransformStartParams) (*types.AcknowledgedResponse, error)
	Stop(ctx context.Context, transformId string, params *TransformStopParams) (*types.AcknowledgedResponse, error)
	Reset(ctx context.Context, transformId string, params *TransformResetParams) (*types.AcknowledgedResponse, error)
	ScheduleNow(ctx context.Context, transformId string) (*types.AcknowledgedResponse, error)
	Upgrade(ctx context.Context, params *TransformUpgradeParams) (*TransformUpgradeResponse, error)
	GetNodeStats(ctx context.Context) (*TransformNodeStatsResponse, error)
}

TransformService provides access to the transform APIs.

func NewTransformService

func NewTransformService(client *resty.Client, logger *logrus.Entry) TransformService

NewTransformService creates a new TransformService.

type TransformStartParams

type TransformStartParams struct {
	Common  *CommonParams
	Timeout string
}

TransformStartParams are the query parameters for transform start.

func (*TransformStartParams) ToMap

func (p *TransformStartParams) ToMap() map[string]string

ToMap converts TransformStartParams to a query-parameter map.

type TransformStats

type TransformStats struct {
	ID             string         `json:"id"`
	State          string         `json:"state"`
	Reason         string         `json:"reason,omitempty"`
	Stats          map[string]any `json:"stats,omitempty"`
	CheckpointInfo map[string]any `json:"checkpointing_info,omitempty"`
	Health         map[string]any `json:"health,omitempty"`
}

TransformStats describes transform statistics.

type TransformStatsResponse

type TransformStatsResponse struct {
	Count      int              `json:"count"`
	Transforms []TransformStats `json:"transforms"`
}

TransformStatsResponse is the response from transform stats.

type TransformStopParams

type TransformStopParams struct {
	Common            *CommonParams
	AllowNoMatch      *bool
	Force             *bool
	Timeout           string
	WaitForCheckpoint *bool
	WaitForCompletion *bool
}

TransformStopParams are the query parameters for transform stop.

func (*TransformStopParams) ToMap

func (p *TransformStopParams) ToMap() map[string]string

ToMap converts TransformStopParams to a query-parameter map.

type TransformUpgradeParams

type TransformUpgradeParams struct {
	Common  *CommonParams
	DryRun  *bool
	Timeout string
}

TransformUpgradeParams are the query parameters for transform upgrade.

func (*TransformUpgradeParams) ToMap

func (p *TransformUpgradeParams) ToMap() map[string]string

ToMap converts TransformUpgradeParams to a query-parameter map.

type TransformUpgradeResponse

type TransformUpgradeResponse struct {
	NeedsUpdate bool     `json:"needs_update"`
	DryRun      bool     `json:"dry_run"`
	Updated     []string `json:"updated"`
	NoAction    []string `json:"no_action"`
}

TransformUpgradeResponse is the response from transform upgrade.

type UpdateByQueryParams

type UpdateByQueryParams struct {
	Common              *CommonParams
	Analyzer            string
	AnalyzeWildcard     *bool
	Conflicts           Conflicts
	DefaultOperator     DefaultOperator
	Df                  string
	ExpandWildcards     ExpandWildcards
	From                *int
	IgnoreUnavailable   *bool
	Lenient             *bool
	MaxDocs             *int
	Pipeline            string
	Preference          string
	Q                   string
	Refresh             *bool
	RequestCache        *bool
	RequestsPerSecond   *float64
	Routing             string
	Scroll              string
	ScrollSize          *int
	SearchTimeout       string
	SearchType          SearchType
	SliceId             string
	SliceMax            *int
	Slices              string
	Sort                []string
	Stats               []string
	TerminateAfter      *int
	Timeout             string
	Version             *bool
	VersionType         VersionType
	WaitForActiveShards string
	WaitForCompletion   *bool
}

UpdateByQueryParams are the query parameters for update_by_query. They mirror DeleteByQueryParams plus the update-specific pipeline and version_type parameters.

func (*UpdateByQueryParams) ToMap

func (p *UpdateByQueryParams) ToMap() map[string]string

ToMap converts UpdateByQueryParams to a query-parameter map.

type UpdateByQueryRequest

type UpdateByQueryRequest struct {
	Indices []string `validate:"required,min=1"`
	Body    any
	Params  *UpdateByQueryParams
}

UpdateByQueryRequest is the request for POST /{index}/_update_by_query.

func (*UpdateByQueryRequest) Validate

func (r *UpdateByQueryRequest) Validate() error

Validate validates the UpdateByQueryRequest.

type UpdateParams

type UpdateParams struct {
	Common              *CommonParams
	IfPrimaryTerm       *int64
	IfSeqNo             *int64
	Lang                string
	Refresh             Refresh
	RequireAlias        *bool
	RetryOnConflict     *int
	Routing             string
	Source              string
	SourceExcludes      []string
	SourceIncludes      []string
	Timeout             string
	WaitForActiveShards string
}

UpdateParams are the query parameters for the update endpoint.

func (*UpdateParams) ToMap

func (p *UpdateParams) ToMap() map[string]string

ToMap converts UpdateParams to a query-parameter map.

type UpdateRequest

type UpdateRequest struct {
	Index  string `validate:"required"`
	Id     string `validate:"required"`
	Body   any
	Params *UpdateParams
}

UpdateRequest is the request for POST /{index}/_update/{id}.

func (*UpdateRequest) Validate

func (r *UpdateRequest) Validate() error

Validate validates the UpdateRequest.

type UpdateResponse

type UpdateResponse struct {
	Index         string            `json:"_index,omitempty"`
	Id            string            `json:"_id,omitempty"`
	Version       int64             `json:"_version,omitempty"`
	Result        string            `json:"result,omitempty"`
	Shards        *types.ShardsInfo `json:"_shards,omitempty"`
	SeqNo         int64             `json:"_seq_no,omitempty"`
	PrimaryTerm   int64             `json:"_primary_term,omitempty"`
	Status        int               `json:"status,omitempty"`
	ForcedRefresh bool              `json:"forced_refresh,omitempty"`
	GetResult     *GetResult        `json:"get,omitempty"`
}

UpdateResponse represents the result of an update document operation.

type ValidateQueryParams

type ValidateQueryParams struct {
	Common            *CommonParams
	AllShards         *bool
	AllowNoIndices    *bool
	Analyzer          string
	AnalyzeWildcard   *bool
	DefaultOperator   DefaultOperator
	Df                string
	ExpandWildcards   ExpandWildcards
	Explain           *bool
	IgnoreUnavailable *bool
	Lenient           *bool
	Q                 string
	Rewrite           *bool
}

ValidateQueryParams are the query parameters for the validate_query endpoint.

func (*ValidateQueryParams) ToMap

func (p *ValidateQueryParams) ToMap() map[string]string

ToMap converts ValidateQueryParams to a query-parameter map.

type ValidateQueryRequest

type ValidateQueryRequest struct {
	Indices []string
	Body    any
	Params  *ValidateQueryParams
}

ValidateQueryRequest is the request for GET|POST /_validate/query.

type VersionType

type VersionType string

VersionType controls versioning strategy for document operations.

const (
	VersionTypeInternal    VersionType = "internal"
	VersionTypeExternal    VersionType = "external"
	VersionTypeExternalGte VersionType = "external_gte"
)

type WaitForStatus

type WaitForStatus string

WaitForStatus values.

const (
	WaitForStatusGreen  WaitForStatus = "green"
	WaitForStatusYellow WaitForStatus = "yellow"
	WaitForStatusRed    WaitForStatus = "red"
)

type WatcherAckWatchResponse

type WatcherAckWatchResponse struct {
	Status map[string]any `json:"status"`
}

WatcherAckWatchResponse is the response from ack watch.

type WatcherActivateWatchResponse

type WatcherActivateWatchResponse struct {
	Status map[string]any `json:"status"`
}

WatcherActivateWatchResponse is the response from activate/deactivate watch.

type WatcherDeleteWatchResponse

type WatcherDeleteWatchResponse struct {
	Found   bool   `json:"found"`
	ID      string `json:"_id,omitempty"`
	Version int64  `json:"_version,omitempty"`
}

WatcherDeleteWatchResponse is the response from delete watch.

type WatcherExecuteWatchParams

type WatcherExecuteWatchParams struct {
	Common *CommonParams
	Debug  *bool
}

WatcherExecuteWatchParams are the query parameters for execute watch.

func (*WatcherExecuteWatchParams) ToMap

func (p *WatcherExecuteWatchParams) ToMap() map[string]string

ToMap converts WatcherExecuteWatchParams to a query-parameter map.

type WatcherExecuteWatchResponse

type WatcherExecuteWatchResponse struct {
	ID          string         `json:"id"`
	WatchRecord map[string]any `json:"watch_record"`
}

WatcherExecuteWatchResponse is the response from execute watch.

type WatcherGetWatchResponse

type WatcherGetWatchResponse struct {
	Found  bool           `json:"found"`
	ID     string         `json:"_id,omitempty"`
	Status map[string]any `json:"status,omitempty"`
	Watch  map[string]any `json:"watch,omitempty"`
}

WatcherGetWatchResponse is the response from get watch.

type WatcherPutWatchParams

type WatcherPutWatchParams struct {
	Common        *CommonParams
	Active        *bool
	IfPrimaryTerm *int64
	IfSeqNo       *int64
}

WatcherPutWatchParams are the query parameters for put watch.

func (*WatcherPutWatchParams) ToMap

func (p *WatcherPutWatchParams) ToMap() map[string]string

ToMap converts WatcherPutWatchParams to a query-parameter map.

type WatcherPutWatchResponse

type WatcherPutWatchResponse struct {
	ID      string `json:"_id"`
	Version int64  `json:"_version"`
	Created bool   `json:"created"`
}

WatcherPutWatchResponse is the response from put watch.

type WatcherQueryWatchesResponse

type WatcherQueryWatchesResponse struct {
	Count   int `json:"count"`
	Watches []struct {
		ID     string         `json:"id"`
		Watch  map[string]any `json:"watch,omitempty"`
		Status map[string]any `json:"status,omitempty"`
	} `json:"watches"`
}

WatcherQueryWatchesResponse is the response from query watches.

type WatcherService

WatcherService provides access to the watcher APIs.

func NewWatcherService

func NewWatcherService(client *resty.Client, logger *logrus.Entry) WatcherService

NewWatcherService creates a new WatcherService.

type WatcherStatsParams

type WatcherStatsParams struct {
	Common          *CommonParams
	EmitStacktraces *bool
}

WatcherStatsParams are the query parameters for watcher stats.

func (*WatcherStatsParams) ToMap

func (p *WatcherStatsParams) ToMap() map[string]string

ToMap converts WatcherStatsParams to a query-parameter map.

type WatcherStatsResponse

type WatcherStatsResponse struct {
	WatcherState   string           `json:"watcher_state"`
	Stats          map[string]any   `json:"stats,omitempty"`
	Queues         map[string]any   `json:"queues,omitempty"`
	CurrentWatches []map[string]any `json:"current_watches,omitempty"`
}

WatcherStatsResponse is the response from watcher stats.

type XpackFeature

type XpackFeature struct {
	Available    bool     `json:"available"`
	Enabled      bool     `json:"enabled"`
	NativeRealms []string `json:"native_realms,omitempty"`
	Description  string   `json:"description,omitempty"`
}

XpackFeature describes an X-Pack feature.

type XpackInfoParams

type XpackInfoParams struct {
	Common     *CommonParams
	Categories []string
}

XpackInfoParams are the query parameters for GET /_xpack.

func (*XpackInfoParams) ToMap

func (p *XpackInfoParams) ToMap() map[string]string

ToMap converts XpackInfoParams to a query-parameter map.

type XpackInfoResponse

type XpackInfoResponse struct {
	Build    map[string]any          `json:"build"`
	License  map[string]any          `json:"license"`
	Features map[string]XpackFeature `json:"features"`
	Tagline  string                  `json:"tagline"`
}

XpackInfoResponse is the response from GET /_xpack.

type XpackService

type XpackService interface {
	Info(ctx context.Context, params *XpackInfoParams) (*XpackInfoResponse, error)
	Usage(ctx context.Context) (XpackUsageResponse, error)
}

XpackService provides access to the X-Pack info and usage APIs.

func NewXpackService

func NewXpackService(client *resty.Client, logger *logrus.Entry) XpackService

NewXpackService creates a new XpackService.

type XpackUsage

type XpackUsage struct {
	Available bool `json:"available"`
	Enabled   bool `json:"enabled"`
	// Data holds every feature-specific field that is neither available nor
	// enabled.
	Data map[string]any `json:"-"`
}

XpackUsage describes usage for an X-Pack feature. Feature-specific fields (which vary per feature) are collected into Data by the custom UnmarshalJSON implementation.

func (*XpackUsage) UnmarshalJSON

func (u *XpackUsage) UnmarshalJSON(b []byte) error

UnmarshalJSON decodes an X-Pack usage object, capturing the known available/enabled flags and collecting all remaining feature-specific fields into Data.

type XpackUsageResponse

type XpackUsageResponse map[string]XpackUsage

XpackUsageResponse is the response from GET /_xpack/usage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL