检查通过travis API v3请求的作业状态 [英] check status of job requested through travis API v3

查看:77
本文介绍了检查通过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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆