use of jetbrains.buildServer.server.rest.model.Fields in project teamcity-rest by JetBrains.
the class FeatureSubResource method replaceAll.
@PUT
@Produces({ "application/xml", "application/json" })
@Consumes({ "application/xml", "application/json" })
@ApiOperation(value = "Update all features.", nickname = "updateFeatures")
public M replaceAll(M newEntities, @QueryParam("fields") String fields) {
myEntity.replaceAll(newEntities, myBeanContext.getServiceLocator());
myEntity.persist();
return myEntity.get(null, new Fields(fields), myBeanContext);
}
use of jetbrains.buildServer.server.rest.model.Fields in project teamcity-rest by JetBrains.
the class FeatureSubResource method add.
@POST
@Produces({ "application/xml", "application/json" })
@Consumes({ "application/xml", "application/json" })
@ApiOperation(value = "Add a feature.", nickname = "addFeature")
public S add(S entityToAdd, @QueryParam("fields") String fields) {
final String resultId = myEntity.add(entityToAdd, myBeanContext.getServiceLocator());
myEntity.persist();
return myEntity.getSingle(resultId, new Fields(fields), myBeanContext);
}
use of jetbrains.buildServer.server.rest.model.Fields in project teamcity-rest by JetBrains.
the class HealthRequest method getCategories.
@GET
@Path("/category")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public HealthCategories getCategories(@QueryParam("locator") @Nullable final String locator, @QueryParam("fields") @Nullable final String fields, @Context @NotNull final UriInfo uriInfo, @Context @NotNull final HttpServletRequest request) {
final PagedSearchResult<ItemCategory> pagedItems = myHealthItemFinder.getCategories(locator);
final PagerData pagerData = new PagerData(uriInfo.getRequestUriBuilder(), request.getContextPath(), pagedItems, locator, "locator");
return new HealthCategories(pagedItems.myEntries, pagerData, new Fields(fields), myBeanContext);
}
use of jetbrains.buildServer.server.rest.model.Fields in project teamcity-rest by JetBrains.
the class HealthRequest method getHealthItems.
@GET
@Path("/")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public HealthItems getHealthItems(@QueryParam("locator") @Nullable final String locator, @QueryParam("fields") @Nullable final String fields, @Context @NotNull final UriInfo uriInfo, @Context @NotNull final HttpServletRequest request) {
final PagedSearchResult<jetbrains.buildServer.serverSide.healthStatus.HealthStatusItem> pagedItems = myHealthItemFinder.getItems(locator);
final PagerData pagerData = new PagerData(uriInfo.getRequestUriBuilder(), request.getContextPath(), pagedItems, locator, "locator");
return new HealthItems(pagedItems.myEntries, pagerData, new Fields(fields), myBeanContext);
}
use of jetbrains.buildServer.server.rest.model.Fields in project teamcity-rest by JetBrains.
the class AgentRequest method setAllowedRunConfigurations.
/**
* Experimental use only
*/
@PUT
@Path("/{agentLocator}/compatibilityPolicy")
@Consumes({ "application/xml", "application/json" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Update build configuration run policy of agent matching locator.", nickname = "setBuildConfigurationRunPolicy")
public CompatibilityPolicy setAllowedRunConfigurations(@ApiParam(format = LocatorName.AGENT) @PathParam("agentLocator") String agentLocator, CompatibilityPolicy payload, @QueryParam("fields") String fields) {
final SBuildAgent agent = myAgentFinder.getItem(agentLocator);
payload.applyTo(agent, myServiceLocator);
return CompatibilityPolicy.getCompatibilityPolicy(agent, new Fields(fields), myBeanContext);
}
Aggregations