private void copyDatasetVersions() throws RestServiceException {
      long startListDatasetVersionTime = System.currentTimeMillis();
      String accountName = null;
      String containerName = null;
      String sourceDatasetVersion = null;
      String targetDatasetVersion = null;
      String datasetName = null;
      try {
        DatasetVersionPath datasetVersionPath =
            DatasetVersionPath.parse(RestUtils.getRequestPath(restRequest), restRequest.getArgs());
        accountName = datasetVersionPath.getAccountName();
        containerName = datasetVersionPath.getContainerName();
        datasetName = datasetVersionPath.getDatasetName();
        sourceDatasetVersion = datasetVersionPath.getVersion();
        targetDatasetVersion = datasetVersionPath.getTargetVersion();
        accountService.renameDatasetVersion(accountName, containerName, datasetName, sourceDatasetVersion,
            targetDatasetVersion);
        frontendMetrics.copyDatasetVersionProcessingTimeInMs.update(
            System.currentTimeMillis() - startListDatasetVersionTime);
      } catch (AccountServiceException ex) {
        LOGGER.error("Dataset version rename failed for accountName " + accountName + " containerName " + containerName
            + " datasetName " + datasetName + " sourceDatasetVersion " + sourceDatasetVersion + " targetDatasetVersion "
            + targetDatasetVersion);
        frontendMetrics.copyDatasetVersionError.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/CopyDatasetVersionHandler.java