Thanks Ulli, 
i just started using it.
Here is what i am trying to do. Its a bit advanced, but if i get this to work, 
then i can really add relevant content to one screen on Jenkins.

1. Use Jenkins Python 
API https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API
2. The API is accessable via http://192.168.1.104:8080/api/?
3. so when i use http://192.168.1.104:8080/job/PYGMENTS/api/json
i get the following in JSON format:

{"actions":[{},{},{},{},{},{},{},{},{}],"description":"","displayName":"PYGMENTS","displayNameOrNull":null,"name":"PYGMENTS","url":"http://192.168.1.104:8080/job/PYGMENTS/","buildable":true,"builds":[{"number":21,"url":"http://192.168.1.104:8080/job/PYGMENTS/21/"},{"number":16,"url":"http://192.168.1.104:8080/job/PYGMENTS/16/"},{"number":15,"url":"http://192.168.1.104:8080/job/PYGMENTS/15/"},{"number":14,"url":"http://192.168.1.104:8080/job/PYGMENTS/14/"},{"number":13,"url":"http://192.168.1.104:8080/job/PYGMENTS/13/"},{"number":12,"url":"http://192.168.1.104:8080/job/PYGMENTS/12/"},{"number":11,"url":"http://192.168.1.104:8080/job/PYGMENTS/11/"},{"number":10,"url":"http://192.168.1.104:8080/job/PYGMENTS/10/"},{"number":9,"url":"http://192.168.1.104:8080/job/PYGMENTS/9/"},{"number":8,"url":"http://192.168.1.104:8080/job/PYGMENTS/8/"}],"color":"yellow","firstBuild":{"number":8,"url":"http://192.168.1.104:8080/job/PYGMENTS/8/"},"healthReport":[{"descripti
on":"No xml report files found for 
cpd","iconUrl":"health-00to19.png","score":0},{"description":"Cobertura 
Coverage: 60% (8885/14925) 
Lines","iconUrl":"health-60to79.png","score":75},{"description":"Build 
stability: 1 out of the last 5 builds 
failed.","iconUrl":"health-60to79.png","score":80},{"description":"Test Result: 
0 tests failing out of a total of 768
 
tests.","iconUrl":"health-80plus.png","score":100}],"inQueue":false,"keepDependencies":false,"lastBuild":{"number":21,"url":"http://192.168.1.104:8080/job/PYGMENTS/21/"},"lastCompletedBuild":{"number":21,"url":"http://192.168.1.104:8080/job/PYGMENTS/21/"},"lastFailedBuild":{"number":16,"url":"http://192.168.1.104:8080/job/PYGMENTS/16/"},"lastStableBuild":{"number":13,"url":"http://192.168.1.104:8080/job/PYGMENTS/13/"},"lastSuccessfulBuild":{"number":21,"url":"http://192.168.1.104:8080/job/PYGMENTS/21/"},"lastUnstableBuild":{"number":21,"url":"http://192.168.1.104:8080/job/PYGMENTS/21/"},"lastUnsuccessfulBuild":{"number":21,"url":"http://192.168.1.104:8080/job/PYGMENTS/21/"},"nextBuildNumber":22,"property":[{}],"queueItem":null,"concurrentBuild":false,"downstreamProjects":[],"scm":{},"upstreamProjects":[]}

Now, if we see as an example:

https://wiki.jenkins-ci.org/display/JENKINS/Add+a+Google-O-Meter+to+a+view

if we add the following Javascript in the description:
<script> var xmlhttp = null; if (window.XMLHttpRequest) xmlhttp = new 
XMLHttpRequest(); else if (window.ActiveXObject) { if (new 
ActiveXObject("Microsoft.XMLHTTP")) xmlhttp = new 
ActiveXObject("Microsoft.XMLHTTP"); else xmlhttp = new 
ActiveXObject("Msxml2.XMLHTTP");
} var url = document.location + 
"/api/xml?xpath=count%28//job[color=%22blue%22]%29div+count%28//job%29" 
xmlhttp.open("GET", url, false);//false means synchronous xmlhttp.send() var 
buildSuccessFraction= xmlhttp.responseText
document.write('<img 
src="http://chart.apis.google.com/chart?chs=320x160&cht=gom&chd=t:' + 
buildSuccessFraction * 100.0 + '&chxt=x,y&chxl=y|0:||1:|failure|success">') 
</script>

I understand this is wrong example since this is XML, but i could not find a 
JSON Example.
But you get the picture in this way we can create many dashboards, like 
annotated timeline:

https://developers.google.com/chart/interactive/docs/gallery/annotatedtimeline#Example


applied to Jenkins builds.

Thanks,
-Kamal.



>________________________________
> From: Ulli Hafner <ullrich.haf...@gmail.com>
>To: jenkinsci-users@googlegroups.com 
>Sent: Sunday, June 17, 2012 12:13 PM
>Subject: Re: Jenkins plugin to create dashboards
> 
>
>On 06/16/2012 09:13 PM, Kamal Ahmed wrote: 
>Hi, 
>>Is there a plugin, which i can use to create dashboards that can display 
>>reports from various plugins on one page.
>>Thanks,
>>-Kamal.
>>
>>
There is the dashboard view plug-in: 
https://wiki.jenkins-ci.org/display/JENKINS/Dashboard+View
>
>Ulli
>
>
>

Reply via email to