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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opensearch

type Opensearch interface {
	// HTTPHelper Http wrapper to make REST based method calls
	HTTPHelper(ctx context.Context, method, requestURL string, body io.Reader, data interface{}) error

	// EnsureOpenSearchIsReachable Keep alive check with retry
	EnsureOpenSearchIsReachable() error

	// EnsureOpenSearchIsHealthy Health status check with retry
	EnsureOpenSearchIsHealthy() error

	// ReloadOpensearchSecureSettings updates Opensearch keystore with credentials
	ReloadOpensearchSecureSettings() error

	// RegisterSnapshotRepository creates a new S3 based repository
	RegisterSnapshotRepository() error

	// TriggerSnapshot starts the snapshot(backup) of the Opensearch data streams
	TriggerSnapshot() error

	// CheckSnapshotProgress checks the status of the backup process
	CheckSnapshotProgress() error

	// DeleteData deletes all data streams and indices
	DeleteData() error

	// TriggerRestore starts the snapshot restore of the Opensearch data streams
	TriggerRestore() error

	// CheckRestoreProgress checks the progress of the restore progress
	CheckRestoreProgress() error

	// Backup Toplevel method to start the backup operation
	Backup() error

	// Restore Toplevel method to start the restore operation
	Restore() error
}

Opensearch Interface implements methods needed for backup and restore of Opensearch These methods are used with the hook to save and restore Opensearch data

type OpensearchImpl

type OpensearchImpl struct {
	Client     *http.Client
	Timeout    string //Timeout for HTTP calls
	BaseURL    string
	SecretData *types.ConnectionData
	Log        *zap.SugaredLogger
}

OpensearchImpl struct for Opensearch interface

func New

func New(baseURL string, timeout string, client *http.Client, secretData *types.ConnectionData, log *zap.SugaredLogger) *OpensearchImpl

New Opensearch Impl constructor

func (*OpensearchImpl) Backup

func (o *OpensearchImpl) Backup() error

Backup - Toplevel method to invoke OpenSearch backup

func (*OpensearchImpl) CheckRestoreProgress

func (o *OpensearchImpl) CheckRestoreProgress() error

CheckRestoreProgress checks progress of restore process, by monitoring all the data streams

func (*OpensearchImpl) CheckSnapshotProgress

func (o *OpensearchImpl) CheckSnapshotProgress() error

CheckSnapshotProgress checks the data backup progress.

func (*OpensearchImpl) DeleteData

func (o *OpensearchImpl) DeleteData() error

DeleteData used to delete data streams before restore.

func (*OpensearchImpl) EnsureOpenSearchIsHealthy

func (o *OpensearchImpl) EnsureOpenSearchIsHealthy() error

EnsureOpenSearchIsHealthy ensures OpenSearch cluster is healthy

func (*OpensearchImpl) EnsureOpenSearchIsReachable

func (o *OpensearchImpl) EnsureOpenSearchIsReachable() error

EnsureOpenSearchIsReachable is used determine whether OpenSearch cluster is reachable

func (*OpensearchImpl) HTTPHelper

func (o *OpensearchImpl) HTTPHelper(ctx context.Context, method, requestURL string, body io.Reader, data interface{}) error

HTTPHelper supports net/http calls of type GET/POST/DELETE

func (*OpensearchImpl) RegisterSnapshotRepository

func (o *OpensearchImpl) RegisterSnapshotRepository() error

RegisterSnapshotRepository registers an object store with OpenSearch using the s3-plugin

func (*OpensearchImpl) ReloadOpensearchSecureSettings

func (o *OpensearchImpl) ReloadOpensearchSecureSettings() error

ReloadOpensearchSecureSettings used to reload secure settings once object store keys are updated

func (*OpensearchImpl) Restore

func (o *OpensearchImpl) Restore() error

Restore - Top level method to invoke opensearch restore

func (*OpensearchImpl) TriggerRestore

func (o *OpensearchImpl) TriggerRestore() error

TriggerRestore Triggers a restore from a specified snapshot

func (*OpensearchImpl) TriggerSnapshot

func (o *OpensearchImpl) TriggerSnapshot() error

TriggerSnapshot this triggers a snapshot/backup of all the data streams/indices

Jump to

Keyboard shortcuts

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