【Jenkins】REST API
Jenkins REST API
https://www.jenkins.io/doc/book/using/remote-access-api/
Jenkins provides machine-consumable remote access API to its functionalities. Currently it comes in three flavors:
- XML
- JSON with JSONP support
- Python
What can you do with it?
Remote API can be used to do things like these:
- retrieve information from Jenkins for programmatic consumption.
- trigger a new build
- create/copy jobs
Python API wrappers
JenkinsAPI and Python-Jenkins, api4jenkins are object-oriented python wrappers for the Python REST API which aim to provide a more conventionally pythonic way of controlling a Jenkins server. It provides a higher-level API containing a number of convenience functions. Services offered currently include:
- Query the test-results of a completed build
- Get objects representing the latest builds of a job
- Search for artifacts by simple criteria
- Block until jobs are complete
- Install artifacts to custom-specified directory structures
- Authentication support for Jenkins instances
- Ability to search for builds by subversion revision
- Ability to add/remove/query Jenkins agents
JenkinsAPI
https://pypi.org/project/jenkinsapi/
Python-Jenkins
https://pypi.org/project/python-jenkins/
api4jenkins
https://pypi.org/project/api4jenkins/