<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11794</bug_id>
          
          <creation_ts>2017-07-14 18:26:34 +0000</creation_ts>
          <short_desc>Add remote HTTP API to enable status aggregation of multiple Toaster instances</short_desc>
          <delta_ts>2017-08-01 02:01:37 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Toaster</product>
          <component>toaster</component>
          <version>2.4</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.4 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Konrad Scherer">konrad.scherer</reporter>
          <assigned_to name="David Reyna">david.reyna</assigned_to>
          <cc>jessica.zhang</cc>
    
    <cc>stanciux.mihail</cc>
          
          <qa_contact name="Libertad">libertad.gonzalez.de.la.cruz</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>75042</commentid>
    <comment_count>0</comment_count>
    <who name="Konrad Scherer">konrad.scherer</who>
    <bug_when>2017-07-14 18:26:34 +0000</bug_when>
    <thetext>I am creating a very basic Toaster Aggregation webapp for a build cluster of potentially 100+ machines. The idea is that each build will be running Toaster and the webapp will show a list of all currently running builds with progress information and a direct link to each individual toaster instance.

I suggest the following endpoints:

/health: Returns 200 if Toaster instance is healthy. This will help remove inactive Toaster instances from the webapp quickly.

/builds: Returns json with a list of names of currently running builds

/build/&lt;name&gt;: Returns json with build status for the build with &lt;name&gt;. This should include at minimum the current progress but could include any other relevant status information. If the status information is limited, this endpoint could be merged with the /builds endpoint.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75046</commentid>
    <comment_count>1</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2017-07-14 18:45:50 +0000</bug_when>
    <thetext>The patterns &quot;/builds&quot; and &quot;build/&lt;name&gt;&quot; are currently already used for the normal full GUI pages, so I will propose alternate names.

FYI, the Toaster URL patterns are encoded here:
    bitbake/lib/toaster/toastergui/urls.py</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75047</commentid>
    <comment_count>2</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2017-07-14 19:21:17 +0000</bug_when>
    <thetext>The counter proposal is:
 /api/builds
 /api/build/&lt;name&gt;

This makes sense in that it follows the Layer Index model for the back end data.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75122</commentid>
    <comment_count>3</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2017-07-18 22:29:30 +0000</bug_when>
    <thetext>Here are the example API calls and output, with the returned JSON data fanned out and sorted for clarity.

1) &quot;localhost:8000/toastergui/api/building&quot;

{&quot;count&quot;: 1, 
 &quot;building&quot;: [
   {&quot;id&quot;: 22, 
    &quot;name&quot;: &quot;20170718220837&quot;, 
    &quot;project&quot;: &quot;foo&quot;, 
    &quot;target&quot;: &quot;core-image-base&quot;, 
    &quot;distro&quot;: &quot;poky&quot;, 
    &quot;machine&quot;: &quot;qemux86&quot;, 
    &quot;start&quot;: &quot;2017-07-18T22:07:48.083Z&quot;, 
    &quot;seconds&quot;: &quot;32.783&quot;, 
    &quot;clone&quot;: &quot;1:1&quot;}
    &quot;parse&quot;: &quot;800:803&quot;, 
    &quot;task&quot;: &quot;0:0&quot;, 
    }]
}

2) &quot;localhost:8000/toastergui/api/builds&quot;

{&quot;count&quot;: 1,
 &quot;builds&quot;: [
   {&quot;id&quot;: 21, 
    &quot;outcome&quot;: &quot;Succeeded&quot;, 
    &quot;name&quot;: &quot;20170630232654&quot;, 
    &quot;project&quot;: &quot;Command line builds&quot;, 
    &quot;target&quot;: &quot;core-image-base&quot;, 
    &quot;distro&quot;: &quot;poky&quot;
    &quot;machine&quot;: &quot;qemux86&quot;, 
    &quot;start&quot;: &quot;2017-06-30T23:26:47.767Z&quot;, 
    &quot;stop&quot;: &quot;2017-06-30T23:35:32.753Z&quot;, 
    &quot;seconds&quot;: &quot;524.986&quot;, 
    &quot;errors&quot;: 0, 
    &quot;warnings&quot;: 0, 
   }]
}

3) &quot;localhost:8000/health&quot;

&quot;Ok&quot;

Source:
  &lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
    &lt;head&gt;&lt;title&gt;Toaster Health&lt;/title&gt;&lt;/head&gt;
    &lt;body&gt;Ok&lt;/body&gt;
  &lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75527</commentid>
    <comment_count>4</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2017-08-01 02:01:37 +0000</bug_when>
    <thetext>commit 3bc3d26b465b5af3cebc1d4c0d1fa382965c32cf</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>