telemetry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 7 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) *resty.Client

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

Types

type AckAgentActionsRequest

type AckAgentActionsRequest struct {
	Ack []*AgentActionAck `json:"ack,omitempty"`
}

type AgentAction

type AgentAction struct {
	ID        string          `json:"id"`
	Type      AgentActionType `json:"type"`
	CreatedAt time.Time       `json:"createdAt"`
	Data      json.RawMessage `json:"data"`
}

type AgentActionAck

type AgentActionAck struct {
	ID    string  `json:"id"`
	Error *string `json:"error,omitempty"`
}

type AgentActionDeleteNode

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

type AgentActionDrainNode

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

type AgentActionPatchNode

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

type AgentActionType

type AgentActionType string
const (
	AgentActionTypeDrainNode  AgentActionType = "drain_node"
	AgentActionTypeDeleteNode AgentActionType = "delete_node"
	AgentActionTypePatchNode  AgentActionType = "patch_node"
)

type Client

type Client interface {
	GetActions(ctx context.Context, clusterID string) ([]*AgentAction, error)
	AckActions(ctx context.Context, clusterID string, ack []*AgentActionAck) error
}

func NewClient

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

type GetAgentActionsResponse

type GetAgentActionsResponse struct {
	Actions []*AgentAction `json:"actions"`
}

type NodeTaint

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

Jump to

Keyboard shortcuts

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