作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 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.
$body = @"
{
definitionId": 1,
"description": "test",
"artifacts": [
{
"alias": "Tailspin Toys",
"version": {
"id": 147,
},
"instanceReference": {
"id": 5
}
}
]
}
"@
$releaseResponse = Invoke-RestMethod -Method Post -Credential $credential -ContentType application/json -Uri $postUri -Body $body
最佳答案
是的,当前版本的 VSTS API 和 TFS 2015.2 API 之间存在一些差异。但是除了极少数 API 之外,大多数 API 都应该可以工作。这是documentation link .
以下是创建发布所需的 JSON。
所需的 JSON 需要具有 name
在 instanceReference
尽管它对于当前版本的 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/
我是一名优秀的程序员,十分优秀!