gpt4 book ai didi

json - VS402881 : No artifact version is specified corresponding to artifact source 'MyBuild.' Release Management vNext REST API

转载 作者:行者123 更新时间:2023-12-04 19:50:36 27 4
gpt4 key购买 nike

我正在使用 TFS 2015.2 RTM,我刚刚发现 Release Management vNext REST API 在本地 2.2-preview.1 中。我想创建一个版本,但我不知道自 documentation 以来放入 POST 请求正文的确切 JSON仅适用于 VSTS。

当我发送请求时,我收到错误消息:

VS402881: No artifact version is specified corresponding to artifact source 'MyBuild.' Specify a valid value and try again. 

这是JSON:
$body = @"
{
definitionId": 1,
"description": "test",
"artifacts": [
{
"alias": "Tailspin Toys",
"version": {
"id": 147,
},
"instanceReference": {
"id": 5
}
}
]
}
"@

这是 Invoke-RestMethod 命令:
$releaseResponse = Invoke-RestMethod -Method Post -Credential $credential -ContentType application/json -Uri $postUri -Body $body

我缺少哪些 JSON 项?如果文档没有缺少的内容,我如何找到要放入 JSON 正文的内容?

最佳答案

是的,当前版本的 VSTS API 和 TFS 2015.2 API 之间存在一些差异。但是除了极少数 API 之外,大多数 API 都应该可以工作。这是documentation link .

以下是创建发布所需的 JSON。
所需的 JSON 需要具有 nameinstanceReference尽管它对于当前版本的 VSTS API 是可选的。

{
"definitionId": 1,
"description": "test",
"artifacts": [
{
"alias": "Tailspin Toys",
"instanceReference": {
"id": "5",
"name": "<build_name>"
}
}
]
}

关于json - VS402881 : No artifact version is specified corresponding to artifact source 'MyBuild.' Release Management vNext REST API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36635473/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com