Fix the scale swagger description

This commit is contained in:
Berger Eugene 2023-07-08 17:25:52 +03:00
parent 08ddae986e
commit 43ac3cc86f
4 changed files with 24 additions and 4 deletions

View File

@ -169,8 +169,9 @@ func (api *PcApi) RestartProcess(c *gin.Context) {
// @Summary Scale a process to a given replicas count
// @Produce json
// @Param name path string true "Process Name"
// @Param scale path int true "New amount of process replicas"
// @Success 200 {string} string "Scaled Process Name"
// @Router /process/scale/{name}/{scale} [post]
// @Router /process/scale/{name}/{scale} [patch]
func (api *PcApi) ScaleProcess(c *gin.Context) {
name := c.Param("name")
scale, err := strconv.Atoi(c.Param("scale"))

View File

@ -152,7 +152,7 @@ const docTemplate = `{
}
},
"/process/scale/{name}/{scale}": {
"post": {
"patch": {
"description": "Scale a process",
"produces": [
"application/json"
@ -168,6 +168,13 @@ const docTemplate = `{
"name": "name",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "New amount of process replicas",
"name": "scale",
"in": "path",
"required": true
}
],
"responses": {

View File

@ -140,7 +140,7 @@
}
},
"/process/scale/{name}/{scale}": {
"post": {
"patch": {
"description": "Scale a process",
"produces": [
"application/json"
@ -156,6 +156,13 @@
"name": "name",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "New amount of process replicas",
"name": "scale",
"in": "path",
"required": true
}
],
"responses": {

View File

@ -110,7 +110,7 @@ paths:
tags:
- Process
/process/scale/{name}/{scale}:
post:
patch:
description: Scale a process
parameters:
- description: Process Name
@ -118,6 +118,11 @@ paths:
name: name
required: true
type: string
- description: New amount of process replicas
in: path
name: scale
required: true
type: integer
produces:
- application/json
responses: