+287
-25
@@ -41,9 +41,103 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/auth/login": {
|
||||
"post": {
|
||||
"description": "Authenticates a username/password against LDAP and returns a signed access token.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"auth"
|
||||
],
|
||||
"summary": "Login",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Login credentials",
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.AuthLoginRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Login success",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.AuthLoginResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Invalid credentials",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"503": {
|
||||
"description": "Authentication disabled",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/auth/me": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns JWT claims for the currently authenticated bearer token.\nRequires Bearer authentication.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"auth"
|
||||
],
|
||||
"summary": "Who am I",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Authenticated identity",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.AuthMeResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Missing or invalid authentication context",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/cleanup/updates": {
|
||||
"delete": {
|
||||
"description": "Deprecated: Removes update records that are no longer associated with a VM.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Deprecated: Removes update records that are no longer associated with a VM.\nRequires Bearer authentication with the admin role.",
|
||||
"produces": [
|
||||
"text/plain"
|
||||
],
|
||||
@@ -106,7 +200,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/diagnostics/daily-creation": {
|
||||
"get": {
|
||||
"description": "Returns counts of daily summary rows missing CreationTime and sample rows for the given date.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns counts of daily summary rows missing CreationTime and sample rows for the given date.\nRequires Bearer authentication with the viewer role (admin also allowed).",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -153,7 +252,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/encrypt": {
|
||||
"post": {
|
||||
"description": "Encrypts a plaintext value and returns the ciphertext.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Encrypts a plaintext value and returns the ciphertext.\nRequires Bearer authentication with the admin role.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -202,7 +306,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/event/vm/create": {
|
||||
"post": {
|
||||
"description": "Deprecated: Parses a VM create CloudEvent and stores the event data.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Deprecated: Parses a VM create CloudEvent and stores the event data.\nRequires Bearer authentication with the admin role.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -249,7 +358,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/event/vm/delete": {
|
||||
"post": {
|
||||
"description": "Deprecated: Parses a VM delete CloudEvent and marks the VM as deleted in inventory.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Deprecated: Parses a VM delete CloudEvent and marks the VM as deleted in inventory.\nRequires Bearer authentication with the admin role.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -296,7 +410,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/event/vm/modify": {
|
||||
"post": {
|
||||
"description": "Deprecated: Parses a VM modify CloudEvent and creates an update record when relevant changes are detected.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Deprecated: Parses a VM modify CloudEvent and creates an update record when relevant changes are detected.\nRequires Bearer authentication with the admin role.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -343,7 +462,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/event/vm/move": {
|
||||
"post": {
|
||||
"description": "Deprecated: Parses a VM move CloudEvent and creates an update record.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Deprecated: Parses a VM move CloudEvent and creates an update record.\nRequires Bearer authentication with the admin role.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -390,7 +514,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/import/vm": {
|
||||
"post": {
|
||||
"description": "Deprecated: Imports existing VM inventory data in bulk.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Deprecated: Imports existing VM inventory data in bulk.\nRequires Bearer authentication with the admin role.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -431,7 +560,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/inventory/vm/delete": {
|
||||
"delete": {
|
||||
"description": "Deprecated: Removes a VM inventory entry by VM ID and datacenter name.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Deprecated: Removes a VM inventory entry by VM ID and datacenter name.\nRequires Bearer authentication with the admin role.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -474,7 +608,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/inventory/vm/update": {
|
||||
"post": {
|
||||
"description": "Deprecated: Queries vCenter and updates inventory records with missing details.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Deprecated: Queries vCenter and updates inventory records with missing details.\nRequires Bearer authentication with the admin role.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -501,7 +640,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/report/inventory": {
|
||||
"get": {
|
||||
"description": "Generates an inventory XLSX report and returns it as a file download.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Generates an inventory XLSX report and returns it as a file download.\nRequires Bearer authentication with the viewer role (admin also allowed).",
|
||||
"produces": [
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
],
|
||||
@@ -527,7 +671,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/report/snapshot": {
|
||||
"get": {
|
||||
"description": "Downloads a snapshot table as an XLSX file.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Downloads a snapshot table as an XLSX file.\nRequires Bearer authentication with the viewer role (admin also allowed).",
|
||||
"produces": [
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
],
|
||||
@@ -568,7 +717,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/report/updates": {
|
||||
"get": {
|
||||
"description": "Generates an updates XLSX report and returns it as a file download.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Generates an updates XLSX report and returns it as a file download.\nRequires Bearer authentication with the viewer role (admin also allowed).",
|
||||
"produces": [
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
],
|
||||
@@ -594,7 +748,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/snapshots/aggregate": {
|
||||
"post": {
|
||||
"description": "Forces regeneration of a daily or monthly summary table for a specified date or month.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Forces regeneration of a daily or monthly summary table for a specified date or month.\nRequires Bearer authentication with the admin role.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -648,7 +807,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/snapshots/hourly/force": {
|
||||
"post": {
|
||||
"description": "Manually trigger an hourly snapshot for all configured vCenters. Requires confirmation text to avoid accidental execution.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Manually trigger an hourly snapshot for all configured vCenters. Requires confirmation text to avoid accidental execution.\nRequires Bearer authentication with the admin role.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -692,7 +856,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/snapshots/migrate": {
|
||||
"post": {
|
||||
"description": "Rebuilds the snapshot registry from existing tables and renames hourly tables to epoch-based names.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Rebuilds the snapshot registry from existing tables and renames hourly tables to epoch-based names.\nRequires Bearer authentication with the admin role.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -718,7 +887,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/snapshots/regenerate-hourly-reports": {
|
||||
"post": {
|
||||
"description": "Regenerates XLSX reports for hourly snapshots when the report files are missing or empty.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Regenerates XLSX reports for hourly snapshots when the report files are missing or empty.\nRequires Bearer authentication with the admin role.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -744,7 +918,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/snapshots/repair": {
|
||||
"post": {
|
||||
"description": "Backfills SnapshotTime and lifecycle info for existing daily summary tables and reruns monthly lifecycle refinement using hourly data.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Backfills SnapshotTime and lifecycle info for existing daily summary tables and reruns monthly lifecycle refinement using hourly data.\nRequires Bearer authentication with the admin role.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -764,7 +943,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/snapshots/repair/all": {
|
||||
"post": {
|
||||
"description": "Rebuilds snapshot registry, backfills per-vCenter totals, repairs daily summaries (SnapshotTime/lifecycle), and refines monthly lifecycle.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Rebuilds snapshot registry, backfills per-vCenter totals, repairs daily summaries (SnapshotTime/lifecycle), and refines monthly lifecycle.\nRequires Bearer authentication with the admin role.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -784,7 +968,12 @@ const docTemplate = `{
|
||||
},
|
||||
"/api/vcenters/cache/rebuild": {
|
||||
"post": {
|
||||
"description": "Rebuilds cached folder/resource-pool/host(cluster+datacenter) references from vCenter and rewrites the database cache tables.",
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Rebuilds cached folder/resource-pool/host(cluster+datacenter) references from vCenter and rewrites the database cache tables.\nRequires Bearer authentication with the admin role.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -1120,6 +1309,72 @@ const docTemplate = `{
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"models.AuthLoginRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.AuthLoginResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"access_token": {
|
||||
"type": "string"
|
||||
},
|
||||
"expires_at": {
|
||||
"type": "integer"
|
||||
},
|
||||
"token_type": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.AuthMeResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"audience": {
|
||||
"type": "string"
|
||||
},
|
||||
"expires_at": {
|
||||
"type": "integer"
|
||||
},
|
||||
"groups": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"issued_at": {
|
||||
"type": "integer"
|
||||
},
|
||||
"issuer": {
|
||||
"type": "string"
|
||||
},
|
||||
"not_before": {
|
||||
"type": "integer"
|
||||
},
|
||||
"roles": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"subject": {
|
||||
"type": "string"
|
||||
},
|
||||
"token_id": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.CloudEventReceived": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -1613,17 +1868,24 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
"BearerAuth": {
|
||||
"type": "apiKey",
|
||||
"name": "Authorization",
|
||||
"in": "header"
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
||||
var SwaggerInfo = &swag.Spec{
|
||||
Version: "",
|
||||
Version: "1.0",
|
||||
Host: "",
|
||||
BasePath: "",
|
||||
Schemes: []string{},
|
||||
Title: "",
|
||||
Description: "",
|
||||
BasePath: "/",
|
||||
Schemes: []string{"http", "https"},
|
||||
Title: "vCTP API",
|
||||
Description: "vCTP API endpoints for inventory snapshots, reporting, and administration.",
|
||||
InfoInstanceName: "swagger",
|
||||
SwaggerTemplate: docTemplate,
|
||||
LeftDelim: "{{",
|
||||
|
||||
Reference in New Issue
Block a user