Class BackupRestoreResource


  • public class BackupRestoreResource
    extends Object
    • Constructor Detail

      • BackupRestoreResource

        public BackupRestoreResource​(BackupRestoreService backupRestoreService)
    • Method Detail

      • createSpaceBackupJob

        public javax.ws.rs.core.Response createSpaceBackupJob​(SpaceBackupSettings settings)
        Creates new space backup job and adds it to the queue.
        Parameters:
        settings - space backup settings
        Returns:
        space backup job details
      • createSiteBackupJob

        public javax.ws.rs.core.Response createSiteBackupJob​(SiteBackupSettings settings)
        Starts the new site backup job.
        Parameters:
        settings - site backup settings
        Returns:
        site backup job details
      • createSpaceRestoreJob

        public javax.ws.rs.core.Response createSpaceRestoreJob​(SpaceRestoreSettings settings)
        Creates new space restore job and adds it to the queue.
        Parameters:
        settings - space restore settings
        Returns:
        space restore job details
      • createSiteRestoreJob

        public javax.ws.rs.core.Response createSiteRestoreJob​(SiteRestoreSettings settings)
        Starts the new site restore job.
        Parameters:
        settings - site restore settings
        Returns:
        site restore job details
      • getJob

        public javax.ws.rs.core.Response getJob​(Long jobId)
        Get job by id. The user must be a sysadmin or the owner of the job
        Parameters:
        jobId - id of the backup/restore job
        Returns:
        job details
      • findJobs

        public javax.ws.rs.core.Response findJobs​(Integer limit,
                                                  String fromDate,
                                                  String toDate,
                                                  JobScope jobScope,
                                                  JobOperation jobOperation,
                                                  List<JobState> jobStates,
                                                  String owner)
        Returns jobs based on the filters provided.
        Parameters:
        limit - amount of jobs that should be returned
        fromDate - minimum job creation date. Supported date format is `yyyy-MM-ddTHH:mm:ss.SSSZ`
        toDate - maximum job create date. Supported date format is `yyyy-MM-ddTHH:mm:ss.SSSZ`
        jobScope - scope of the job. Acceptable values: "SPACE" and "SITE"
        jobOperation - job operation. Acceptable values: "BACKUP" and "RESTORE"
        jobStates - list of job states. Acceptable values: "QUEUED", "PROCESSING", "FINISHED", "CANCELLING", "CANCELLED", "FAILED"
        owner - userName of user who had created a job
        Returns:
        List of backup/restore jobs visible to user based on the filter provided.
      • cancelJob

        public javax.ws.rs.core.Response cancelJob​(Long jobId)
        Cancels the job. If the job is already cancelled or failed, the method will do nothing.
        Parameters:
        jobId - id of the backup/restore job
        Returns:
        details of cancelled job
      • cancelAllQueuedJobs

        public javax.ws.rs.core.Response cancelAllQueuedJobs()
        Cancels all queued jobs. Does not affect jobs that are being processed at the moment.
        Returns:
        number of cancelled jobs.