api

package
v0.0.0-...-8ca999e Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	// GetAlerts returns a list of alerts matching the given query.
	GetAlerts(ctx context.Context, q query.AlertQuery) ([]model.Alert, error)

	// PostAlerts stores the given alerts in the database, updating any existing alerts with the same labels.
	PostAlerts(ctx context.Context, alerts []model.Alert) error

	// QueryAlertStats executes the given stats query, returning the resulting frames.
	QueryAlertStats(ctx context.Context, q query.AlertStatsQuery) ([]query.StatsResult, error)

	// GetSilences returns a list of silences matching the given query.
	GetSilences(ctx context.Context, query query.SilenceQuery) ([]model.Silence, error)

	// PostSilences stores the given silences in the database, updating any existing silences with the same ID.
	PostSilence(ctx context.Context, silences model.Silence) error

	// AckAlert acknowledges the given alert with the given acknowledgement.
	AckAlert(ctx context.Context, alertID string, alertAck model.AlertAcknowledgement) error

	// GetClusterStatus returns the status of the nodes in the cluster.
	GetClusterStatus(ctx context.Context) ([]any, error)
}

API defines an interface that represents all the operations that can be performed on the kiora API.

type APIImpl

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

func NewAPIImpl

func NewAPIImpl(bus services.Bus, clusterer clustering.Clusterer) *APIImpl

func (*APIImpl) AckAlert

func (a *APIImpl) AckAlert(ctx context.Context, alertID string, alertAck model.AlertAcknowledgement) error

func (*APIImpl) GetAlerts

func (a *APIImpl) GetAlerts(ctx context.Context, q query.AlertQuery) ([]model.Alert, error)

func (*APIImpl) GetClusterStatus

func (a *APIImpl) GetClusterStatus(ctx context.Context) ([]any, error)

func (*APIImpl) GetSilences

func (a *APIImpl) GetSilences(ctx context.Context, q query.SilenceQuery) ([]model.Silence, error)

func (*APIImpl) PostAlerts

func (a *APIImpl) PostAlerts(ctx context.Context, alerts []model.Alert) error

func (*APIImpl) PostSilence

func (a *APIImpl) PostSilence(ctx context.Context, silence model.Silence) error

func (*APIImpl) QueryAlertStats

func (a *APIImpl) QueryAlertStats(ctx context.Context, q query.AlertStatsQuery) ([]query.StatsResult, error)

Directories

Path Synopsis
Package apiv1 provides primitives to interact with the openapi HTTP API.
Package apiv1 provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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