Documentation
¶
Overview ¶
Package gen provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
Package gen contains generated code for the agent API.
Index ¶
- Constants
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type AgentInfo
- type AgentInfoState
- type AgentInfoStatus
- type DrainAgent200JSONResponse
- type DrainAgent400JSONResponse
- type DrainAgent401JSONResponse
- type DrainAgent403JSONResponse
- type DrainAgent404JSONResponse
- type DrainAgent409JSONResponse
- type DrainAgentRequestObject
- type DrainAgentResponseObject
- type EchoRouter
- type ErrorResponse
- type GetAgentDetails200JSONResponse
- type GetAgentDetails400JSONResponse
- type GetAgentDetails401JSONResponse
- type GetAgentDetails403JSONResponse
- type GetAgentDetails404JSONResponse
- type GetAgentDetails500JSONResponse
- type GetAgentDetailsRequestObject
- type GetAgentDetailsResponseObject
- type GetAgents200JSONResponse
- type GetAgents401JSONResponse
- type GetAgents403JSONResponse
- type GetAgents500JSONResponse
- type GetAgentsRequestObject
- type GetAgentsResponseObject
- type ListAgentsResponse
- type LoadAverageResponse
- type MemoryResponse
- type NetworkInterfaceResponse
- type NetworkInterfaceResponseFamily
- type NodeCondition
- type NodeConditionType
- type OSInfoResponse
- type RouteResponse
- type ServerInterface
- type ServerInterfaceWrapper
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TimelineEvent
- type UndrainAgent200JSONResponse
- type UndrainAgent400JSONResponse
- type UndrainAgent401JSONResponse
- type UndrainAgent403JSONResponse
- type UndrainAgent404JSONResponse
- type UndrainAgent409JSONResponse
- type UndrainAgentRequestObject
- type UndrainAgentResponseObject
Constants ¶
const (
BearerAuthScopes = "BearerAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
type AgentInfo ¶
type AgentInfo struct {
// Architecture CPU architecture.
Architecture *string `json:"architecture,omitempty"`
// Conditions Evaluated node conditions.
Conditions *[]NodeCondition `json:"conditions,omitempty"`
// CpuCount Number of logical CPUs.
CpuCount *int `json:"cpu_count,omitempty"`
// Facts Extended facts from additional providers.
Facts *map[string]interface{} `json:"facts,omitempty"`
// Fqdn Fully qualified domain name.
Fqdn *string `json:"fqdn,omitempty"`
// Hostname The hostname of the agent.
Hostname string `json:"hostname"`
Interfaces *[]NetworkInterfaceResponse `json:"interfaces,omitempty"`
// KernelVersion OS kernel version.
KernelVersion *string `json:"kernel_version,omitempty"`
// Labels Key-value labels configured on the agent.
Labels *map[string]string `json:"labels,omitempty"`
// LoadAverage The system load averages for 1, 5, and 15 minutes.
LoadAverage *LoadAverageResponse `json:"load_average,omitempty"`
// Memory Memory usage information.
Memory *MemoryResponse `json:"memory,omitempty"`
// OsInfo Operating system information.
OsInfo *OSInfoResponse `json:"os_info,omitempty"`
// PackageMgr Package manager.
PackageMgr *string `json:"package_mgr,omitempty"`
// PrimaryInterface Name of the interface used for the default route.
PrimaryInterface *string `json:"primary_interface,omitempty"`
// RegisteredAt When the agent last refreshed its heartbeat.
RegisteredAt *time.Time `json:"registered_at,omitempty"`
// Routes Network routing table entries.
Routes *[]RouteResponse `json:"routes,omitempty"`
// ServiceMgr Init system.
ServiceMgr *string `json:"service_mgr,omitempty"`
// StartedAt When the agent process started.
StartedAt *time.Time `json:"started_at,omitempty"`
// State Agent scheduling state.
State *AgentInfoState `json:"state,omitempty"`
// Status The current status of the agent.
Status AgentInfoStatus `json:"status"`
// Timeline Agent state transition history.
Timeline *[]TimelineEvent `json:"timeline,omitempty"`
// Uptime The system uptime.
Uptime *string `json:"uptime,omitempty"`
}
AgentInfo defines model for AgentInfo.
type AgentInfoState ¶
type AgentInfoState string
AgentInfoState Agent scheduling state.
const ( AgentInfoStateCordoned AgentInfoState = "Cordoned" AgentInfoStateDraining AgentInfoState = "Draining" AgentInfoStateReady AgentInfoState = "Ready" )
Defines values for AgentInfoState.
type AgentInfoStatus ¶
type AgentInfoStatus string
AgentInfoStatus The current status of the agent.
const ( AgentInfoStatusNotReady AgentInfoStatus = "NotReady" AgentInfoStatusReady AgentInfoStatus = "Ready" )
Defines values for AgentInfoStatus.
type DrainAgent200JSONResponse ¶
type DrainAgent200JSONResponse struct {
Message string `json:"message"`
}
func (DrainAgent200JSONResponse) VisitDrainAgentResponse ¶
func (response DrainAgent200JSONResponse) VisitDrainAgentResponse(w http.ResponseWriter) error
type DrainAgent400JSONResponse ¶
type DrainAgent400JSONResponse externalRef0.ErrorResponse
func (DrainAgent400JSONResponse) VisitDrainAgentResponse ¶
func (response DrainAgent400JSONResponse) VisitDrainAgentResponse(w http.ResponseWriter) error
type DrainAgent401JSONResponse ¶
type DrainAgent401JSONResponse externalRef0.ErrorResponse
func (DrainAgent401JSONResponse) VisitDrainAgentResponse ¶
func (response DrainAgent401JSONResponse) VisitDrainAgentResponse(w http.ResponseWriter) error
type DrainAgent403JSONResponse ¶
type DrainAgent403JSONResponse externalRef0.ErrorResponse
func (DrainAgent403JSONResponse) VisitDrainAgentResponse ¶
func (response DrainAgent403JSONResponse) VisitDrainAgentResponse(w http.ResponseWriter) error
type DrainAgent404JSONResponse ¶
type DrainAgent404JSONResponse externalRef0.ErrorResponse
func (DrainAgent404JSONResponse) VisitDrainAgentResponse ¶
func (response DrainAgent404JSONResponse) VisitDrainAgentResponse(w http.ResponseWriter) error
type DrainAgent409JSONResponse ¶
type DrainAgent409JSONResponse externalRef0.ErrorResponse
func (DrainAgent409JSONResponse) VisitDrainAgentResponse ¶
func (response DrainAgent409JSONResponse) VisitDrainAgentResponse(w http.ResponseWriter) error
type DrainAgentRequestObject ¶
type DrainAgentRequestObject struct {
Hostname string `json:"hostname"`
}
type DrainAgentResponseObject ¶
type DrainAgentResponseObject interface {
VisitDrainAgentResponse(w http.ResponseWriter) error
}
type EchoRouter ¶
type EchoRouter interface {
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
type ErrorResponse ¶
type ErrorResponse = externalRef0.ErrorResponse
ErrorResponse defines model for ErrorResponse.
type GetAgentDetails200JSONResponse ¶
type GetAgentDetails200JSONResponse AgentInfo
func (GetAgentDetails200JSONResponse) VisitGetAgentDetailsResponse ¶
func (response GetAgentDetails200JSONResponse) VisitGetAgentDetailsResponse(w http.ResponseWriter) error
type GetAgentDetails400JSONResponse ¶
type GetAgentDetails400JSONResponse externalRef0.ErrorResponse
func (GetAgentDetails400JSONResponse) VisitGetAgentDetailsResponse ¶
func (response GetAgentDetails400JSONResponse) VisitGetAgentDetailsResponse(w http.ResponseWriter) error
type GetAgentDetails401JSONResponse ¶
type GetAgentDetails401JSONResponse externalRef0.ErrorResponse
func (GetAgentDetails401JSONResponse) VisitGetAgentDetailsResponse ¶
func (response GetAgentDetails401JSONResponse) VisitGetAgentDetailsResponse(w http.ResponseWriter) error
type GetAgentDetails403JSONResponse ¶
type GetAgentDetails403JSONResponse externalRef0.ErrorResponse
func (GetAgentDetails403JSONResponse) VisitGetAgentDetailsResponse ¶
func (response GetAgentDetails403JSONResponse) VisitGetAgentDetailsResponse(w http.ResponseWriter) error
type GetAgentDetails404JSONResponse ¶
type GetAgentDetails404JSONResponse externalRef0.ErrorResponse
func (GetAgentDetails404JSONResponse) VisitGetAgentDetailsResponse ¶
func (response GetAgentDetails404JSONResponse) VisitGetAgentDetailsResponse(w http.ResponseWriter) error
type GetAgentDetails500JSONResponse ¶
type GetAgentDetails500JSONResponse externalRef0.ErrorResponse
func (GetAgentDetails500JSONResponse) VisitGetAgentDetailsResponse ¶
func (response GetAgentDetails500JSONResponse) VisitGetAgentDetailsResponse(w http.ResponseWriter) error
type GetAgentDetailsRequestObject ¶
type GetAgentDetailsRequestObject struct {
Hostname string `json:"hostname"`
}
type GetAgentDetailsResponseObject ¶
type GetAgentDetailsResponseObject interface {
VisitGetAgentDetailsResponse(w http.ResponseWriter) error
}
type GetAgents200JSONResponse ¶
type GetAgents200JSONResponse ListAgentsResponse
func (GetAgents200JSONResponse) VisitGetAgentsResponse ¶
func (response GetAgents200JSONResponse) VisitGetAgentsResponse(w http.ResponseWriter) error
type GetAgents401JSONResponse ¶
type GetAgents401JSONResponse externalRef0.ErrorResponse
func (GetAgents401JSONResponse) VisitGetAgentsResponse ¶
func (response GetAgents401JSONResponse) VisitGetAgentsResponse(w http.ResponseWriter) error
type GetAgents403JSONResponse ¶
type GetAgents403JSONResponse externalRef0.ErrorResponse
func (GetAgents403JSONResponse) VisitGetAgentsResponse ¶
func (response GetAgents403JSONResponse) VisitGetAgentsResponse(w http.ResponseWriter) error
type GetAgents500JSONResponse ¶
type GetAgents500JSONResponse externalRef0.ErrorResponse
func (GetAgents500JSONResponse) VisitGetAgentsResponse ¶
func (response GetAgents500JSONResponse) VisitGetAgentsResponse(w http.ResponseWriter) error
type GetAgentsRequestObject ¶
type GetAgentsRequestObject struct {
}
type GetAgentsResponseObject ¶
type GetAgentsResponseObject interface {
VisitGetAgentsResponse(w http.ResponseWriter) error
}
type ListAgentsResponse ¶
type ListAgentsResponse struct {
Agents []AgentInfo `json:"agents"`
// Total Total number of active agents.
Total int `json:"total"`
}
ListAgentsResponse defines model for ListAgentsResponse.
type LoadAverageResponse ¶
type LoadAverageResponse struct {
// N15min Load average for the last 15 minutes.
N15min float32 `json:"15min"`
// N1min Load average for the last 1 minute.
N1min float32 `json:"1min"`
// N5min Load average for the last 5 minutes.
N5min float32 `json:"5min"`
}
LoadAverageResponse The system load averages for 1, 5, and 15 minutes.
type MemoryResponse ¶
type MemoryResponse struct {
// Free Free memory in bytes.
Free int `json:"free"`
// Total Total memory in bytes.
Total int `json:"total"`
// Used Used memory in bytes.
Used int `json:"used"`
}
MemoryResponse Memory usage information.
type NetworkInterfaceResponse ¶
type NetworkInterfaceResponse struct {
// Family IP address family.
Family *NetworkInterfaceResponseFamily `json:"family,omitempty"`
Ipv4 *string `json:"ipv4,omitempty"`
Ipv6 *string `json:"ipv6,omitempty"`
Mac *string `json:"mac,omitempty"`
Name string `json:"name"`
}
NetworkInterfaceResponse defines model for NetworkInterfaceResponse.
type NetworkInterfaceResponseFamily ¶
type NetworkInterfaceResponseFamily string
NetworkInterfaceResponseFamily IP address family.
const ( Dual NetworkInterfaceResponseFamily = "dual" Inet NetworkInterfaceResponseFamily = "inet" Inet6 NetworkInterfaceResponseFamily = "inet6" )
Defines values for NetworkInterfaceResponseFamily.
type NodeCondition ¶
type NodeCondition struct {
LastTransitionTime time.Time `json:"last_transition_time"`
Reason *string `json:"reason,omitempty"`
Status bool `json:"status"`
Type NodeConditionType `json:"type"`
}
NodeCondition defines model for NodeCondition.
type NodeConditionType ¶
type NodeConditionType string
NodeConditionType defines model for NodeCondition.Type.
const ( DiskPressure NodeConditionType = "DiskPressure" HighLoad NodeConditionType = "HighLoad" MemoryPressure NodeConditionType = "MemoryPressure" )
Defines values for NodeConditionType.
type OSInfoResponse ¶
type OSInfoResponse struct {
// Distribution The name of the Linux distribution.
Distribution string `json:"distribution"`
// Version The version of the Linux distribution.
Version string `json:"version"`
}
OSInfoResponse Operating system information.
type RouteResponse ¶
type RouteResponse struct {
// Destination Destination network address.
Destination string `json:"destination"`
// Flags Route flags.
Flags *string `json:"flags,omitempty"`
// Gateway Gateway address.
Gateway string `json:"gateway"`
// Interface Network interface name.
Interface string `json:"interface"`
// Mask Network mask in CIDR notation.
Mask *string `json:"mask,omitempty"`
// Metric Route metric.
Metric *int `json:"metric,omitempty"`
}
RouteResponse A network routing table entry.
type ServerInterface ¶
type ServerInterface interface {
// List active agents
// (GET /api/agent)
GetAgents(ctx echo.Context) error
// Get agent details
// (GET /api/agent/{hostname})
GetAgentDetails(ctx echo.Context, hostname string) error
// Drain an agent
// (POST /api/agent/{hostname}/drain)
DrainAgent(ctx echo.Context, hostname string) error
// Undrain an agent
// (POST /api/agent/{hostname}/undrain)
UndrainAgent(ctx echo.Context, hostname string) error
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) DrainAgent ¶
func (w *ServerInterfaceWrapper) DrainAgent(ctx echo.Context) error
DrainAgent converts echo context to params.
func (*ServerInterfaceWrapper) GetAgentDetails ¶
func (w *ServerInterfaceWrapper) GetAgentDetails(ctx echo.Context) error
GetAgentDetails converts echo context to params.
func (*ServerInterfaceWrapper) GetAgents ¶
func (w *ServerInterfaceWrapper) GetAgents(ctx echo.Context) error
GetAgents converts echo context to params.
func (*ServerInterfaceWrapper) UndrainAgent ¶
func (w *ServerInterfaceWrapper) UndrainAgent(ctx echo.Context) error
UndrainAgent converts echo context to params.
type StrictHandlerFunc ¶
type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// List active agents
// (GET /api/agent)
GetAgents(ctx context.Context, request GetAgentsRequestObject) (GetAgentsResponseObject, error)
// Get agent details
// (GET /api/agent/{hostname})
GetAgentDetails(ctx context.Context, request GetAgentDetailsRequestObject) (GetAgentDetailsResponseObject, error)
// Drain an agent
// (POST /api/agent/{hostname}/drain)
DrainAgent(ctx context.Context, request DrainAgentRequestObject) (DrainAgentResponseObject, error)
// Undrain an agent
// (POST /api/agent/{hostname}/undrain)
UndrainAgent(ctx context.Context, request UndrainAgentRequestObject) (UndrainAgentResponseObject, error)
}
StrictServerInterface represents all server handlers.
type TimelineEvent ¶
type TimelineEvent struct {
Error *string `json:"error,omitempty"`
Event string `json:"event"`
Hostname *string `json:"hostname,omitempty"`
Message *string `json:"message,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
TimelineEvent defines model for TimelineEvent.
type UndrainAgent200JSONResponse ¶
type UndrainAgent200JSONResponse struct {
Message string `json:"message"`
}
func (UndrainAgent200JSONResponse) VisitUndrainAgentResponse ¶
func (response UndrainAgent200JSONResponse) VisitUndrainAgentResponse(w http.ResponseWriter) error
type UndrainAgent400JSONResponse ¶
type UndrainAgent400JSONResponse externalRef0.ErrorResponse
func (UndrainAgent400JSONResponse) VisitUndrainAgentResponse ¶
func (response UndrainAgent400JSONResponse) VisitUndrainAgentResponse(w http.ResponseWriter) error
type UndrainAgent401JSONResponse ¶
type UndrainAgent401JSONResponse externalRef0.ErrorResponse
func (UndrainAgent401JSONResponse) VisitUndrainAgentResponse ¶
func (response UndrainAgent401JSONResponse) VisitUndrainAgentResponse(w http.ResponseWriter) error
type UndrainAgent403JSONResponse ¶
type UndrainAgent403JSONResponse externalRef0.ErrorResponse
func (UndrainAgent403JSONResponse) VisitUndrainAgentResponse ¶
func (response UndrainAgent403JSONResponse) VisitUndrainAgentResponse(w http.ResponseWriter) error
type UndrainAgent404JSONResponse ¶
type UndrainAgent404JSONResponse externalRef0.ErrorResponse
func (UndrainAgent404JSONResponse) VisitUndrainAgentResponse ¶
func (response UndrainAgent404JSONResponse) VisitUndrainAgentResponse(w http.ResponseWriter) error
type UndrainAgent409JSONResponse ¶
type UndrainAgent409JSONResponse externalRef0.ErrorResponse
func (UndrainAgent409JSONResponse) VisitUndrainAgentResponse ¶
func (response UndrainAgent409JSONResponse) VisitUndrainAgentResponse(w http.ResponseWriter) error
type UndrainAgentRequestObject ¶
type UndrainAgentRequestObject struct {
Hostname string `json:"hostname"`
}
type UndrainAgentResponseObject ¶
type UndrainAgentResponseObject interface {
VisitUndrainAgentResponse(w http.ResponseWriter) error
}