Documentation ¶
Index ¶
- func GetErrorLogIndexName() string
- func GetTimerLogIndexName() string
- type Client
- func (c *Client) AddArrayMetrics(metrics []*metrics.ArrayMetric) error
- func (c *Client) AddVolumeMetrics(metrics []*metrics.VolumeMetric) error
- func (c *Client) CleanAlerts(maxAgeInDays int) error
- func (c *Client) CleanArrayMetrics(maxAgeInDays int) error
- func (c *Client) CleanErrorLogs(maxAgeInDays int) error
- func (c *Client) CleanTimerLogs(maxAgeInDays int) error
- func (c *Client) CleanVolumeMetrics(maxAgeInDays int) error
- func (e *Client) Client() *elastic.Client
- func (e *Client) Connect() error
- func (e *Client) Connected(ctx context.Context) bool
- func (c *Client) CreateAlertsTemplate(ctx context.Context) error
- func (c *Client) CreateArrayMetricsTemplate(ctx context.Context) error
- func (c *Client) CreateArrayTemplate(ctx context.Context) error
- func (c *Client) CreateErrorLogTemplate(ctx context.Context) error
- func (c *Client) CreateTimerLogTemplate(ctx context.Context) error
- func (c *Client) CreateVolumeMetricsTemplate(ctx context.Context) error
- func (c *Client) DeleteArray(query *resources.ArrayQuery) ([]string, error)
- func (e *Client) DeleteByQuery(ctx context.Context, indexName string, query elastic.Query) error
- func (e *Client) DeleteIndices(ctx context.Context, indexNames []string) error
- func (e *Client) EnsureConnected(ctx context.Context) error
- func (c *Client) FindArrays(query *resources.ArrayQuery) ([]*resources.Array, error)
- func (c *Client) InsertArray(device *resources.Array) error
- func (c *Client) PatchArray(device *resources.Array) (*resources.Array, error)
- func (c *Client) PatchArrayTags(device *resources.Array) (*resources.Array, error)
- func (c *Client) UpdateAlerts(alerts []*metrics.Alert) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetErrorLogIndexName ¶
func GetErrorLogIndexName() string
GetErrorLogIndexName returns the dynamic index name for error logs
func GetTimerLogIndexName ¶
func GetTimerLogIndexName() string
GetTimerLogIndexName returns then dynamic index name for timer logs
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper around the core Elastic Client struct which provides some additional methods. It also implements the metrics.Database interface and will, in the future, implement the API server-related resources.ArrayDatabase interface as well.
func InitializeClient ¶
InitializeClient creates a new Client and has it attempt to connect
func (*Client) AddArrayMetrics ¶
func (c *Client) AddArrayMetrics(metrics []*metrics.ArrayMetric) error
AddArrayMetrics adds the given metrics to both the time-series and latest indices
func (*Client) AddVolumeMetrics ¶
func (c *Client) AddVolumeMetrics(metrics []*metrics.VolumeMetric) error
AddVolumeMetrics adds the given volume metrics to both the time-series and latest indices
func (*Client) CleanAlerts ¶
CleanAlerts deletes all alerts older than the given age in days
func (*Client) CleanArrayMetrics ¶
CleanArrayMetrics deletes all indices that are older than the given age in days and marks any older than today as read-only
func (*Client) CleanErrorLogs ¶
CleanErrorLogs deletes all error logs that are older than the given age in days and marks any older than today as read-only
func (*Client) CleanTimerLogs ¶
CleanTimerLogs deletes all timer logs that are older than the given age in days and marks any older than today as read-only
func (*Client) CleanVolumeMetrics ¶
CleanVolumeMetrics deletes all volume indices that are older than the given age in days and marks any older than today as read-only
func (*Client) Client ¶
Client returns the inner Elastic client to perform standard Elasticsearch calls on
func (*Client) CreateAlertsTemplate ¶
CreateAlertsTemplate creates the template for the alert index
func (*Client) CreateArrayMetricsTemplate ¶
CreateArrayMetricsTemplate creates the template for the array metrics indices
func (*Client) CreateArrayTemplate ¶
CreateArrayTemplate creates the template for the array index
func (*Client) CreateErrorLogTemplate ¶
CreateErrorLogTemplate creates the template for the error logs
func (*Client) CreateTimerLogTemplate ¶
CreateTimerLogTemplate creates the template for the error logs
func (*Client) CreateVolumeMetricsTemplate ¶
CreateVolumeMetricsTemplate creates the template for the volume metrics indices
func (*Client) DeleteArray ¶
func (c *Client) DeleteArray(query *resources.ArrayQuery) ([]string, error)
DeleteArray deletes the devices matching the given query from Elastic.
func (*Client) DeleteByQuery ¶
DeleteByQuery deletes documents by query in the given index
func (*Client) DeleteIndices ¶
DeleteIndices deletes the given indices
func (*Client) EnsureConnected ¶
EnsureConnected provides a method such that, once called, the client is guaranteed to be connected or an error will be thrown
func (*Client) FindArrays ¶
FindArrays searches with the given query to find arrays. Note that this leaves the API token blank, and thus it will need to be filled in by the calling method.
func (*Client) InsertArray ¶
InsertArray inserts the given storage device into Elastic.
func (*Client) PatchArray ¶
PatchArray patches the given device's fields (except for tags).
func (*Client) PatchArrayTags ¶
PatchArrayTags patches the tags on the given device.