castai

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultClient

func NewDefaultClient(url, key string, level logrus.Level, binVersion *config.AgentActionsVersion) *resty.Client

NewDefaultClient configures a default instance of the resty.Client used to do HTTP requests.

Types

type AckClusterActionRequest

type AckClusterActionRequest struct {
	Error *string `json:"error"`
}

type ActionCreateEvent added in v0.4.0

type ActionCreateEvent struct {
	Reporter  string             `json:"reportingComponent"`
	ObjectRef v1.ObjectReference `json:"objectReference"`
	EventTime time.Time          `json:"eventTime"`
	EventType string             `json:"eventType"`
	Reason    string             `json:"reason"`
	Action    string             `json:"action"`
	Message   string             `json:"message"`
}

type ActionDeleteNode

type ActionDeleteNode struct {
	NodeName string `json:"nodeName"`
}

type ActionDrainNode

type ActionDrainNode struct {
	NodeName            string `json:"nodeName"`
	DrainTimeoutSeconds int    `json:"drainTimeoutSeconds"`
	Force               bool   `json:"force"`
}

type ActionPatchNode

type ActionPatchNode struct {
	NodeName string            `json:"nodeName"`
	Labels   map[string]string `json:"labels"`
	Taints   []NodeTaint       `json:"taints"`
}

type Client

type Client interface {
	GetActions(ctx context.Context) ([]*ClusterAction, error)
	AckAction(ctx context.Context, actionID string, req *AckClusterActionRequest) error
	SendLogs(ctx context.Context, req *LogEvent) error
}

func NewClient

func NewClient(log *logrus.Logger, rest *resty.Client, clusterID string) Client

type ClusterAction

type ClusterAction struct {
	ID                string             `json:"id"`
	ActionDeleteNode  *ActionDeleteNode  `json:"actionDeleteNode,omitempty"`
	ActionDrainNode   *ActionDrainNode   `json:"actionDrainNode,omitempty"`
	ActionPatchNode   *ActionPatchNode   `json:"actionPatchNode,omitempty"`
	ActionCreateEvent *ActionCreateEvent `json:"actionCreateEvent,omitempty"`
	CreatedAt         time.Time          `json:"createdAt"`
	DoneAt            *time.Time         `json:"doneAt,omitempty"`
	Error             *string            `json:"error,omitempty"`
}

func (*ClusterAction) Data

func (c *ClusterAction) Data() interface{}

type GetClusterActionsResponse

type GetClusterActionsResponse struct {
	Items []*ClusterAction `json:"items"`
}

type LogEvent added in v0.3.0

type LogEvent struct {
	Level   string        `json:"level"`
	Time    time.Time     `json:"time"`
	Message string        `json:"message"`
	Fields  logrus.Fields `json:"fields"`
}

type NodeTaint

type NodeTaint struct {
	Effect string `json:"effect"`
	Key    string `json:"key"`
	Value  string `json:"value"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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