• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • Jenkins ver. 2.46.2

      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.

          [JENKINS-44304] node build history is missing REST API

          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.

           

          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.  

          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?

          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?

            Unassigned Unassigned
            mcrooney mcrooney
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: