Create, Move, and Delete Build Configurations
This article shows how to create, pause, and delete build configurations via TeamCity REST API.
Create Build Configuration
To create a new build configuration, compose and post a BuildType entity to:
Example:
Copy Build Configuration
To copy a build configuration to the same or a different project, compose and post a NewBuildTypeDescription entity to:
TargetProjectLocator
— a ProjectLocator that specifies which project should own the new copy of a build configuration.Request body — a new NewBuildTypeDescription entity, where:
sourceBuildTypeLocator
— a BuildTypeLocator that specifies which build configuration should be copied;name
,id
— String name and ID for the new copy of the build configuration;copyAllAssociatedSettings
— set totrue
.
Example:
Move Build Configuration
To remove a build configuration from its original parent project and add it to another project, send a POST
request to the following endpoint:
For example, the following request finds a build configuration with the "SourceProject_MyBuildConfig" ID and moves it to "MyProject2":
Delete Build Configuration
To delete a build configuration, send:
where buildConfigurationLocator
is a BuildTypeLocator-typed string used to locate the build configuration.
Pause Build Configurations
To get the current status of a build configuration, use:
The server will respond with the text/plain
boolean value indicating whether the configuration is paused (true
) or not (false
). To change the status, put the required value in text/plain
format to: