use of jetbrains.buildServer.serverSide.artifacts.SArtifactDependency in project teamcity-rest by JetBrains.
the class BuildTypeRequest method getArtifactDepSetting.
// todo: list and allow changing parameters of the dependency
// like for features, steps (otherwise there is no way to update dependency in a template not resetting enabled/disabled in usages)
// Note: on adding editing should test editing of a dependnecy when inherited form a tempalte
@GET
@Path("/{btLocator}/artifact-dependencies/{artifactDepLocator}/{fieldName}")
@Produces({ "text/plain" })
@ApiOperation(value = "Get a parameter of an artifact dependency of the matching build configuration.", nickname = "getArtifactDependencyParameter")
public String getArtifactDepSetting(@ApiParam(format = LocatorName.BUILD_TYPE) @PathParam("btLocator") String buildTypeLocator, @PathParam("artifactDepLocator") String artifactDepLocator, @PathParam("fieldName") String name) {
final BuildTypeOrTemplate buildType = myBuildTypeFinder.getBuildTypeOrTemplate(null, buildTypeLocator, true);
final SArtifactDependency dep = getArtifactDependency(buildType, artifactDepLocator);
return PropEntityArtifactDep.getSetting(buildType.get(), dep.getId(), name);
}
use of jetbrains.buildServer.serverSide.artifacts.SArtifactDependency in project teamcity-rest by JetBrains.
the class BuildTypeRequest method changeArtifactDepSetting.
@PUT
@Path("/{btLocator}/artifact-dependencies/{artifactDepLocator}/{fieldName}")
@Consumes({ "text/plain" })
@Produces({ "text/plain" })
@ApiOperation(value = "Update a parameter of an artifact dependency of the matching build configuration.", nickname = "setArtifactDependencyParameter")
public String changeArtifactDepSetting(@ApiParam(format = LocatorName.BUILD_TYPE) @PathParam("btLocator") String buildTypeLocator, @PathParam("artifactDepLocator") String artifactDepLocator, @PathParam("fieldName") String name, String newValue) {
final BuildTypeOrTemplate buildType = myBuildTypeFinder.getBuildTypeOrTemplate(null, buildTypeLocator, true);
final SArtifactDependency dep = getArtifactDependency(buildType, artifactDepLocator);
PropEntityArtifactDep.setSetting(buildType.get(), dep.getId(), name, newValue);
buildType.persist("Artifact dependency settings changed");
return PropEntityArtifactDep.getSetting(buildType.get(), dep.getId(), name);
}
use of jetbrains.buildServer.serverSide.artifacts.SArtifactDependency in project teamcity-rest by JetBrains.
the class BuildTypeRequest method getArtifactDep.
@GET
@Path("/{btLocator}/artifact-dependencies/{artifactDepLocator}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Get an artifact dependency of the matching build configuration.", nickname = "getArtifactDependency")
public PropEntityArtifactDep getArtifactDep(@ApiParam(format = LocatorName.BUILD_TYPE) @PathParam("btLocator") String buildTypeLocator, @PathParam("artifactDepLocator") String artifactDepLocator, @QueryParam("fields") String fields) {
final BuildTypeOrTemplate buildType = myBuildTypeFinder.getBuildTypeOrTemplate(null, buildTypeLocator, true);
final SArtifactDependency artifactDependency = getArtifactDependency(buildType, artifactDepLocator);
return new PropEntityArtifactDep(artifactDependency, buildType.getSettingsEx(), new Fields(fields), new BeanContext(myFactory, myServiceLocator, myApiUrlBuilder));
}
use of jetbrains.buildServer.serverSide.artifacts.SArtifactDependency in project teamcity-rest by JetBrains.
the class BaseFinderTest method addArtifactDependency.
protected SArtifactDependency addArtifactDependency(final SBuildType dependent, final SBuildType dependOn) {
SArtifactDependency dep = myFixture.getSingletonService(ArtifactDependencyFactory.class).createArtifactDependency(dependOn, ARTIFACT_DEP_FILE_NAME, RevisionRules.LAST_FINISHED_RULE);
dependent.addArtifactDependency(dep);
return dep;
}
Aggregations