Search in sources :

Example 1 with Properties

use of jetbrains.buildServer.server.rest.model.Properties in project teamcity-rest by JetBrains.

the class BuildTypeRequest method replaceStepParameters.

@PUT
@Path("/{btLocator}/steps/{stepId}/parameters")
@Consumes({ "application/xml", "application/json" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Update a parameter of a build step of the matching build configuration.", nickname = "deleteBuildStepParameters")
public Properties replaceStepParameters(@ApiParam(format = LocatorName.BUILD_TYPE) @PathParam("btLocator") String buildTypeLocator, @PathParam("stepId") String stepId, Properties properties, @QueryParam("fields") String fields) {
    final BuildTypeOrTemplate buildType = myBuildTypeFinder.getBuildTypeOrTemplate(null, buildTypeLocator, true);
    SBuildRunnerDescriptor step = getStep(buildType.get(), stepId);
    buildType.get().updateBuildRunner(step.getId(), step.getName(), step.getType(), properties.getMap());
    buildType.persist("Build step parameters changed");
    return new Properties(getStep(buildType.get(), stepId).getParameters(), null, new Fields(fields), myBeanContext);
}
Also used : BuildTypeOrTemplate(jetbrains.buildServer.server.rest.util.BuildTypeOrTemplate) Properties(jetbrains.buildServer.server.rest.model.Properties) ApiOperation(io.swagger.annotations.ApiOperation)

Example 2 with Properties

use of jetbrains.buildServer.server.rest.model.Properties in project teamcity-rest by JetBrains.

the class BuildTypeRequest method replaceFeatureParameters.

@PUT
@Path("/{btLocator}/features/{featureId}/parameters")
@Consumes({ "application/xml", "application/json" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Update a parameter of a build feature of the matching build configuration.", nickname = "replaceBuildFeatureParameters")
public Properties replaceFeatureParameters(@ApiParam(format = LocatorName.BUILD_TYPE) @PathParam("btLocator") String buildTypeLocator, @PathParam("featureId") String featureId, Properties properties, @QueryParam("fields") String fields) {
    final BuildTypeOrTemplate buildType = myBuildTypeFinder.getBuildTypeOrTemplate(null, buildTypeLocator, true);
    SBuildFeatureDescriptor feature = BuildTypeUtil.getBuildTypeFeature(buildType.get(), featureId);
    buildType.get().updateBuildFeature(feature.getId(), feature.getType(), properties.getMap());
    buildType.persist("Build feature parameters replaced");
    return new Properties(BuildTypeUtil.getBuildTypeFeature(buildType.get(), featureId).getParameters(), null, new Fields(fields), myBeanContext);
}
Also used : BuildTypeOrTemplate(jetbrains.buildServer.server.rest.util.BuildTypeOrTemplate) Properties(jetbrains.buildServer.server.rest.model.Properties) ApiOperation(io.swagger.annotations.ApiOperation)

Example 3 with Properties

use of jetbrains.buildServer.server.rest.model.Properties in project teamcity-rest by JetBrains.

the class BuildTypeRequest method getFeatureParameters.

@GET
@Path("/{btLocator}/features/{featureId}/parameters")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Get all parameters of a build feature of the matching build configuration.", nickname = "getAllBuildFeatureParameters")
public Properties getFeatureParameters(@ApiParam(format = LocatorName.BUILD_TYPE) @PathParam("btLocator") String buildTypeLocator, @PathParam("featureId") String featureId, @QueryParam("fields") String fields) {
    final BuildTypeOrTemplate buildType = myBuildTypeFinder.getBuildTypeOrTemplate(null, buildTypeLocator, true);
    SBuildFeatureDescriptor feature = BuildTypeUtil.getBuildTypeFeature(buildType.get(), featureId);
    return new Properties(feature.getParameters(), null, new Fields(fields), myBeanContext);
}
Also used : BuildTypeOrTemplate(jetbrains.buildServer.server.rest.util.BuildTypeOrTemplate) Properties(jetbrains.buildServer.server.rest.model.Properties) ApiOperation(io.swagger.annotations.ApiOperation)

Example 4 with Properties

use of jetbrains.buildServer.server.rest.model.Properties in project teamcity-rest by JetBrains.

the class ParametersSubResource method setParameters.

@PUT
@Consumes({ "application/xml", "application/json" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Update build parameters.", nickname = "updateBuildParameters")
public Properties setParameters(Properties properties, @QueryParam("fields") String fields) {
    properties.setTo(myEntityWithParameters, myBeanContext.getServiceLocator());
    myEntityWithParameters.persist("Parameters changed");
    return new Properties(myEntityWithParameters, myParametersHref, null, new Fields(fields), myBeanContext);
}
Also used : Fields(jetbrains.buildServer.server.rest.model.Fields) Properties(jetbrains.buildServer.server.rest.model.Properties) ApiOperation(io.swagger.annotations.ApiOperation)

Example 5 with Properties

use of jetbrains.buildServer.server.rest.model.Properties in project teamcity-rest by JetBrains.

the class BuildTypeRequest method getStepParameters.

@GET
@Path("/{btLocator}/steps/{stepId}/parameters")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Get all parameters of a build step of the matching build configuration.", nickname = "getAllBuildStepParameters")
public Properties getStepParameters(@ApiParam(format = LocatorName.BUILD_TYPE) @PathParam("btLocator") String buildTypeLocator, @PathParam("stepId") String stepId, @QueryParam("fields") String fields) {
    final BuildTypeOrTemplate buildType = myBuildTypeFinder.getBuildTypeOrTemplate(null, buildTypeLocator, true);
    SBuildRunnerDescriptor step = getStep(buildType.get(), stepId);
    return new Properties(step.getParameters(), null, new Fields(fields), myBeanContext);
}
Also used : BuildTypeOrTemplate(jetbrains.buildServer.server.rest.util.BuildTypeOrTemplate) Properties(jetbrains.buildServer.server.rest.model.Properties) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

ApiOperation (io.swagger.annotations.ApiOperation)6 Properties (jetbrains.buildServer.server.rest.model.Properties)6 BuildTypeOrTemplate (jetbrains.buildServer.server.rest.util.BuildTypeOrTemplate)4 Fields (jetbrains.buildServer.server.rest.model.Fields)2 SVcsRoot (jetbrains.buildServer.vcs.SVcsRoot)1