Add PostgreSQL checkpoint functionality and update related database operations
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-02-16 09:21:00 +11:00
parent ff1ec3f4aa
commit 6da2da3e82
8 changed files with 412 additions and 34 deletions

View File

@@ -379,7 +379,7 @@
},
"/api/import/vm": {
"post": {
"description": "Imports existing VM inventory data in bulk.",
"description": "Deprecated: Imports existing VM inventory data in bulk.",
"consumes": [
"application/json"
],
@@ -389,7 +389,8 @@
"tags": [
"inventory"
],
"summary": "Import VMs",
"summary": "Import VMs (deprecated)",
"deprecated": true,
"parameters": [
{
"description": "Bulk import payload",
@@ -419,14 +420,15 @@
},
"/api/inventory/vm/delete": {
"delete": {
"description": "Removes a VM inventory entry by VM ID and datacenter name.",
"description": "Deprecated: Removes a VM inventory entry by VM ID and datacenter name.",
"produces": [
"application/json"
],
"tags": [
"inventory"
],
"summary": "Cleanup VM inventory entry",
"summary": "Cleanup VM inventory entry (deprecated)",
"deprecated": true,
"parameters": [
{
"type": "string",
@@ -461,14 +463,15 @@
},
"/api/inventory/vm/update": {
"post": {
"description": "Queries vCenter and updates inventory records with missing details.",
"description": "Deprecated: Queries vCenter and updates inventory records with missing details.",
"produces": [
"application/json"
],
"tags": [
"inventory"
],
"summary": "Refresh VM details",
"summary": "Refresh VM details (deprecated)",
"deprecated": true,
"responses": {
"200": {
"description": "Update completed",
@@ -768,6 +771,52 @@
}
}
},
"/api/vcenters/cache/rebuild": {
"post": {
"description": "Rebuilds cached folder/resource-pool/host(cluster+datacenter) references from vCenter and rewrites the database cache tables.",
"produces": [
"application/json"
],
"tags": [
"vcenters"
],
"summary": "Rebuild vCenter object cache",
"parameters": [
{
"type": "string",
"description": "Optional single vCenter URL to rebuild; defaults to all configured vCenters",
"name": "vcenter",
"in": "query"
}
],
"responses": {
"200": {
"description": "Cache rebuild summary",
"schema": {
"$ref": "#/definitions/models.VcenterCacheRebuildResponse"
}
},
"400": {
"description": "Invalid request",
"schema": {
"$ref": "#/definitions/models.ErrorResponse"
}
},
"405": {
"description": "Method not allowed",
"schema": {
"$ref": "#/definitions/models.ErrorResponse"
}
},
"500": {
"description": "All rebuild attempts failed",
"schema": {
"$ref": "#/definitions/models.VcenterCacheRebuildResponse"
}
}
}
}
},
"/metrics": {
"get": {
"description": "Exposes Prometheus metrics for vctp.",
@@ -1506,6 +1555,52 @@
"type": "string"
}
}
},
"models.VcenterCacheRebuildResponse": {
"type": "object",
"properties": {
"failed": {
"type": "integer"
},
"results": {
"type": "array",
"items": {
"$ref": "#/definitions/models.VcenterCacheRebuildResult"
}
},
"status": {
"type": "string"
},
"succeeded": {
"type": "integer"
},
"total": {
"type": "integer"
}
}
},
"models.VcenterCacheRebuildResult": {
"type": "object",
"properties": {
"duration_seconds": {
"type": "number"
},
"error": {
"type": "string"
},
"folder_entries": {
"type": "integer"
},
"host_entries": {
"type": "integer"
},
"resource_pool_entries": {
"type": "integer"
},
"vcenter": {
"type": "string"
}
}
}
}
}