The eKuiper REST api for configuration file uploads allows you to upload configuration files and list all uploaded files.

Upload a configuration file

The API supports to upload a local file or provide the text content of file. The upload request will save the file into your ${configPath}/uploads. It will override the existed file of the same name. The response is the absolute path of the uploaded file which you can refer in other configurations.

Upload by a file

The API accepts a multipart file upload requests. Below is an example html file to upload file to http://127.0.0.1:9081/config/uploads. In the form data, the file input name must be uploadFile.

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  7. <title>Upload File</title>
  8. </head>
  9. <body>
  10. <form
  11. enctype="multipart/form-data"
  12. action="http://127.0.0.1:9081/config/uploads"
  13. method="post"
  14. >
  15. <input type="file" name="uploadFile" />
  16. <input type="submit" value="upload" />
  17. </form>
  18. </body>
  19. </html>

Upload by content

Provide the text content and file name to create a configuration file.

  1. POST http://localhost:9081/config/uploads
  2. {
  3. "name": "my.json",
  4. "content": "{\"hello\":\"world\"}"
  5. }

Show uploaded file list

The API is used for displaying all files in the ${configPath}/uploads path.

  1. GET http://localhost:9081/config/uploads

Response Sample:

  1. [
  2. "/ekuiper/etc/uploads/zk.gif",
  3. "/ekuiper/etc/uploads/abc.gif"
  4. ]

Delete an uploaded file

The API is used for deleting a file in the ${configPath}/uploads path.

  1. DELETE http://localhost:9081/config/uploads/{fileName}