private Page<String> listAllValidDatasetVersions() throws RestServiceException {
      long startListDatasetVersionTime = System.currentTimeMillis();
      String accountName = null;
      String containerName = null;
      String pageToken = null;
      String datasetName;
      try {
        Dataset dataset = (Dataset) restRequest.getArgs().get(RestUtils.InternalKeys.TARGET_DATASET);
        accountName = dataset.getAccountName();
        containerName = dataset.getContainerName();
        datasetName = dataset.getDatasetName();
        pageToken = RestUtils.getHeader(restRequest.getArgs(), RestUtils.Headers.TARGET_PAGE_PARAM, false);
        Page<String> result =
            accountService.listAllValidDatasetVersions(accountName, containerName, datasetName, pageToken);
        frontendMetrics.listDatasetVersionProcessingTimeInMs.update(
            System.currentTimeMillis() - startListDatasetVersionTime);
        return result;
      } catch (AccountServiceException ex) {
        LOGGER.error(
            "Dataset get failed for accountName " + accountName + " containerName " + containerName + " pageToken "
                + pageToken);
        frontendMetrics.listDatasetVersionError.inc();
        throw new RestServiceException(ex.getMessage(),
            RestServiceErrorCode.getRestServiceErrorCode(ex.getErrorCode()));
      }
    }
List all valid dataset versions under the specific dataset.
@return the page of the dataset version.
@throws RestServiceException
ambry-frontend/src/main/java/com/github/ambry/frontend/ListDatasetVersionHandler.java