opensearch

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: UPL-1.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HealthGreen           = "green"
	MinDataNodesForResize = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterHealth

type ClusterHealth struct {
	Status string `json:"status"`
}

type Dest

type Dest struct {
	Index  string `json:"index"`
	OpType string `json:"op_type"`
}

type ISMPolicy

type ISMPolicy struct {
	ID             *string      `json:"_id,omitempty"`
	PrimaryTerm    *int         `json:"_primary_term,omitempty"`
	SequenceNumber *int         `json:"_seq_no,omitempty"`
	Status         *int         `json:"status,omitempty"`
	Policy         InlinePolicy `json:"policy"`
}

type ISMTemplate

type ISMTemplate struct {
	IndexPatterns []string `json:"index_patterns"`
	Priority      int      `json:"priority"`
}

type InlinePolicy

type InlinePolicy struct {
	DefaultState string        `json:"default_state"`
	Description  string        `json:"description"`
	States       []PolicyState `json:"states"`
	ISMTemplate  []ISMTemplate `json:"ism_template"`
}

type Node

type Node struct {
	Version string   `json:"version"`
	Roles   []string `json:"roles"`
}

type NodeSettings

type NodeSettings struct {
	Nodes map[string]interface{} `json:"nodes"`
}

type OSClient

type OSClient struct {
	DoHTTP func(request *http.Request) (*http.Response, error)
	// contains filtered or unexported fields
}

func NewOSClient

func NewOSClient(statefulSetLister appslistersv1.StatefulSetLister) *OSClient

func (*OSClient) ConfigureISM

func (o *OSClient) ConfigureISM(vmi *vmcontrollerv1.VerrazzanoMonitoringInstance) chan error

ConfigureISM sets up the ISM Policies The returned channel should be read for exactly one response, which tells whether ISM configuration succeeded.

func (*OSClient) DataStreamExists

func (o *OSClient) DataStreamExists(openSearchEndpoint, dataStream string) (bool, error)

func (*OSClient) IsDataResizable

func (o *OSClient) IsDataResizable(vmo *vmcontrollerv1.VerrazzanoMonitoringInstance) error

IsDataResizable returns an error unless these conditions of the OpenSearch cluster are met - at least 2 data nodes - 'green' health - all expected nodes are present in the cluster status

func (*OSClient) IsGreen

IsGreen returns an error unless these conditions of the OpenSearch cluster are met - 'green' health

func (*OSClient) IsOpenSearchReady

func (o *OSClient) IsOpenSearchReady(vmi *vmcontrollerv1.VerrazzanoMonitoringInstance) bool

IsOpenSearchReady returns true when all OpenSearch pods are ready, false otherwise

func (*OSClient) IsUpdated

IsUpdated returns an error unless these conditions of the OpenSearch cluster are met - 'green' health - all expected nodes are present in the cluster status

func (*OSClient) MigrateIndicesToDataStreams

func (o *OSClient) MigrateIndicesToDataStreams(log vzlog.VerrazzanoLogger, vmi *vmcontrollerv1.VerrazzanoMonitoringInstance, openSearchEndpoint string) error

Reindex old style indices to data streams and delete it

func (*OSClient) SetAutoExpandIndices

func (o *OSClient) SetAutoExpandIndices(vmi *vmcontrollerv1.VerrazzanoMonitoringInstance) chan error

SetAutoExpandIndices updates the default index settings to auto expand replicas (max 1) when nodes are added to the cluster

type PolicyConditions

type PolicyConditions struct {
	MinIndexAge string `json:"min_index_age"`
}

type PolicyList

type PolicyList struct {
	Policies      []ISMPolicy `json:"policies"`
	TotalPolicies int         `json:"total_policies"`
}

type PolicyState

type PolicyState struct {
	Name        string                   `json:"name"`
	Actions     []map[string]interface{} `json:"actions"`
	Transitions []PolicyTransition       `json:"transitions"`
}

type PolicyTransition

type PolicyTransition struct {
	StateName  string           `json:"state_name"`
	Conditions PolicyConditions `json:"conditions"`
}

type Query

type Query struct {
	Range `json:"range"`
}

type Range

type Range struct {
	Timestamp `json:"@timestamp"`
}

type ReindexPayload

type ReindexPayload struct {
	Conflicts string `json:"conflicts"`
	Source    `json:"source"`
	Dest      `json:"dest"`
}

type Source

type Source struct {
	Index string `json:"index"`
	Query *Query `json:"query,omitempty"`
}

type Timestamp

type Timestamp struct {
	GreaterThanEqual string `json:"gte"`
	LessThan         string `json:"lt"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL