proto

package
v1.0.0-beta.11 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProbeEventFieldPath           = "spec.containers{kbagent}"
	ProbeEventReportingController = "kbagent"
	ProbeEventSourceComponent     = "kbagent"
)

Variables

View Source
var (
	ErrNotDefined     = errors.New("notDefined")
	ErrNotImplemented = errors.New("notImplemented")
	ErrBadRequest     = errors.New("badRequest")
	ErrInProgress     = errors.New("inProgress")
	ErrBusy           = errors.New("busy")
	ErrTimedOut       = errors.New("timedOut")
	ErrFailed         = errors.New("failed")
	ErrInternalError  = errors.New("internalError")
	ErrUnknown        = errors.New("unknown")
)
View Source
var (
	ServiceAction = &Service{
		Kind:    "Action",
		Version: "v1.0",
		URI:     "/v1.0/action",
	}
	ServiceProbe = &Service{
		Kind:    "Probe",
		Version: "v1.0",
		URI:     "/v1.0/probe",
	}
	ServiceStreaming = &Service{
		Kind:    "Streaming",
		Version: "v1.0",
		URI:     "/v1.0/streaming",
	}
)

Functions

func Error2Type

func Error2Type(err error) string

func Type2Error

func Type2Error(errType string) error

Types

type Action

type Action struct {
	Name           string       `json:"name"`
	Exec           *ExecAction  `json:"exec,omitempty"`
	TimeoutSeconds int32        `json:"timeoutSeconds,omitempty"`
	RetryPolicy    *RetryPolicy `json:"retryPolicy,omitempty"`
}

type ActionRequest

type ActionRequest struct {
	Action         string            `json:"action"`
	Parameters     map[string]string `json:"parameters,omitempty"`
	NonBlocking    *bool             `json:"nonBlocking,omitempty"`
	TimeoutSeconds *int32            `json:"timeoutSeconds,omitempty"`
	RetryPolicy    *RetryPolicy      `json:"retryPolicy,omitempty"`
}

type ActionResponse

type ActionResponse struct {
	Error   string `json:"error,omitempty"`
	Message string `json:"message,omitempty"`
	Output  []byte `json:"output,omitempty"`
}

type ExecAction

type ExecAction struct {
	Commands []string `json:"command,omitempty"`
	Args     []string `json:"args,omitempty"`
}

type NewReplicaTask

type NewReplicaTask struct {
	Remote         string            `json:"remote"` // the remote address of the data source
	Port           int32             `json:"port"`
	Replicas       string            `json:"replicas"`             // replicas to load the data
	Parameters     map[string]string `json:"parameters,omitempty"` // parameters for data dump and load
	TimeoutSeconds *int32            `json:"timeoutSeconds,omitempty"`
}

type Probe

type Probe struct {
	Instance            string `json:"instance"`
	Action              string `json:"action"`
	InitialDelaySeconds int32  `json:"initialDelaySeconds,omitempty"`
	PeriodSeconds       int32  `json:"periodSeconds,omitempty"`
	SuccessThreshold    int32  `json:"successThreshold,omitempty"`
	FailureThreshold    int32  `json:"failureThreshold,omitempty"`
	ReportPeriodSeconds int32  `json:"reportPeriodSeconds,omitempty"`
}

type ProbeEvent

type ProbeEvent struct {
	Instance string `json:"instance"`
	Probe    string `json:"probe"`
	Code     int32  `json:"code"`
	Output   []byte `json:"output,omitempty"`  // output of the probe on success, or latest succeed output on failure
	Message  string `json:"message,omitempty"` // message of the probe on failure
}

type RetryPolicy

type RetryPolicy struct {
	MaxRetries    int           `json:"maxRetries,omitempty"`
	RetryInterval time.Duration `json:"retryInterval,omitempty"`
}

type Service

type Service struct {
	Kind    string
	Version string
	URI     string
}

type Task

type Task struct {
	Instance            string          `json:"instance"`
	Task                string          `json:"task"`
	UID                 string          `json:"UID"`                           // the unique identifier of the task
	Replicas            string          `json:"replicas"`                      // target replicas to run the task
	NotifyAtFinish      bool            `json:"notifyAtFinish,omitempty"`      // whether to notify the controller when the task is finished
	ReportPeriodSeconds int32           `json:"reportPeriodSeconds,omitempty"` // the period to report the progress of the task
	NewReplica          *NewReplicaTask `json:"newReplica,omitempty"`
}

type TaskEvent

type TaskEvent struct {
	Instance  string    `json:"instance"`
	Task      string    `json:"task"`
	UID       string    `json:"UID"`
	Replica   string    `json:"replica"`
	StartTime time.Time `json:"startTime"`
	EndTime   time.Time `json:"endTime"`
	Code      int32     `json:"code"`
	Output    []byte    `json:"output,omitempty"`  // output of the task on success
	Message   string    `json:"message,omitempty"` // message of the task on failure
}

Jump to

Keyboard shortcuts

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