python-jenkins抓取jenk

2023-01-31 00:01:42 python

python-jenkins抓取jenkins网页信息

#!/usr/bin/Python

#coding:utf-8

import jenkins

server = Jenkins('Http://10.0.1.2:8080/jenkins', username='ming', passWord='xxxxxx')

print(server.jobs_count()) (显示job个数)

print(server.get_nodes()) (显示所有slave)

nodes = server.get_nodes()
print(len(nodes)) (显示slave个数,有带master)

print(server.keys())
print(server.get_jobs_list()) (显示jenkins上所有job信息)

:wq

相关文章