{ "swagger": "2.0", "info": { "description": "Karpor is a brand new Kubernetes visualization tool that focuses on search, insights, and AI at its core", "title": "Karpor", "contact": {}, "version": "1.0" }, "paths": { "/authn": { "get": { "description": "This endpoint returns an authn result.", "produces": [ "application/json" ], "tags": [ "authn" ], "summary": "Get returns an authn result of user's token.", "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/endpoints": { "get": { "description": "List all registered endpoints in the router", "consumes": [ "text/plain" ], "produces": [ "text/plain" ], "tags": [ "debug" ], "summary": "List all available endpoints", "responses": { "200": { "description": "Endpoints listed successfully", "schema": { "type": "string" } } } } }, "/insight/aggregator/event/diagnosis/stream": { "post": { "description": "This endpoint analyzes events using AI to identify issues and provide solutions", "consumes": [ "application/json" ], "produces": [ "text/event-stream" ], "tags": [ "insight" ], "summary": "Diagnose events using AI", "parameters": [ { "description": "The events to analyze", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/aggregator.EventDiagnoseRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ai.DiagnosisEvent" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/insight/aggregator/event/{cluster}/{namespace}/{name}": { "get": { "description": "This endpoint streams resource events in real-time using SSE. It supports event type filtering and automatic updates.", "produces": [ "text/event-stream" ], "tags": [ "insight" ], "summary": "Stream resource events using Server-Sent Events", "parameters": [ { "type": "string", "description": "The cluster name", "name": "cluster", "in": "path", "required": true }, { "type": "string", "description": "The namespace name", "name": "namespace", "in": "path", "required": true }, { "type": "string", "description": "The resource name", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "The resource kind", "name": "kind", "in": "query", "required": true }, { "type": "string", "description": "The resource API version", "name": "apiVersion", "in": "query", "required": true }, { "type": "string", "description": "Event type filter (Normal or Warning)", "name": "type", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/ai.Event" } } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } } } } }, "/insight/aggregator/log/diagnosis/stream": { "post": { "description": "This endpoint analyzes pod logs using AI to identify issues and provide solutions", "consumes": [ "application/json" ], "produces": [ "text/event-stream" ], "tags": [ "insight" ], "summary": "Diagnose pod logs using AI", "parameters": [ { "description": "The logs to analyze", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/aggregator.DiagnoseRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ai.DiagnosisEvent" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/insight/aggregator/log/pod/{cluster}/{namespace}/{name}": { "get": { "description": "This endpoint streams pod logs in real-time using SSE. It supports container selection and automatic reconnection.", "produces": [ "text/event-stream", "application/json" ], "tags": [ "insight" ], "summary": "Stream pod logs using Server-Sent Events", "parameters": [ { "type": "string", "description": "The cluster name", "name": "cluster", "in": "path", "required": true }, { "type": "string", "description": "The namespace name", "name": "namespace", "in": "path", "required": true }, { "type": "string", "description": "The pod name", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "The container name (optional if pod has only one container)", "name": "container", "in": "query" }, { "type": "string", "description": "Only return logs newer than a relative duration like 5s, 2m, or 3h", "name": "since", "in": "query" }, { "type": "string", "description": "Only return logs after a specific date (RFC3339)", "name": "sinceTime", "in": "query" }, { "type": "boolean", "description": "Include timestamps in log output", "name": "timestamps", "in": "query" }, { "type": "integer", "description": "Number of lines from the end of the logs to show", "name": "tailLines", "in": "query" }, { "type": "boolean", "description": "Download logs as file instead of streaming", "name": "download", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/aggregator.LogEntry" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } } } } }, "/insight/issue/interpret/stream": { "post": { "description": "This endpoint analyzes scanner issues using AI to provide detailed interpretation and insights", "consumes": [ "application/json" ], "produces": [ "text/event-stream" ], "tags": [ "insight" ], "summary": "Interpret scanner issues using AI", "parameters": [ { "description": "The audit data to interpret", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/scanner.InterpretRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ai.InterpretEvent" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/insight/yaml/interpret/stream": { "post": { "description": "This endpoint analyzes YAML content using AI to provide detailed interpretation and insights", "consumes": [ "application/json" ], "produces": [ "text/event-stream" ], "tags": [ "insight" ], "summary": "Interpret YAML using AI", "parameters": [ { "description": "The YAML content to interpret", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/detail.InterpretRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ai.InterpretEvent" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/cluster/config/file": { "post": { "description": "Uploads a KubeConfig file for cluster, with a maximum size of 2MB.", "consumes": [ "multipart/form-data" ], "produces": [ "text/plain" ], "tags": [ "cluster" ], "summary": "Upload kubeConfig file for cluster", "parameters": [ { "type": "file", "description": "Upload file with field name 'file'", "name": "file", "in": "formData", "required": true }, { "type": "string", "description": "cluster name", "name": "name", "in": "formData", "required": true }, { "type": "string", "description": "cluster display name", "name": "displayName", "in": "formData", "required": true }, { "type": "string", "description": "cluster description", "name": "description", "in": "formData", "required": true } ], "responses": { "200": { "description": "Returns the content of the uploaded KubeConfig file.", "schema": { "$ref": "#/definitions/cluster.UploadData" } }, "400": { "description": "The uploaded file is too large or the request is invalid.", "schema": { "type": "string" } }, "500": { "description": "Internal server error.", "schema": { "type": "string" } } } } }, "/rest-api/v1/cluster/config/validate": { "post": { "description": "Validates the provided KubeConfig using cluster manager methods.", "consumes": [ "text/plain", "application/json" ], "produces": [ "application/json" ], "tags": [ "cluster" ], "summary": "Validate KubeConfig", "parameters": [ { "description": "KubeConfig payload to validate", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cluster.ValidatePayload" } } ], "responses": { "200": { "description": "Verification passed server version", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/cluster/{clusterName}": { "get": { "description": "This endpoint returns a cluster resource by name.", "produces": [ "application/json" ], "tags": [ "cluster" ], "summary": "Get returns a cluster resource by name.", "parameters": [ { "type": "string", "description": "The name of the cluster", "name": "clusterName", "in": "path", "required": true }, { "type": "string", "description": "The format of the response. Either in json or yaml", "name": "format", "in": "query" } ], "responses": { "200": { "description": "Unstructured object", "schema": { "$ref": "#/definitions/unstructured.Unstructured" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } }, "put": { "description": "This endpoint updates the display name and description of an existing cluster resource.", "consumes": [ "text/plain", "application/json" ], "produces": [ "application/json" ], "tags": [ "cluster" ], "summary": "Update updates the cluster metadata by name.", "parameters": [ { "description": "cluster to update (either plain text or JSON format)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cluster.ClusterPayload" } }, { "type": "string", "description": "The name of the cluster", "name": "clusterName", "in": "path", "required": true } ], "responses": { "200": { "description": "Unstructured object", "schema": { "$ref": "#/definitions/unstructured.Unstructured" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } }, "post": { "description": "This endpoint creates a new cluster resource using the payload.", "consumes": [ "text/plain", "application/json" ], "produces": [ "application/json" ], "tags": [ "cluster" ], "summary": "Create creates a cluster resource.", "parameters": [ { "description": "cluster to create (either plain text or JSON format)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cluster.ClusterPayload" } }, { "type": "string", "description": "The name of the cluster", "name": "clusterName", "in": "path", "required": true } ], "responses": { "200": { "description": "Unstructured object", "schema": { "$ref": "#/definitions/unstructured.Unstructured" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } }, "delete": { "description": "This endpoint deletes the cluster resource by name.", "produces": [ "application/json" ], "tags": [ "cluster" ], "summary": "Delete removes a cluster resource by name.", "parameters": [ { "type": "string", "description": "The name of the cluster", "name": "clusterName", "in": "path", "required": true } ], "responses": { "200": { "description": "Operation status", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/clusters": { "get": { "description": "This endpoint lists all cluster resources.", "produces": [ "application/json" ], "tags": [ "cluster" ], "summary": "List lists all cluster resources.", "parameters": [ { "type": "boolean", "description": "Whether to display summary or not. Default to false", "name": "summary", "in": "query" }, { "type": "string", "description": "The order to list the cluster. Default to order by name", "name": "orderBy", "in": "query" }, { "type": "boolean", "description": "Whether to sort the list in descending order. Default to false", "name": "descending", "in": "query" } ], "responses": { "200": { "description": "List of cluster objects", "schema": { "type": "array", "items": { "$ref": "#/definitions/unstructured.Unstructured" } } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/insight/audit": { "get": { "description": "This endpoint audits based on the specified resource group.", "produces": [ "application/json" ], "tags": [ "insight" ], "summary": "Audit based on resource group.", "parameters": [ { "type": "string", "description": "The specified cluster name, such as 'example-cluster'", "name": "cluster", "in": "query" }, { "type": "string", "description": "The specified apiVersion, such as 'apps/v1'", "name": "apiVersion", "in": "query" }, { "type": "string", "description": "The specified kind, such as 'Deployment'", "name": "kind", "in": "query" }, { "type": "string", "description": "The specified namespace, such as 'default'", "name": "namespace", "in": "query" }, { "type": "string", "description": "The specified resource name, such as 'foo'", "name": "name", "in": "query" }, { "type": "boolean", "description": "Switch for forced scanning, default is 'false'", "name": "forceNew", "in": "query" } ], "responses": { "200": { "description": "Audit results", "schema": { "$ref": "#/definitions/ai.AuditData" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/insight/detail": { "get": { "description": "This endpoint returns a Kubernetes resource by name, namespace, cluster, apiVersion and kind.", "produces": [ "application/json" ], "tags": [ "insight" ], "summary": "GetDetail returns a Kubernetes resource by name, namespace, cluster, apiVersion and kind.", "parameters": [ { "type": "string", "description": "The format of the response. Either in json or yaml. Default to json", "name": "format", "in": "query" }, { "type": "string", "description": "The specified cluster name, such as 'example-cluster'", "name": "cluster", "in": "query" }, { "type": "string", "description": "The specified apiVersion, such as 'apps/v1'. Should be percent-encoded", "name": "apiVersion", "in": "query" }, { "type": "string", "description": "The specified kind, such as 'Deployment'", "name": "kind", "in": "query" }, { "type": "string", "description": "The specified namespace, such as 'default'", "name": "namespace", "in": "query" }, { "type": "string", "description": "The specified resource name, such as 'foo'", "name": "name", "in": "query" } ], "responses": { "200": { "description": "Unstructured object", "schema": { "$ref": "#/definitions/unstructured.Unstructured" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/insight/events": { "get": { "description": "This endpoint returns events for a Kubernetes resource YAML by name, namespace, cluster, apiVersion and kind.", "produces": [ "application/json" ], "tags": [ "insight" ], "summary": "GetEvents returns events for a Kubernetes resource by name, namespace, cluster, apiVersion and kind.", "parameters": [ { "type": "string", "description": "The specified cluster name, such as 'example-cluster'", "name": "cluster", "in": "query" }, { "type": "string", "description": "The specified apiVersion, such as 'apps/v1'. Should be percent-encoded", "name": "apiVersion", "in": "query" }, { "type": "string", "description": "The specified kind, such as 'Deployment'", "name": "kind", "in": "query" }, { "type": "string", "description": "The specified namespace, such as 'default'", "name": "namespace", "in": "query" }, { "type": "string", "description": "The specified resource name, such as 'foo'", "name": "name", "in": "query" } ], "responses": { "200": { "description": "List of events", "schema": { "type": "array", "items": { "$ref": "#/definitions/unstructured.Unstructured" } } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/insight/score": { "get": { "description": "This endpoint calculates a score for the provided manifest based on the number and severity of issues detected during the audit.", "produces": [ "application/json" ], "tags": [ "insight" ], "summary": "ScoreHandler calculates a score for the audited manifest.", "parameters": [ { "type": "string", "description": "The specified cluster name, such as 'example-cluster'", "name": "cluster", "in": "query" }, { "type": "string", "description": "The specified apiVersion, such as 'apps/v1'", "name": "apiVersion", "in": "query" }, { "type": "string", "description": "The specified kind, such as 'Deployment'", "name": "kind", "in": "query" }, { "type": "string", "description": "The specified namespace, such as 'default'", "name": "namespace", "in": "query" }, { "type": "string", "description": "The specified resource name, such as 'foo'", "name": "name", "in": "query" }, { "type": "boolean", "description": "Switch for forced compute score, default is 'false'", "name": "forceNew", "in": "query" } ], "responses": { "200": { "description": "Score calculation result", "schema": { "$ref": "#/definitions/insight.ScoreData" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/insight/stats": { "get": { "description": "This endpoint returns a global statistics info.", "produces": [ "application/json" ], "tags": [ "insight" ], "summary": "Get returns a global statistics info.", "responses": { "200": { "description": "Global statistics info", "schema": { "$ref": "#/definitions/insight.Statistics" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/insight/summary": { "get": { "description": "This endpoint returns a Kubernetes resource summary by name, namespace, cluster, apiVersion and kind.", "produces": [ "application/json" ], "tags": [ "insight" ], "summary": "Get returns a Kubernetes resource summary by name, namespace, cluster, apiVersion and kind.", "parameters": [ { "type": "string", "description": "The specified cluster name, such as 'example-cluster'", "name": "cluster", "in": "query" }, { "type": "string", "description": "The specified apiVersion, such as 'apps/v1'. Should be percent-encoded", "name": "apiVersion", "in": "query" }, { "type": "string", "description": "The specified kind, such as 'Deployment'", "name": "kind", "in": "query" }, { "type": "string", "description": "The specified namespace, such as 'default'", "name": "namespace", "in": "query" }, { "type": "string", "description": "The specified resource name, such as 'foo'", "name": "name", "in": "query" } ], "responses": { "200": { "description": "Resource Summary", "schema": { "$ref": "#/definitions/insight.ResourceSummary" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/insight/topology": { "get": { "description": "This endpoint returns a topology map for a Kubernetes resource by name, namespace, cluster, apiVersion and kind.", "produces": [ "application/json" ], "tags": [ "insight" ], "summary": "GetTopology returns a topology map for a Kubernetes resource by name, namespace, cluster, apiVersion and kind.", "parameters": [ { "type": "string", "description": "The specified cluster name, such as 'example-cluster'", "name": "cluster", "in": "query" }, { "type": "string", "description": "The specified apiVersion, such as 'apps/v1'. Should be percent-encoded", "name": "apiVersion", "in": "query" }, { "type": "string", "description": "The specified kind, such as 'Deployment'", "name": "kind", "in": "query" }, { "type": "string", "description": "The specified namespace, such as 'default'", "name": "namespace", "in": "query" }, { "type": "string", "description": "The specified resource name, such as 'foo'", "name": "name", "in": "query" }, { "type": "boolean", "description": "Force re-generating the topology, default is 'false'", "name": "forceNew", "in": "query" } ], "responses": { "200": { "description": "map from string to resource.ResourceTopology", "schema": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "$ref": "#/definitions/insight.ResourceTopology" } } } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/resource-group-rule": { "put": { "description": "This endpoint updates the display name and description of an existing ResourceGroupRule.", "consumes": [ "text/plain", "application/json" ], "produces": [ "application/json" ], "tags": [ "resourcegrouprule" ], "summary": "Update updates the ResourceGroupRule metadata by name.", "parameters": [ { "description": "resourceGroupRule to update (either plain text or JSON format)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/resourcegrouprule.ResourceGroupRulePayload" } } ], "responses": { "200": { "description": "Unstructured object", "schema": { "$ref": "#/definitions/unstructured.Unstructured" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } }, "post": { "description": "This endpoint creates a new ResourceGroupRule using the payload.", "consumes": [ "text/plain", "application/json" ], "produces": [ "application/json" ], "tags": [ "resourcegrouprule" ], "summary": "Create creates a ResourceGroupRule.", "parameters": [ { "description": "resourceGroupRule to create (either plain text or JSON format)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/resourcegrouprule.ResourceGroupRulePayload" } } ], "responses": { "200": { "description": "Unstructured object", "schema": { "$ref": "#/definitions/unstructured.Unstructured" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/resource-group-rule/{resourceGroupRuleName}": { "get": { "description": "This endpoint returns a ResourceGroupRule by name.", "produces": [ "application/json" ], "tags": [ "resourcegrouprule" ], "summary": "Get returns a ResourceGroupRule by name.", "parameters": [ { "type": "string", "description": "The name of the resource group rule", "name": "resourceGroupRuleName", "in": "path", "required": true } ], "responses": { "200": { "description": "Unstructured object", "schema": { "$ref": "#/definitions/unstructured.Unstructured" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } }, "delete": { "description": "This endpoint deletes the ResourceGroupRule by name.", "produces": [ "application/json" ], "tags": [ "resourcegrouprule" ], "summary": "Delete removes a ResourceGroupRule by name.", "parameters": [ { "type": "string", "description": "The name of the resource group rule", "name": "resourceGroupRuleName", "in": "path", "required": true } ], "responses": { "200": { "description": "Operation status", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/resource-group-rules": { "get": { "description": "This endpoint lists all ResourceGroupRules.", "produces": [ "application/json" ], "tags": [ "resourcegrouprule" ], "summary": "List lists all ResourceGroupRules.", "parameters": [ { "type": "boolean", "description": "Whether to display summary or not. Default to false", "name": "summary", "in": "query" }, { "type": "string", "description": "The order to list the resourceGroupRule. Default to order by name", "name": "orderBy", "in": "query" }, { "type": "boolean", "description": "Whether to sort the list in descending order. Default to false", "name": "descending", "in": "query" } ], "responses": { "200": { "description": "List of resourceGroupRule objects", "schema": { "type": "array", "items": { "$ref": "#/definitions/unstructured.Unstructured" } } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/resource-groups/{resourceGroupRuleName}": { "get": { "description": "This endpoint lists all ResourceGroups.", "produces": [ "application/json" ], "tags": [ "resourcegroup" ], "summary": "List lists all ResourceGroups by rule name.", "parameters": [ { "type": "string", "description": "The name of the resource group rule", "name": "resourceGroupRuleName", "in": "path", "required": true } ], "responses": { "200": { "description": "List of resourceGroup objects", "schema": { "type": "array", "items": { "$ref": "#/definitions/unstructured.Unstructured" } } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/rest-api/v1/search": { "get": { "description": "This endpoint returns an array of Kubernetes runtime Object matched using the query from context.", "produces": [ "application/json" ], "tags": [ "search" ], "summary": "SearchForResource returns an array of Kubernetes runtime Object matched using the query from context.", "parameters": [ { "type": "string", "description": "The query to use for search. Required", "name": "query", "in": "query", "required": true }, { "type": "string", "description": "The search pattern. Can be either sql, dsl or nl. Required", "name": "pattern", "in": "query", "required": true }, { "type": "string", "description": "The size of the page. Default to 10", "name": "pageSize", "in": "query" }, { "type": "string", "description": "The current page to fetch. Default to 1", "name": "page", "in": "query" }, { "type": "string", "description": "The keyword to use for search. Optional", "name": "keyword", "in": "query" } ], "responses": { "200": { "description": "Array of runtime.Object", "schema": { "type": "array", "items": {} } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "401": { "description": "Unauthorized", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "type": "string" } }, "405": { "description": "Method Not Allowed", "schema": { "type": "string" } }, "429": { "description": "Too Many Requests", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/server-configs": { "get": { "description": "Returns server configuration", "produces": [ "application/json" ], "tags": [ "debug" ], "summary": "Get server configurations", "responses": { "200": { "description": "Server configurations", "schema": { "type": "object", "additionalProperties": true } } } } } }, "definitions": { "aggregator.DiagnoseRequest": { "type": "object", "properties": { "language": { "description": "Language code for AI response", "type": "string" }, "logs": { "type": "array", "items": { "type": "string" } } } }, "aggregator.EventDiagnoseRequest": { "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/definitions/ai.Event" } }, "language": { "type": "string" } } }, "aggregator.LogEntry": { "type": "object", "properties": { "content": { "type": "string" }, "error": { "type": "string" }, "timestamp": { "type": "string" } } }, "ai.AuditData": { "type": "object", "properties": { "bySeverity": { "type": "object", "additionalProperties": { "type": "integer" } }, "issueGroups": { "type": "array", "items": { "$ref": "#/definitions/ai.IssueGroup" } }, "issueTotal": { "type": "integer" }, "resourceTotal": { "type": "integer" } } }, "ai.DiagnosisEvent": { "type": "object", "properties": { "content": { "description": "Event content", "type": "string" }, "type": { "description": "Event type: start/chunk/error/complete", "type": "string" } } }, "ai.Event": { "type": "object", "properties": { "count": { "type": "integer" }, "firstTimestamp": { "type": "string" }, "lastTimestamp": { "type": "string" }, "message": { "type": "string" }, "reason": { "type": "string" }, "type": { "type": "string" } } }, "ai.InterpretEvent": { "type": "object", "properties": { "content": { "description": "Event content or error message", "type": "string" }, "type": { "description": "Event type: start, chunk, error, complete", "type": "string" } } }, "ai.IssueGroup": { "type": "object", "properties": { "issue": { "$ref": "#/definitions/scanner.Issue" }, "resourceGroups": { "type": "array", "items": { "$ref": "#/definitions/entity.ResourceGroup" } } } }, "cluster.ClusterPayload": { "type": "object", "properties": { "description": { "description": "ClusterDescription is the description of cluster to be created", "type": "string" }, "displayName": { "description": "ClusterDisplayName is the display name of cluster to be created", "type": "string" }, "kubeConfig": { "description": "ClusterKubeConfig is the kubeconfig of cluster to be created", "type": "string" } } }, "cluster.UploadData": { "type": "object", "properties": { "content": { "type": "string" }, "fileName": { "type": "string" }, "fileSize": { "type": "integer" }, "sanitizedClusterContent": { "type": "string" } } }, "cluster.ValidatePayload": { "type": "object", "properties": { "kubeConfig": { "type": "string" } } }, "detail.InterpretRequest": { "type": "object", "properties": { "language": { "type": "string" }, "yaml": { "type": "string" } } }, "entity.ResourceGroup": { "type": "object", "properties": { "annotations": { "type": "object", "additionalProperties": { "type": "string" } }, "apiVersion": { "type": "string" }, "cluster": { "type": "string" }, "kind": { "type": "string" }, "labels": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "namespace": { "type": "string" }, "status": { "type": "string" } } }, "insight.ResourceSummary": { "type": "object", "properties": { "creationTimestamp": { "type": "string" }, "resource": { "$ref": "#/definitions/entity.ResourceGroup" }, "resourceVersion": { "type": "string" }, "uid": { "type": "string" } } }, "insight.ResourceTopology": { "type": "object", "properties": { "children": { "type": "array", "items": { "type": "string" } }, "parents": { "type": "array", "items": { "type": "string" } }, "resourceGroup": { "$ref": "#/definitions/entity.ResourceGroup" } } }, "insight.ScoreData": { "type": "object", "properties": { "issuesTotal": { "description": "IssuesTotal is the total count of all issues found during the audit.\nThis count can be used to understand the overall number of problems\nthat need to be addressed.", "type": "integer" }, "resourceTotal": { "description": "ResourceTotal is the count of unique resources audited during the scan.", "type": "integer" }, "score": { "description": "Score represents the calculated score of the audited manifest based on\nthe number and severity of issues. It provides a quantitative measure\nof the security posture of the resources in the manifest.", "type": "number" }, "severityStatistic": { "description": "SeverityStatistic is a mapping of severity levels to their respective\nnumber of occurrences. It allows for a quick overview of the distribution\nof issues across different severity categories.", "type": "object", "additionalProperties": { "type": "integer" } } } }, "insight.Statistics": { "type": "object", "properties": { "clusterCount": { "type": "integer" }, "resourceCount": { "type": "integer" }, "resourceGroupRuleCount": { "type": "integer" } } }, "resourcegrouprule.ResourceGroupRulePayload": { "type": "object", "properties": { "description": { "type": "string" }, "fields": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" } } }, "scanner.InterpretRequest": { "type": "object", "properties": { "auditData": { "description": "The audit data to interpret", "$ref": "#/definitions/ai.AuditData" }, "language": { "description": "Language for interpretation", "type": "string" } } }, "scanner.Issue": { "type": "object", "properties": { "message": { "description": "Message provides a detailed human-readable description of the issue.", "type": "string" }, "scanner": { "description": "Scanner is the name of the scanner that discovered the issue.", "type": "string" }, "severity": { "description": "Severity indicates how critical the issue is, using the IssueSeverityLevel constants.", "type": "integer" }, "title": { "description": "Title is a brief summary of the issue.", "type": "string" } } }, "unstructured.Unstructured": { "type": "object", "properties": { "object": { "description": "Object is a JSON compatible map with string, float, int, bool, []interface{}, or\nmap[string]interface{}\nchildren.", "type": "object", "additionalProperties": true } } } } }