使用 curl 和 http rest api 安装 arangodb 服务

Install arangodb service using curl and the http rest api

我在注册文件系统上已有的服务时遇到问题。我知道我以前能做到,但我已经失去了技巧。

我试过这个:

curl
  -H "Content-Type: application/json"
  -X POST
  -d @install-data.json 
  http://localhost:8529/_api/foxx

安装-data.json

{
    "configuration": {
        "engines": {
            "arangodb": "^3.0.0"
        },
        "main": "index.js"
    },
    "source": "/var/opt/foxx/getting-started.zip"
}

服务包位于 /var/opt/foxx/getting-started.zip

结果是

{"error":true,"errorNum":3013,"errorMessage":"failed to parse service options\nDetails: Unexpected token o in JSON at position 1","code":400}

目前在解析请求正文中的 configurationdependencies 时,HTTP API 中存在错误。 Github 期 here。 您在配置中给定的参数也应该存在于您的服务 manifest.json 中,因此无需在您的请求中设置它们。对你来说,如果你只 post

它应该工作
{
  "source": "/var/opt/foxx/getting-started.zip"
}