Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-44304

node build history is missing REST API

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
    • Environment:
      Jenkins ver. 2.46.2
    • Similar Issues:

      Description

      Hello there! The view at /computer/${NODE}/builds is pretty useful, but I haven't found a way to access this via the REST API. Much like I can access /computer/${NODE}/api/xml, I'd expect to be able to hit /computer/${NODE}/builds/api/xml, but it doesn't work.

       

      Is there a way to access this over HTTP that I'm missing? The goal would be to get of recent builds from the node which include status and time since, like the table does.

        Attachments

          Activity

          Hide
          netjunki Benjamin Lau added a comment -

          mcrooney in case you didn't discover this yourself (or to that next poor sap who runs across this...) you can get some of this data by pulling down the rss feeds for the computer.

          https://jenkins/computer/myslave/rssAll
          https://jenkins/computer/myslave/rssFailed
          https://jenkins/computer/myslave/rssLatest #though couldn't test this since it seems to be broken on my jenkins instance

          I was working with this using one of the Python Jenkins binding (this one) and found this to be a pretty nice solution to working with that data in combination with the feedparser python module.

          import jenkins
          import feedparser
          server = jenkins.Jenkins(os.environ['JENKINS_SERVER'], username=os.environ['JENKINS_USERNAME'], password=os.environ['JENKINS_PASSWORD'])
          failedbuilds_rss = server.jenkins_open(Request("{}/computer/{}/rssFailed".format(os.environ['JENKINS_SERVER'],"myslave")))
          failedbuilds = feedparser.parse(failedbuilds_rss)
          for build in failedbuilds.entries:
              print build

          Hopefully this'll be useful to somebody.

           

          Show
          netjunki Benjamin Lau added a comment - mcrooney in case you didn't discover this yourself (or to that next poor sap who runs across this...) you can get some of this data by pulling down the rss feeds for the computer. https://jenkins/computer/myslave/rssAll https://jenkins/computer/myslave/rssFailed https://jenkins/computer/myslave/rssLatest #though couldn't test this since it seems to be broken on my jenkins instance I was working with this using one of the Python Jenkins binding ( this one ) and found this to be a pretty nice solution to working with that data in combination with the feedparser python module. import jenkins import feedparser server = jenkins.Jenkins(os.environ[ 'JENKINS_SERVER' ], username=os.environ[ 'JENKINS_USERNAME' ], password=os.environ[ 'JENKINS_PASSWORD' ]) failedbuilds_rss = server.jenkins_open(Request( "{}/computer/{}/rssFailed" .format(os.environ[ 'JENKINS_SERVER' ], "myslave" ))) failedbuilds = feedparser.parse(failedbuilds_rss) for build in failedbuilds.entries: print build Hopefully this'll be useful to somebody.  
          Hide
          deiga Timo Sand added a comment -

          The RSS feed only has information on jobs specifically assigned to nodes, but if the node just runs whatever, then the RSS feed is empty.

          Is there any other way to programatically access this data from an API?

          Show
          deiga Timo Sand added a comment - The RSS feed only has information on jobs specifically assigned to nodes, but if the node just runs whatever, then the RSS feed is empty. Is there any other way to programatically access this data from an API?

            People

            • Assignee:
              Unassigned
              Reporter:
              mcrooney mcrooney
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: