opensearch

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: UPL-1.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ComponentName is the name of the component
	ComponentName = "opensearch"

	// ComponentNamespace is the namespace of the component
	ComponentNamespace = constants.VerrazzanoSystemNamespace
)
View Source
const ComponentJSONName = "opensearch"

ComponentJSONName is the JSON name of the opensearch component in CRD

View Source
const (
	HealthGreen = "green"
)

Variables

This section is empty.

Functions

func AreOpensearchStsReady added in v1.7.0

func AreOpensearchStsReady(log vzlog.VerrazzanoLogger, client client.Client, namespacedNames []types.NamespacedName, expectedReplicas int32, prefix string) bool

AreOpensearchStsReady Check that the OS statefulsets have the minimum number of specified replicas ready and available. It ignores the updated replicas check if updated replicas are zero or cluster is not healthy.

func GetOSDHTTPEndpoint added in v1.7.0

func GetOSDHTTPEndpoint(client clipkg.Client) (string, error)

func GetOpenSearchHTTPEndpoint added in v1.7.0

func GetOpenSearchHTTPEndpoint(client clipkg.Client) (string, error)

func GetVerrazzanoPassword added in v1.7.0

func GetVerrazzanoPassword(client clipkg.Client) (string, error)

GetVerrazzanoPassword returns the password credential for the Verrazzano secret

func IsSingleDataNodeCluster added in v1.4.0

func IsSingleDataNodeCluster(ctx spi.ComponentContext) bool

IsSingleDataNodeCluster returns true if there is exactly 1 or 0 data nodes

func NewComponent

func NewComponent() spi.Component

Types

type ClusterHealth added in v1.7.0

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

type DataStream added in v1.7.0

type DataStream struct {
	Name           string    `json:"name,omitempty"`
	TimeStampField TimeStamp `json:"timestamp_field,omitempty"`
	Indices        []Index   `json:"indices,omitempty"`
	Generation     int       `json:"generation,omitempty"`
	Status         string    `json:"status,omitempty"`
	Template       string    `json:"template,omitempty"`
}

type DataStreams added in v1.7.0

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

type ISMPolicy added in v1.7.0

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 added in v1.7.0

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

type Index added in v1.7.0

type Index struct {
	Name string `json:"index_name,omitempty"`
	UUID string `json:"index_uuid,omitempty"`
}

type InlinePolicy added in v1.7.0

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

type OSClient added in v1.7.0

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

func NewOSClient added in v1.7.0

func NewOSClient(pas string) *OSClient

func (*OSClient) ConfigureISM added in v1.7.0

func (o *OSClient) ConfigureISM(log vzlog.VerrazzanoLogger, client clipkg.Client, vz *vzv1alpha1.Verrazzano) error

ConfigureISM sets up the ISM Policies

func (*OSClient) DeleteDefaultISMPolicy added in v1.7.0

func (o *OSClient) DeleteDefaultISMPolicy(log vzlog.VerrazzanoLogger, client clipkg.Client, vz *vzv1alpha1.Verrazzano) error

DeleteDefaultISMPolicy deletes the default ISM policy if they exists

func (*OSClient) IsClusterHealthy added in v1.7.0

func (o *OSClient) IsClusterHealthy(client clipkg.Client) (bool, error)

IsClusterHealthy checks whether Opensearch Cluster is healthy or not.

func (*OSClient) IsOpenSearchReady added in v1.7.0

func (o *OSClient) IsOpenSearchReady(client clipkg.Client) bool

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

func (*OSClient) SetAutoExpandIndices added in v1.7.0

func (o *OSClient) SetAutoExpandIndices(log vzlog.VerrazzanoLogger, client clipkg.Client, vz *vzv1alpha1.Verrazzano) error

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

func (*OSClient) SyncDefaultISMPolicy added in v1.7.0

func (o *OSClient) SyncDefaultISMPolicy(log vzlog.VerrazzanoLogger, client clipkg.Client, vz *vzv1alpha1.Verrazzano) error

SyncDefaultISMPolicy set up the default ISM Policies.

type PolicyConditions added in v1.7.0

type PolicyConditions struct {
	MinIndexAge    string `json:"min_index_age,omitempty"`
	MinRolloverAge string `json:"min_rollover_age,omitempty"`
}

type PolicyList added in v1.7.0

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

type PolicyState added in v1.7.0

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

type PolicyTransition added in v1.7.0

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

type TimeStamp added in v1.7.0

type TimeStamp struct {
	Name string `json:"name,omitempty"`
}

Jump to

Keyboard shortcuts

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