TeamCity REST API to get list of artifacts for specified build.

We have CPU-intensive benchmarking unit tests.
We launch it every night with custom test runner on separate machine to prevent hanging TeamCity during the day.
I am requesting TeamCity for builds - it returns me list of last 100 builds:

string getBuildsUrl = string.Format("http://{0}/guestAuth/app/rest/buildTypes/id:{1}/builds", Config.TeamCityServerAddress, Config.TeamCityBuildTypeId);

Then I am trying to download each not yet "benchmarked" test:

string url = string.Format("http://{0}/guestAuth/repository/downloadAll/{1}/{2}:id", Config.TeamCityServerAddress, Config.TeamCityBuildTypeId, build.Id);

But if build doesn't have artifacts then I get timeout exception.
It would be nice to have API to get list of artifacts for specified build.
In that case I could find out is there are any artifacts.
If there are artifacts then download not all of them - but only interested (for example artifacts which includes "benchmark" word).

Please sign in to leave a comment.