将 IBM Watson Knowledge Studio 模型标识添加到 IBM Discovery

Add IBM Watson Knowledge Studio model id to IBM Discovery

我尝试将我的 Watson Knowledge Studio 模型 ID 添加到我的 Watson Discovery 配置中 as described here

使用此命令下载我的配置效果很好:

curl -u "{username}":"{password}" "https://gateway.watsonplatform.net/discovery/api/v1/environments/{environment_id}/configurations/{configuration_id}?version=2016-12-01" > my_config.json

但是当我尝试使用此命令上传此文件而不进行任何更改时:

curl -X PUT -u "{username}":"{password}" -H "Content-Type: application/json" -F configuration=@my_config.json "https://gateway.watsonplatform.net/discovery/api/v1/environments/{environment_id}/configurations/{configuration_id}?version=2016-12-01"

我总会得到一个:

{
"code": 400,
"error": "Unexpected token -"
}

我是不是漏掉了什么?

经过IBM的帮助,看来是文档有误。 正确的命令是

curl -X PUT -u "{username}":"{password}" -H "Content-Type: application/json" -d@my_config.json "https://gateway.watsonplatform.net/discovery/api/v1/environments/{environment_ID}/configurations/{Configuration_ID}?version=2016-12-01"

我同意 - 文档 here 有误。 什么对我有用:

1) 从已编辑的 my_config.json 配置文件中删除配置 ID(因为这是默认配置)

2)插入一个新的配置(并获取一个新生成的配置Id>注意请求中没有设置配置id)

 curl -X POST -u {username}":"{password}"  -H "Content-Type: application/json" -d@my_config.json "https://gateway.watsonplatform.net/discovery/api/v1/environments/{environment_id}/configurations?version=2016-12-01"