mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 00:38:33 +02:00
fix(swagger): correct response type for health api and update swagger
This commit is contained in:
@@ -1171,7 +1171,10 @@
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "Health info by route name",
|
"description": "Health info by route name",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/HealthMap"
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"$ref": "#/definitions/HealthStatusString"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"403": {
|
"403": {
|
||||||
@@ -2820,43 +2823,6 @@
|
|||||||
"operationId": "tail"
|
"operationId": "tail"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/reload": {
|
|
||||||
"post": {
|
|
||||||
"description": "Reload config",
|
|
||||||
"consumes": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"v1"
|
|
||||||
],
|
|
||||||
"summary": "Reload config",
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "OK",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/SuccessResponse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"403": {
|
|
||||||
"description": "Forbidden",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/ErrorResponse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "Internal Server Error",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/ErrorResponse"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-id": "reload",
|
|
||||||
"operationId": "reload"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/route/by_provider": {
|
"/route/by_provider": {
|
||||||
"get": {
|
"get": {
|
||||||
"description": "List routes by provider",
|
"description": "List routes by provider",
|
||||||
@@ -4071,14 +4037,6 @@
|
|||||||
"x-nullable": false,
|
"x-nullable": false,
|
||||||
"x-omitempty": false
|
"x-omitempty": false
|
||||||
},
|
},
|
||||||
"HealthMap": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"$ref": "#/definitions/HealthStatusString"
|
|
||||||
},
|
|
||||||
"x-nullable": false,
|
|
||||||
"x-omitempty": false
|
|
||||||
},
|
|
||||||
"HealthStatusString": {
|
"HealthStatusString": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
@@ -5329,7 +5287,6 @@
|
|||||||
"x-omitempty": false
|
"x-omitempty": false
|
||||||
},
|
},
|
||||||
"bind": {
|
"bind": {
|
||||||
"description": "for TCP and UDP routes, bind address to listen on",
|
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"x-nullable": true
|
"x-nullable": true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -419,10 +419,6 @@ definitions:
|
|||||||
url:
|
url:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
HealthMap:
|
|
||||||
additionalProperties:
|
|
||||||
$ref: '#/definitions/HealthStatusString'
|
|
||||||
type: object
|
|
||||||
HealthStatusString:
|
HealthStatusString:
|
||||||
enum:
|
enum:
|
||||||
- unknown
|
- unknown
|
||||||
@@ -1007,7 +1003,6 @@ definitions:
|
|||||||
alias:
|
alias:
|
||||||
type: string
|
type: string
|
||||||
bind:
|
bind:
|
||||||
description: for TCP and UDP routes, bind address to listen on
|
|
||||||
type: string
|
type: string
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
container:
|
container:
|
||||||
@@ -1807,12 +1802,12 @@ definitions:
|
|||||||
type: string
|
type: string
|
||||||
kernel_version:
|
kernel_version:
|
||||||
type: string
|
type: string
|
||||||
|
load_avg_5m:
|
||||||
|
type: string
|
||||||
load_avg_15m:
|
load_avg_15m:
|
||||||
type: string
|
type: string
|
||||||
load_avg_1m:
|
load_avg_1m:
|
||||||
type: string
|
type: string
|
||||||
load_avg_5m:
|
|
||||||
type: string
|
|
||||||
mem_pct:
|
mem_pct:
|
||||||
type: string
|
type: string
|
||||||
mem_total:
|
mem_total:
|
||||||
@@ -2675,7 +2670,9 @@ paths:
|
|||||||
"200":
|
"200":
|
||||||
description: Health info by route name
|
description: Health info by route name
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/HealthMap'
|
additionalProperties:
|
||||||
|
$ref: '#/definitions/HealthStatusString'
|
||||||
|
type: object
|
||||||
"403":
|
"403":
|
||||||
description: Forbidden
|
description: Forbidden
|
||||||
schema:
|
schema:
|
||||||
@@ -3790,30 +3787,6 @@ paths:
|
|||||||
- proxmox
|
- proxmox
|
||||||
- websocket
|
- websocket
|
||||||
x-id: tail
|
x-id: tail
|
||||||
/reload:
|
|
||||||
post:
|
|
||||||
consumes:
|
|
||||||
- application/json
|
|
||||||
description: Reload config
|
|
||||||
produces:
|
|
||||||
- application/json
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
description: OK
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/SuccessResponse'
|
|
||||||
"403":
|
|
||||||
description: Forbidden
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/ErrorResponse'
|
|
||||||
"500":
|
|
||||||
description: Internal Server Error
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/ErrorResponse'
|
|
||||||
summary: Reload config
|
|
||||||
tags:
|
|
||||||
- v1
|
|
||||||
x-id: reload
|
|
||||||
/route/{which}:
|
/route/{which}:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
entrypoint "github.com/yusing/godoxy/internal/entrypoint/types"
|
entrypoint "github.com/yusing/godoxy/internal/entrypoint/types"
|
||||||
apitypes "github.com/yusing/goutils/apitypes"
|
"github.com/yusing/goutils/apitypes"
|
||||||
"github.com/yusing/goutils/http/httpheaders"
|
"github.com/yusing/goutils/http/httpheaders"
|
||||||
"github.com/yusing/goutils/http/websocket"
|
"github.com/yusing/goutils/http/websocket"
|
||||||
)
|
)
|
||||||
@@ -18,7 +18,7 @@ import (
|
|||||||
// @Tags v1,websocket
|
// @Tags v1,websocket
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {object} routes.HealthMap "Health info by route name"
|
// @Success 200 {object} map[string]types.HealthStatusString "Health info by route name"
|
||||||
// @Failure 403 {object} apitypes.ErrorResponse
|
// @Failure 403 {object} apitypes.ErrorResponse
|
||||||
// @Failure 500 {object} apitypes.ErrorResponse
|
// @Failure 500 {object} apitypes.ErrorResponse
|
||||||
// @Router /health [get]
|
// @Router /health [get]
|
||||||
|
|||||||
Reference in New Issue
Block a user