recomputations2

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0, Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeStatus

func ChangeStatus(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

ChangeStatus updates the status of an existing recomputation

func Delete

func Delete(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

Delete recomputation

func HandleSubrouter

func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler)

HandleSubrouter uses the subrouter for a specific calls and creates a tree of sorts handling each route with a different subrouter

func List

func List(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

List existing recomputations

func ListOne

func ListOne(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

ListOne lists a single recomputation according to the given id

func ResetStatus

func ResetStatus(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

ResetStatus resets status changes back to pending when recomputation was created

func SubmitRecomputation

func SubmitRecomputation(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

SubmitRecomputation insert a new pending recomputation in the tenants database

func Update

func Update(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

Update updates an already existing recomputation

Types

type AppliedStatusChange

type AppliedStatusChange struct {
	Metric   string `bson:"metric" json:"metric,omitempty"`
	Hostname string `bson:"hostname" json:"hostname,omitempty"`
	Service  string `bson:"service"  json:"service,omitempty"`
	Group    string `bson:"group" json:"group,omitempty"`
	State    string `bson:"state" json:"state,omitempty"`
}

Additional field to represent items that have applied statuses on them Items can be metrics, endpoints, services or groups

type Exclude

type Exclude struct {
	XMLName xml.Name `xml:"exclude" json:"-"`
	Group   string   `xml:"name,attr" json:"name"`
}

type ExcludeMonSource

type ExcludeMonSource struct {
	Host      string `bson:"host" json:"host"`
	StartTime string `bson:"start_time" json:"start_time"`
	EndTime   string `bson:"end_time" json:"end_time"`
}

type ExcludedMetric

type ExcludedMetric struct {
	Metric   string `bson:"metric" json:"metric,omitempty"`
	Hostname string `bson:"hostname" json:"timestamp,omitempty"`
	Service  string `bson:"service"  json:"service,omitempty"`
	Group    string `bson:"group" json:"group,omitempty"`
}

type HistoryItem

type HistoryItem struct {
	Status    string `bson:"status" xml:"status" json:"status"`
	Timestamp string `bson:"timestamp" xml:"timestamp" json:"timestamp"`
}

type IncomingRecomputation

type IncomingRecomputation struct {
	ID                   string                `xml:"id" json:"id" bson:"id,omitempty"`
	StartTime            string                `xml:"start_time,attr" json:"start_time" bson:"start_time,omitempty"`
	RequesterName        string                `xml:"requester_name" json:"requester_name" bson:"requester_name,omitempty" `
	RequesterEmail       string                `xml:"requester_email" json:"requester_email" bson:"requester_email,omitempty" `
	EndTime              string                `xml:"end_time,attr" json:"end_time" bson:"end_time,omitempty"`
	Reason               string                `xml:"reason,attr" json:"reason" bson:"reason,omitempty"`
	Report               string                `xml:"report,attr" json:"report" bson:"report,omitempty"`
	Exclude              []string              `xml:"exclude" json:"exclude" bson:"exclude,omitempty"`
	ExcludeMonSource     []ExcludeMonSource    `bson:"exclude_monitoring_source" json:"exclude_monitoring_source,omitempty"`
	ExcludeMetrics       []ExcludedMetric      `bson:"exclude_metrics" json:"exclude_metrics,omitempty"`
	AppliedStatusChanges []AppliedStatusChange `bson:"applied_status_changes" json:"applied_status_changes,omitempty"`
}

type IncomingRequest

type IncomingRequest struct {
	Data []IncomingRecomputation `xml:"data" json:"data"`
}

type IncomingStatus

type IncomingStatus struct {
	Status string `xml:"status" json:"status"`
}
type Links struct {
	Self string `xml:"self" json:"self"`
}

type Message

type Message struct {
	XMLName xml.Name `xml:"root" json:"-"`
	Message string   `json:"message" xml:"message"`
	Status  string   `json:"status" xml:"status"`
}

type MongoInterface

type MongoInterface struct {
	XMLName              xml.Name              `bson:"-" xml:"recomputation" json:"-"`
	ID                   string                `bson:"id" xml:"id" json:"id"`
	RequesterName        string                `bson:"requester_name" xml:"requester_name" json:"requester_name"`
	RequesterEmail       string                `bson:"requester_email" xml:"requester_email" json:"requester_email"`
	Reason               string                `bson:"reason" xml:"reason" json:"reason"`
	StartTime            string                `bson:"start_time" xml:"start_time" json:"start_time"`
	EndTime              string                `bson:"end_time" xml:"end_time" json:"end_time"`
	Report               string                `bson:"report" xml:"report" json:"report"`
	Exclude              []string              `bson:"exclude" xml:"exclude>group" json:"exclude"`
	Status               string                `bson:"status" xml:"status" json:"status"`
	Timestamp            string                `bson:"timestamp" xml:"timestamp" json:"timestamp"`
	History              []HistoryItem         `bson:"history" xml:"history" json:"history"`
	ExcludeMetrics       []ExcludedMetric      `bson:"exclude_metrics" json:"exclude_metrics,omitempty"`
	ExcludeMonSource     []ExcludeMonSource    `bson:"exclude_monitoring_source" json:"exclude_monitoring_source,omitempty"`
	AppliedStatusChanges []AppliedStatusChange `bson:"applied_status_changes" json:"applied_status_changes,omitempty"`
}

type SelfReference

type SelfReference struct {
	ID    string `xml:"id" json:"id" bson:"id,omitempty"`
	Links Links  `xml:"links" json:"links"`
}

Jump to

Keyboard shortcuts

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