0

I know below few of the Jenkins RestAPI to execute script, schedule job and check status.

a) https:///scriptText

b) https:///job//build"

c) https:///job//job//api/json

But I want to perform more operations like get list of builds and build details, current running builds, stop build, update build etc.

Is any official documentation available for these API. I got https://wiki.jenkins.io/display/JENKINS/Remote+access+API , but its doesn't list the all API.

va1bhav
  • 365
  • 1
  • 5
  • 21
  • Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. – Liam Aug 01 '18 at 13:59

1 Answers1

0

I wrote a system a couple of years ago they put an entire platform (built and deployed by Jenkins on a page.)

I did not go looking for documentation. I don't think any really exists outside of the REST API link in the footer in Jenkins itself.

I learnt what was avaiable simply by adding api/json on the end of whatever page I was interested in seeing what information was exposed. I then wrote the system around the information exposed.

I just copied the json and pasted it into json2csharp.com. (Remember to change RootObject to a meaningful name.)

Then I used the Json.NET Nuget package to call the REST API with C# and deserialised the resultant json into the class model that json2csharp gave me.

Works a treat!

More detailed information here.

Andrew Gray
  • 3,593
  • 3
  • 35
  • 62