从Jenkins,如何获取JSON中当前正在运行的作业的列表? [英] From Jenkins, how do I get a list of the currently running jobs in JSON?

查看:195
本文介绍了从Jenkins,如何获取JSON中当前正在运行的作业的列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过Remote API找到有关我的Jenkins服务器的几乎所有信息,而不是当前正在运行的作业的列表.

I can find out just about everything about my Jenkins server via the Remote API, but not the list of currently running jobs.

这个

http://my-jenkins/computer/api/json

http://my-jenkins/computer/(master)/api/json

这似乎是最合乎逻辑的选择,但他们却没有说出(实际上是工作数量)工作.

Would seem like the most logical choices, but they say nothing (other than the count of jobs) about which jobs are actually running.

推荐答案

我有一个使用查看作业过滤器插件,它仅过滤当前正在运行的作业,然后您可以在查看页面上使用/api/json来仅查看正在运行的作业.我也有一个用于流产,不稳定等.

I have a view defined using View Job Filters Plugin that filters just currently running jobs, then you can use /api/json on the view page to see just the jobs that are running. I also have one for aborted, unstable, etc.

更新

选择编辑视图 工作过滤器 添加工作过滤器  ▼ 构建状态过滤器
  构建状态:  ☑当前正在建造
  匹配类型排除不匹配-...

Select Edit ViewJob FiltersAdd Job Filter   ▼Build Statuses Filter
  Build Statuses:   ☑ Currently Building
  Match Type:   Exclude Unmatched - ...

这篇关于从Jenkins,如何获取JSON中当前正在运行的作业的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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