automations

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(group *echo.Group, logger *zap.Logger, tsClient *timescaledb.Client)

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

func (h *Handler) CreateAction(c echo.Context) error

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

func (h *Handler) CreateAutomation(c echo.Context) error

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

func (h *Handler) DeleteAction(c echo.Context) error

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

func (h *Handler) DeleteAutomation(c echo.Context) error

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

func (h *Handler) GetActions(c echo.Context) error

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

func (h *Handler) GetAutomationByID(c echo.Context) error

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

func (h *Handler) GetAutomations(c echo.Context) error

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

func (h *Handler) GetAutomationsSummary(c echo.Context) error

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

func (h *Handler) UpdateAction(c echo.Context) error

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

func (h *Handler) UpdateAutomation(c echo.Context) error

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]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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