m00*_*0.0 7 rest tfs json ms-release-management
我正在使用 TFS 2015.2 RTM,我刚刚发现 Release Management vNext REST API 在本地 2.2-preview.1 中。我想创建一个版本,但我不知道放入 POST 请求正文的确切 JSON,因为该文档仅适用于 VSTS。
当我发送请求时,我收到错误消息:
VS402881: No artifact version is specified corresponding to artifact source 'MyBuild.' Specify a valid value and try again.
Run Code Online (Sandbox Code Playgroud)
这是JSON:
$body = @"
{
definitionId": 1,
"description": "test",
"artifacts": [
{
"alias": "Tailspin Toys",
"version": {
"id": 147,
},
"instanceReference": {
"id": 5
}
}
]
}
"@
Run Code Online (Sandbox Code Playgroud)
这是 Invoke-RestMethod 命令:
$releaseResponse = Invoke-RestMethod -Method Post -Credential $credential -ContentType application/json -Uri $postUri -Body $body
Run Code Online (Sandbox Code Playgroud)
我缺少哪些 JSON 项?如果文档没有缺少的内容,我如何找到要放入 JSON 正文的内容?
是的,当前版本的 VSTS API 和 TFS 2015.2 API 之间存在一些差异。但是除了极少数 API 之外,大多数 API 都应该可以工作。这是文档链接。
以下是创建发布所需的 JSON。尽管当前版本的 VSTS API 是可选的name
,instanceReference
但必需的 JSON 需要有in 。
{
"definitionId": 1,
"description": "test",
"artifacts": [
{
"alias": "Tailspin Toys",
"instanceReference": {
"id": "5",
"name": "<build_name>"
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2704 次 |
最近记录: |