Rest API request to view all builds (/httpAuth/app/rest/builds/) is not working correctly?
I am using the following get request '/httpAuth/app/rest/builds/'
It returns:
<builds count="16" href="/httpAuth/app/rest/builds/">
</builds>
The problem is that when I look at my TeamCity server I see a lot of builds that are not being returned by the above command.
This is what I see in TeamCity (attached image shows a better view of the whats in TeamCity):
<build id="15856" buildTypeId="MasterAutomatedBuilds_Master" number="1363" status="SUCCESS" state="finished" href="/httpAuth/app/rest/builds/id:15856" webUrl="http://llama:8080/viewLog.html?buildId=15856&buildTypeId=MasterAutomatedBuilds_Master"/>
<build id="15855" buildTypeId="MediaRadarAutomatedBuilds_ProductionBugFixes" number="373" status="SUCCESS" state="finished" href="/httpAuth/app/rest/builds/id:15855" webUrl="http://llama:8080/viewLog.html?buildId=15855&buildTypeId=MediaRadarAutomatedBuilds_ProductionBugFixes"/>
<build id="15848" buildTypeId="MasterAutomatedBuilds_Master" number="1362" status="SUCCESS" state="finished" href="/httpAuth/app/rest/builds/id:15848" webUrl="http://llama:8080/viewLog.html?buildId=15848&buildTypeId=MasterAutomatedBuilds_Master"/>
<build id="15846" buildTypeId="MasterAutomatedBuilds_Master" number="1361" status="SUCCESS" state="finished" href="/httpAuth/app/rest/builds/id:15846" webUrl="http://llama:8080/viewLog.html?buildId=15846&buildTypeId=MasterAutomatedBuilds_Master"/>
<build id="15822" buildTypeId="MediaRadarAutomatedBuilds_ProductionBugFixes" number="372" status="SUCCESS" state="finished" href="/httpAuth/app/rest/builds/id:15822" webUrl="http://llama:8080/viewLog.html?buildId=15822&buildTypeId=MediaRadarAutomatedBuilds_ProductionBugFixes"/>
<build id="15818" buildTypeId="MediaRadarAutomatedBuilds_ProductionBugFixes" number="371" status="SUCCESS" state="finished" href="/httpAuth/app/rest/builds/id:15818" webUrl="http://llama:8080/viewLog.html?buildId=15818&buildTypeId=MediaRadarAutomatedBuilds_ProductionBugFixes"/>
<build id="15734" buildTypeId="MediaRadarAutomatedBuilds_Staging" number="448" status="SUCCESS" state="finished" href="/httpAuth/app/rest/builds/id:15734" webUrl="http://llama:8080/viewLog.html?buildId=15734&buildTypeId=MediaRadarAutomatedBuilds_Staging"/>
<build id="15715" buildTypeId="MediaRadarAutomatedBuilds_Staging" number="447" status="SUCCESS" state="finished" href="/httpAuth/app/rest/builds/id:15715" webUrl="http://llama:8080/viewLog.html?buildId=15715&buildTypeId=MediaRadarAutomatedBuilds_Staging"/>
<build id="15582" buildTypeId="MediaRadarAutomatedBuilds_Integration" number="14" status="SUCCESS" state="finished" href="/httpAuth/app/rest/builds/id:15582" webUrl="http://llama:8080/viewLog.html?buildId=15582&buildTypeId=MediaRadarAutomatedBuilds_Integration"/>
<build id="15554" buildTypeId="MediaRadarAutomatedBuilds_Integration" number="13" status="SUCCESS" state="finished" href="/httpAuth/app/rest/builds/id:15554" webUrl="http://llama:8080/viewLog.html?buildId=15554&buildTypeId=MediaRadarAutomatedBuilds_Integration"/>
<build id="15553" buildTypeId="InternalAutomatedBuilds_InternalBranchBuilder" number="585" status="SUCCESS" state="finished" branchName="master" defaultBranch="true" href="/httpAuth/app/rest/builds/id:15553"webUrl="http://llama:8080/viewLog.html?buildId=15553&buildTypeId=InternalAutomatedBuilds_InternalBranchBuilder"/>
<build id="15551" buildTypeId="InternalAutomatedBuilds_InternalBuilder" number="729" status="SUCCESS" state="finished" branchName="master" defaultBranch="true" href="/httpAuth/app/rest/builds/id:15551"webUrl="http://llama:8080/viewLog.html?buildId=15551&buildTypeId=InternalAutomatedBuilds_InternalBuilder"/>
<build id="14765" buildTypeId="InternalAutomatedBuilds_InternalBuilder" number="474" status="SUCCESS" state="finished" branchName="master" defaultBranch="true" href="/httpAuth/app/rest/builds/id:14765"webUrl="http://llama:8080/viewLog.html?buildId=14765&buildTypeId=InternalAutomatedBuilds_InternalBuilder"/>
<build id="14697" buildTypeId="InternalAutomatedBuilds_InternalBranchBuilder" number="474" status="SUCCESS" state="finished" branchName="master" defaultBranch="true" href="/httpAuth/app/rest/builds/id:14697"webUrl="http://llama:8080/viewLog.html?buildId=14697&buildTypeId=InternalAutomatedBuilds_InternalBranchBuilder"/>
<build id="14694" buildTypeId="MasterAutomatedBuilds_NightlyIntegration" number="79" status="SUCCESS" state="finished" href="/httpAuth/app/rest/builds/id:14694" webUrl="http://llama:8080/viewLog.html?buildId=14694&buildTypeId=MasterAutomatedBuilds_NightlyIntegration"/>
<build id="14666" buildTypeId="MasterAutomatedBuilds_NightlyIntegration" number="77" status="SUCCESS" state="finished" href="/httpAuth/app/rest/builds/id:14666" webUrl="http://llama:8080/viewLog.html?buildId=14666&buildTypeId=MasterAutomatedBuilds_NightlyIntegration"/>
</builds>
The problem is that when I look at my TeamCity server I see a lot of builds that are not being returned by the above command.
This is what I see in TeamCity (attached image shows a better view of the whats in TeamCity):
| Ciro/…Finder | #606 |
|
Artifacts | aaaaaaaaaaa (1) |
2 hours ago (18m:41s)
|
|
| Tony/…rSplit | #605 |
|
Artifacts | zzzzzzzzzzz (1) |
3 hours ago (19m:06s)
|
|
| Media…/98677 | #603 |
|
Artifacts | Changes (836) |
23 hours ago (18m:38s)
|
|
| Inter…leanup | #602 |
|
No artifacts | yyyyyyyyyyy (1) |
one day ago (4m:09s)
|
|
| Media…/98504 | #599 |
|
Artifacts | xxxxxxxxxxx (1) |
one day ago (21m:20s)
|
|
| Media…/98688 | #593 |
|
Artifacts | Changes (743) |
5 days ago (22m:03s)
|
|
| TROI/…Mapper | #591 |
|
No artifacts | Changes (99) |
7 days ago (5m:06s)
|
|
| master | #585 |
|
Artifacts | Changes (901) |
16 days ago (24m:07s)
|
|
| Media…taging | #550 |
|
Artifacts | Changes (4) |
one month ago (21m:05s)
|
| #1363 |
|
Artifacts | bbbbbbbbbbbb (2) |
3 hours ago (19m:03s)
|
Clearly, you can see that most of the builds seen in TeamCity are not showing up when using '/httpAuth/app/rest/builds/'
Am I not using the correct REST API call? Or, is there something else missing?
Thanks in advance for any help.
Attachment(s):
TeamCityBuilds.png
Please sign in to leave a comment.
Hi Boris,
If build configuration utilizes feature branches then, by default, only builds from default branch are returned. To retrieve all builds, add the following locator: branch:default:any. The whole path will look like this: /httpAuth/app/rest/builds/?locator=branch:default:any
Thanks, That worked.