chore(swagger): updated swagger docs

This commit is contained in:
yusing
2025-09-04 06:41:04 +08:00
parent de9ddfaef6
commit f34f502660
3 changed files with 1684 additions and 554 deletions

View File

@@ -4,8 +4,6 @@ definitions:
properties:
addr:
type: string
is_nerdctl:
type: boolean
name:
type: string
version:
@@ -97,6 +95,8 @@ definitions:
description: non-zero publicPort:types.Port
running:
type: boolean
state:
$ref: '#/definitions/container.ContainerState'
type: object
ContainerImage:
properties:
@@ -122,7 +122,9 @@ definitions:
server:
type: string
state:
$ref: '#/definitions/ContainerState'
allOf:
- $ref: '#/definitions/ContainerState'
x-nullable: true
type: object
ContainerState:
enum:
@@ -281,11 +283,84 @@ definitions:
additionalProperties:
$ref: '#/definitions/routes.HealthInfo'
type: object
HomepageItems:
additionalProperties:
HomepageCategory:
properties:
items:
$ref: '#/definitions/homepage.Item'
type: array
items:
$ref: '#/definitions/HomepageItem'
type: array
name:
type: string
type: object
HomepageItem:
properties:
alias:
type: string
all_sort_order:
description: sort order in all
type: integer
category:
type: string
description:
type: string
fav_sort_order:
description: sort order in favorite
type: integer
favorite:
type: boolean
icon:
type: string
name:
description: display name
type: string
origin_url:
type: string
provider:
type: string
show:
type: boolean
sort_order:
description: sort order in category
type: integer
url:
type: string
widget_config:
allOf:
- $ref: '#/definitions/widgets.Config'
x-nullable: true
widgets:
items:
$ref: '#/definitions/HomepageItemWidget'
type: array
type: object
HomepageItemConfig:
properties:
category:
type: string
description:
type: string
favorite:
type: boolean
icon:
type: string
name:
description: display name
type: string
show:
type: boolean
url:
type: string
widget_config:
allOf:
- $ref: '#/definitions/widgets.Config'
x-nullable: true
type: object
HomepageItemWidget:
properties:
label:
type: string
value:
type: string
type: object
HomepageOverrideCategoryOrderParams:
properties:
@@ -294,10 +369,40 @@ definitions:
which:
type: string
type: object
HomepageOverrideItemAllSortOrderParams:
properties:
value:
type: integer
which:
type: string
type: object
HomepageOverrideItemFavSortOrderParams:
properties:
value:
type: integer
which:
type: string
type: object
HomepageOverrideItemFavoriteParams:
properties:
value:
type: boolean
which:
items:
type: string
type: array
type: object
HomepageOverrideItemParams:
properties:
value:
$ref: '#/definitions/homepage.ItemConfig'
$ref: '#/definitions/HomepageItemConfig'
which:
type: string
type: object
HomepageOverrideItemSortOrderParams:
properties:
value:
type: integer
which:
type: string
type: object
@@ -314,7 +419,7 @@ definitions:
properties:
value:
additionalProperties:
$ref: '#/definitions/homepage.ItemConfig'
$ref: '#/definitions/HomepageItemConfig'
type: object
type: object
IdlewatcherConfig:
@@ -454,13 +559,6 @@ definitions:
- MetricsPeriod1mo
NewAgentRequest:
properties:
container_runtime:
allOf:
- $ref: '#/definitions/agent.ContainerRuntime'
enum:
- docker
- podman
- nerdctl
host:
type: string
name:
@@ -587,6 +685,10 @@ definitions:
type: boolean
excluded:
type: boolean
x-nullable: true
excluded_reason:
type: string
x-nullable: true
health:
allOf:
- $ref: '#/definitions/HealthJSON'
@@ -594,7 +696,7 @@ definitions:
healthcheck:
$ref: '#/definitions/HealthCheckConfig'
homepage:
$ref: '#/definitions/homepage.ItemConfig'
$ref: '#/definitions/HomepageItemConfig'
host:
type: string
idlewatcher:
@@ -693,12 +795,22 @@ definitions:
type: string
avg_latency:
type: number
current_status:
enum:
- healthy
- unhealthy
- unknown
- napping
- starting
type: string
display_name:
type: string
downtime:
type: number
idle:
type: number
is_docker:
type: boolean
statuses:
items:
$ref: '#/definitions/RouteStatus'
@@ -819,8 +931,6 @@ definitions:
$ref: '#/definitions/PEMPairResponse'
client:
$ref: '#/definitions/PEMPairResponse'
container_runtime:
$ref: '#/definitions/agent.ContainerRuntime'
host:
type: string
type: object
@@ -872,16 +982,6 @@ definitions:
status_codes:
$ref: '#/definitions/LogFilter-StatusCodeRange'
type: object
agent.ContainerRuntime:
enum:
- docker
- podman
- nerdctl
type: string
x-enum-varnames:
- ContainerRuntimeDocker
- ContainerRuntimePodman
- ContainerRuntimeNerdctl
auth.UserPassAuthCallbackRequest:
properties:
password:
@@ -889,6 +989,43 @@ definitions:
username:
type: string
type: object
container.ContainerState:
enum:
- created
- running
- paused
- restarting
- removing
- exited
- dead
type: string
x-enum-comments:
StateCreated: StateCreated indicates the container is created, but not (yet)
started.
StateDead: StateDead indicates that the container failed to be deleted. Containers
in this state are attempted to be cleaned up when the daemon restarts.
StateExited: StateExited indicates that the container exited.
StatePaused: StatePaused indicates that the container's current state is paused.
StateRemoving: StateRemoving indicates that the container is being removed.
StateRestarting: StateRestarting indicates that the container is currently restarting.
StateRunning: StateRunning indicates that the container is running.
x-enum-descriptions:
- StateCreated indicates the container is created, but not (yet) started.
- StateRunning indicates that the container is running.
- StatePaused indicates that the container's current state is paused.
- StateRestarting indicates that the container is currently restarting.
- StateRemoving indicates that the container is being removed.
- StateExited indicates that the container exited.
- StateDead indicates that the container failed to be deleted. Containers in this
state are attempted to be cleaned up when the daemon restarts.
x-enum-varnames:
- StateCreated
- StateRunning
- StatePaused
- StateRestarting
- StateRemoving
- StateExited
- StateDead
container.Port:
properties:
IP:
@@ -1001,52 +1138,6 @@ definitions:
- IconSourceRelative
- IconSourceWalkXCode
- IconSourceSelfhSt
homepage.Item:
properties:
alias:
type: string
category:
type: string
description:
type: string
icon:
type: string
name:
description: display name
type: string
origin_url:
type: string
provider:
type: string
show:
type: boolean
sort_order:
type: integer
url:
type: string
widget_config:
allOf:
- $ref: '#/definitions/widgets.Config'
x-nullable: true
type: object
homepage.ItemConfig:
properties:
category:
type: string
description:
type: string
icon:
type: string
name:
description: display name
type: string
show:
type: boolean
sort_order:
type: integer
url:
type: string
type: object
mem.VirtualMemoryStat:
properties:
available:
@@ -1118,6 +1209,10 @@ definitions:
type: boolean
excluded:
type: boolean
x-nullable: true
excluded_reason:
type: string
x-nullable: true
health:
allOf:
- $ref: '#/definitions/HealthJSON'
@@ -1125,7 +1220,7 @@ definitions:
healthcheck:
$ref: '#/definitions/HealthCheckConfig'
homepage:
$ref: '#/definitions/homepage.ItemConfig'
$ref: '#/definitions/HomepageItemConfig'
host:
type: string
idlewatcher:
@@ -1212,18 +1307,14 @@ definitions:
description: uptime in milliseconds
type: number
type: object
rules.Command:
type: object
rules.Rule:
properties:
do:
$ref: '#/definitions/rules.Command'
type: string
name:
type: string
"on":
$ref: '#/definitions/rules.RuleOn'
type: object
rules.RuleOn:
type: string
type: object
sensors.TemperatureStat:
properties:
@@ -1389,38 +1480,6 @@ paths:
- agent
x-id: verify
/auth/callback:
get:
description: Handles the callback from the provider after successful authentication
parameters:
- description: Userpass only
in: body
name: body
required: true
schema:
$ref: '#/definitions/auth.UserPassAuthCallbackRequest'
produces:
- text/plain
responses:
"200":
description: 'Userpass: OK'
schema:
type: string
"302":
description: 'OIDC: Redirects to home page'
schema:
type: string
"400":
description: 'Userpass: invalid request / credentials'
schema:
type: string
"500":
description: Internal server error
schema:
type: string
summary: Auth Callback
tags:
- auth
x-id: callback
post:
description: Handles the callback from the provider after successful authentication
parameters:
@@ -1557,6 +1616,34 @@ paths:
- cert
- websocket
x-id: renew
/docker/container/{id}:
get:
description: Get container by container id
parameters:
- description: Container ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/ContainerResponse'
"403":
description: Forbidden
schema:
$ref: '#/definitions/ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ErrorResponse'
summary: Get container
tags:
- docker
x-id: container
/docker/containers:
get:
description: Get containers
@@ -1603,20 +1690,15 @@ paths:
tags:
- docker
x-id: info
/docker/logs/{server}/{container}:
/docker/logs/{id}:
get:
consumes:
- application/json
description: Get docker container logs
description: Get docker container logs by container id
parameters:
- description: server name
in: path
name: server
required: true
type: string
- description: container id
in: path
name: container
name: id
required: true
type: string
- description: show stdout
@@ -1930,6 +2012,10 @@ paths:
- application/json
description: Homepage items
parameters:
- description: Search query
in: query
name: search
type: string
- description: Category filter
in: query
name: category
@@ -1944,7 +2030,9 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/HomepageItems'
items:
$ref: '#/definitions/HomepageCategory'
type: array
"400":
description: Bad Request
schema:
@@ -2019,6 +2107,130 @@ paths:
tags:
- homepage
x-id: set-item
/homepage/set/item_all_sort_order:
post:
consumes:
- application/json
description: Set homepage item all sort order.
parameters:
- description: Set item all sort order
in: body
name: request
required: true
schema:
$ref: '#/definitions/HomepageOverrideItemAllSortOrderParams'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/SuccessResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ErrorResponse'
summary: Set homepage item all sort order
tags:
- homepage
x-id: set-item-all-sort-order
/homepage/set/item_fav_sort_order:
post:
consumes:
- application/json
description: Set homepage item fav sort order.
parameters:
- description: Set item fav sort order
in: body
name: request
required: true
schema:
$ref: '#/definitions/HomepageOverrideItemFavSortOrderParams'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/SuccessResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ErrorResponse'
summary: Set homepage item fav sort order
tags:
- homepage
x-id: set-item-fav-sort-order
/homepage/set/item_favorite:
post:
consumes:
- application/json
description: Set homepage item favorite.
parameters:
- description: Set item favorite
in: body
name: request
required: true
schema:
$ref: '#/definitions/HomepageOverrideItemFavoriteParams'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/SuccessResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ErrorResponse'
summary: Set homepage item favorite
tags:
- homepage
x-id: set-item-favorite
/homepage/set/item_sort_order:
post:
consumes:
- application/json
description: Set homepage item sort order.
parameters:
- description: Set item sort order
in: body
name: request
required: true
schema:
$ref: '#/definitions/HomepageOverrideItemSortOrderParams'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/SuccessResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ErrorResponse'
summary: Set homepage item sort order
tags:
- homepage
x-id: set-item-sort-order
/homepage/set/item_visible:
post:
consumes:
@@ -2116,6 +2328,80 @@ paths:
tags:
- v1
x-id: icons
/metrics/all_system_info:
get:
description: Get system info
parameters:
- enum:
- cpu_average
- memory_usage
- memory_usage_percent
- disks_read_speed
- disks_write_speed
- disks_iops
- disk_usage
- network_speed
- network_transfer
- sensor_temperature
in: query
name: aggregate
type: string
x-enum-varnames:
- SystemInfoAggregateModeCPUAverage
- SystemInfoAggregateModeMemoryUsage
- SystemInfoAggregateModeMemoryUsagePercent
- SystemInfoAggregateModeDisksReadSpeed
- SystemInfoAggregateModeDisksWriteSpeed
- SystemInfoAggregateModeDisksIOPS
- SystemInfoAggregateModeDiskUsage
- SystemInfoAggregateModeNetworkSpeed
- SystemInfoAggregateModeNetworkTransfer
- SystemInfoAggregateModeSensorTemperature
- format: duration
in: query
name: interval
type: string
- enum:
- 5m
- 15m
- 1h
- 1d
- 1mo
in: query
name: period
type: string
x-enum-varnames:
- MetricsPeriod5m
- MetricsPeriod15m
- MetricsPeriod1h
- MetricsPeriod1d
- MetricsPeriod1mo
produces:
- application/json
responses:
"200":
description: period specified, aggregated system info by agent name
schema:
additionalProperties:
$ref: '#/definitions/SystemInfoAggregate'
type: object
"400":
description: Bad Request
schema:
$ref: '#/definitions/ErrorResponse'
"403":
description: Forbidden
schema:
$ref: '#/definitions/ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ErrorResponse'
summary: Get system info
tags:
- metrics
- websocket
x-id: all_system_info
/metrics/system_info:
get:
description: Get system info
@@ -2123,6 +2409,9 @@ paths:
- in: query
name: agentAddr
type: string
- in: query
name: agentName
type: string
- enum:
- cpu_average
- memory_usage
@@ -2178,10 +2467,6 @@ paths:
description: Forbidden
schema:
$ref: '#/definitions/ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/ErrorResponse'
"500":
description: Internal Server Error
schema: