Search in sources :

Example 16 with Fields

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);
}
Also used : Fields(jetbrains.buildServer.server.rest.model.Fields) ApiOperation(io.swagger.annotations.ApiOperation)

Example 17 with Fields

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);
}
Also used : Fields(jetbrains.buildServer.server.rest.model.Fields) ApiOperation(io.swagger.annotations.ApiOperation)

Example 18 with Fields

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);
}
Also used : HealthCategories(jetbrains.buildServer.server.rest.model.health.HealthCategories) ItemCategory(jetbrains.buildServer.serverSide.healthStatus.ItemCategory) Fields(jetbrains.buildServer.server.rest.model.Fields) PagerData(jetbrains.buildServer.server.rest.model.PagerData)

Example 19 with Fields

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);
}
Also used : Fields(jetbrains.buildServer.server.rest.model.Fields) HealthItems(jetbrains.buildServer.server.rest.model.health.HealthItems) PagerData(jetbrains.buildServer.server.rest.model.PagerData)

Example 20 with Fields

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);
}
Also used : Fields(jetbrains.buildServer.server.rest.model.Fields) SBuildAgent(jetbrains.buildServer.serverSide.SBuildAgent) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

Fields (jetbrains.buildServer.server.rest.model.Fields)93 ApiOperation (io.swagger.annotations.ApiOperation)69 BadRequestException (jetbrains.buildServer.server.rest.errors.BadRequestException)18 PagerData (jetbrains.buildServer.server.rest.model.PagerData)18 ServiceLocator (jetbrains.buildServer.ServiceLocator)13 Test (org.testng.annotations.Test)13 SUser (jetbrains.buildServer.users.SUser)11 NotNull (org.jetbrains.annotations.NotNull)11 NotFoundException (jetbrains.buildServer.server.rest.errors.NotFoundException)10 SBuildAgent (jetbrains.buildServer.serverSide.SBuildAgent)9 Locator (jetbrains.buildServer.server.rest.data.Locator)8 BuildTypeOrTemplate (jetbrains.buildServer.server.rest.util.BuildTypeOrTemplate)8 ChangeStatus (jetbrains.buildServer.vcs.ChangeStatus)8 ChangeStatusProvider (jetbrains.buildServer.vcs.ChangeStatusProvider)8 SVcsModification (jetbrains.buildServer.vcs.SVcsModification)8 BuildType (jetbrains.buildServer.server.rest.model.buildType.BuildType)7 BeanContext (jetbrains.buildServer.server.rest.util.BeanContext)7 List (java.util.List)6 BuildPromotion (jetbrains.buildServer.serverSide.BuildPromotion)6 Nullable (org.jetbrains.annotations.Nullable)6