Child pages
  • REST API Plugin

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add information about new build artifacts api (TW-20830)

...

Anchor
build_artifacts
build_artifacts

Artifacts:
Before 8.0 (deprecated in 8.0):
GET http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/artifacts/files/<artifact relative name>
  Returns artifact content

Since 8.0:
GET http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/artifacts/metadata/<artifact relative name>
  Returns base information about artifact
  Media-Type: application/xml or application/json

GET http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/artifacts/children/<artifact relative name>
  Returns list of artifact children (if artifact is directory or archive, otherwise return error 400)
  Media-Type: application/xml or application/json
  Possible error: 400 if artifact is not directory nor archive.

GET http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/artifacts/content/<artifact relative name>
  Returns artifact content (if artifact is file or archive, otherwise return error 400)
  Media-Type: application/octet-stream or more specific media type (determined from artifact name)
  Possible error: 400 if artifact is directory.

Since 8.0 <artifact relative name> supports archived files, so "!/" delimiter can be used.
Samples:
  GET http://teamcity:8111/httpAuth/app/rest/builds/id:100/artifacts/children/my-great-tool-0.1.jar\!/META-INF
  GET http://teamcity:8111/httpAuth/app/rest/builds/id:100/artifacts/metadata/my-great-tool-0.1.jar\!/META-INF/MANIFEST.MF
  GET http://teamcity:8111/httpAuth/app/rest/builds/id:100/artifacts/metadata/my-great-tool-0.1.jar!/lib/commons-logging-1.1.1.jar!/META-INF/MANIFEST.MF
  GET http://teamcity:8111/httpAuth/app/rest/builds/id:100/artifacts/content/my-great-tool-0.1.jar!/lib/commons-logging-1.1.1.jar!/META-INF/MANIFEST.MF

If you download the artifacts from within a TeamCity build, consider using teamcity.auth.userId/teamcity.auth.password system properties as credentials for the download artifacts request: this way TeamCity will have a way to record that one build used artifacts of another and will display that on build's Dependencies tab.

...