@GET
  @Produces("text/plain")
  @ApiOperation(value = "Get all groups", nickname = "GroupService#getGroups", notes = "Returns details of all groups.", response = GroupResponse.class, responseContainer = "List")
  @ApiImplicitParams({
    @ApiImplicitParam(name = "fields", value = "Filter group details", defaultValue = "Groups/*", dataType = "string", paramType = "query"),
    @ApiImplicitParam(name = "sortBy", value = "Sort groups (asc | desc)", defaultValue = "Groups/group_name.asc", dataType = "string", paramType = "query"),
    @ApiImplicitParam(name = "page_size", value = "The number of resources to be returned for the paged response.", defaultValue = "10", dataType = "integer", paramType = "query"),
    @ApiImplicitParam(name = "from", value = "The starting page resource (inclusive). Valid values are :offset | \"start\"", defaultValue = "0", dataType = "string", paramType = "query"),
    @ApiImplicitParam(name = "to", value = "The ending page resource (inclusive). Valid values are :offset | \"end\"", dataType = "string", paramType = "query")
  })
  @ApiResponses(value = {
    @ApiResponse(code = 200, message = "Successful retrieval of all group entries", response = GroupResponse.class, responseContainer = "List")}
  )
  public Response getGroups(@Context HttpHeaders headers, @Context UriInfo ui) {
    return handleRequest(headers, null, ui, Request.Type.GET, createGroupResource(null));
  }
Gets all groups.
Handles: GET /groups requests.

@param headers    http headers
@param ui         uri info
ambari-server/src/main/java/org/apache/ambari/server/api/services/groups/GroupService.java