Info |
---|
The plugin is bundled since TeamCity 5.0. See the usage details in the current documentation version. |
On this page:
Table of Contents |
---|
General Info
Vendor | JetBrains |
License | |
Type | free, open-source |
Plugin Description
Exposes the TeamCity API via REST.
Info |
---|
The plugin is bundled with TeamCity 5.0 |
Usage
...
Usage
Details of the API usage are described at the version-specific pages:
- for TeamCity 10.x and TeamCity 2017.x
- for TeamCity 9.x
- for TeamCity 8.x
- for TeamCity versions 5.0 - 7.x
REST API Versions
As REST API evolves from one TeamCity version to another, there can be incompatible changes in the protocol.
Under the http://teamcity:8111/httpAuth/app/rest/application.wadl
- to the get list of supported requests and names of parametersFor example:
URL the latest version is available.
Under http://teamcity:8111/httpAuth/app/rest/version
- to get plugin version
http://teamcity:8111/httpAuth/app/rest/projects
- to get projects list, then follow href's
http://teamcity:8111/httpAuth/app/rest/buildTypes/id:bt284/builds?status=SUCCESS&tag=EAP
- (example ids are used) to get builds
As a rule, single value responses are "text/plain" and complex value responses support both "application/xml" and "application/json". Supply appropriate "Accept" header in the request to get necessary response type.
Feel free to ask questions and provide feedback in our plugins forum.
Build Tags
Get tags: GET http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/tags/
Replace tags: PUT http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/tags/
(should put the same XML of JSON as returned by GET)
Add tags: POST http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/tags/
(should post the same XML of JSON as returned by GET)
Where <buildLocator> is a string in the formats of id:<internal build id>
<version>
URL, other versions CAN be available. Our general policy is to supply TeamCity with ONE previous version.
In TeamCity 7.x you can use "6.0" instead of <version> to get the previous version of the protocol.
In TeamCity 8.0 you can use "6.0" or "7.0" instead of <version> to get earlier versions of the protocol.
API Changes
Breaking changes in the API are described in Upgrade Notes sections of the corresponding TeamCity version documentation.
Please note that additions to the objects returned (such as new XML attributes or elements) are not considered major changes and do not cause the protocol version to increment.
Also, the endpoints marked with "Experiments" comment in application.wadl
may change without special notice in future versions.
Logging
You can get details on errors and REST request processing in logs\teamcity-rest.log
server log.
Please turn on debug logging (e.g. set Logging Preset to "debug-rest" on Administration/Diagnostics page or modify Log4J "jetbrains.buildServer.server.rest" category) to get details about each processed request.
Development links
If you need to extend the plugin with your functionality, you can base your plugin on the current REST API plugin code, but ensure make sure that your plugin does not interfere with the bundled REST plugin. To achieve this, change the teamcity-plugin.xml
file to have a different plugin name and a different value for the "api.path" parameter. Once this is done, your patched plugin and the original REST api plugin can work in the single TeamCity installation.
hidden-data |
---|
[Builds|http://buildserver.labs.intellij.net/viewType.html?buildTypeId=bt638] at buildserver.
|
TeamCity Versions Compatibility
TeamCity 5.0 and above.
...
The plugin is branched with each TeamCity release. The corresponding plugin branch should be used.
Feedback
Feel free to ask questions and provide feedback in our plugins forum.