...

Package experiment

import "github.com/chaos-mesh/chaos-mesh/pkg/apiserver/experiment"
Overview
Index

Overview ▾

func Register

func Register(r *gin.RouterGroup, s *Service)

Register mounts our HTTP handler on the mux.

type ChaosState

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"`
}

type Experiment

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"`
}

type ExperimentBase

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"`
}

type ExperimentDetail

ExperimentDetail represents an experiment instance.

type ExperimentDetail struct {
    Experiment
    ExperimentInfo core.ExperimentInfo `json:"experiment_info"`
}

type Service

Service defines a handler service for experiments.

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

func NewService

func NewService(
    conf *config.ChaosDashboardConfig,
    cli client.Client,
    archive core.ExperimentStore,
    event core.EventStore,
) *Service

NewService returns an experiment service instance.

type StatusResponse

StatusResponse defines a common status struct.

type StatusResponse struct {
    Status string `json:"status"`
}