use*_*898 4 rest postman azure-devops azure-pipelines azure-devops-rest-api
我尝试首先通过邮递员调用rest API到azure,我调用get pipelines API来获取管道id,结果是:2响应:
{
"count": 1,
"value": [
{
"_links": {
"self": {
"href": "https://dev.azure.com/xxx/5fcd81ac-534e-xxx/_apis/pipelines/2?revision=3"
},
"web": {
"href": "https://dev.azure.com/xxx/5fcd81ac-534e-xxx/_build/definition?definitionId=2"
}
},
"url": "https://dev.azure.com/xxx/5fcd81ac-534e-xxx/_apis/pipelines/2?revision=3",
"id": 2,
"revision": 3,
"name": "xxx.ios_build_on_azure",
"folder": "\\"
}
]
}
Run Code Online (Sandbox Code Playgroud)
好的,假设 id 是 2,因为我只有 1 个管道,我尝试调用运行 API 来启动这个管道,我得到了这个:

{
"$id": "1",
"innerException": null,
"message": "Value cannot be null.\r\nParameter name: runParameters",
"typeName": "System.ArgumentNullException, mscorlib",
"typeKey": "ArgumentNullException",
"errorCode": 0,
"eventId": 0
}
Run Code Online (Sandbox Code Playgroud)
如果我尝试添加到正文,也要更新:如:
Azure REST API for running builds or pipelines 中所述
像这样 :
{
"resources": {
"repositories:" {
"self": {
"refName": "xxx/ios_build_on_azure"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我越来越 :
{
"$id": "1",
"innerException": null,
"message": "TF400898: An Internal Error Occurred. Activity Id: xxxxx-6ff6-4786-bb2e-f12dxxxx.",
"typeName": "Newtonsoft.Json.JsonReaderException, Newtonsoft.Json",
"typeKey": "JsonReaderException",
"errorCode": 0,
"eventId": 0
}
Run Code Online (Sandbox Code Playgroud)
您可以在正文中尝试以下内容:
{
"resources": {
"repositories": {
"self": {
"refName": "refs/heads/branchname"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1340 次 |
| 最近记录: |