aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/toaster/toastergui/api.py54
-rw-r--r--bitbake/lib/toaster/toastergui/urls.py3
2 files changed, 57 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/api.py b/bitbake/lib/toaster/toastergui/api.py
index 5b035505c2f..67391d93906 100644
--- a/bitbake/lib/toaster/toastergui/api.py
+++ b/bitbake/lib/toaster/toastergui/api.py
@@ -28,6 +28,7 @@ from orm.models import LayerVersionDependency, LayerSource, ProjectLayer
from orm.models import Recipe, CustomImageRecipe, CustomImagePackage
from orm.models import Layer, Target, Package, Package_Dependency
from orm.models import ProjectVariable
+from orm.models import LogMessage
from bldcontrol.models import BuildRequest
from bldcontrol import bbcontroller
@@ -1023,3 +1024,56 @@ class XhrBuild(View):
"error": "ok",
"gotoUrl": reverse("projectbuilds", args=(project.pk,))
})
+
+
+
+class XhrProjectBuild(View):
+ """ Get Build information
+ Methods: GET
+ """
+ def get(self, request, *args, **kwargs):
+ """
+ Get Build information
+
+ Method: GET
+ Entry point: /xhr_projectBuild
+ """
+
+ try:
+ ret = []
+ logs = []
+ logmessage = LogMessage.objects.all()
+
+
+ for b in Build.objects.all():
+
+ logs[:] = []
+ for log in LogMessage.objects.filter(build=b.pk):
+ logs.append({"message" : log.message,
+ "task" : log.task,
+ "level" : log.level
+ })
+
+ ret.append({
+ "buildId": b.pk,
+ "buildName" : b.build_name,
+ "buildOutcome": b.outcome,
+ "buildMachine" : b.machine,
+ "buildDistro" : b.distro,
+ "buildDistroVersion" : b.distro_version,
+ "buildBitbakeVersion" : b.bitbake_version,
+ "buildLogPath" : b.cooker_log_path,
+ "buildProjectId" : b.project.pk,
+ "buildProjectName" : b.project.name,
+ "buildLogs" : logs
+ })
+
+ except Build.DoesNotExist:
+ return error_response("No Builds")
+
+ return JsonResponse(ret,safe=False)
+
+
+
+
+
diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py
index d92f190aed8..845e997991c 100644
--- a/bitbake/lib/toaster/toastergui/urls.py
+++ b/bitbake/lib/toaster/toastergui/urls.py
@@ -235,6 +235,9 @@ urlpatterns = patterns('toastergui.views',
url(r'^mostrecentbuilds$', widgets.MostRecentBuildsView.as_view(),
name='most_recent_builds'),
+ url(r'xhr_projectBuild/', api.XhrProjectBuild.as_view(),
+ name='xhr_projectBuild'),
+
# default redirection
url(r'^$', RedirectView.as_view(url='landing', permanent=True)),
)