elasticsearch

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(params CreateParams) (*models.ClusterCrudResponse, error)

Create Creates a new Elasticsearch cluster.

func DeleteCluster

func DeleteCluster(params DeleteClusterParams) error

DeleteCluster deletes an Elasticsearch cluster.

func Diagnose

func Diagnose(params DiagnoseParams) error

Diagnose generates a diagnostic bundle and writes it to the specified Writer.

func GetCluster

GetCluster fetches the cluster information with the settings

func List

List lists all the elasticsearch clusters matching the filters

func NewQueryByUserID

func NewQueryByUserID(params NewQueryParams) ([]*models.QueryContainer, error)

NewQueryByUserID creates query to match on userID

func NewStartedClusterQuery

func NewStartedClusterQuery(includeInitializing bool) []*models.QueryContainer

NewStartedClusterQuery matches clusters currently running (started)

func Query

func Query(params QueryParams) error

Query performs either an API call to an elasticsearch cluster or opens an interactive console connected to the public facing URL.

func Reallocate

func Reallocate(params ReallocateParams) error

Reallocate will reallocate the Elasticsearch cluster instances, if no Instances are specified, all of the instances will be moved. The operation will attempt to create a cluster comment to leave context in the cluster

func RestartCluster

func RestartCluster(params RestartClusterParams) error

RestartCluster restarts an Elasticsearch cluster, if rolling is set to true the restart will happen on one logical zone at a time, meaning the cluster won't experience downtime, else, all of the nodes will be restarted at the same time causing downtime in the cluster.

func ResyncCluster

func ResyncCluster(params ResyncClusterParams) error

ResyncCluster forces indexer to immediately resynchronize the search index and cache for a given Elasticsearch cluster.

func SearchClusters

func SearchClusters(params SearchClusterParams) (*models.ElasticsearchClustersInfo, error)

SearchClusters searches all the elasticsearch clusters using Query DSL

func ShutdownCluster

func ShutdownCluster(params ShutdownClusterParams) error

ShutdownCluster shuts down an Elasticsearch cluster. If hide is true it will also hide the cluster in the UI

func Upgrade

func Upgrade(params UpgradeParams) (*models.ClusterCrudResponse, error)

Upgrade the Elasticsearch cluster to the specified version.

Types

type CreateParams

type CreateParams struct {
	*api.API
	util.TrackParams

	// Plan defines the Elasticsearch cluster plan definition.
	PlanDefinition *models.ElasticsearchClusterPlan

	// ClusterName is the optional name to give to the cluster.
	ClusterName string

	// LegacyPlanParams are used when no Plan definition is passed
	plan.LegacyParams
}

CreateParams is consumed by Create.

func (*CreateParams) Validate

func (params *CreateParams) Validate() error

Validate ensures the parameters are usable by Create.

type DeleteClusterParams

type DeleteClusterParams struct {
	util.ClusterParams
}

DeleteClusterParams ensures the parameters are usable by DeleteCluster.

type DiagnoseParams

type DiagnoseParams struct {
	util.ClusterParams
	Writer io.Writer
}

DiagnoseParams is consumed by Diagnose.

func (DiagnoseParams) Validate

func (params DiagnoseParams) Validate() error

Validate ensures the parameters are usable by the consumer.

type GetClusterParams

type GetClusterParams struct {
	util.ClusterParams
	Metadata, PlanDefaults, Plans, Logs, Settings bool
}

GetClusterParams contains parameters used to fetch cluster's data

type ListParams

type ListParams struct {
	*api.API

	// Version post processes the list results filtering out any versions which
	// don't match the specified one. Using this parameter makes the resulting
	// list equal or smaller to the specified size.
	Version string

	// SystemAlerts is number of system alerts to include in the response.
	// For example, the number of forced restarts caused from a limited amount
	// of memory. Only numbers greater than zero return a field. If 0, defaults
	// to 5.
	SystemAlerts int64

	// Optional parameters
	deputil.QueryParams
}

ListParams is used to obtain a number of clusters

func (ListParams) Validate

func (params ListParams) Validate() error

Validate ensures the parameters are usable.

type NewQueryParams

type NewQueryParams struct {
	UserID string
}

NewQueryParams specifies user to perform the query on

func (NewQueryParams) Validate

func (params NewQueryParams) Validate() error

Validate ensures the structure is usable

type QueryParams

type QueryParams struct {
	util.AuthenticationParams
	util.ClusterParams
	RestRequest

	Client      *http.Client
	Interactive bool
	Verbose     bool
}

QueryParams describes the options passed to OpenElasticsearchConsole

func (QueryParams) Validate

func (params QueryParams) Validate() error

Validate ensures that the params are usable by the consuming function.

type ReallocateParams

type ReallocateParams struct {
	util.ClusterParams
	Instances []string

	// Commenting user
	User          string
	InstancesDown *bool
	OutputDevice  *output.Device
	PollFrequency time.Duration
	MaxRetries    uint8
}

ReallocateParams is used by ReallocateES as a config struct

func (ReallocateParams) Validate

func (params ReallocateParams) Validate() error

Validate ensures that the parameters are usable by the consuming function.

type RestRequest

type RestRequest struct {
	Method, Path, Body string
}

RestRequest sets the one-time request that will be handled by elasticsearch-cli

type RestartClusterParams

type RestartClusterParams struct {
	util.ClusterParams
	util.TrackParams

	ShardInitWaitTime time.Duration

	RollingByName, RollingByZone, SkipSnapshot, RestoreSnapshot bool
}

RestartClusterParams is used to restart clusters with specific parameters / options

func (RestartClusterParams) Validate

func (params RestartClusterParams) Validate() error

Validate ensures the parameters are usable by ShutdownCluster.

type ResyncClusterParams

type ResyncClusterParams struct {
	// ClusterParams embeds default Elasticsearch cluster
	// parameters (e.g., API clients, etc.).
	util.ClusterParams
}

ResyncClusterParams represents parameters used to resynchronize an Elasticsearch cluster.

type SearchClusterParams

type SearchClusterParams struct {
	Request models.SearchRequest
	*api.API
}

SearchClusterParams contains parameters used to search cluster's data using Query DSL

func (SearchClusterParams) Validate

func (params SearchClusterParams) Validate() error

Validate is the implementation for the ecctl.Validator interface

type ShutdownClusterParams

type ShutdownClusterParams struct {
	util.ClusterParams
	util.TrackParams

	// Hides the cluster from the user console if specified.
	Hide         bool
	SkipSnapshot bool
}

ShutdownClusterParams used to shut down an elasticsearch cluster.

func (ShutdownClusterParams) Validate

func (params ShutdownClusterParams) Validate() error

Validate ensures the parameters are usable by ShutdownCluster.

type UpgradeParams

type UpgradeParams struct {
	util.ClusterParams
	util.TrackParams

	Version string
}

UpgradeParams is consumed by Upgrade.

func (UpgradeParams) Validate

func (params UpgradeParams) Validate() error

Validate ensures that the parameters are usable by Upgrade.

Directories

Path Synopsis
Package instances contains all of the elasticsearch instance actions that can be performed.
Package instances contains all of the elasticsearch instance actions that can be performed.

Jump to

Keyboard shortcuts

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