api

package
v1.0.0-beta.12 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package api Represent an API object

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartAPI

func StartAPI(serverAddr, dbtype string)

StartAPI Start a new API process

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API Represent API object

func (*API) AgentGetSample

func (a *API) AgentGetSample(w http.ResponseWriter, r *http.Request)

AgentGetSample is a handler that returns a sample of the agent

func (*API) AgentListSamples

func (a *API) AgentListSamples(w http.ResponseWriter, r *http.Request)

AgentListSamples Get a list of samples by id and checksum

func (*API) AgentPushMetrics

func (a *API) AgentPushMetrics(w http.ResponseWriter, r *http.Request)

AgentPushMetrics Receive new metrics from an agent

func (*API) CreateSetup

func (a *API) CreateSetup(w http.ResponseWriter, r *http.Request)

CreateSetup is the handler to create a new setup

func (*API) GetAgent

func (a *API) GetAgent(w http.ResponseWriter, r *http.Request)

GetAgent is a function to get agent

func (*API) GetMetrics

func (a *API) GetMetrics(w http.ResponseWriter, r *http.Request)

GetMetrics returns the metrics for the given namespace and name

func (*API) GetSampleResult

func (a *API) GetSampleResult(w http.ResponseWriter, r *http.Request)

GetSampleResult is a handler to get a sample result

func (*API) ListAgents

func (a *API) ListAgents(w http.ResponseWriter, r *http.Request)

ListAgents returns the list of agents

func (*API) ListSamples

func (a *API) ListSamples(w http.ResponseWriter, r *http.Request)

ListSamples is a method to list samples

func (*API) ListScenariosSteps

func (a *API) ListScenariosSteps(w http.ResponseWriter, r *http.Request)

ListScenariosSteps returns a list of all the steps of all the scenarios

func (*API) Login

func (a *API) Login(w http.ResponseWriter, r *http.Request)

Login is the handler for the login endpoint

func (*API) Ping

func (a *API) Ping(w http.ResponseWriter, r *http.Request)

Ping is a simple ping endpoint

func (*API) RegisterAgent

func (a *API) RegisterAgent(w http.ResponseWriter, r *http.Request)

RegisterAgent register a new agent

func (*API) RegisterSample

func (a *API) RegisterSample(w http.ResponseWriter, r *http.Request)

RegisterSample is a function to register a sample

func (*API) SetupStatus

func (a *API) SetupStatus(w http.ResponseWriter, r *http.Request)

SetupStatus returns the status of the setup

func (*API) SystemInfo

func (a *API) SystemInfo(w http.ResponseWriter, r *http.Request)

SystemInfo is the response of the system info

func (*API) UpdateAgent

func (a *API) UpdateAgent(w http.ResponseWriter, r *http.Request)

UpdateAgent update agent

func (*API) UpdateSample

func (a *API) UpdateSample(w http.ResponseWriter, r *http.Request)

UpdateSample is a function to update a sample

func (*API) VerifyToken

func (a *API) VerifyToken(w http.ResponseWriter, r *http.Request)

VerifyToken is a handler function that verifies the validity of a token.

type ListAgentsResponse

type ListAgentsResponse struct {
	ID          string
	Name        string
	Description string
	Secret      string
	Tags        map[string]string
	UpdatedAt   time.Time
}

ListAgentsResponse is the response of the list agents

type RegisterAgentRequest

type RegisterAgentRequest struct {
	Name        string
	Description string
	Tags        map[string]string
}

RegisterAgentRequest is the request to register a new agent

type RegisterAgentResponse

type RegisterAgentResponse struct {
	Secret string
}

RegisterAgentResponse is the response of RegisterAgent

type SetupStatusResponse

type SetupStatusResponse struct {
	Status bool
}

SetupStatusResponse is the response of the setup status

Jump to

Keyboard shortcuts

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