api

package
v0.0.0-...-e650048 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregatedPost

func AggregatedPost(ctx *fiber.Ctx) error

Starts a measurement on a list of nodes and returns an aggregated spectrum measurement

@summary Get an aggregated spectrum measurement from a list of nodes @description Sends an aggregated measurement request to the nodes specified in `sensors` and returns a list of `stats.Stats` objects for all sensors taking part in the campaign. Will time out in `300ms` if any sensor does not respond. @tags measurement @security BasicAuth @accept json @param id body types.AggregatedMeasurementRequest true "Measurement request object" @produce json @success 201 {array} stats.Stats "Bare statistics for all nodes in the measurement campaign. Will always include sensor status information." @header 201 {string} Location "Location of the new campaign object." @failure 500 "When the internal timeout for information retrieval expires" @router /aggregated [post]

func CampaignsGet

func CampaignsGet(ctx *fiber.Ctx) error

List campaigns

@summary List campaigns @description Returns a list of campaigns that were successfully started. Will return all campaigns unless either of the query parameters is set. @tags data @security BasicAuth @param sensors path string false "Matches campigns which contain ALL these sensors as a comma-separated list." @param campaignId path string false "Matches a single campaign by its unique ID." @produce json @success 200 {array} models.Campaign "All recorded campaigns which match the given parameters" @failure 500 "Generally a database error" @router /campaigns [get]

func Init

func Init(config *koanf.Koanf, router *fiber.App, prefix string)

Creates a router for the public API. Initializes all REST endpoints under the given prefix and servers swagger documentation on /swagger.

func NodeGet

func NodeGet(ctx *fiber.Ctx) error

Get stats from a node

@summary Get stats from a node @description Returns full stats from the node with given hardware ID. Will time out in `300ms` if the node does not respond. @tags administration @security BasicAuth @param sensor_id path string true "Node hardware ID" @produce json @success 200 {object} stats.Stats "Full system statistics for the node associated to the given ID" @failure 500 "When the internal timeout for information retrieval expires" @router /nodes/{sensor_id} [get]

func NodesGet

func NodesGet(ctx *fiber.Ctx) error

List nodes

@summary List nodes @description Returns a list of all connected nodes by their hardware ID. Will time out in `300ms` if any one of the nodes does not respond. @tags administration @security BasicAuth @produce json @success 200 {array} stats.Stats "Bare statistics for all the running and connected nodes" @failure 500 "When the internal timeout for information retrieval expires" @router /nodes [get]

func RawPost

func RawPost(ctx *fiber.Ctx) error

Starts a measurement on a node and returns the raw spectrum measurement

@summary Get a raw spectrum measurement from a list of nodes @description Sends a raw measurement request to the nodes specified in `sensors` and returns a list of `stats.Stats` objects for all sensors taking part in the campaign. Will time out in `300ms` if any sensor does not respond. @tags measurement @security BasicAuth @accept json @param id body types.RawMeasurementRequest true "Measurement request object" @produce json @success 201 {array} stats.Stats "Bare statistics for all nodes in the measurement campaign. Will always include sensor status information." @header 201 {string} Location "Location of the new campaign object." @failure 500 "When the internal timeout for information retrieval expires" @router /raw [post]

func SamplesGet

func SamplesGet(ctx *fiber.Ctx) error

Get samples

@summary Get samples @description Returns a list of all the samples recorded during a campaign by a specific sensors partaking in said campaign. @tags data @security BasicAuth @param sensorId path string true "Sensor which the samples belong to" @param campaignId path string true "Campaign which the samples belong to" @param from path string false "Samples returned will have been received strictly later than this date (must be in ISO 8601/RFC 3339)" @param to path string false "Samples returned will have been received strictly before this date (must be in ISO 8601/RFC 3339)" @produce json @success 200 {array} models.Sample "All samples which respect the given conditions" @failure 500 "Generally a database error" @router /samples [get]

Types

This section is empty.

Jump to

Keyboard shortcuts

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