chore: add handlers for rename dir ans scripts
ci-agent / build (push) Failing after 2m50s

This commit is contained in:
d3m0k1d
2026-04-05 03:29:36 +03:00
parent 534d6aa738
commit 1f6908900b
5 changed files with 316 additions and 0 deletions
+84
View File
@@ -2018,6 +2018,73 @@ const docTemplate = `{
}
}
},
"/scripts/rename": {
"post": {
"security": [
{
"Bearer": []
}
],
"description": "Renames a single script or all scripts under a folder prefix",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"scripts"
],
"summary": "Rename script or folder",
"parameters": [
{
"description": "Rename request",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_handlers.RenameRequest"
}
}
],
"responses": {
"200": {
"description": "Rename result with count of renamed scripts",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"409": {
"description": "Conflict",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/scripts/run": {
"post": {
"security": [
@@ -2798,6 +2865,23 @@ const docTemplate = `{
}
}
},
"internal_handlers.RenameRequest": {
"type": "object",
"required": [
"new_path",
"old_path"
],
"properties": {
"new_path": {
"type": "string",
"example": "deploy/nginx-v2"
},
"old_path": {
"type": "string",
"example": "deploy/nginx"
}
}
},
"internal_handlers.RunScriptIn": {
"type": "object",
"required": [
+84
View File
@@ -2007,6 +2007,73 @@
}
}
},
"/scripts/rename": {
"post": {
"security": [
{
"Bearer": []
}
],
"description": "Renames a single script or all scripts under a folder prefix",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"scripts"
],
"summary": "Rename script or folder",
"parameters": [
{
"description": "Rename request",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_handlers.RenameRequest"
}
}
],
"responses": {
"200": {
"description": "Rename result with count of renamed scripts",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"409": {
"description": "Conflict",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/scripts/run": {
"post": {
"security": [
@@ -2787,6 +2854,23 @@
}
}
},
"internal_handlers.RenameRequest": {
"type": "object",
"required": [
"new_path",
"old_path"
],
"properties": {
"new_path": {
"type": "string",
"example": "deploy/nginx-v2"
},
"old_path": {
"type": "string",
"example": "deploy/nginx"
}
}
},
"internal_handlers.RunScriptIn": {
"type": "object",
"required": [
+55
View File
@@ -477,6 +477,18 @@ definitions:
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:
@@ -1809,6 +1821,49 @@ paths:
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: