agent

package
v0.0.55 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

README

api/routes/agent

HTTP handlers for the agent-facing API endpoints. These routes are the interface between the scoring API and the agents that run check scripts in the field. They are not intended for use by operators or frontends.

This package exposes two endpoints: one that hands out the next service check for an agent to execute, and one that accepts a completed check result. Both operate on the same data types used throughout the rest of the system. Both endpoints handle the absence of a database sink gracefully — score submission is a no-op when no sink is configured, and check retrieval skips credential attachment rather than failing if the database is unavailable.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddScore

func AddScore(c *gin.Context)

AddScore is a POST route for submitting a completed scorecheck, only meant for interaction from an agent.

@Summary		Submit a completed score check
@Description	Accepts a completed score check result from an agent and forwards it to all configured sinks. The timestamp field is assigned by the server on receipt and must not be included in the request body.
@Tags			agent
@Accept			json
@Produce		json
@Param			score	body		types.Score	true	"Completed score check"
@Success		200		{object}	object
@Failure		400		{object}	object
@Failure		500		{object}	object
@Router			/agent/completed-score [post]

func GetCheck

func GetCheck(c *gin.Context)

GetCheck is a route that returns the next check to run. This is meant for interaction from the agents.

@Summary		Get next check to run
@Description	Returns the next fully-rendered service check for the agent to execute. Rotates round-robin across all services and teams.
@Tags			agent
@Produce		json
@Success		200	{object}	types.Service
@Failure		400	{object}	object
@Failure		500	{object}	object
@Router			/agent/new-check [get]

Types

This section is empty.

Jump to

Keyboard shortcuts

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