use of jetbrains.buildServer.server.rest.util.BeanContext in project teamcity-rest by JetBrains.
the class BuildTypeRequest method serveBuildField.
@GET
@Path("/{btLocator}/builds/{buildLocator}/{field}")
@Produces("text/plain")
@ApiOperation(value = "serveBuildField", hidden = true)
public String serveBuildField(@ApiParam(format = LocatorName.BUILD_TYPE) @PathParam("btLocator") String buildTypeLocator, @ApiParam(format = LocatorName.BUILD) @PathParam("buildLocator") String buildLocator, @PathParam("field") String field) {
SBuildType buildType = myBuildTypeFinder.getBuildType(null, buildTypeLocator, false);
BuildPromotion build = myBuildFinder.getBuildPromotion(buildType, buildLocator);
return Build.getFieldValue(build, field, new BeanContext(myFactory, myServiceLocator, myApiUrlBuilder));
}
use of jetbrains.buildServer.server.rest.util.BeanContext in project teamcity-rest by JetBrains.
the class BuildTypeRequest method replaceArtifactDep.
@PUT
@Path("/{btLocator}/artifact-dependencies/{artifactDepLocator}")
@Consumes({ "application/xml", "application/json" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Update an artifact dependency of the matching build configuration.", nickname = "replaceArtifactDependency")
public PropEntityArtifactDep replaceArtifactDep(@ApiParam(format = LocatorName.BUILD_TYPE) @PathParam("btLocator") String buildTypeLocator, @PathParam("artifactDepLocator") String artifactDepLocator, @QueryParam("fields") String fields, PropEntityArtifactDep description) {
final BuildTypeOrTemplate buildType = myBuildTypeFinder.getBuildTypeOrTemplate(null, buildTypeLocator, true);
final SArtifactDependency newDependency = description.replaceIn(buildType.getSettingsEx(), getArtifactDependency(buildType, artifactDepLocator), myServiceLocator);
buildType.persist("Artifact dependency replaced");
return new PropEntityArtifactDep(newDependency, buildType.getSettingsEx(), new Fields(fields), new BeanContext(myFactory, myServiceLocator, myApiUrlBuilder));
}
use of jetbrains.buildServer.server.rest.util.BeanContext in project teamcity-rest by JetBrains.
the class BuildTypeRequest method addSnapshotDep.
/**
* Creates new snapshot dependency. 'id' attribute is ignored in the submitted descriptor.
* Reports error if new dependency cannot be created (e.g. another dependency on the specified build configuration already exists).
*/
@POST
@Path("/{btLocator}/snapshot-dependencies")
@Consumes({ "application/xml", "application/json" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Add a snapshot dependency to the matching build configuration.", nickname = "addSnapshotDependencyToBuildType")
public PropEntitySnapshotDep addSnapshotDep(@ApiParam(format = LocatorName.BUILD_TYPE) @PathParam("btLocator") String buildTypeLocator, @QueryParam("fields") String fields, PropEntitySnapshotDep description) {
final BuildTypeOrTemplate buildType = myBuildTypeFinder.getBuildTypeOrTemplate(null, buildTypeLocator, true);
Dependency createdDependency = description.addTo(buildType.getSettingsEx(), myServiceLocator);
buildType.persist("Snapshot dependency added");
return new PropEntitySnapshotDep(createdDependency, buildType.getSettingsEx(), new Fields(fields), new BeanContext(myFactory, myServiceLocator, myApiUrlBuilder));
}
use of jetbrains.buildServer.server.rest.util.BeanContext in project teamcity-rest by JetBrains.
the class BuildTypeRequest method addArtifactDep.
@POST
@Path("/{btLocator}/artifact-dependencies")
@Consumes({ "application/xml", "application/json" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Add an artifact dependency to the matching build configuration.", nickname = "addArtifactDependencyToBuildType")
public PropEntityArtifactDep addArtifactDep(@ApiParam(format = LocatorName.BUILD_TYPE) @PathParam("btLocator") String buildTypeLocator, @QueryParam("fields") String fields, PropEntityArtifactDep description) {
final BuildTypeOrTemplate buildType = myBuildTypeFinder.getBuildTypeOrTemplate(null, buildTypeLocator, true);
final SArtifactDependency result = description.addTo(buildType.getSettingsEx(), myServiceLocator);
buildType.persist("Artifact dependency added");
return new PropEntityArtifactDep(result, buildType.getSettingsEx(), new Fields(fields), new BeanContext(myFactory, myServiceLocator, myApiUrlBuilder));
}
use of jetbrains.buildServer.server.rest.util.BeanContext in project teamcity-rest by JetBrains.
the class BuildTypeRequest method setVCSLabelingOptions.
/**
* Sets VCS labeling settings
* Experimental support only
* @deprecated VCS labeling configuration is moved to build features settings.
*/
@PUT
@ApiOperation(value = "setVCSLabelingOptions", hidden = true)
@Path("/{btLocator}/vcsLabeling")
@Consumes({ "application/xml", "application/json" })
@Produces({ "application/xml", "application/json" })
public VCSLabelingOptions setVCSLabelingOptions(@ApiParam(format = LocatorName.BUILD_TYPE) @PathParam("btLocator") String buildTypeLocator, VCSLabelingOptions options) {
final BuildTypeOrTemplate buildType = myBuildTypeFinder.getBuildTypeOrTemplate(null, buildTypeLocator, true);
options.applyTo(buildType, new BeanContext(myFactory, myServiceLocator, myApiUrlBuilder));
buildType.persist("VCS labeling settings changed");
return new VCSLabelingOptions();
}
Aggregations