我首先尝试通过邮递员调用rest API来使天蓝色,我调用get pipes 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": "\\"
}
]
}
好吧,假设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
}
更新
另外,如果我尝试添加到身体:
如中所述:
Azure REST API for running builds or pipelines
像这样:
{
"resources": {
"repositories:" {
"self": {
"refName": "xxx/ios_build_on_azure"
}
}
}
}
我得到了:
{
"$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
}