func Register(r *gin.RouterGroup, s *Service)
Register mounts our HTTP handler on the mux.
ChaosState defines the number of chaos experiments of each phase
type ChaosState struct { Total int `json:"Total"` Running int `json:"Running"` Waiting int `json:"Waiting"` Paused int `json:"Paused"` Failed int `json:"Failed"` Finished int `json:"Finished"` }
Experiment defines the basic information of an experiment
type Experiment struct { ExperimentBase Created string `json:"created"` Status string `json:"status"` UID string `json:"uid"` FailedMessage string `json:"failed_message,omitempty"` }
ExperimentBase is used to identify the unique experiment from API request.
type ExperimentBase struct { Kind string `uri:"kind" binding:"required,oneof=PodChaos NetworkChaos IoChaos StressChaos TimeChaos KernelChaos" json:"kind"` Namespace string `uri:"namespace" binding:"required,NameValid" json:"namespace"` Name string `uri:"name" binding:"required,NameValid" json:"name"` }
ExperimentDetail represents an experiment instance.
type ExperimentDetail struct { Experiment ExperimentInfo core.ExperimentInfo `json:"experiment_info"` }
Service defines a handler service for experiments.
type Service struct {
// contains filtered or unexported fields
}
func NewService( conf *config.ChaosDashboardConfig, cli client.Client, archive core.ExperimentStore, event core.EventStore, ) *Service
NewService returns an experiment service instance.
StatusResponse defines a common status struct.
type StatusResponse struct { Status string `json:"status"` }