Documentation
¶
Index ¶
- func RegisterRoutes(group *echo.Group, logger *zap.Logger, tsClient *timescaledb.Client)
- type Handler
- func (h *Handler) CreateAction(c echo.Context) error
- func (h *Handler) CreateAutomation(c echo.Context) error
- func (h *Handler) DeleteAction(c echo.Context) error
- func (h *Handler) DeleteAutomation(c echo.Context) error
- func (h *Handler) GetActions(c echo.Context) error
- func (h *Handler) GetAutomationByID(c echo.Context) error
- func (h *Handler) GetAutomations(c echo.Context) error
- func (h *Handler) GetAutomationsSummary(c echo.Context) error
- func (h *Handler) UpdateAction(c echo.Context) error
- func (h *Handler) UpdateAutomation(c echo.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(logger *zap.Logger, tsClient *timescaledb.Client) *Handler
func (*Handler) CreateAction ¶
CreateAction creates a new action @Summary Create action @Description Create a new action. Organization is resolved from X-Organization header or hostname (e.g., {org}.localhost) @Tags automations @Accept json @Produce json @Param request body apimodels.ActionRequest true "Action configuration" @Success 201 {object} map[string]interface{} @Failure 400 {object} map[string]string "Invalid request parameters" @Failure 500 {object} map[string]string "Internal server error" @Router /telemetry/v1/actions [post]
func (*Handler) CreateAutomation ¶
CreateAutomation creates a new automation @Summary Create automation @Description Create a new automation. Organization is resolved from X-Organization header or hostname (e.g., {org}.localhost) @Tags automations @Accept json @Produce json @Param request body apimodels.AutomationRequest true "Automation configuration" @Success 201 {object} map[string]interface{} @Failure 400 {object} map[string]string "Invalid request parameters" @Failure 500 {object} map[string]string "Internal server error" @Router /telemetry/v1/automations [post]
func (*Handler) DeleteAction ¶
DeleteAction deletes an action @Summary Delete action @Description Delete an action by ID. Organization is resolved from X-Organization header or hostname (e.g., {org}.localhost) @Tags automations @Accept json @Produce json @Param action_id path string true "Action ID" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string "Invalid request parameters" @Failure 404 {object} map[string]string "Action not found" @Failure 500 {object} map[string]string "Internal server error" @Router /telemetry/v1/actions/{action_id} [delete]
func (*Handler) DeleteAutomation ¶
DeleteAutomation deletes an automation @Summary Delete automation @Description Delete an automation by ID. Organization is resolved from X-Organization header or hostname (e.g., {org}.localhost) @Tags automations @Accept json @Produce json @Param automation_id path string true "Automation ID" @Success 200 {object} map[string]string @Failure 400 {object} map[string]string "Invalid request parameters" @Failure 404 {object} map[string]string "Automation not found" @Failure 500 {object} map[string]string "Internal server error" @Router /telemetry/v1/automations/{automation_id} [delete]
func (*Handler) GetActions ¶
GetActions returns actions with pagination and search @Summary Get actions @Description Retrieve actions with optional search. Organization is resolved from X-Organization header or hostname (e.g., {org}.localhost) @Tags automations @Accept json @Produce json @Param search query string false "Search by name or key" @Param limit query int false "Number of results per page (default 20)" @Param offset query int false "Number of results to skip (default 0)" @Success 200 {object} common.PaginatedResponse @Failure 400 {object} map[string]string "Invalid request parameters" @Failure 500 {object} map[string]string "Internal server error" @Router /telemetry/v1/actions [get]
func (*Handler) GetAutomationByID ¶
GetAutomationByID returns a single automation by ID @Summary Get automation by ID @Description Retrieve a single automation by ID. Organization is resolved from X-Organization header or hostname (e.g., {org}.localhost) @Tags automations @Accept json @Produce json @Param automation_id path string true "Automation ID" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string "Invalid request parameters" @Failure 404 {object} map[string]string "Automation not found" @Failure 500 {object} map[string]string "Internal server error" @Router /telemetry/v1/automations/{automation_id} [get]
func (*Handler) GetAutomations ¶
GetAutomations returns automations with pagination, search, and filters @Summary Get automations @Description Retrieve automations with optional filtering by device_id, space_slug, and search. Organization is resolved from X-Organization header or hostname (e.g., {org}.localhost) @Tags automations @Accept json @Produce json @Param device_id query string false "Filter by device ID" @Param search query string false "Search by name or device ID" @Param limit query int false "Number of results per page (default 20)" @Param offset query int false "Number of results to skip (default 0)" @Success 200 {object} common.PaginatedResponse @Failure 400 {object} map[string]string "Invalid request parameters" @Failure 500 {object} map[string]string "Internal server error" @Router /telemetry/v1/automations [get]
func (*Handler) GetAutomationsSummary ¶ added in v0.0.3
GetAutomationSummary returns total, active, and disabled automation counts for a space. @Summary Get automation summary @Description Returns total, active, and disabled counts for automations in a space. Organization is resolved from X-Organization header or hostname. @Tags automations @Accept json @Produce json @Success 200 {object} models.AutomationSummary @Failure 400 {object} map[string]string "Invalid request parameters" @Failure 500 {object} map[string]string "Internal server error" @Router /telemetry/v1/automations/summary [get]
func (*Handler) UpdateAction ¶
UpdateAction updates an existing action @Summary Update action @Description Update an existing action by ID. Organization is resolved from X-Organization header or hostname (e.g., {org}.localhost) @Tags automations @Accept json @Produce json @Param action_id path string true "Action ID" @Param request body apimodels.ActionRequest true "Action configuration" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string "Invalid request parameters" @Failure 404 {object} map[string]string "Action not found" @Failure 500 {object} map[string]string "Internal server error" @Router /telemetry/v1/actions/{action_id} [put]
func (*Handler) UpdateAutomation ¶
UpdateAutomation updates an existing automation @Summary Update automation @Description Update an existing automation by ID. Organization is resolved from X-Organization header or hostname (e.g., {org}.localhost) @Tags automations @Accept json @Produce json @Param automation_id path string true "Automation ID" @Param request body apimodels.AutomationRequest true "Automation configuration" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]string "Invalid request parameters" @Failure 404 {object} map[string]string "Automation not found" @Failure 500 {object} map[string]string "Internal server error" @Router /telemetry/v1/automations/{automation_id} [put]