It's all about the answers!

Ask a question

How to query all build engines and get the build definitions associated to it in Java API?


Karthik Krishnan (8805112159) | asked Aug 09 '17, 5:26 a.m.

I want to analyze the load on each build engines and rearrange some build definitions to some other build engines.


To do this which I want to get all available Build engines in a given PA and then get all build definitions associated to it.

How can i do this with Plain Java API? 

we have 50+ Build engines and doing this manually is tough and also want to do the same in future too.

2 answers



permanent link
Ralph Schoon (62.7k33643) | answered Aug 09 '17, 5:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Comments
Karthik Krishnan commented Aug 10 '17, 11:43 a.m.

Thanks Ralph for the pointers.


I also found https://jazz.net/forum/questions/88881/how-to-get-the-iteambuildservice and this is mostly what I need. 

Now that I have the build engines, I am able to get buildEngine.getSupportedBuildDefinitions() just that I am unable o get the ID of the build definition returned. I am exploring that.


permanent link
Karthik Krishnan (8805112159) | answered Aug 11 '17, 5:11 a.m.
edited Aug 22 '17, 4:49 a.m.

I found https://jazz.net/forum/questions/88881/how-to-get-the-iteambuildservice and this is mostly what I need. 

With the piece of code in the above link, the following code will give all the build definitions from the Engine.

List<IBuildDefinitionHandle> lstBDefs = buildEngine.getSupportedBuildDefinitions();
for (IBuildDefinitionHandle lBDef : lstBDefs)
{
     IBuildDefinition bd = (IBuildDefinition)auditableClient.fetchCurrentAuditable(lBDef, ItemProfile.createFullProfile(IBuildDefinition.ITEM_TYPE), null);
     System.out.println(buildEngine.getId() + ";" + buildEngine.isActive() + ";" + bd.getId());
}

Thanks @Ralph and @sdetweil

Your answer


Register or to post your answer.