jenkinsapi抓取jenkins网页信息

2021-07-02 19:12

阅读:679

标签:python   http   pass   import   jobs   build   jenkin   follow   min   

jenkinsapi抓取jenkins网页信息

pip install jenkinsapi

vi aa.py

#!/usr/bin/python

#coding:utf-8

from jenkinsapi.jenkins import Jenkins
from jenkinsapi.build import Build

def get_server_instance():
server = Jenkins(‘http://10.0.1.2:8080/jenkins‘, username=‘ming‘, password=‘xxxxxx‘)
return server

server = get_server_instance()

print(server.version) (显示jenkins版本)

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

jenkinsapi抓取jenkins网页信息

标签:python   http   pass   import   jobs   build   jenkin   follow   min   

原文地址:http://blog.51cto.com/yangzhiming/2313626


评论


亲,登录后才可以留言!