use of jetbrains.buildServer.server.rest.model.PagerData in project teamcity-rest by JetBrains.
the class TestScopesRequest method serveGroupedTestOccurrences.
// Very highly experimental
@GET
@Path("/{scopeName}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(hidden = true, value = "highly experimental")
public TestScopes serveGroupedTestOccurrences(@QueryParam("locator") String locatorText, @PathParam("scopeName") String scopeName, @QueryParam("fields") String fields, @Context UriInfo uriInfo, @Context HttpServletRequest request) {
Set<String> supportedGroupings = new HashSet<>(Arrays.asList("package", "suite", "class"));
if (!supportedGroupings.contains(scopeName)) {
throw new BadRequestException("Invalid scope. Only scopes " + String.join(",", supportedGroupings) + " are supported.");
}
Locator patchedLocator = new Locator(locatorText);
patchedLocator.setDimension(TestScopesCollector.SCOPE_TYPE, scopeName);
PagedSearchResult<TestScope> items = myTestScopesCollector.getPagedItems(patchedLocator);
PagerData pager = new PagerData(uriInfo.getRequestUriBuilder(), request.getContextPath(), items, locatorText, "locator");
return new TestScopes(items.myEntries, new Fields(fields), pager, uriInfo, myBeanContext);
}
use of jetbrains.buildServer.server.rest.model.PagerData in project teamcity-rest by JetBrains.
the class CloudRequest method serveInstances.
/**
* Returns list of currently known cloud instances
* @param locator
*/
@GET
@Path("/instances")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Get all cloud instances.", nickname = "getAllCloudInstances")
public CloudInstances serveInstances(@QueryParam("locator") String locator, @QueryParam("fields") String fields, @Context UriInfo uriInfo, @Context HttpServletRequest request) {
final PagedSearchResult<CloudInstanceData> result = myCloudInstanceFinder.getItems(locator);
final PagerData pager = new PagerData(uriInfo.getRequestUriBuilder(), request.getContextPath(), result, locator, "locator");
return new CloudInstances(CachingValue.simple(() -> result.myEntries), pager, new Fields(fields), myBeanContext);
}
use of jetbrains.buildServer.server.rest.model.PagerData in project teamcity-rest by JetBrains.
the class CloudRequest method serveImages.
/**
* Returns list of currently known cloud images
* @param locator
*/
@GET
@Path("/images")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Get all cloud images.", nickname = "getAllCloudImages")
public CloudImages serveImages(@QueryParam("locator") String locator, @QueryParam("fields") String fields, @Context UriInfo uriInfo, @Context HttpServletRequest request) {
final PagedSearchResult<jetbrains.buildServer.clouds.CloudImage> result = myCloudImageFinder.getItems(locator);
final PagerData pager = new PagerData(uriInfo.getRequestUriBuilder(), request.getContextPath(), result, locator, "locator");
return new CloudImages(CachingValue.simple(() -> result.myEntries), pager, new Fields(fields), myBeanContext);
}
use of jetbrains.buildServer.server.rest.model.PagerData 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.PagerData 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);
}
Aggregations