Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python-jenkins or jenkinsapi for jenkins remote access API in python [closed]

Tags:

python

jenkins

There are two python packages exist for jenkins remote access API, I need help to compare those two packages, so I can judge which to use.

  • python-jenkins http://pythonhosted.org/python-jenkins/
  • JenkinsAPI: http://pythonhosted.org/jenkinsapi/

So far for my thoughts:

  • python-jenkins is quite simple interface and is part of new Ubuntu release, which means easy to use, mature enough for general usage.

  • JenkinsAPI is mentioned in Jenkins official document, it looks new, but it is more connected with jenkins API development as well.

What I needed so far:

  • https access and simple authentication (token inside jenkins) : document is not clear both
  • get list of installed plugins (possible for those packages ?)
  • get list of jobs
  • get config xml from job
  • .. may needed for other exposed remote Access API later

I want to stick with python API in high level module, if possible, avoid to use python-requests module

Any more ideas ?

EDIT refine the questions after the comments below

like image 252
Larry Cai Avatar asked Aug 06 '13 07:08

Larry Cai


People also ask

Does Jenkins have Python?

Python Jenkins is a python wrapper for the Jenkins REST API which aims to provide a more conventionally pythonic way of controlling a Jenkins server. It provides a higher-level API containing a number of convenience functions. We like to use python-jenkins to automate our Jenkins servers.

Does Jenkins have a REST API?

The jenkins-rest library is an object oriented Java project that provides access to the Jenkins REST API programmatically to some remote API Jenkins provides. It is built using the jclouds toolkit and can easily be extended to support more REST endpoints.


1 Answers

Given that both seem to have more or less the basic features and that JenkinsAPI is

  1. mentioned by the official documentation
  2. more active (jenkins-python history vs jenkinsapi history)

I would go for jenkinsapi.

As for token support, given the documentation, the fact that the code uses token in place of passwords for the API and is backward compatible with basic auth, I would say that any client that supports passwords will support tokens.

like image 107
coffeebreaks Avatar answered Oct 19 '22 10:10

coffeebreaks