add vcenter totals line graph
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-01-16 12:36:53 +11:00
parent 268919219e
commit 871904f63e
14 changed files with 1841 additions and 132 deletions

View File

@@ -854,6 +854,73 @@ const docTemplate = `{
}
}
}
},
"/vcenters": {
"get": {
"description": "Lists all vCenters with recorded snapshot totals.",
"produces": [
"text/html"
],
"tags": [
"vcenters"
],
"summary": "List vCenters",
"responses": {
"200": {
"description": "HTML page",
"schema": {
"type": "string"
}
}
}
}
},
"/vcenters/totals": {
"get": {
"description": "Shows per-snapshot totals for a vCenter.",
"produces": [
"text/html"
],
"tags": [
"vcenters"
],
"summary": "vCenter totals",
"parameters": [
{
"type": "string",
"description": "vCenter URL",
"name": "vcenter",
"in": "query",
"required": true
},
{
"type": "string",
"description": "hourly|daily|monthly (default: hourly)",
"name": "type",
"in": "query"
},
{
"type": "integer",
"description": "Limit results (default 200)",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "HTML page",
"schema": {
"type": "string"
}
},
"400": {
"description": "Missing vcenter",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {

View File

@@ -843,6 +843,73 @@
}
}
}
},
"/vcenters": {
"get": {
"description": "Lists all vCenters with recorded snapshot totals.",
"produces": [
"text/html"
],
"tags": [
"vcenters"
],
"summary": "List vCenters",
"responses": {
"200": {
"description": "HTML page",
"schema": {
"type": "string"
}
}
}
}
},
"/vcenters/totals": {
"get": {
"description": "Shows per-snapshot totals for a vCenter.",
"produces": [
"text/html"
],
"tags": [
"vcenters"
],
"summary": "vCenter totals",
"parameters": [
{
"type": "string",
"description": "vCenter URL",
"name": "vcenter",
"in": "query",
"required": true
},
{
"type": "string",
"description": "hourly|daily|monthly (default: hourly)",
"name": "type",
"in": "query"
},
{
"type": "integer",
"description": "Limit results (default 200)",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "HTML page",
"schema": {
"type": "string"
}
},
"400": {
"description": "Missing vcenter",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {

View File

@@ -720,4 +720,48 @@ paths:
summary: List monthly snapshots
tags:
- snapshots
/vcenters:
get:
description: Lists all vCenters with recorded snapshot totals.
produces:
- text/html
responses:
"200":
description: HTML page
schema:
type: string
summary: List vCenters
tags:
- vcenters
/vcenters/totals:
get:
description: Shows per-snapshot totals for a vCenter.
parameters:
- description: vCenter URL
in: query
name: vcenter
required: true
type: string
- description: 'hourly|daily|monthly (default: hourly)'
in: query
name: type
type: string
- description: Limit results (default 200)
in: query
name: limit
type: integer
produces:
- text/html
responses:
"200":
description: HTML page
schema:
type: string
"400":
description: Missing vcenter
schema:
type: string
summary: vCenter totals
tags:
- vcenters
swagger: "2.0"

View File

@@ -66,6 +66,8 @@ func New(logger *slog.Logger, database db.Database, buildTime string, sha1ver st
mux.HandleFunc("/api/snapshots/hourly/force", h.SnapshotForceHourly)
mux.HandleFunc("/api/snapshots/migrate", h.SnapshotMigrate)
mux.HandleFunc("/api/snapshots/regenerate-hourly-reports", h.SnapshotRegenerateHourlyReports)
mux.HandleFunc("/vcenters", h.VcenterList)
mux.HandleFunc("/vcenters/totals", h.VcenterTotals)
mux.HandleFunc("/metrics", h.Metrics)
mux.HandleFunc("/snapshots/hourly", h.SnapshotHourlyList)