v1alpha1

package
v0.0.0-...-58d9a08 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the v1alpha1 API group +kubebuilder:object:generate=true +groupName=chaosmeta.io

Index

Constants

View Source
const (
	FinalizerName   = "chaosmeta/measure"
	TimeFormat      = "2006-01-02 15:04:05"
	JudgeValueSplit = ","
	KVListSplit     = ","
	KVSplit         = ":"

	IntervalMax = math.MaxFloat64
	IntervalMin = -math.MaxFloat64

	ConnectivityTrue  = "true"
	ConnectivityFalse = "false"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "chaosmeta.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func ConvertDuration

func ConvertDuration(d string) (time.Duration, error)

func GetApiServer

func GetApiServer() client.Client

func SetApiServer

func SetApiServer(c client.Client)

func SetMeasureExecutor

func SetMeasureExecutor(ctx context.Context, measureType MeasureType, e MeasureExecutor)

Types

type CommonMeasure

type CommonMeasure struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   CommonMeasureSpec   `json:"spec,omitempty"`
	Status CommonMeasureStatus `json:"status,omitempty"`
}

CommonMeasure is the Schema for the commonmeasures API

func (*CommonMeasure) DeepCopy

func (in *CommonMeasure) DeepCopy() *CommonMeasure

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonMeasure.

func (*CommonMeasure) DeepCopyInto

func (in *CommonMeasure) DeepCopyInto(out *CommonMeasure)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CommonMeasure) DeepCopyObject

func (in *CommonMeasure) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*CommonMeasure) Default

func (r *CommonMeasure) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*CommonMeasure) SetupWebhookWithManager

func (r *CommonMeasure) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*CommonMeasure) ValidateCreate

func (r *CommonMeasure) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*CommonMeasure) ValidateDelete

func (r *CommonMeasure) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*CommonMeasure) ValidateUpdate

func (r *CommonMeasure) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type CommonMeasureList

type CommonMeasureList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []CommonMeasure `json:"items"`
}

CommonMeasureList contains a list of CommonMeasure

func (*CommonMeasureList) DeepCopy

func (in *CommonMeasureList) DeepCopy() *CommonMeasureList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonMeasureList.

func (*CommonMeasureList) DeepCopyInto

func (in *CommonMeasureList) DeepCopyInto(out *CommonMeasureList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CommonMeasureList) DeepCopyObject

func (in *CommonMeasureList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CommonMeasureSpec

type CommonMeasureSpec struct {
	MeasureType  MeasureType   `json:"measureType"`
	Duration     string        `json:"duration"`
	Interval     string        `json:"interval"`
	SuccessCount int           `json:"successCount,omitempty"`
	FailedCount  int           `json:"failedCount,omitempty"`
	Stopped      bool          `json:"stopped"`
	Judgement    Judgement     `json:"judgement"`
	Args         []MeasureArgs `json:"args"`
}

CommonMeasureSpec defines the desired state of CommonMeasure

func (*CommonMeasureSpec) DeepCopy

func (in *CommonMeasureSpec) DeepCopy() *CommonMeasureSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonMeasureSpec.

func (*CommonMeasureSpec) DeepCopyInto

func (in *CommonMeasureSpec) DeepCopyInto(out *CommonMeasureSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CommonMeasureStatus

type CommonMeasureStatus struct {
	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
	// Important: Run "make" to regenerate code after modifying this file
	Status         StatusType    `json:"status"`
	Message        string        `json:"message"`
	TotalMeasure   int           `json:"totalMeasure"`
	SuccessMeasure int           `json:"successMeasure"`
	FailedMeasure  int           `json:"failedMeasure"`
	InitialData    string        `json:"initialData"`
	CreateTime     string        `json:"createTime"`
	UpdateTime     string        `json:"updateTime"`
	NextTime       string        `json:"nextTime"`
	MeetTime       string        `json:"meetTime"`
	Measures       []MeasureTask `json:"measures,omitempty"`
}

CommonMeasureStatus defines the observed state of CommonMeasure

func (*CommonMeasureStatus) DeepCopy

func (in *CommonMeasureStatus) DeepCopy() *CommonMeasureStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonMeasureStatus.

func (*CommonMeasureStatus) DeepCopyInto

func (in *CommonMeasureStatus) DeepCopyInto(out *CommonMeasureStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JudgeType

type JudgeType string
const (
	AbsoluteValueJudgeType   JudgeType = "absolutevalue"
	RelativeValueJudgeType   JudgeType = "relativevalue"
	RelativePercentJudgeType JudgeType = "relativepercent"

	CountJudgeType JudgeType = "count"

	ConnectivityJudgeType JudgeType = "connectivity"
	CodeJudgeType         JudgeType = "code"
	BodyJudgeType         JudgeType = "body"
)

type Judgement

type Judgement struct {
	JudgeType  JudgeType `json:"judgeType"`
	JudgeValue string    `json:"judgeValue"`
}

func (*Judgement) DeepCopy

func (in *Judgement) DeepCopy() *Judgement

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Judgement.

func (*Judgement) DeepCopyInto

func (in *Judgement) DeepCopyInto(out *Judgement)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MeasureArgs

type MeasureArgs struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

func (*MeasureArgs) DeepCopy

func (in *MeasureArgs) DeepCopy() *MeasureArgs

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeasureArgs.

func (*MeasureArgs) DeepCopyInto

func (in *MeasureArgs) DeepCopyInto(out *MeasureArgs)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MeasureExecutor

type MeasureExecutor interface {
	CheckConfig(ctx context.Context, args []MeasureArgs, judgement Judgement) error
	InitialData(ctx context.Context, args []MeasureArgs) (string, error)
	Measure(ctx context.Context, args []MeasureArgs, judgement Judgement, initialData string) error
}

+kubebuilder:object:generate=false

func GetMeasureExecutor

func GetMeasureExecutor(ctx context.Context, measureType MeasureType) MeasureExecutor

type MeasureTask

type MeasureTask struct {
	Uid        string     `json:"uid"`
	CreateTime string     `json:"createTime"`
	UpdateTime string     `json:"updateTime"`
	Status     StatusType `json:"status"`
	Message    string     `json:"message"`
}

func (*MeasureTask) DeepCopy

func (in *MeasureTask) DeepCopy() *MeasureTask

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeasureTask.

func (*MeasureTask) DeepCopyInto

func (in *MeasureTask) DeepCopyInto(out *MeasureTask)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MeasureType

type MeasureType string
const (
	MonitorMeasureType MeasureType = "monitor"
	PodMeasureType     MeasureType = "pod"
	DeployMeasureType  MeasureType = "deploy"
	SvcMeasureType     MeasureType = "svc"
	HTTPMeasureType    MeasureType = "http"
	IPMeasureType      MeasureType = "ip"
	TCPMeasureType     MeasureType = "tcp"
)

type StatusType

type StatusType string
const (
	CreatedStatus StatusType = "created"
	RunningStatus StatusType = "running"
	SuccessStatus StatusType = "success"
	FailedStatus  StatusType = "failed"
)

Jump to

Keyboard shortcuts

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