Documentation
¶
Index ¶
- Constants
- Variables
- func Error2Type(err error) string
- func Type2Error(errType string) error
- type Action
- type ActionRequest
- type ActionResponse
- type ExecAction
- type GRPCAction
- type GRPCResponse
- type HTTPAction
- type HTTPHeader
- type NewReplicaTask
- type Probe
- type ProbeEvent
- type RetryPolicy
- type Service
- type Task
- type TaskEvent
Constants ¶
View Source
const ( ProbeEventFieldPath = "spec.containers{kbagent}" ProbeEventReportingController = "kbagent" ProbeEventSourceComponent = "kbagent" )
Variables ¶
View Source
var ( ErrNotDefined = errors.New("notDefined") ErrNotImplemented = errors.New("notImplemented") ErrPreconditionFailed = errors.New("preconditionFailed") 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 Type2Error ¶
Types ¶
type Action ¶
type Action struct {
Name string `json:"name"`
Exec *ExecAction `json:"exec,omitempty"`
HTTP *HTTPAction `json:"http,omitempty"`
GRPC *GRPCAction `json:"grpc,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"` // TODO: not implemented
RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"` // TODO: not implemented
}
type ActionResponse ¶
type ExecAction ¶
type GRPCAction ¶ added in v1.0.1
type GRPCResponse ¶ added in v1.0.1
type HTTPAction ¶ added in v1.0.1
type HTTPHeader ¶ added in v1.0.1
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"` // TODO: not implemented
}
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 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
}
Click to show internal directories.
Click to hide internal directories.