检查通过 travis API v3 请求的作业的状态 [英] check status of job requested through travis API v3
本文介绍了检查通过 travis API v3 请求的作业的状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我使用 提交了一个请求travis api v3 指南并得到如下回复:
So I've submitted a request using travis api v3 guide and got response like:
{
"@type": "pending",
"remaining_requests": 10,
"repository": {
"@type": "repository",
"@href": "/repo/111111111",
"@representation": "minimal",
"id": 111111111,
"name": "my-111111111",
"slug": "me/my111111111"
},
"request": {
"repository": {
"id": 222222,
"owner_name": "me",
"name": "my-111111111"
},
"user": {
"id": 333333
},
"id": 444444,
"message": "Cool message",
"branch": "master"
},
"resource_type": "request"
}
那么现在获取这些工作状态的方法是什么?我想我需要使用 id 444444,但我在下面收到错误,不确定我做错了什么:
So what is the way to get status of those jobs now? I suppose that I need to use id 444444, but I am getting error below, not sure what I am doing wrong:
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token mycooltoken" \
https://api.travis-ci.org/repo/111111111/requests/444444
{
"@type": "error",
"error_type": "not_found",
"error_message": "resource not found (or insufficient access)"
}
有人可以指出我在哪里可以找到示例或任何其他想法吗?
Can somebody point me where to look for examples or any other idea?
推荐答案
哦,抱歉混淆了 - 不知何故我忽略了我必须将 POST 更改为 GET;通过这个简单的修复,一切正常.
Oh sorry for confusion - somehow I overlooked that I must change POST to GET; with that simple fix everything worked fine.
这篇关于检查通过 travis API v3 请求的作业的状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文