{
  "openapi": "3.0.3",
  "x-ekuiper-version": "2.4.1",
  "x-source-tag": "https://github.com/lf-edge/ekuiper/tree/v2.4.1",
  "x-source-commit": "bf8c1258b2a80e41e575d674346636c9bb687d33",
  "info": {
    "title": "rekuiper REST Management API",
    "description": "Authoritative OpenAPI contract for the management REST routes registered by rekuiper (100% wire-compatible with eKuiper v2.4.1). Optional components depend on build tags; JWT authentication, when enabled, expects a raw RS256 token in the Authorization header.",
    "version": "1.0.0-rc4",
    "contact": {
      "name": "I-Dacs Labs",
      "url": "https://i-dacs.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    }
  },
  "externalDocs": {
    "description": "Tagged rekuiper REST API documentation",
    "url": "https://github.com/Indus-Stack/rekuiper/tree/main/docs/en_US/api/restapi"
  },
  "servers": [
    {
      "url": "http://localhost:9081",
      "description": "Default rekuiper REST listener"
    }
  ],
  "tags": [
    {
      "name": "System",
      "description": "System information, health, runtime configuration, metrics, shutdown, and batch requests."
    },
    {
      "name": "Streams",
      "description": "Stream definition management."
    },
    {
      "name": "Tables",
      "description": "Table definition management."
    },
    {
      "name": "Rules",
      "description": "Rule definition and lifecycle management."
    },
    {
      "name": "Rule Test",
      "description": "Temporary ten-minute rule trial runs. SSE results use the separately configured HTTP server port."
    },
    {
      "name": "Tracing",
      "description": "Local rule traces and optional remote OpenTelemetry collection."
    },
    {
      "name": "Ruleset",
      "description": "Streams, tables, and rules import/export."
    },
    {
      "name": "Data",
      "description": "Full JSON/YAML configuration import/export and asynchronous tasks."
    },
    {
      "name": "Uploads",
      "description": "Files stored below the eKuiper data uploads directory."
    },
    {
      "name": "Connections",
      "description": "Named shared connection management."
    },
    {
      "name": "Plugins",
      "description": "Native and portable plugin management. Native routes require a non-core/plugin build; portable routes require a non-core/portable build."
    },
    {
      "name": "Schemas",
      "description": "Schema registry management. protobuf and custom schema types are registered in non-core/schema builds."
    },
    {
      "name": "UDF",
      "description": "JavaScript UDF management; available in full/script builds."
    },
    {
      "name": "Services",
      "description": "External service management; available in non-core/service builds."
    },
    {
      "name": "Metadata",
      "description": "UI metadata, configuration keys, resources, and connectivity tests; available in non-core/ui builds."
    }
  ],
  "paths": {
    "/": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Get eKuiper system information",
        "operationId": "getSystemInfo",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/overview.md"
        ],
        "security": [],
        "description": "Returns version, platform, uptime, and available process metrics.",
        "responses": {
          "200": {
            "description": "System information",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "JSON encoded as text/plain by the v2.4.1 handler."
                },
                "example": "{\"version\":\"2.4.1\",\"os\":\"linux\",\"arch\":\"amd64\",\"upTimeSeconds\":14,\"memoryTotal\":\"33582968832\"}",
                "x-decoded-schema": {
                  "$ref": "#/components/schemas/SystemInfo"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "System"
        ],
        "summary": "Get eKuiper system information",
        "operationId": "getSystemInfoViaPost",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/overview.md"
        ],
        "security": [],
        "description": "Registered compatibility alias; the tagged documentation advertises GET.",
        "responses": {
          "200": {
            "description": "System information",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "JSON encoded as text/plain by the v2.4.1 handler."
                },
                "example": "{\"version\":\"2.4.1\",\"os\":\"linux\",\"arch\":\"amd64\",\"upTimeSeconds\":14,\"memoryTotal\":\"33582968832\"}",
                "x-decoded-schema": {
                  "$ref": "#/components/schemas/SystemInfo"
                }
              }
            }
          }
        }
      }
    },
    "/stop": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Shut down eKuiper",
        "operationId": "stopEKuiperViaGet",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/configs.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Registered compatibility alias; the tagged documentation advertises POST.",
        "responses": {
          "200": {
            "description": "Shutdown accepted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "stop success"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "System"
        ],
        "summary": "Shut down eKuiper",
        "operationId": "stopEKuiper",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/configs.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Stops the eKuiper process.",
        "responses": {
          "200": {
            "description": "Shutdown accepted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "stop success"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/ping": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Check REST server health",
        "operationId": "ping",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/overview.md"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "REST server is reachable; empty response body."
          }
        }
      }
    },
    "/configs": {
      "patch": {
        "tags": [
          "System"
        ],
        "summary": "Dynamically reload supported configuration",
        "operationId": "patchConfigs",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/import_export.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/configs.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DynamicConfig"
              },
              "example": {
                "debug": true,
                "consoleLog": true,
                "fileLog": true,
                "timezone": "UTC"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Configuration updated; no response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Get system configuration",
        "operationId": "getConfigs",
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "System configuration object",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "basic": {
                      "type": "object",
                      "properties": {
                        "debug": {
                          "type": "boolean"
                        },
                        "logLevel": {
                          "type": "string"
                        },
                        "port": {
                          "type": "integer"
                        },
                        "restPort": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "basic": {
                    "debug": false,
                    "logLevel": "info",
                    "port": 20498,
                    "restPort": 9081
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/metrics/dump/check": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Check whether metrics dump is enabled",
        "operationId": "checkMetricsDump",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/metrics_init.go"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current metrics-dump state",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "enabled"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/metrics/dump": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Download collected metrics",
        "operationId": "downloadMetricsDump",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/metrics_init.go"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "name": "startTime",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Inclusive Unix timestamp in seconds; defaults with endTime to the previous hour."
          },
          {
            "name": "endTime",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Exclusive Unix timestamp in seconds; defaults with startTime to now."
          }
        ],
        "responses": {
          "200": {
            "description": "ZIP archive of collected metrics",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Metrics archive not found",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Metrics archive could not be read",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/batch/req": {
      "post": {
        "tags": [
          "System"
        ],
        "summary": "Execute multiple REST requests",
        "operationId": "batchRequests",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/overview.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Executes nested requests sequentially through the same router. Each nested body is a string and each result records its HTTP code and response text.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BatchRequest"
                }
              },
              "example": [
                {
                  "method": "GET",
                  "path": "/ping"
                }
              ]
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-request results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BatchResponse"
                  }
                },
                "example": [
                  {
                    "code": 200
                  }
                ]
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/streams": {
      "get": {
        "tags": [
          "Streams"
        ],
        "summary": "List streams",
        "operationId": "listStreams",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/streams.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Defined streams names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "Streams"
        ],
        "summary": "Execute stream SQL",
        "operationId": "createStream",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/streams.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "The handler executes any stream SQL statement, not only CREATE.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatementRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Stream SQL executed",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/streamdetails": {
      "get": {
        "tags": [
          "Streams"
        ],
        "summary": "List detailed streams",
        "operationId": "listStreamsDetails",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/streams.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Name, source type, and format for each definition",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DatasourceDetail"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/streams/{name}": {
      "get": {
        "tags": [
          "Streams"
        ],
        "summary": "Describe a stream",
        "operationId": "getStream",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/streams.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Parsed definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasourceDescription"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "tags": [
          "Streams"
        ],
        "summary": "Replace a stream",
        "operationId": "updateStream",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/streams.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Definition replaced",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Streams"
        ],
        "summary": "Delete a stream",
        "operationId": "deleteStream",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/streams.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "name": "force",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "When true, skip the check for rules that reference the stream/table."
          }
        ],
        "responses": {
          "200": {
            "description": "Definition deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/streams/{name}/schema": {
      "get": {
        "tags": [
          "Streams"
        ],
        "summary": "Get inferred stream schema",
        "operationId": "getStreamSchema",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/streams.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "JSON-schema-like field map",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/JsonSchemaField"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/tables": {
      "get": {
        "tags": [
          "Tables"
        ],
        "summary": "List tables",
        "operationId": "listTables",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/tables.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "scan",
                "lookup"
              ]
            },
            "description": "Filter table kind; other or omitted values return all kinds."
          }
        ],
        "responses": {
          "200": {
            "description": "Defined tables names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "Tables"
        ],
        "summary": "Execute table SQL",
        "operationId": "createTable",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/tables.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "The handler executes any table SQL statement, not only CREATE.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatementRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Table SQL executed",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/tabledetails": {
      "get": {
        "tags": [
          "Tables"
        ],
        "summary": "List detailed tables",
        "operationId": "listTablesDetails",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/tables.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "scan",
                "lookup"
              ]
            },
            "description": "Filter table kind; other or omitted values return all kinds."
          }
        ],
        "responses": {
          "200": {
            "description": "Name, source type, and format for each definition",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DatasourceDetail"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/tables/{name}": {
      "get": {
        "tags": [
          "Tables"
        ],
        "summary": "Describe a table",
        "operationId": "getTable",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/tables.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Parsed definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasourceDescription"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "tags": [
          "Tables"
        ],
        "summary": "Replace a table",
        "operationId": "updateTable",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/tables.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Definition replaced",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Tables"
        ],
        "summary": "Delete a table",
        "operationId": "deleteTable",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/tables.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "name": "force",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "When true, skip the check for rules that reference the stream/table."
          }
        ],
        "responses": {
          "200": {
            "description": "Definition deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/tables/{name}/schema": {
      "get": {
        "tags": [
          "Tables"
        ],
        "summary": "Get inferred table schema",
        "operationId": "getTableSchema",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/tables.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "JSON-schema-like field map",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/JsonSchemaField"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules": {
      "get": {
        "tags": [
          "Rules"
        ],
        "summary": "List rules with brief status",
        "operationId": "listRules",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Rule summaries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RuleListItem"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "Rules"
        ],
        "summary": "Create and start a rule",
        "operationId": "createRule",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Rule created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Rule rule1 was created successfully."
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/rules/{name}": {
      "get": {
        "tags": [
          "Rules"
        ],
        "summary": "Describe a rule",
        "operationId": "getRule",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Stored rule definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "tags": [
          "Rules"
        ],
        "summary": "Create or update a rule",
        "operationId": "upsertRule",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "The body id may be omitted; when supplied it must equal the path name. If updating fails, the original rule continues running.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Rule"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rule updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Rules"
        ],
        "summary": "Delete a rule",
        "operationId": "deleteRule",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Rule deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules/status/all": {
      "get": {
        "tags": [
          "Rules"
        ],
        "summary": "Get status of all rules",
        "operationId": "getAllRuleStatus",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Status and latest exception summary keyed by rule id",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/RuleExceptionStatus"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/rules/{name}/status": {
      "get": {
        "tags": [
          "Rules"
        ],
        "summary": "Get rule status and metrics",
        "operationId": "getRuleStatus",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Legacy status serialization. Metrics are appended as dynamically named properties.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Rule status and metrics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v2/rules/{name}/status": {
      "get": {
        "tags": [
          "Rules"
        ],
        "summary": "Get typed rule status and metrics",
        "operationId": "getRuleStatusV2",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/topo/rule/state.go"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Returns native JSON metric value types, unlike the legacy string-built status response.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Rule status and typed metrics",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "JSON encoded as text/plain by the v2.4.1 handler."
                },
                "example": "{\"status\":\"running\",\"message\":\"\",\"lastStartTimestamp\":0,\"lastStopTimestamp\":0,\"nextStartTimestamp\":0}",
                "x-decoded-schema": {
                  "$ref": "#/components/schemas/RuleStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules/{name}/start": {
      "post": {
        "tags": [
          "Rules"
        ],
        "summary": "Start a rule",
        "operationId": "startRule",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "A successful response means the command was accepted; poll status to observe completion.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Rule start command accepted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules/{name}/stop": {
      "post": {
        "tags": [
          "Rules"
        ],
        "summary": "Stop a rule",
        "operationId": "stopRule",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "A successful response means the command was accepted; poll status to observe completion.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Rule stop command accepted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules/{name}/restart": {
      "post": {
        "tags": [
          "Rules"
        ],
        "summary": "Restart a rule",
        "operationId": "restartRule",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Rule restart command accepted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules/{name}/topo": {
      "get": {
        "tags": [
          "Rules"
        ],
        "summary": "Get rule topology",
        "operationId": "getRuleTopology",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Topology graph",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleTopology"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules/{id}/schema": {
      "get": {
        "tags": [
          "Rules"
        ],
        "summary": "Get rule output schema",
        "operationId": "getRuleSchema",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "The tagged Markdown accidentally prints /rules/{id}; the v2.4.1 router and handler register /rules/{id}/schema.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Output fields keyed by field name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/JsonSchemaField"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules/validate": {
      "post": {
        "tags": [
          "Rules"
        ],
        "summary": "Validate a rule",
        "operationId": "validateRule",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Valid rule and referenced sources",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "JSON encoded as text/plain by the v2.4.1 handler."
                },
                "example": "{\"sources\":[\"demo\"],\"valid\":true}",
                "x-decoded-schema": {
                  "$ref": "#/components/schemas/RuleValidationResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "The body parsed but the rule is invalid",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/rules/{name}/reset_state": {
      "put": {
        "tags": [
          "Rules"
        ],
        "summary": "Reset a running rule stream offset",
        "operationId": "resetRuleState",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rule_state.go"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Only state type 1 (update offset) is implemented, and the target rule must be running.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleStateUpdateRequest"
              },
              "example": {
                "type": 1,
                "params": {
                  "streamName": "demo",
                  "input": {
                    "partition": 0,
                    "offset": 10
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Offset updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "success"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules/{name}/explain": {
      "get": {
        "tags": [
          "Rules"
        ],
        "summary": "Explain a SQL rule plan",
        "operationId": "explainRule",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Only SQL rules are supported. The result is an indented plain-text logical plan.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Logical plan",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules/usage/cpu": {
      "get": {
        "tags": [
          "Rules"
        ],
        "summary": "Get rule CPU usage over the last 30 seconds",
        "operationId": "getRuleCpuUsage",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Milliseconds keyed by rule id, or a plain-text not-enabled/not-ready state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  }
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "cpu usage not enabled",
                    "cpu usage not ready"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/rules/{name}/tags": {
      "put": {
        "tags": [
          "Rules"
        ],
        "summary": "Replace all rule tags",
        "operationId": "replaceRuleTags",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rule_tag.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "The v2.4.1 handler decodes the JSON property \"tags\". The tagged Markdown incorrectly shows \"keys\" for DELETE.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleTagRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tags updated; empty response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "tags": [
          "Rules"
        ],
        "summary": "Add rule tags",
        "operationId": "addRuleTags",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rule_tag.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "The v2.4.1 handler decodes the JSON property \"tags\". The tagged Markdown incorrectly shows \"keys\" for DELETE.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleTagRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tags updated; empty response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Rules"
        ],
        "summary": "Remove rule tags",
        "operationId": "removeRuleTags",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rule_tag.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "The v2.4.1 handler decodes the JSON property \"tags\". The tagged Markdown incorrectly shows \"keys\" for DELETE.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleTagRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tags updated; empty response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules/tags/match": {
      "get": {
        "tags": [
          "Rules"
        ],
        "summary": "Find rules containing all requested tags",
        "operationId": "matchRulesByTagsGet",
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Matches rules containing all specified tags. Query parameters ?tags=, ?tag=, ?keys=, or ?key= (comma-separated) can be used, or a JSON body.",
        "parameters": [
          {
            "name": "tags",
            "in": "query",
            "required": false,
            "description": "Comma-separated list of tags to match (e.g. env:prod,tier:vip)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Single tag or comma-separated tags to match",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keys",
            "in": "query",
            "required": false,
            "description": "Legacy alias for tags parameter",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching rule IDs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "example": [
                  "rule_comprehensive",
                  "rule_monitoring"
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "Rules"
        ],
        "summary": "Find rules containing all requested tags via POST body",
        "operationId": "matchRulesByTagsPost",
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "tags": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                ]
              },
              "example": {
                "tags": [
                  "tier:vip",
                  "env:prod"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Matching rule IDs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "example": [
                  "rule_comprehensive"
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/rules/bulkstart": {
      "post": {
        "tags": [
          "Rules"
        ],
        "summary": "Bulk start rules by tag",
        "operationId": "bulkStartRules",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rule_tag.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Non-atomic. Each matching rule reports success or an error independently.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleTagRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-rule operation results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BulkOperationResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/rules/bulkstop": {
      "post": {
        "tags": [
          "Rules"
        ],
        "summary": "Bulk stop rules by tag",
        "operationId": "bulkStopRules",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rule_tag.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/rules.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Non-atomic. Each matching rule reports success or an error independently.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleTagRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-rule operation results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BulkOperationResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/ruletest": {
      "post": {
        "tags": [
          "Rule Test"
        ],
        "summary": "Create a temporary test rule",
        "operationId": "createRuleTest",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/ruletest.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "The test rule is not persisted and is automatically cleared after ten minutes. Connect to the returned port using SSE at /test/{id}, then start the test rule.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleTestRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Test rule id and separate SSE port. v2.4.1 writes the JSON object with a text/plain Content-Type.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "{\"id\":\"uuid\",\"port\":10081}"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/ruletest/{name}/start": {
      "post": {
        "tags": [
          "Rule Test"
        ],
        "summary": "Start a temporary test rule",
        "operationId": "startRuleTest",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/ruletest.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Test rule started",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/ruletest/{name}": {
      "delete": {
        "tags": [
          "Rule Test"
        ],
        "summary": "Stop and delete a temporary test rule",
        "operationId": "deleteRuleTest",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/ruletest.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Test rule stopped",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/rules/{name}/trace/start": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "Enable tracing for a rule",
        "operationId": "enableRuleTrace",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/trace.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TraceEnableRequest"
              },
              "example": {
                "strategy": "head"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tracing enabled; empty response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules/{name}/trace/stop": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "Disable tracing for a rule",
        "operationId": "disableRuleTrace",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/trace.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Tracing disabled; empty response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/trace/rule/{ruleID}": {
      "get": {
        "tags": [
          "Tracing"
        ],
        "summary": "List recent trace IDs for a rule",
        "operationId": "listRuleTraceIds",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/tracer.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/trace.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/RuleID"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "description": "Maximum trace IDs. Invalid or omitted values are treated as 0 by the handler."
          }
        ],
        "responses": {
          "200": {
            "description": "Trace IDs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/trace/{id}": {
      "get": {
        "tags": [
          "Tracing"
        ],
        "summary": "Get a trace tree",
        "operationId": "getTrace",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/tracer.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/trace.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Root trace span",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TraceSpan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/tracer": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "Configure remote trace collection",
        "operationId": "setTracer",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/tracer.go"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TracerRequest"
              },
              "example": {
                "service_name": "ekuiper",
                "action": "start",
                "collector_url": "http://otel-collector:4318"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tracer configuration applied",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "success"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/ruleset/import": {
      "post": {
        "tags": [
          "Ruleset"
        ],
        "summary": "Import streams, tables, and rules",
        "operationId": "importRuleset",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/ruleset.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Existing objects are not recreated. Exactly one of content or file is required.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportReference"
              },
              "examples": {
                "content": {
                  "value": {
                    "content": "{\"streams\":{},\"tables\":{},\"rules\":{}}"
                  }
                },
                "file": {
                  "value": {
                    "file": "file:///tmp/ekuiper-export.json"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Counts of imported definitions",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "imported 1 streams, 0 tables and 2 rules"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/ruleset/export": {
      "post": {
        "tags": [
          "Ruleset"
        ],
        "summary": "Export streams, tables, and rules",
        "operationId": "exportRuleset",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/ruleset.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Download named ekuiper_export.json",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/config/uploads": {
      "get": {
        "tags": [
          "Uploads"
        ],
        "summary": "List uploaded configuration files",
        "operationId": "listUploads",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/uploads.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Absolute server paths",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "Uploads"
        ],
        "summary": "Upload or replace a configuration file",
        "operationId": "uploadConfigFile",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/uploads.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "JSON accepts inline content or an HTTP file URL. Multipart upload accepts one uploadFile field. Files are stored below dataPath/uploads and overwrite the same name.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadJsonRequest"
              },
              "examples": {
                "content": {
                  "value": {
                    "name": "my.json",
                    "content": "{\"hello\":\"world\"}"
                  }
                },
                "url": {
                  "value": {
                    "name": "my.json",
                    "file": "http://127.0.0.1/my.json"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "uploadFile"
                ],
                "properties": {
                  "uploadFile": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Absolute path of saved file",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/config/uploads/{name}": {
      "delete": {
        "tags": [
          "Uploads"
        ],
        "summary": "Delete an uploaded configuration file",
        "operationId": "deleteUpload",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/uploads.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "File deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "ok"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/data/export": {
      "get": {
        "tags": [
          "Data"
        ],
        "summary": "Export all configuration as JSON",
        "operationId": "exportData",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/import_export.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/data.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Download named ekuiper_export.json",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "Data"
        ],
        "summary": "Export selected rules and dependencies as JSON",
        "operationId": "exportSelectedData",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/import_export.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/data.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of rule IDs to export"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "rules": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                ]
              },
              "example": [
                "rule_comprehensive"
              ]
            }
          }
        },
        "responses": {
          "200": {
            "description": "Filtered ekuiper_export.json download",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/data/import": {
      "post": {
        "tags": [
          "Data"
        ],
        "summary": "Import JSON configuration",
        "operationId": "importData",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/import_export.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/data.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "By default this resets existing configuration before import. Exactly one of content or file is required.",
        "parameters": [
          {
            "name": "stop",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                1
              ]
            },
            "description": "When 1, exit after import so static plugins/schemas can take effect."
          },
          {
            "name": "partial",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                1
              ]
            },
            "description": "When 1, retain existing data and merge/overwrite supported objects."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportReference"
              },
              "examples": {
                "content": {
                  "value": {
                    "content": "{\"streams\":{},\"tables\":{},\"rules\":{}}"
                  }
                },
                "file": {
                  "value": {
                    "file": "file:///tmp/ekuiper-export.json"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import outcome",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "JSON encoded as text/plain by the v2.4.1 handler."
                },
                "x-decoded-schema": {
                  "$ref": "#/components/schemas/ImportConfigurationStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/data/import/status": {
      "get": {
        "tags": [
          "Data"
        ],
        "summary": "Get latest import status",
        "operationId": "getDataImportStatus",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/import_export.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/data.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Error messages keyed by imported object name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Configuration"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/async/data/import": {
      "post": {
        "tags": [
          "Data"
        ],
        "summary": "Start an asynchronous JSON import",
        "operationId": "startAsyncDataImport",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/async_rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/data.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "name": "stop",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                1
              ]
            },
            "description": "When 1, exit after import so static plugins/schemas can take effect."
          },
          {
            "name": "partial",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                1
              ]
            },
            "description": "When 1, retain existing data and merge/overwrite supported objects."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportReference"
              },
              "examples": {
                "content": {
                  "value": {
                    "content": "{\"streams\":{},\"tables\":{},\"rules\":{}}"
                  }
                },
                "file": {
                  "value": {
                    "file": "file:///tmp/ekuiper-export.json"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Registered task id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "JSON encoded as text/plain by the v2.4.1 handler."
                },
                "example": "{\"id\":\"dataImport-1750000000\"}",
                "x-decoded-schema": {
                  "$ref": "#/components/schemas/AsyncTaskId"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/async/task/{id}": {
      "get": {
        "tags": [
          "Data"
        ],
        "summary": "Get asynchronous task status",
        "operationId": "getAsyncTaskStatus",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/async_rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/data.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Stored task status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "JSON encoded as text/plain by the v2.4.1 handler."
                },
                "x-decoded-schema": {
                  "$ref": "#/components/schemas/AsyncTaskStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/async/task/{id}/cancel": {
      "post": {
        "tags": [
          "Data"
        ],
        "summary": "Cancel an asynchronous task",
        "operationId": "cancelAsyncTask",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/async_rest.go"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Task cancelled",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "cancel success"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v2/data/export": {
      "get": {
        "tags": [
          "Data"
        ],
        "summary": "Export configuration as YAML",
        "operationId": "exportYamlData",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/yaml_import_export.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/data.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Download named ekuiper_export.yaml",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v2/data/import": {
      "post": {
        "tags": [
          "Data"
        ],
        "summary": "Import YAML configuration",
        "operationId": "importYamlData",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/yaml_import_export.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/data.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Exactly one of content or file is required. partial and reboot are decoded but marked TODO and have no effect in v2.4.1.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/YamlImportRequest"
              },
              "example": {
                "file": "file:///tmp/a.yaml"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "YAML imported",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "success"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/connections": {
      "get": {
        "tags": [
          "Connections"
        ],
        "summary": "List connection information and status",
        "operationId": "listConnections",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/connection.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/connection.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "name": "forceAll",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Include unnamed/internal connection metadata when true."
          }
        ],
        "responses": {
          "200": {
            "description": "JSON-encoded connection array returned as text/plain",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "[{\"id\":\"connection-1\",\"typ\":\"mqtt\",\"props\":{\"server\":\"tcp://broker:1883\"},\"isNamed\":true,\"status\":\"connected\"}]"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "description": "Returns all connection information and status. The v2.4.1 handler emits a text/plain Content-Type with a JSON array body and may include plaintext secret fields inside props."
      },
      "post": {
        "tags": [
          "Connections"
        ],
        "summary": "Create a named shared connection",
        "operationId": "createConnection",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/connection.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/connection.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionRequest"
              },
              "examples": {
                "mqtt": {
                  "value": {
                    "id": "connection-1",
                    "typ": "mqtt",
                    "props": {
                      "server": "tcp://127.0.0.1:1883"
                    }
                  }
                },
                "kafka": {
                  "value": {
                    "id": "kafka-1",
                    "typ": "kafka",
                    "props": {
                      "brokers": "127.0.0.1:9092",
                      "saslAuthType": "none"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Connection created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "success"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/connections/{id}": {
      "get": {
        "tags": [
          "Connections"
        ],
        "summary": "Get a connection",
        "operationId": "getConnection",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/connection.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/connection.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Connection details and status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "tags": [
          "Connections"
        ],
        "summary": "Update a connection",
        "operationId": "updateConnection",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/connection.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/connection.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "A connection referenced by a rule cannot be updated.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionRequest"
              },
              "examples": {
                "mqtt": {
                  "value": {
                    "id": "connection-1",
                    "typ": "mqtt",
                    "props": {
                      "server": "tcp://127.0.0.1:1883"
                    }
                  }
                },
                "kafka": {
                  "value": {
                    "id": "kafka-1",
                    "typ": "kafka",
                    "props": {
                      "brokers": "127.0.0.1:9092",
                      "saslAuthType": "none"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connection updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "success"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Connections"
        ],
        "summary": "Delete a connection",
        "operationId": "deleteConnection",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/connection.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/connection.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "A connection referenced by a rule cannot be deleted.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Connection deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "success"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/schemas/{type}": {
      "get": {
        "tags": [
          "Schemas"
        ],
        "summary": "List schemas of a type",
        "operationId": "listSchemas",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/schema_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/schemas.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SchemaType"
          }
        ],
        "responses": {
          "200": {
            "description": "Schema names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "Schemas"
        ],
        "summary": "Create a schema",
        "operationId": "createSchema",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/schema_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/schemas.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SchemaType"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SchemaCreateRequest"
              },
              "examples": {
                "content": {
                  "value": {
                    "name": "schema1",
                    "content": "message Book { required string title = 1; }"
                  }
                },
                "file": {
                  "value": {
                    "name": "schema2",
                    "file": "file:///tmp/schema2.proto",
                    "version": "1756436910"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Schema created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/schemas/{type}/{name}": {
      "get": {
        "tags": [
          "Schemas"
        ],
        "summary": "Describe a schema",
        "operationId": "getSchema",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/schema_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/schemas.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SchemaType"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Schema definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchemaInfo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "tags": [
          "Schemas"
        ],
        "summary": "Create or update a schema",
        "operationId": "updateSchema",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/schema_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/schemas.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "If version is supplied, it must be lexically greater than the stored version.",
        "parameters": [
          {
            "$ref": "#/components/parameters/SchemaType"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SchemaWriteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Schema updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Schemas"
        ],
        "summary": "Delete a schema",
        "operationId": "deleteSchema",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/schema_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/schemas.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SchemaType"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Schema deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/schemas/{type}/{name}/upload": {
      "put": {
        "tags": [
          "Schemas"
        ],
        "summary": "Create or update a schema from a multipart file",
        "operationId": "uploadSchema",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/schema_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/schemas.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "The file field must appear exactly once. version is optional, at most 4096 bytes, and may not repeat. The temporary upload is removed after processing.",
        "parameters": [
          {
            "$ref": "#/components/parameters/SchemaType"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "version": {
                    "type": "string",
                    "maxLength": 4096
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Existing schema replaced",
            "headers": {
              "Location": {
                "description": "Canonical schema resource path",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchemaUploadResponse"
                }
              }
            }
          },
          "201": {
            "description": "New schema created",
            "headers": {
              "Location": {
                "description": "Canonical schema resource path",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchemaUploadResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "415": {
            "description": "Content-Type is not multipart/form-data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Response encoding failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/plugins/sources": {
      "get": {
        "tags": [
          "Plugins"
        ],
        "summary": "List native sources plugins",
        "operationId": "listSourcesPlugins",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Installed plugin names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "Plugins"
        ],
        "summary": "Install a native sources plugin",
        "operationId": "installSourcesPlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PluginInstallRequest"
              },
              "example": {
                "name": "random",
                "file": "file:///var/plugins/sources/random.zip"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Plugin installed",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/plugins/sources/{name}": {
      "get": {
        "tags": [
          "Plugins"
        ],
        "summary": "Describe a native sources plugin",
        "operationId": "getSourcesPlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Plugin version and exported functions when applicable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NativePluginInfo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "tags": [
          "Plugins"
        ],
        "summary": "Update a native sources plugin",
        "operationId": "updateSourcesPlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Native plugin updates require an eKuiper restart before the new binary takes effect.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PluginInstallRequest"
              },
              "example": {
                "name": "random",
                "file": "file:///var/plugins/sources/random.zip"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Plugin updated; restart required",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Plugins"
        ],
        "summary": "Delete a native sources plugin",
        "operationId": "deleteSourcesPlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "name": "stop",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                1
              ]
            },
            "description": "When 1, stop eKuiper after deletion. Otherwise restart manually for the deletion to take effect."
          }
        ],
        "responses": {
          "200": {
            "description": "Plugin deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/plugins/sources/prebuild": {
      "get": {
        "tags": [
          "Plugins"
        ],
        "summary": "List installable native sources plugins",
        "operationId": "listPrebuiltSourcesPlugins",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Available on Linux. URLs are constructed from pluginHosts, eKuiper version, distribution family, and architecture.",
        "responses": {
          "200": {
            "description": "Plugin download URLs keyed by name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/plugins/sinks": {
      "get": {
        "tags": [
          "Plugins"
        ],
        "summary": "List native sinks plugins",
        "operationId": "listSinksPlugins",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Installed plugin names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "Plugins"
        ],
        "summary": "Install a native sinks plugin",
        "operationId": "installSinksPlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PluginInstallRequest"
              },
              "example": {
                "name": "random",
                "file": "file:///var/plugins/sinks/random.zip"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Plugin installed",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/plugins/sinks/{name}": {
      "get": {
        "tags": [
          "Plugins"
        ],
        "summary": "Describe a native sinks plugin",
        "operationId": "getSinksPlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Plugin version and exported functions when applicable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NativePluginInfo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "tags": [
          "Plugins"
        ],
        "summary": "Update a native sinks plugin",
        "operationId": "updateSinksPlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Native plugin updates require an eKuiper restart before the new binary takes effect.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PluginInstallRequest"
              },
              "example": {
                "name": "random",
                "file": "file:///var/plugins/sinks/random.zip"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Plugin updated; restart required",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Plugins"
        ],
        "summary": "Delete a native sinks plugin",
        "operationId": "deleteSinksPlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "name": "stop",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                1
              ]
            },
            "description": "When 1, stop eKuiper after deletion. Otherwise restart manually for the deletion to take effect."
          }
        ],
        "responses": {
          "200": {
            "description": "Plugin deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/plugins/sinks/prebuild": {
      "get": {
        "tags": [
          "Plugins"
        ],
        "summary": "List installable native sinks plugins",
        "operationId": "listPrebuiltSinksPlugins",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Available on Linux. URLs are constructed from pluginHosts, eKuiper version, distribution family, and architecture.",
        "responses": {
          "200": {
            "description": "Plugin download URLs keyed by name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/plugins/functions": {
      "get": {
        "tags": [
          "Plugins"
        ],
        "summary": "List native functions plugins",
        "operationId": "listFunctionsPlugins",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Installed plugin names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "Plugins"
        ],
        "summary": "Install a native functions plugin",
        "operationId": "installFunctionsPlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FunctionPluginInstallRequest"
              },
              "example": {
                "name": "random",
                "file": "file:///var/plugins/functions/random.zip"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Plugin installed",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/plugins/functions/{name}": {
      "get": {
        "tags": [
          "Plugins"
        ],
        "summary": "Describe a native functions plugin",
        "operationId": "getFunctionsPlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Plugin version and exported functions when applicable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NativePluginInfo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "tags": [
          "Plugins"
        ],
        "summary": "Update a native functions plugin",
        "operationId": "updateFunctionsPlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Native plugin updates require an eKuiper restart before the new binary takes effect.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FunctionPluginInstallRequest"
              },
              "example": {
                "name": "random",
                "file": "file:///var/plugins/functions/random.zip"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Plugin updated; restart required",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Plugins"
        ],
        "summary": "Delete a native functions plugin",
        "operationId": "deleteFunctionsPlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "name": "stop",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                1
              ]
            },
            "description": "When 1, stop eKuiper after deletion. Otherwise restart manually for the deletion to take effect."
          }
        ],
        "responses": {
          "200": {
            "description": "Plugin deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/plugins/functions/prebuild": {
      "get": {
        "tags": [
          "Plugins"
        ],
        "summary": "List installable native functions plugins",
        "operationId": "listPrebuiltFunctionsPlugins",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Available on Linux. URLs are constructed from pluginHosts, eKuiper version, distribution family, and architecture.",
        "responses": {
          "200": {
            "description": "Plugin download URLs keyed by name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/plugins/portables": {
      "get": {
        "tags": [
          "Plugins"
        ],
        "summary": "List portable plugins",
        "operationId": "listPortablePlugins",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/portable_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "portable",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Installed portable plugin names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "Plugins"
        ],
        "summary": "Install a portable plugin",
        "operationId": "installPortablePlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/portable_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "portable",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PluginInstallRequest"
              },
              "example": {
                "name": "mirror",
                "file": "file:///var/plugins/portables/mirror.zip"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Portable plugin installed",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/plugins/portables/{name}": {
      "get": {
        "tags": [
          "Plugins"
        ],
        "summary": "Describe a portable plugin",
        "operationId": "getPortablePlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/portable_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "portable",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Portable package metadata and symbols",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortablePluginInfo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "tags": [
          "Plugins"
        ],
        "summary": "Update a portable plugin",
        "operationId": "updatePortablePlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/portable_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "portable",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Portable updates take effect immediately, including for running rules.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PluginInstallRequest"
              },
              "example": {
                "name": "mirror",
                "file": "file:///var/plugins/portables/mirror.zip"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Portable plugin updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Plugins"
        ],
        "summary": "Delete a portable plugin",
        "operationId": "deletePortablePlugin",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/portable_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "portable",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Deletion takes effect immediately; rules using the plugin may report errors.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Portable plugin deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/plugins/portables/{name}/status": {
      "get": {
        "tags": [
          "Plugins"
        ],
        "summary": "Get portable plugin runtime status",
        "operationId": "getPortablePluginStatus",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/portable_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "portable",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "The tagged Markdown repeats the detail path, but the router registers this dedicated /status path.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Runtime status and per-rule references",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "JSON encoded as text/plain by the v2.4.1 handler."
                },
                "x-decoded-schema": {
                  "$ref": "#/components/schemas/PortablePluginStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/plugins/udfs": {
      "get": {
        "tags": [
          "Plugins"
        ],
        "summary": "List UDF symbols exported by native function plugins",
        "operationId": "listPluginUdfs",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "UDF symbol names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/plugins/udfs/{name}": {
      "get": {
        "tags": [
          "Plugins"
        ],
        "summary": "Find the native plugin that owns a UDF",
        "operationId": "getPluginUdfOwner",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Symbol and owning plugin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UdfOwner"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/plugins/functions/{name}/register": {
      "post": {
        "tags": [
          "Plugins"
        ],
        "summary": "Register symbols exported by a function plugin",
        "operationId": "registerFunctionPluginSymbols",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/plugin_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/plugins.md"
        ],
        "x-ekuiper-build-tags": [
          "plugin",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FunctionRegistration"
              },
              "example": {
                "functions": [
                  "func1",
                  "func2"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Function list registered",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/udf/javascript": {
      "get": {
        "tags": [
          "UDF"
        ],
        "summary": "List JavaScript UDFs",
        "operationId": "listJavascriptUdfs",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/script_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/udf.md"
        ],
        "x-ekuiper-build-tags": [
          "script",
          "full"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Function ids",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "UDF"
        ],
        "summary": "Create a JavaScript UDF",
        "operationId": "createJavascriptUdf",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/script_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/udf.md"
        ],
        "x-ekuiper-build-tags": [
          "script",
          "full"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JavascriptUdf"
              },
              "example": {
                "id": "area",
                "description": "calculate area",
                "script": "function area(x, y) { return x * y; }",
                "isAgg": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "JavaScript UDF created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/udf/javascript/{id}": {
      "get": {
        "tags": [
          "UDF"
        ],
        "summary": "Describe a JavaScript UDF",
        "operationId": "getJavascriptUdf",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/script_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/udf.md"
        ],
        "x-ekuiper-build-tags": [
          "script",
          "full"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Function definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JavascriptUdf"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "tags": [
          "UDF"
        ],
        "summary": "Create or update a JavaScript UDF",
        "operationId": "updateJavascriptUdf",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/script_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/udf.md"
        ],
        "x-ekuiper-build-tags": [
          "script",
          "full"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Running rules must be restarted to load the updated function.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JavascriptUdf"
              },
              "example": {
                "id": "area",
                "description": "calculate area",
                "script": "function area(x, y) { return x * y; }",
                "isAgg": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JavaScript UDF updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "UDF"
        ],
        "summary": "Delete a JavaScript UDF",
        "operationId": "deleteJavascriptUdf",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/script_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/udf.md"
        ],
        "x-ekuiper-build-tags": [
          "script",
          "full"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "JavaScript UDF deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/services": {
      "get": {
        "tags": [
          "Services"
        ],
        "summary": "List external services",
        "operationId": "listServices",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/service_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/services.md"
        ],
        "x-ekuiper-build-tags": [
          "service",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Service names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "Services"
        ],
        "summary": "Register an external service",
        "operationId": "createService",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/service_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/services.md"
        ],
        "x-ekuiper-build-tags": [
          "service",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceRequest"
              },
              "example": {
                "name": "sample",
                "file": "file:///var/services/sample.zip"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Service registered",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/services/{name}": {
      "get": {
        "tags": [
          "Services"
        ],
        "summary": "Describe an external service",
        "operationId": "getService",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/service_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/services.md"
        ],
        "x-ekuiper-build-tags": [
          "service",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Parsed service definition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "tags": [
          "Services"
        ],
        "summary": "Update an external service",
        "operationId": "updateService",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/service_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/services.md"
        ],
        "x-ekuiper-build-tags": [
          "service",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceUpdateRequest"
              },
              "example": {
                "name": "sample",
                "file": "file:///var/services/sample.zip"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Service updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Services"
        ],
        "summary": "Delete an external service",
        "operationId": "deleteService",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/service_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/services.md"
        ],
        "x-ekuiper-build-tags": [
          "service",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Also deletes all functions defined by the service.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Service deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/services/functions": {
      "get": {
        "tags": [
          "Services"
        ],
        "summary": "List external functions",
        "operationId": "listServiceFunctions",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/service_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/services.md"
        ],
        "x-ekuiper-build-tags": [
          "service",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "External function bindings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ExternalFunction"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/services/functions/{name}": {
      "get": {
        "tags": [
          "Services"
        ],
        "summary": "Describe an external function",
        "operationId": "getServiceFunction",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/service_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/services.md"
        ],
        "x-ekuiper-build-tags": [
          "service",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "External function binding",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalFunction"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/metadata/functions": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "Get SQL function metadata",
        "operationId": "getFunctionMetadata",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Combines the JSON metadata documents installed under etc/functions and data/functions.",
        "responses": {
          "200": {
            "description": "Function metadata documents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MetadataDocument"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/metadata/operators": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "Get rule-graph operator metadata",
        "operationId": "getOperatorMetadata",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Combines the installed operator JSON documents.",
        "responses": {
          "200": {
            "description": "Operator metadata documents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MetadataDocument"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/metadata/sinks": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "List sink metadata summaries",
        "operationId": "listSinkMetadata",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Installed sink metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MetadataPluginSummary"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/metadata/sinks/{name}": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "Get sink metadata",
        "operationId": "getSinkMetadata",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "$ref": "#/components/parameters/ContentLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "UI metadata for the sink",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataDocument"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/metadata/sources": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "List source metadata summaries",
        "operationId": "listSourceMetadata",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "scan",
                "lookup"
              ],
              "default": "scan"
            },
            "description": "Source kind. Omitted and unrecognized values select scan sources."
          }
        ],
        "responses": {
          "200": {
            "description": "Installed source metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MetadataPluginSummary"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/metadata/sources/{name}": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "Get source metadata",
        "operationId": "getSourceMetadata",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "$ref": "#/components/parameters/ContentLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "UI metadata for the source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataDocument"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/metadata/connections": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "List connection metadata summaries",
        "operationId": "listConnectionMetadata",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Installed shared-connection metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MetadataPluginSummary"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/metadata/connections/{name}": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "Get connection metadata",
        "operationId": "getConnectionMetadata",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "$ref": "#/components/parameters/ContentLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "UI metadata for the connection type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataDocument"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/metadata/sources/yaml/{name}": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "List source configuration keys",
        "operationId": "getSourceConfigKeys",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/configKey.md"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Configuration values keyed by configuration name. Despite the tagged Markdown claiming password/token redaction, the v2.4.1 handler does not call its secret-masking helper and live v2.4.1 responses can contain plaintext credentials. Protect this endpoint and never log or publish its response.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "$ref": "#/components/parameters/ContentLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "Configuration-key map",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigKeyMap"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/metadata/sources/{name}/confKeys/{confKey}": {
      "put": {
        "tags": [
          "Metadata"
        ],
        "summary": "Create or replace a source configuration key",
        "operationId": "putSourceConfigKey",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/configKey.md"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "name": "confKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "$ref": "#/components/parameters/ContentLanguage"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "example": {
                "qos": 0,
                "server": "tcp://127.0.0.1:1883"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Configuration stored; empty response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "delete": {
        "tags": [
          "Metadata"
        ],
        "summary": "Delete a source configuration key",
        "operationId": "deleteSourceConfigKey",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/configKey.md"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "name": "confKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "$ref": "#/components/parameters/ContentLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "Configuration deleted; empty response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/metadata/sinks/yaml/{name}": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "List sink configuration keys",
        "operationId": "getSinkConfigKeys",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/configKey.md"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Configuration values keyed by configuration name. Despite the tagged Markdown claiming password/token redaction, the v2.4.1 handler does not call its secret-masking helper and live v2.4.1 responses can contain plaintext credentials. Protect this endpoint and never log or publish its response.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "$ref": "#/components/parameters/ContentLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "Configuration-key map",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigKeyMap"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/metadata/sinks/{name}/confKeys/{confKey}": {
      "put": {
        "tags": [
          "Metadata"
        ],
        "summary": "Create or replace a sink configuration key",
        "operationId": "putSinkConfigKey",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/configKey.md"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "name": "confKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "$ref": "#/components/parameters/ContentLanguage"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "example": {
                "qos": 0,
                "server": "tcp://127.0.0.1:1883"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Configuration stored; empty response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "delete": {
        "tags": [
          "Metadata"
        ],
        "summary": "Delete a sink configuration key",
        "operationId": "deleteSinkConfigKey",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/configKey.md"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "name": "confKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "$ref": "#/components/parameters/ContentLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "Configuration deleted; empty response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/metadata/connections/yaml/{name}": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "List connection configuration keys",
        "operationId": "getConnectionConfigKeys",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/configKey.md"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "Configuration values keyed by configuration name. Despite the tagged Markdown claiming password/token redaction, the v2.4.1 handler does not call its secret-masking helper and live v2.4.1 responses can contain plaintext credentials. Protect this endpoint and never log or publish its response.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "$ref": "#/components/parameters/ContentLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "Configuration-key map",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigKeyMap"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/metadata/connections/{name}/confKeys/{confKey}": {
      "put": {
        "tags": [
          "Metadata"
        ],
        "summary": "Create or replace a connection configuration key",
        "operationId": "putConnectionConfigKey",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/configKey.md"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "name": "confKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "$ref": "#/components/parameters/ContentLanguage"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "example": {
                "qos": 0,
                "server": "tcp://127.0.0.1:1883"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Configuration stored; empty response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "delete": {
        "tags": [
          "Metadata"
        ],
        "summary": "Delete a connection configuration key",
        "operationId": "deleteConnectionConfigKey",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/configKey.md"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          },
          {
            "name": "confKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "$ref": "#/components/parameters/ContentLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "Configuration deleted; empty response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/metadata/resource": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "Get source resource configurations",
        "operationId": "getSourceResourceConfigurations",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "name": "sourceType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "When supplied, include configurations whose sourceType property equals this value; otherwise include all source configurations."
          }
        ],
        "responses": {
          "200": {
            "description": "Configurations grouped by plugin and key",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "JSON encoded as text/plain by the v2.4.1 handler."
                },
                "x-decoded-schema": {
                  "$ref": "#/components/schemas/SourceResourceConfig"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "description": "Returns stored source configurations grouped by plugin and key. Values may contain plaintext credentials; protect this endpoint and never log or publish responses."
      }
    },
    "/metadata/resources": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "List updatable source and sink resources",
        "operationId": "listUpdatableResources",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ContentLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "Updatable resource ids grouped by source/sink",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "JSON encoded as text/plain by the v2.4.1 handler."
                },
                "x-decoded-schema": {
                  "$ref": "#/components/schemas/UpdatableResources"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/metadata/sources/connection/{name}": {
      "post": {
        "tags": [
          "Metadata"
        ],
        "summary": "Test source connectivity",
        "operationId": "testSourceConnection",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/connection.md"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "The JSON properties are specific to the named connector type.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "example": {
                "url": "mysql://root@127.0.0.1:4000/test"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connectivity check succeeded; empty response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/metadata/sinks/connection/{name}": {
      "post": {
        "tags": [
          "Metadata"
        ],
        "summary": "Test sink connectivity",
        "operationId": "testSinkConnection",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/connection.md"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "The JSON properties are specific to the named connector type.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "example": {
                "url": "mysql://root@127.0.0.1:4000/test"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connectivity check succeeded; empty response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/metadata/lookups/connection/{name}": {
      "post": {
        "tags": [
          "Metadata"
        ],
        "summary": "Test lookup source connectivity",
        "operationId": "testLookupSourceConnection",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/meta_init.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/connection.md"
        ],
        "x-ekuiper-build-tags": [
          "ui",
          "!core"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "description": "The JSON properties are specific to the named connector type.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "example": {
                "url": "mysql://root@127.0.0.1:4000/test"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connectivity check succeeded; empty response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/streams/{name}/data": {
      "post": {
        "summary": "Ingest JSON, CSV, or binary event payload into a stream",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Data ingested successfully"
          }
        }
      }
    },
    "/tables/{name}/data": {
      "post": {
        "summary": "Insert or update lookup rows in a table",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Table data ingested successfully"
          }
        }
      }
    },
    "/rules/{name}/errors": {
      "get": {
        "summary": "Get dead-letter queue (DLQ) statistics and recent poison-pill records for a rule",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "DLQ statistics and recent error envelopes"
          }
        }
      },
      "delete": {
        "summary": "Clear buffered dead-letter queue (DLQ) error records for a rule",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "DLQ errors cleared"
          }
        }
      }
    },
    "/rules/{name}/dlq": {
      "get": {
        "summary": "Alias of GET /rules/{name}/errors",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "DLQ statistics and recent error envelopes"
          }
        }
      },
      "delete": {
        "summary": "Alias of DELETE /rules/{name}/errors",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "DLQ errors cleared"
          }
        }
      }
    },
    "/declarative/reload": {
      "post": {
        "summary": "Trigger atomic reconciliation and hot-reload of declarative GitOps manifests",
        "responses": {
          "200": {
            "description": "Reconciliation report"
          },
          "400": {
            "description": "Validation or mode error"
          }
        }
      }
    },
    "/v1/metrics": {
      "post": {
        "summary": "Ingest OpenTelemetry (OTLP/HTTP JSON) metrics batch",
        "responses": {
          "200": {
            "description": "OTLP partialSuccess response"
          }
        }
      }
    },
    "/v1/logs": {
      "post": {
        "summary": "Ingest OpenTelemetry (OTLP/HTTP JSON) logs batch",
        "responses": {
          "200": {
            "description": "OTLP partialSuccess response"
          }
        }
      }
    },
    "/v1/traces": {
      "post": {
        "summary": "Ingest OpenTelemetry (OTLP/HTTP JSON) traces batch",
        "responses": {
          "200": {
            "description": "OTLP partialSuccess response"
          }
        }
      }
    },
    "/ui": {
      "get": {
        "summary": "Embedded self-contained web inspection console",
        "responses": {
          "200": {
            "description": "HTML web console"
          }
        }
      }
    },
    "/plugins/wasm": {
      "get": {
        "summary": "List registered WebAssembly plugin modules",
        "responses": {
          "200": {
            "description": "Array of WASM module names"
          }
        }
      },
      "post": {
        "summary": "Register a WebAssembly plugin module from file or base64 bytecode",
        "responses": {
          "201": {
            "description": "Registered WASM module and exported UDFs"
          }
        }
      }
    },
    "/plugins/wasm/{name}": {
      "delete": {
        "summary": "Unregister a WebAssembly plugin module",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Module unregistered"
          }
        }
      }
    },
    "/config": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Get system configuration (alias for /configs)",
        "operationId": "getConfigAlias",
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "System configuration object",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "patch": {
        "tags": [
          "System"
        ],
        "summary": "Dynamically reload supported configuration",
        "operationId": "patchConfigs",
        "x-ekuiper-source": [
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/rest.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/internal/server/import_export.go",
          "https://github.com/lf-edge/ekuiper/blob/v2.4.1/docs/en_US/api/restapi/configs.md"
        ],
        "security": [
          {},
          {
            "JwtToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DynamicConfig"
              },
              "example": {
                "debug": true,
                "consoleLog": true,
                "fileLog": true,
                "timezone": "UTC"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Configuration updated; no response body."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "JwtToken": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Optional eKuiper RS256 JWT authentication. Supply the raw compact JWT without a Bearer prefix. The token audience must contain eKuiper."
      }
    },
    "parameters": {
      "Name": {
        "name": "name",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "Id": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "RuleID": {
        "name": "ruleID",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "SchemaType": {
        "name": "type",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "protobuf",
            "custom"
          ]
        }
      },
      "ContentLanguage": {
        "name": "Content-Language",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "default": "en_US"
        },
        "description": "Metadata language, for example en-US or zh-CN."
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          },
          "text/plain": {
            "schema": {
              "type": "string",
              "description": "JSON error envelope serialized through http.Error."
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          },
          "text/plain": {
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing or invalid JWT when authentication is enabled",
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            }
          }
        }
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "description": "Error envelope emitted by eKuiper. Most handlers serialize this JSON value through http.Error, so the HTTP Content-Type may be text/plain even though the payload is JSON.",
        "required": [
          "error",
          "message"
        ],
        "properties": {
          "error": {
            "type": "integer",
            "description": "eKuiper internal error code."
          },
          "message": {
            "type": "string"
          }
        },
        "example": {
          "error": 1001,
          "message": "Invalid body: bad request"
        }
      },
      "SystemInfo": {
        "type": "object",
        "required": [
          "version",
          "os",
          "arch",
          "upTimeSeconds",
          "memoryTotal"
        ],
        "properties": {
          "version": {
            "type": "string",
            "example": "2.4.1"
          },
          "os": {
            "type": "string",
            "example": "linux"
          },
          "arch": {
            "type": "string",
            "example": "amd64"
          },
          "upTimeSeconds": {
            "type": "integer",
            "format": "int64"
          },
          "cpuUsage": {
            "type": "string"
          },
          "memoryUsed": {
            "type": "string"
          },
          "memoryTotal": {
            "type": "string"
          }
        }
      },
      "BatchRequest": {
        "type": "object",
        "required": [
          "method",
          "path"
        ],
        "properties": {
          "method": {
            "type": "string",
            "example": "GET"
          },
          "path": {
            "type": "string",
            "example": "/streams"
          },
          "body": {
            "type": "string",
            "description": "Nested request body encoded as a string."
          }
        }
      },
      "BatchResponse": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "integer"
          },
          "response": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        }
      },
      "DynamicConfig": {
        "type": "object",
        "properties": {
          "logLevel": {
            "type": "string"
          },
          "debug": {
            "type": "boolean"
          },
          "consoleLog": {
            "type": "boolean"
          },
          "fileLog": {
            "type": "boolean"
          },
          "timezone": {
            "type": "string",
            "example": "UTC"
          },
          "metricsDumpConfig": {
            "type": "object",
            "properties": {
              "enable": {
                "type": "boolean"
              }
            }
          }
        },
        "additionalProperties": false
      },
      "StatementRequest": {
        "type": "object",
        "required": [
          "sql"
        ],
        "properties": {
          "sql": {
            "type": "string",
            "example": "CREATE STREAM demo () WITH (DATASOURCE=\"demo\", FORMAT=\"json\")"
          }
        },
        "additionalProperties": false
      },
      "DatasourceDetail": {
        "type": "object",
        "required": [
          "name",
          "type",
          "format"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "format": {
            "type": "string"
          }
        }
      },
      "DatasourceOptions": {
        "type": "object",
        "properties": {
          "datasource": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "format": {
            "type": "string"
          },
          "confKey": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "strictValidation": {
            "type": "boolean"
          },
          "timestamp": {
            "type": "string"
          },
          "timestampFormat": {
            "type": "string"
          },
          "shared": {
            "type": "boolean"
          },
          "schemaid": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "extra": {
            "type": "string"
          },
          "temp": {
            "type": "boolean"
          },
          "retainSize": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "scan",
              "lookup"
            ]
          },
          "delimiter": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "AstFieldType": {
        "oneOf": [
          {
            "type": "string",
            "description": "Basic eKuiper type such as bigint, float, string, datetime, boolean or bytea."
          },
          {
            "type": "object",
            "additionalProperties": true,
            "description": "Complex array or struct type description."
          }
        ]
      },
      "StreamField": {
        "type": "object",
        "required": [
          "Name",
          "FieldType"
        ],
        "properties": {
          "Name": {
            "type": "string"
          },
          "FieldType": {
            "$ref": "#/components/schemas/AstFieldType"
          }
        }
      },
      "DatasourceDescription": {
        "type": "object",
        "required": [
          "Name",
          "StreamFields",
          "Options",
          "StreamType"
        ],
        "properties": {
          "Name": {
            "type": "string"
          },
          "StreamFields": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/StreamField"
            }
          },
          "Options": {
            "$ref": "#/components/schemas/DatasourceOptions"
          },
          "StreamType": {
            "type": "integer",
            "description": "Internal stream/table kind code."
          },
          "Statement": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true,
            "description": "Parsed statement metadata; normally null in REST responses."
          }
        }
      },
      "JsonSchemaField": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "items": {
            "$ref": "#/components/schemas/JsonSchemaField"
          },
          "properties": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonSchemaField"
            }
          },
          "hasIndex": {
            "type": "boolean"
          },
          "index": {
            "type": "integer"
          },
          "selected": {
            "type": "boolean"
          }
        }
      },
      "RuleOptions": {
        "type": "object",
        "properties": {
          "debug": {
            "type": "boolean"
          },
          "logFilename": {
            "type": "string"
          },
          "isEventTime": {
            "type": "boolean"
          },
          "lateTolerance": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "concurrency": {
            "type": "integer"
          },
          "bufferLength": {
            "type": "integer"
          },
          "sendMetaToSink": {
            "type": "boolean"
          },
          "sendNilField": {
            "type": "boolean"
          },
          "sendError": {
            "type": "boolean"
          },
          "qos": {
            "type": "integer",
            "enum": [
              0,
              1,
              2
            ]
          },
          "checkpointInterval": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "restartStrategy": {
            "type": "object",
            "properties": {
              "attempts": {
                "type": "integer"
              }
            }
          },
          "cron": {
            "type": "string"
          },
          "duration": {
            "type": "string"
          },
          "cronDatetimeRange": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "planOptimizeStrategy": {
            "type": "object",
            "additionalProperties": true
          },
          "notifySub": {
            "type": "boolean"
          },
          "disableBufferFullDiscard": {
            "type": "boolean"
          },
          "enableSaveStateBeforeStop": {
            "type": "boolean"
          },
          "forceExitTimeout": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "experiment": {
            "type": "object",
            "properties": {
              "useSliceTuple": {
                "type": "boolean"
              }
            }
          }
        },
        "additionalProperties": false
      },
      "RuleGraph": {
        "type": "object",
        "required": [
          "nodes",
          "topo"
        ],
        "properties": {
          "nodes": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "required": [
                "type",
                "nodeType",
                "props",
                "ui"
              ],
              "properties": {
                "type": {
                  "type": "string"
                },
                "nodeType": {
                  "type": "string"
                },
                "props": {
                  "type": "object",
                  "additionalProperties": true
                },
                "ui": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "topo": {
            "$ref": "#/components/schemas/RuleTopology"
          }
        }
      },
      "Rule": {
        "type": "object",
        "properties": {
          "triggered": {
            "type": "boolean",
            "default": true
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string",
            "description": "Lexically compared version used to control replacement."
          },
          "temp": {
            "type": "boolean"
          },
          "sql": {
            "type": "string"
          },
          "graph": {
            "$ref": "#/components/schemas/RuleGraph"
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "options": {
            "$ref": "#/components/schemas/RuleOptions"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "oneOf": [
          {
            "required": [
              "sql",
              "actions"
            ]
          },
          {
            "required": [
              "graph"
            ]
          }
        ],
        "example": {
          "id": "rule1",
          "sql": "SELECT * FROM demo",
          "actions": [
            {
              "log": {}
            }
          ]
        }
      },
      "RuleListItem": {
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "version",
          "trace",
          "tags"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "trace": {
            "type": "boolean"
          },
          "tags": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "RuleStatus": {
        "type": "object",
        "required": [
          "status",
          "message",
          "lastStartTimestamp",
          "lastStopTimestamp",
          "nextStartTimestamp"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "lastStartTimestamp": {
            "type": "integer",
            "format": "int64"
          },
          "lastStopTimestamp": {
            "type": "integer",
            "format": "int64"
          },
          "nextStartTimestamp": {
            "type": "integer",
            "format": "int64"
          },
          "lastException": {
            "type": "string",
            "description": "Last recorded exception message (camelCase alias)"
          },
          "last_exception": {
            "type": "string",
            "description": "Last recorded exception message (snake_case alias)"
          },
          "exceptionsTotal": {
            "type": "integer",
            "format": "int64",
            "description": "Total exception count (camelCase)"
          },
          "exceptions_total": {
            "type": "integer",
            "format": "int64",
            "description": "Total exception count (snake_case)"
          },
          "sourceRecordsInTotal": {
            "type": "integer",
            "format": "int64",
            "description": "Total input records read across all sources"
          },
          "sourceRecordsFilteredTotal": {
            "type": "integer",
            "format": "int64",
            "description": "Input records filtered out by WHERE clause"
          },
          "sinkRecordsOutTotal": {
            "type": "integer",
            "format": "int64",
            "description": "Total output records dispatched to sinks"
          },
          "sinkRecordsEnqueuedTotal": {
            "type": "integer",
            "format": "int64",
            "description": "Output records enqueued in sink buffer"
          },
          "sinkRecordsFailedTotal": {
            "type": "integer",
            "format": "int64",
            "description": "Sink operations that failed after dequeue"
          },
          "droppedByPolicyTotal": {
            "type": "integer",
            "format": "int64",
            "description": "Records dropped by buffer overflow/backpressure policy"
          },
          "sinkQueueHighWater": {
            "type": "integer",
            "description": "Peak observed sink queue depth"
          },
          "sinkBlockedMicrosTotal": {
            "type": "integer",
            "format": "int64",
            "description": "Microseconds execution loop blocked on sink capacity"
          },
          "dlqRecordsTotal": {
            "type": "integer",
            "format": "int64",
            "description": "Total records routed to dead-letter queue"
          }
        },
        "additionalProperties": true
      },
      "RuleExceptionStatus": {
        "type": "object",
        "required": [
          "status",
          "last_exception",
          "exceptions_total"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "last_exception": {
            "type": "string"
          },
          "exceptions_total": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "RuleTopology": {
        "type": "object",
        "required": [
          "sources",
          "edges"
        ],
        "properties": {
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "edges": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {}
            }
          }
        }
      },
      "RuleValidationResponse": {
        "type": "object",
        "required": [
          "valid",
          "sources"
        ],
        "properties": {
          "valid": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "RuleTagRequest": {
        "type": "object",
        "required": [
          "tags"
        ],
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false,
        "example": {
          "tags": [
            "t1",
            "t2"
          ]
        }
      },
      "RuleTagMatchResponse": {
        "type": "object",
        "properties": {
          "rules": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "BulkOperationResponse": {
        "type": "object",
        "required": [
          "ruleId",
          "success"
        ],
        "properties": {
          "ruleId": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          },
          "error": {
            "type": "string"
          }
        }
      },
      "RuleStateUpdateRequest": {
        "type": "object",
        "required": [
          "type",
          "params"
        ],
        "properties": {
          "type": {
            "type": "integer",
            "enum": [
              1
            ],
            "description": "Only update-offset (1) is implemented in v2.4.1."
          },
          "params": {
            "type": "object",
            "required": [
              "streamName",
              "input"
            ],
            "properties": {
              "streamName": {
                "type": "string"
              },
              "input": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      },
      "TraceEnableRequest": {
        "type": "object",
        "required": [
          "strategy"
        ],
        "properties": {
          "strategy": {
            "type": "string",
            "enum": [
              "always",
              "head"
            ]
          }
        },
        "additionalProperties": false
      },
      "TracerRequest": {
        "type": "object",
        "required": [
          "action"
        ],
        "properties": {
          "service_name": {
            "type": "string"
          },
          "action": {
            "type": "string",
            "enum": [
              "start",
              "stop"
            ]
          },
          "collector_url": {
            "type": "string",
            "format": "uri"
          }
        },
        "additionalProperties": false
      },
      "TraceLink": {
        "type": "object",
        "properties": {
          "TraceID": {
            "type": "string"
          }
        }
      },
      "TraceSpan": {
        "type": "object",
        "required": [
          "name",
          "traceID",
          "spanID",
          "startTime",
          "endTime",
          "ruleID",
          "ChildSpan"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "traceID": {
            "type": "string"
          },
          "spanID": {
            "type": "string"
          },
          "parentSpanID": {
            "type": "string"
          },
          "attribute": {
            "type": "object",
            "additionalProperties": true
          },
          "links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraceLink"
            }
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "format": "date-time"
          },
          "ruleID": {
            "type": "string"
          },
          "ChildSpan": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraceSpan"
            }
          }
        }
      },
      "ImportReference": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string"
          },
          "file": {
            "type": "string",
            "description": "http(s) or file URI readable by the eKuiper server."
          }
        },
        "oneOf": [
          {
            "required": [
              "content"
            ]
          },
          {
            "required": [
              "file"
            ]
          }
        ],
        "additionalProperties": false
      },
      "Configuration": {
        "type": "object",
        "required": [
          "streams",
          "tables",
          "rules",
          "nativePlugins",
          "portablePlugins",
          "sourceConfig",
          "sinkConfig",
          "connectionConfig",
          "Service",
          "Schema",
          "uploads",
          "scripts"
        ],
        "properties": {
          "streams": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "tables": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "rules": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "nativePlugins": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "portablePlugins": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "sourceConfig": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "sinkConfig": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "connectionConfig": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "Service": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "Schema": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "uploads": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "scripts": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "ImportConfigurationStatus": {
        "type": "object",
        "required": [
          "ErrorMsg",
          "ConfigResponse"
        ],
        "properties": {
          "ErrorMsg": {
            "type": "string"
          },
          "ConfigResponse": {
            "$ref": "#/components/schemas/Configuration"
          }
        }
      },
      "AsyncTaskId": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string"
          }
        }
      },
      "AsyncTaskStatus": {
        "type": "object",
        "required": [
          "id",
          "status",
          "message",
          "createdTimestamp",
          "updatedTimestamp"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "register",
              "running",
              "finish",
              "error",
              "cancel"
            ]
          },
          "message": {
            "type": "string"
          },
          "createdTimestamp": {
            "type": "integer",
            "format": "int64"
          },
          "updatedTimestamp": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ConnectionRequest": {
        "type": "object",
        "required": [
          "id",
          "typ",
          "props"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "typ": {
            "type": "string",
            "enum": [
              "mqtt",
              "nng",
              "httppush",
              "websocket",
              "edgex",
              "sql",
              "kafka"
            ]
          },
          "props": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "ConnectionResponse": {
        "type": "object",
        "required": [
          "id",
          "typ",
          "props",
          "isNamed"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "typ": {
            "type": "string"
          },
          "props": {
            "type": "object",
            "additionalProperties": true,
            "description": "Connector-specific properties. eKuiper returns stored values and may expose plaintext credentials; protect this endpoint and never log or publish responses."
          },
          "isNamed": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "err": {
            "type": "string"
          },
          "refCount": {
            "type": "integer"
          }
        }
      },
      "MockSource": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "interval": {
            "type": "integer"
          },
          "loop": {
            "type": "boolean"
          }
        }
      },
      "RuleTestRequest": {
        "type": "object",
        "required": [
          "id",
          "sql"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "sql": {
            "type": "string"
          },
          "mockSource": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/MockSource"
            }
          },
          "sinkProps": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "PluginInstallRequest": {
        "type": "object",
        "required": [
          "name",
          "file"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "file": {
            "type": "string",
            "description": "http(s) or file URI of a plugin zip."
          },
          "shellParas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "FunctionPluginInstallRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PluginInstallRequest"
          },
          {
            "type": "object",
            "properties": {
              "functions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        ]
      },
      "NativePluginInfo": {
        "type": "object",
        "required": [
          "name",
          "version"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "functions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "FunctionRegistration": {
        "type": "object",
        "properties": {
          "functions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UdfOwner": {
        "type": "object",
        "required": [
          "name",
          "plugin"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "plugin": {
            "type": "string"
          }
        }
      },
      "PortablePluginInfo": {
        "type": "object",
        "required": [
          "name",
          "version",
          "language",
          "executable",
          "sources",
          "sinks",
          "functions"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "enum": [
              "go",
              "python"
            ]
          },
          "executable": {
            "type": "string"
          },
          "virtualEnvType": {
            "type": "string"
          },
          "env": {
            "type": "string"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sinks": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "functions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PortablePluginStatus": {
        "type": "object",
        "required": [
          "refCount",
          "status",
          "errMsg"
        ],
        "properties": {
          "refCount": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "initializing",
              "error",
              "stop"
            ]
          },
          "errMsg": {
            "type": "string"
          }
        }
      },
      "SchemaInfo": {
        "type": "object",
        "required": [
          "type",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "protobuf",
              "custom"
            ]
          },
          "name": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "file": {
            "type": "string"
          },
          "soFile": {
            "type": "string"
          },
          "version": {
            "type": "string",
            "description": "Updates are accepted only when lexically greater than the stored version."
          }
        }
      },
      "SchemaUploadResponse": {
        "type": "object",
        "required": [
          "type",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "JavascriptUdf": {
        "type": "object",
        "required": [
          "id",
          "description",
          "script",
          "isAgg"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "script": {
            "type": "string"
          },
          "isAgg": {
            "type": "boolean"
          }
        }
      },
      "ServiceRequest": {
        "type": "object",
        "required": [
          "name",
          "file"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "file": {
            "type": "string",
            "description": "http(s) or file URI of the service zip."
          }
        }
      },
      "ExternalFunction": {
        "type": "object",
        "required": [
          "ServiceName",
          "InterfaceName",
          "Addr",
          "MethodName",
          "FuncName"
        ],
        "properties": {
          "ServiceName": {
            "type": "string"
          },
          "InterfaceName": {
            "type": "string"
          },
          "Addr": {
            "type": "string"
          },
          "MethodName": {
            "type": "string"
          },
          "FuncName": {
            "type": "string"
          }
        }
      },
      "ServiceDetail": {
        "type": "object",
        "properties": {
          "About": {
            "type": "object",
            "additionalProperties": true
          },
          "Interfaces": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "MetadataPluginSummary": {
        "type": "object",
        "required": [
          "name",
          "about"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "about": {
            "type": "object",
            "additionalProperties": true
          },
          "type": {
            "type": "string"
          }
        }
      },
      "MetadataDocument": {
        "type": "object",
        "additionalProperties": true
      },
      "ConfigKeyMap": {
        "type": "object",
        "additionalProperties": {
          "type": "object",
          "additionalProperties": true
        },
        "description": "Stored configuration values keyed by configuration name. In v2.4.1 these responses can contain plaintext credentials; do not expose, log, or publish them."
      },
      "UploadJsonRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "file": {
            "type": "string",
            "description": "HTTP file URL."
          }
        },
        "anyOf": [
          {
            "required": [
              "content"
            ]
          },
          {
            "required": [
              "file"
            ]
          }
        ],
        "additionalProperties": false
      },
      "SchemaWriteRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "file": {
            "type": "string",
            "description": "http(s) or file URI; may reference a schema file or supported zip archive."
          },
          "soFile": {
            "type": "string",
            "description": "Shared-object URI required for a custom schema."
          },
          "version": {
            "type": "string"
          }
        },
        "description": "For protobuf, exactly one of content or file is required. For custom, soFile is required. On PUT, omitted type/name retain the path values; supplied values must match the path.",
        "additionalProperties": false,
        "anyOf": [
          {
            "required": [
              "content"
            ]
          },
          {
            "required": [
              "file"
            ]
          },
          {
            "required": [
              "soFile"
            ]
          }
        ]
      },
      "YamlImportRequest": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string",
            "description": "YAML configuration text."
          },
          "file": {
            "type": "string",
            "description": "http(s) or file URI of YAML configuration."
          },
          "partial": {
            "type": "boolean",
            "description": "Decoded but not implemented in v2.4.1."
          },
          "reboot": {
            "type": "boolean",
            "description": "Decoded but not implemented in v2.4.1."
          }
        },
        "oneOf": [
          {
            "required": [
              "content"
            ]
          },
          {
            "required": [
              "file"
            ]
          }
        ],
        "additionalProperties": false
      },
      "UpdatableResources": {
        "type": "object",
        "required": [
          "sources",
          "sinks"
        ],
        "properties": {
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "string",
                "description": "Plugin type that owns the resource id."
              }
            }
          },
          "sinks": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "string",
                "description": "Plugin type that owns the resource id."
              }
            }
          }
        }
      },
      "SourceResourceConfig": {
        "type": "object",
        "additionalProperties": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "RuleCreateRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Rule"
          },
          {
            "type": "object",
            "required": [
              "id"
            ]
          }
        ]
      },
      "SchemaCreateRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/SchemaWriteRequest"
          },
          {
            "type": "object",
            "required": [
              "name"
            ]
          }
        ]
      },
      "ServiceUpdateRequest": {
        "type": "object",
        "required": [
          "file"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Optional on update; the handler uses the path name."
          },
          "file": {
            "type": "string",
            "description": "http(s) or file URI of the service zip."
          }
        },
        "additionalProperties": false
      }
    }
  }
}