Files
HellreigN/backend/docs/swagger.yaml
T
shinyzero0 247505a310
ci-agent / build (push) Has started running
feat(backend): add root cause calculation
2026-04-05 08:22:41 +03:00

2037 lines
50 KiB
YAML

definitions:
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.AgentDeployConfig:
description: Configuration for deploying HellreigN agent to a single server
properties:
agentLabel:
example: production-server-1
type: string
authMethod:
allOf:
- $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.AuthMethod'
example: key
deployType:
allOf:
- $ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployType'
example: docker
ip:
example: 192.168.1.100
type: string
password:
example: secret
type: string
port:
example: 22
type: integer
sshKey:
example: '-----BEGIN OPENSSH PRIVATE KEY-----'
type: string
user:
example: admin
type: string
required:
- agentLabel
- authMethod
- deployType
- ip
- user
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.AuthMethod:
description: 'SSH authentication method: key or password'
enum:
- key
- password
type: string
x-enum-varnames:
- AuthMethodKey
- AuthMethodPassword
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployAgentsRequest:
description: Request to deploy HellreigN agents to multiple servers
properties:
servers:
items:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.AgentDeployConfig'
minItems: 1
type: array
required:
- servers
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployResponse:
description: Response containing deployment results and registration tokens
properties:
message:
example: Deployment completed
type: string
results:
items:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployResult'
type: array
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployResult:
description: Result of deploying to a single server
properties:
agent_label:
example: production-server-1
type: string
error:
example: ""
type: string
ip:
example: 192.168.1.100
type: string
success:
example: true
type: boolean
token:
example: abc123...
type: string
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployType:
description: 'Type of deployment: docker or binary'
enum:
- docker
- binary
type: string
x-enum-varnames:
- DeployTypeDocker
- DeployTypeBinary
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.LoginRequest:
properties:
login:
type: string
password:
type: string
required:
- login
- password
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.LoginResponse:
properties:
is_active:
type: boolean
last_name:
type: string
login:
type: string
name:
type: string
permission_admin:
type: boolean
permission_manage_agent:
type: boolean
permission_view:
type: boolean
token:
type: string
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.RegistrationRequest:
properties:
label:
type: string
required:
- label
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Script:
properties:
content:
type: string
created_at:
type: string
id:
type: integer
interpreter_id:
type: integer
path:
type: string
updated_at:
type: string
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptCreate:
properties:
content:
type: string
interpreter_id:
type: integer
path:
type: string
required:
- interpreter_id
- path
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreter:
properties:
argv:
items:
type: string
type: array
created_at:
type: string
id:
type: integer
label:
type: string
name:
type: string
updated_at:
type: string
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreterCreate:
properties:
argv:
items:
type: string
type: array
label:
type: string
name:
type: string
required:
- argv
- label
- name
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreterUpdate:
properties:
argv:
items:
type: string
type: array
label:
type: string
name:
type: string
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptTreeNode:
properties:
children:
items:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptTreeNode'
type: array
content:
type: string
id:
type: integer
interpreter_id:
type: integer
name:
type: string
type:
description: '"folder" or "file"'
type: string
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptUpdate:
properties:
content:
type: string
interpreter_id:
type: integer
path:
type: string
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenCreate:
properties:
is_active:
type: boolean
last_name:
type: string
login:
type: string
name:
type: string
password:
type: string
permission_admin:
type: boolean
permission_manage_agent:
type: boolean
permission_view:
type: boolean
required:
- last_name
- login
- name
- password
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenPasswordReset:
properties:
new_password:
type: string
required:
- new_password
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenUpdate:
properties:
last_name:
type: string
name:
type: string
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenUpdatePermissions:
properties:
is_active:
type: boolean
permission_admin:
type: boolean
permission_manage_agent:
type: boolean
permission_view:
type: boolean
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Tokens:
properties:
id:
type: integer
is_active:
type: boolean
last_name:
type: string
login:
type: string
name:
type: string
permission_admin:
type: boolean
permission_manage_agent:
type: boolean
permission_view:
type: boolean
token:
type: string
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.UserRegister:
properties:
last_name:
type: string
login:
type: string
name:
type: string
password:
type: string
required:
- last_name
- login
- name
- password
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_storage.LogEntry:
properties:
agent:
type: string
level:
type: string
message:
type: string
service:
type: string
timestamp:
type: string
type: object
internal_handlers.AddJobIn:
properties:
agent_id:
type: string
command:
type: string
interpreter_id:
type: integer
stdin:
type: string
required:
- agent_id
- command
type: object
internal_handlers.AddJobOut:
properties:
command:
items:
type: string
type: array
id:
type: integer
wait_url:
type: string
type: object
internal_handlers.AgentInfo:
properties:
connected_at:
description: Time when agent connected (RFC3339-like)
example: "2026-04-04 10:30:00"
type: string
label:
description: Human-readable label
example: web-server-1
type: string
services:
description: 'List of services with status (format: "name:status")'
example:
- nginx:running
- redis:up
items:
type: string
type: array
token:
description: Unique agent identifier
example: agent-001
type: string
type: object
internal_handlers.AgentSystemMetricsOut:
properties:
connected_at:
example: "2026-04-04 10:30:00"
type: string
cpu_percent:
example: 45.2
type: number
disk_percent:
example: 78.9
type: number
id:
example: agent-001
type: string
label:
example: web-server-1
type: string
memory_percent:
example: 62.5
type: number
network_rx_bytes:
example: 1048576
type: number
network_tx_bytes:
example: 524288
type: number
type: object
internal_handlers.CreateFolderRequest:
properties:
path:
example: deploy/nginx
type: string
required:
- path
type: object
internal_handlers.DeleteFolderRequest:
properties:
path:
example: deploy/nginx
type: string
required:
- path
type: object
internal_handlers.FailureRootCauseOut:
properties:
affected:
$ref: '#/definitions/internal_handlers.ServiceStatusOut'
dependency_chain:
items:
type: string
type: array
root_cause:
$ref: '#/definitions/internal_handlers.ServiceStatusOut'
type: object
internal_handlers.InsertLogRequest:
properties:
agent:
type: string
level:
type: string
message:
type: string
service:
type: string
timestamp:
type: string
required:
- agent
- level
- message
- service
type: object
internal_handlers.InsertLogsRequest:
properties:
logs:
items:
$ref: '#/definitions/internal_handlers.InsertLogRequest'
type: array
required:
- logs
type: object
internal_handlers.JobMetricsOut:
properties:
failed:
type: integer
pending:
type: integer
period:
type: string
success:
type: integer
total:
type: integer
type: object
internal_handlers.JobResult:
properties:
command:
items:
type: string
type: array
id:
type: integer
status:
type: integer
stderr:
type: string
stdin:
type: string
stdout:
type: string
type: object
internal_handlers.RegisterRequest:
properties:
csr:
type: string
token:
type: string
required:
- csr
- token
type: object
internal_handlers.RegisterResponse:
properties:
ca_cert:
type: string
client_cert:
type: string
type: object
internal_handlers.RenameRequest:
properties:
new_path:
example: deploy/nginx-v2
type: string
old_path:
example: deploy/nginx
type: string
required:
- new_path
- old_path
type: object
internal_handlers.RunScriptIn:
properties:
agent_id:
type: string
interpreter_id:
type: integer
script_text:
type: string
stdin:
type: string
required:
- agent_id
- interpreter_id
- script_text
type: object
internal_handlers.RunStoredScriptIn:
properties:
stdin:
type: string
token:
type: string
required:
- token
type: object
internal_handlers.ServiceStatusOut:
properties:
healthy:
type: boolean
name:
type: string
node_id:
type: string
status:
type: string
type: object
info:
contact: {}
paths:
/agents:
get:
consumes:
- application/json
description: Returns a list of all agents currently connected via Collector
(log streaming)
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/internal_handlers.AgentInfo'
type: array
security:
- Bearer: []
summary: Get connected agents
tags:
- agents
/agents/deploy:
post:
consumes:
- application/json
description: Deploy HellreigN agents to multiple servers using Ansible playbooks.
Supports Docker and Binary deployment types.
parameters:
- description: Deployment configuration for servers
in: body
name: request
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployAgentsRequest'
produces:
- application/json
responses:
"200":
description: Deployment results with tokens for each server
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployResponse'
"400":
description: Invalid request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal server error
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Deploy agents to multiple servers via Ansible
tags:
- agents
/agents/register:
post:
consumes:
- application/json
parameters:
- description: CSR + token
in: body
name: request
required: true
schema:
$ref: '#/definitions/internal_handlers.RegisterRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/internal_handlers.RegisterResponse'
summary: Register agent
tags:
- agents
/agents/register-token:
post:
consumes:
- application/json
parameters:
- description: Label
in: body
name: request
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.RegistrationRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Create registration token
tags:
- agents
/agents/system-metrics:
get:
consumes:
- application/json
description: Returns CPU, RAM, disk, and network usage metrics for all connected
agents
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/internal_handlers.AgentSystemMetricsOut'
type: array
security:
- Bearer: []
summary: Get agent system metrics
tags:
- agents
/auth/login:
post:
consumes:
- application/json
description: Authenticate with login and password, returns a token and permissions
parameters:
- description: Login credentials
in: body
name: request
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.LoginRequest'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.LoginResponse'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
"403":
description: Forbidden
schema:
additionalProperties:
type: string
type: object
summary: Login
tags:
- auth
/auth/register:
post:
consumes:
- application/json
description: Registers a new user with login, password, name, last name. All
permissions are set to false.
parameters:
- description: Registration data
in: body
name: request
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.UserRegister'
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Register user
tags:
- auth
/auth/token:
delete:
description: Deletes the current authenticated user
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Delete my account
tags:
- auth
post:
consumes:
- application/json
description: Creates a new user with permissions
parameters:
- description: User data
in: body
name: request
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenCreate'
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Create user
tags:
- auth
/auth/tokens:
get:
description: Returns list of all users with their permissions
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Tokens'
type: array
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: List users
tags:
- auth
/auth/tokens/:login:
delete:
description: Deletes a user by their login
parameters:
- description: Login of the user to delete
in: path
name: login
required: true
type: string
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Delete user
tags:
- auth
/auth/users/:login:
get:
description: Returns a user by their login (admin only)
parameters:
- description: Login of the user
in: path
name: login
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Tokens'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Get user by login
tags:
- auth
put:
consumes:
- application/json
description: Updates a user's name and last name (admin only)
parameters:
- description: Login of the user
in: path
name: login
required: true
type: string
- description: User data to update
in: body
name: request
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenUpdate'
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Update user
tags:
- auth
/auth/users/:login/activate:
post:
description: Activates a user account by login (admin only)
parameters:
- description: Login of the user to activate
in: path
name: login
required: true
type: string
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Activate user
tags:
- auth
/auth/users/:login/deactivate:
post:
description: Deactivates a user account by login (admin only)
parameters:
- description: Login of the user to deactivate
in: path
name: login
required: true
type: string
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Deactivate user
tags:
- auth
/auth/users/:login/password:
put:
consumes:
- application/json
description: Resets a user's password to a new value (admin only)
parameters:
- description: Login of the user
in: path
name: login
required: true
type: string
- description: New password
in: body
name: request
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenPasswordReset'
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Reset user password
tags:
- auth
/auth/users/:login/permissions:
put:
consumes:
- application/json
description: Updates a user's permissions and activation status (admin only)
parameters:
- description: Login of the user
in: path
name: login
required: true
type: string
- description: Permissions to update
in: body
name: request
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenUpdatePermissions'
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Update user permissions
tags:
- auth
/auth/users/inactive:
get:
description: Returns list of all users waiting for activation
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Tokens'
type: array
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: List inactive users
tags:
- auth
/auth/validate:
get:
description: Check if the provided Bearer token is valid and return its permissions
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Tokens'
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Validate token
tags:
- auth
/graph:
get:
description: Returns the service dependency graph as raw YAML text
produces:
- text/plain
responses:
"200":
description: YAML content
schema:
type: string
security:
- Bearer: []
summary: Get dependency graph YAML
tags:
- graph
put:
consumes:
- text/plain
description: Replaces the service dependency graph YAML and reloads it
parameters:
- description: New YAML content
in: body
name: body
required: true
schema:
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Update dependency graph YAML
tags:
- graph
/graph/cycle:
get:
description: Returns whether the dependency graph contains cycles
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: boolean
type: object
security:
- Bearer: []
summary: Check for cycles
tags:
- graph
/graph/failure:
get:
description: Analyzes dependencies and service statuses to find the root cause
of a failure
parameters:
- description: Node ID (agent label)
in: query
name: node_id
type: string
- description: Service name
in: query
name: service
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/internal_handlers.FailureRootCauseOut'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Find failure root cause
tags:
- graph
/graph/order:
get:
description: Returns the topologically sorted service startup order
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
type: string
type: array
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Get startup order
tags:
- graph
/jobs:
post:
consumes:
- application/json
description: Sends a command to the specified agent and returns a URL to wait
for the result
parameters:
- description: Job request
in: body
name: body
required: true
schema:
$ref: '#/definitions/internal_handlers.AddJobIn'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/internal_handlers.AddJobOut'
summary: Submit a job to an agent
tags:
- jobs
/jobs/{id}/wait:
post:
consumes:
- application/json
description: Long-polls for a job result. Returns immediately if the job is
already finished.
parameters:
- description: Job ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/internal_handlers.JobResult'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
summary: Wait for job result
tags:
- jobs
/jobs/metrics:
get:
description: Returns total, successful, failed, and pending job counts over
the given period
parameters:
- default: 24h
description: Time period (e.g. 1h, 24h, 7d)
in: query
name: period
type: string
- description: Filter by agent ID
in: query
name: agent_id
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/internal_handlers.JobMetricsOut'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Get job metrics
tags:
- jobs
/logs:
get:
description: Searches logs with various filters
parameters:
- description: Log level (INFO, WARNING, ERROR, FATAL)
in: query
name: level
type: string
- description: Service name
in: query
name: service
type: string
- description: Agent name
in: query
name: agent
type: string
- description: Date from (RFC3339)
in: query
name: date_from
type: string
- description: Date to (RFC3339)
in: query
name: date_to
type: string
- default: 100
description: Limit results
in: query
name: limit
type: integer
- default: 0
description: Offset results
in: query
name: offset
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_storage.LogEntry'
type: array
security:
- Bearer: []
summary: Search logs
tags:
- logs
post:
consumes:
- application/json
description: Inserts a single log entry into ClickHouse
parameters:
- description: Log entry
in: body
name: body
required: true
schema:
$ref: '#/definitions/internal_handlers.InsertLogRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Insert log entry
tags:
- logs
/logs/agents:
get:
description: Returns list of all unique agent names in logs
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
type: string
type: array
security:
- Bearer: []
summary: Get distinct agents
tags:
- logs
/logs/batch:
post:
consumes:
- application/json
description: Inserts multiple log entries into ClickHouse
parameters:
- description: Log entries
in: body
name: body
required: true
schema:
$ref: '#/definitions/internal_handlers.InsertLogsRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Insert log entries (batch)
tags:
- logs
/logs/levels:
get:
description: Returns list of all unique log levels in logs
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
type: string
type: array
security:
- Bearer: []
summary: Get distinct log levels
tags:
- logs
/logs/mock:
get:
description: Returns 100 mock log entries for frontend development (no ClickHouse
required)
parameters:
- description: Filter by level
in: query
name: level
type: string
- description: Filter by service
in: query
name: service
type: string
- description: Filter by agent
in: query
name: agent
type: string
- default: 100
description: Limit results
in: query
name: limit
type: integer
- default: 0
description: Offset results
in: query
name: offset
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_storage.LogEntry'
type: array
security:
- Bearer: []
summary: Get mock logs
tags:
- logs
/logs/services:
get:
description: Returns list of all unique service names in logs
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
type: string
type: array
security:
- Bearer: []
summary: Get distinct services
tags:
- logs
/scripts:
post:
consumes:
- application/json
description: Creates a new script with path, content, and interpreter binding
parameters:
- description: Script data
in: body
name: body
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptCreate'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Script'
security:
- Bearer: []
summary: Create script
tags:
- scripts
/scripts/:id:
delete:
description: Deletes a script by its ID
parameters:
- description: Script ID
in: path
name: id
required: true
type: integer
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Delete script
tags:
- scripts
get:
description: Returns a script by its ID
parameters:
- description: Script ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Script'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Get script
tags:
- scripts
put:
consumes:
- application/json
description: Updates a script's path, content, or interpreter
parameters:
- description: Script ID
in: path
name: id
required: true
type: integer
- description: Script data
in: body
name: body
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptUpdate'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Script'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Update script
tags:
- scripts
/scripts/:id/run:
post:
consumes:
- application/json
description: Loads a script from storage, resolves interpreter command, and
submits it to the agent
parameters:
- description: Script ID
in: path
name: id
required: true
type: integer
- description: Agent ID and optional stdin
in: body
name: body
required: true
schema:
$ref: '#/definitions/internal_handlers.RunStoredScriptIn'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/internal_handlers.AddJobOut'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Run script by ID
tags:
- scripts
/scripts/by-path:
get:
description: Returns a script by its full path (e.g. 'deploy/nginx/restart.sh')
parameters:
- description: Script path
in: query
name: path
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Script'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Get script by path
tags:
- scripts
/scripts/folder:
delete:
consumes:
- application/json
description: Deletes all scripts that start with the given folder path
parameters:
- description: Folder path
in: body
name: body
required: true
schema:
$ref: '#/definitions/internal_handlers.DeleteFolderRequest'
produces:
- application/json
responses:
"200":
description: Folder deleted with count of deleted scripts
schema:
additionalProperties: true
type: object
security:
- Bearer: []
summary: Delete folder
tags:
- scripts
post:
consumes:
- application/json
description: Creates a virtual folder by creating a placeholder script with
the folder path
parameters:
- description: Folder path
in: body
name: body
required: true
schema:
$ref: '#/definitions/internal_handlers.CreateFolderRequest'
produces:
- application/json
responses:
"201":
description: Folder created
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Create folder
tags:
- scripts
/scripts/interpreters:
get:
description: Returns all script interpreters available in the system
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreter'
type: array
security:
- Bearer: []
summary: List interpreters
tags:
- scripts
post:
consumes:
- application/json
description: Registers a new script interpreter with name, label, and argv
parameters:
- description: Interpreter definition
in: body
name: body
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreterCreate'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreter'
security:
- Bearer: []
summary: Create interpreter
tags:
- scripts
/scripts/interpreters/:id:
delete:
description: Removes a script interpreter by ID
parameters:
- description: Interpreter ID
in: path
name: id
required: true
type: integer
responses:
"204":
description: No Content
security:
- Bearer: []
summary: Delete interpreter
tags:
- scripts
get:
description: Returns a script interpreter by ID
parameters:
- description: Interpreter ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreter'
security:
- Bearer: []
summary: Get interpreter
tags:
- scripts
put:
consumes:
- application/json
description: Updates fields of a script interpreter
parameters:
- description: Interpreter ID
in: path
name: id
required: true
type: integer
- description: Interpreter fields
in: body
name: body
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreterUpdate'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreter'
security:
- Bearer: []
summary: Update interpreter
tags:
- scripts
/scripts/rename:
post:
consumes:
- application/json
description: Renames a single script or all scripts under a folder prefix
parameters:
- description: Rename request
in: body
name: body
required: true
schema:
$ref: '#/definitions/internal_handlers.RenameRequest'
produces:
- application/json
responses:
"200":
description: Rename result with count of renamed scripts
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Rename script or folder
tags:
- scripts
/scripts/run:
post:
consumes:
- application/json
description: Resolves interpreter argv[] and sends the full command to the agent
parameters:
- description: Script request
in: body
name: body
required: true
schema:
$ref: '#/definitions/internal_handlers.RunScriptIn'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/internal_handlers.AddJobOut'
security:
- Bearer: []
summary: Run a script on an agent
tags:
- scripts
/scripts/tree:
get:
description: Returns a hierarchical tree of all scripts organized by their paths
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptTreeNode'
type: array
security:
- Bearer: []
summary: Get script directory tree
tags:
- scripts
securityDefinitions:
Bearer:
description: Type "Bearer" followed by a space and the JWT token.
in: header
name: Authorization
type: apiKey
swagger: "2.0"