【发布时间】:2020-07-01 23:43:48
【问题描述】:
利用Watson Studio GUI,我可以毫无问题地创建Studio 项目并将其与git 存储库集成。我需要script这个过程。使用Watson Data API (2.23.1) 时,我确实可以使用.../transactional/v2/projects REST 调用创建项目,但该调用在其payload 中似乎没有任何git 相关信息。
创建项目后(尚未与git 集成),然后我尝试发出此REST 调用:
.../v2/asset_files/git_transactions/remote 传递新创建的项目。
它的有效载荷包含git 信息,所以我认为它是用来将项目与GIT 集成的:
{"repo_url": "https://github.ibm.com/orgn/xxxx.git","access_token":{"git_host":"GitHub Enterprise","token_value":"xxxxxxxxxxxxx" }}
但是这个调用总是失败:
{"code":400,"error":"Bad Request","reason":"Invalid request body, access_token format is not valid","message":"The server cannot or will not process the request due to an apparent client error (e.g. malformed request syntax)."}
消息中提到 access_token 格式无效,但我遵循 api 文档 wrt 格式。
任何指导将不胜感激。
【问题讨论】:
标签: git rest watson-studio