...

Package v1

import "github.com/prometheus/alertmanager/api/v1"
Overview
Index

Overview ▾

type API

API provides registration of handlers for API routes.

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

func New

func New(
    alerts provider.Alerts,
    silences *silence.Silences,
    sf getAlertStatusFn,
    peer cluster.ClusterPeer,
    l log.Logger,
    r prometheus.Registerer,
) *API

New returns a new API.

func (*API) Register

func (api *API) Register(r *route.Router)

Register registers the API handlers under their correct routes in the given router.

func (*API) Update

func (api *API) Update(cfg *config.Config)

Update sets the configuration string to a new value.

type Alert

Alert is the API representation of an alert, which is a regular alert annotated with silencing and inhibition info.

type Alert struct {
    *model.Alert
    Status      types.AlertStatus `json:"status"`
    Receivers   []string          `json:"receivers"`
    Fingerprint string            `json:"fingerprint"`
}