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

UpdateCenter API / UpdateSite Bean: expose hasCoreUpdates() property

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins version = 2.332

      Hi,

      Would be nice to expose the data.hasCoreUpdates() property in the UpdateSite bean.

      This way it would be possible to access the value through the JSON document returned by the updateCenter/coreSource/api/json endpoint.

      This could prove to be handy for Jenkins management scenario

      I believe this should be pretty straightforward and as simple as adding the following lines to core/src/main/java/hudson/model/UpdateSite.java
       

      @ExportedBean
      public class UpdateSite {
         :
         :
           /**
            * Is there any core update available?
            */
           @Exported
           public boolean hasCoreUpdates() {
                Data data = getData();
                return data != null && data.hasCoreUpdates();
           }
        :
        ;
      } 

      Comments ?

      Alexis

            Unassigned Unassigned
            alexis_deruelle Alexis Deruelle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: