elasticsearch

package
v0.0.0-...-51c5060 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: CC0-1.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const PgroupPrefix = "cg-elasticsearch-broker-"

This is the prefix for all pgroups created by the broker.

Variables

This section is empty.

Functions

func InitElasticsearchBroker

func InitElasticsearchBroker(brokerDB *gorm.DB, settings *config.Settings, taskqueue *taskqueue.QueueManager) base.Broker

InitelasticsearchBroker is the constructor for the elasticsearchBroker.

Types

type ElasticsearchAdapter

type ElasticsearchAdapter interface {
	// contains filtered or unexported methods
}

type ElasticsearchAdvancedOptions

type ElasticsearchAdvancedOptions struct {
	IndicesFieldDataCacheSize      string `json:"indices.fielddata.cache.size,omitempty"`
	IndicesQueryBoolMaxClauseCount string `json:"indices.query.bool.max_clause_count,omitempty"`
}

type ElasticsearchInstance

type ElasticsearchInstance struct {
	base.Instance

	Description string `sql:"size(255)"`

	Password                       string `sql:"size(255)"`
	Salt                           string `sql:"size(255)"`
	AccessKey                      string `sql:"size(255)"`
	SecretKey                      string `sql:"size(255)"`
	IamPolicy                      string `sql:"size(255)"`
	IamPolicyARN                   string `sql:"size(255)"`
	AccessControlPolicy            string `sql:"size(255)"`
	ElasticsearchVersion           string `sql:"size(255)"`
	CurrentESVersion               string `sql:"size(255)"`
	MasterCount                    int    `sql:"size(255)"`
	DataCount                      int    `sql:"size(255)"`
	InstanceType                   string `sql:"size(255)"`
	MasterInstanceType             string `sql:"size(255)"`
	VolumeSize                     int    `sql:"size(255)"`
	VolumeType                     string `sql:"size(255)"`
	MasterEnabled                  bool   `sql:"size(255)"`
	NodeToNodeEncryption           bool   `sql:"size(255)"`
	EncryptAtRest                  bool   `sql:"size(255)"`
	AutomatedSnapshotStartHour     int    `sql:"size(255)"`
	Bucket                         string `sql:"size(255)"`
	BrokerSnapshotsEnabled         bool   `sql:"size(255)"`
	SnapshotARN                    string `sql:"size(255)"`
	SnapshotPolicyARN              string `sql:"size(255)"`
	SnapshotPath                   string `sql:"size(255)"`
	IamPassRolePolicyARN           string `sql:"size(255)"`
	IndicesFieldDataCacheSize      string `sql:"size(255)"`
	IndicesQueryBoolMaxClauseCount string `sql:"size(255)"`

	ClearPassword string `sql:"-"`

	Domain string `sql:"size(255)"`
	ARN    string `sql:"size(255)"`

	Tags         map[string]string `sql:"-"`
	SubnetID1AZ1 string            `sql:"-"`
	SubnetID2AZ2 string            `sql:"-"`
	SubnetID3AZ1 string            `sql:"-"`
	SubnetID4AZ2 string            `sql:"-"`
	SecGroup     string            `sql:"-"`
}

ElasticsearchInstance represents the information of an Elasticsearch Service instance.

type ElasticsearchOptions

type ElasticsearchOptions struct {
	ElasticsearchVersion string                       `json:"elasticsearchVersion"`
	Bucket               string                       `json:"bucket"`
	AdvancedOptions      ElasticsearchAdvancedOptions `json:"advanced_options,omitempty"`
	VolumeType           string                       `json:"volume_type"`
}

func (ElasticsearchOptions) Validate

func (o ElasticsearchOptions) Validate(settings *config.Settings) error

type EsApiHandler

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

func (*EsApiHandler) CreateSnapshot

func (es *EsApiHandler) CreateSnapshot(reponame string, snapshotname string) (string, error)

func (*EsApiHandler) CreateSnapshotRepo

func (es *EsApiHandler) CreateSnapshotRepo(reponame string, bucketname string, path string, region string, rolearn string) (string, error)

func (*EsApiHandler) GetSnapshotRepo

func (es *EsApiHandler) GetSnapshotRepo(reponame string) (string, error)

func (*EsApiHandler) GetSnapshotStatus

func (es *EsApiHandler) GetSnapshotStatus(reponame string, snapshotname string) (string, error)

func (*EsApiHandler) Init

func (es *EsApiHandler) Init(svcInfo map[string]string, region string) error

This will take a Credentials mapping from an ElasticSearchInstance and the region info to create an API handler.

func (*EsApiHandler) Send

func (es *EsApiHandler) Send(method string, endpoint string, content string) ([]byte, error)

makes the api request with v4 signing and then returns the body of the response as string

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

abstract this method for mocking

type Snapshot

type Snapshot struct {
	Snapshot  string   `json:"snapshot"`
	Version   string   `json:"version"`
	State     string   `json:"state"`
	Indicies  []string `json:"indicies"`
	StartTime string   `json:"start_time"`
	EndTime   string   `json:"end_time"`
}

type SnapshotRepo

type SnapshotRepo struct {
	Type     string               `json:"type"`
	Settings SnapshotRepoSettings `json:"settings"`
}

func NewSnapshotRepo

func NewSnapshotRepo(bucketname string, path string, region string, rolearn string) *SnapshotRepo

func (*SnapshotRepo) ToString

func (sr *SnapshotRepo) ToString() (string, error)

type SnapshotRepoSettings

type SnapshotRepoSettings struct {
	Bucket   string `json:"bucket"`
	BasePath string `json:"base_path"`              //omit leading '/'
	SSE      bool   `json:"server_side_encryption"` //we set this to true, default is false
	Region   string `json:"region"`
	RoleArn  string `json:"role_arn"`
}

type Snapshots

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

Jump to

Keyboard shortcuts

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