Interface DefensicsApiClient

  • All Known Implementing Classes:
    DefensicsApiV2Client

    public interface DefensicsApiClient
    Interface for Defensics API client. Provides methods to do common Defensics tasks against API server.
    • Method Detail

      • getServerVersion

        Optional<VersionInformation> getServerVersion()
        Fetches API server version information. In future may contain some other component version information as well.
        Returns:
        VersionInformation containing server version.
      • uploadTestPlan

        void uploadTestPlan​(String configurationId,
                            InputStream testplanStream)
        Uploads and assigns a Defensics testplan to the test configuration of run with given ID.
        Parameters:
        configurationId - Test configuration ID
        testplanStream - Defensics testplan file as a stream. Caller has to close the stream.
      • setTestConfigurationSettings

        void setTestConfigurationSettings​(String runId,
                                          SettingCliArgs settings)
        Adds additional configuration settings for suite and monitor. The format is same as in the Defensics command line (e.g. '--uri http://127.0.0.1:7000' for changing URI in HTTP server suite).
        Parameters:
        runId - Run ID whose configuration is changed
        settings - Settings to add
      • getRunSuiteInstance

        Optional<SuiteInstance> getRunSuiteInstance​(String runId)
        Get suite instance currently assigned to run configuration.
        Parameters:
        runId - Run id
        Returns:
        Suite instance assigned to configuration
      • createTestRun

        Run createTestRun()
        Creates new test run.
        Returns:
        new test run
      • getRun

        Optional<Run> getRun​(String runId)
        Gets run for given ID.
        Parameters:
        runId - Run ID
        Returns:
        Run object
      • deleteRun

        void deleteRun​(String runId)
        Removes the Run. Also removes related RunTestConfiguration and unloads any assigned suites
        Parameters:
        runId - Run ID
      • startRun

        void startRun​(String runId)
        Starts Defensics run.
        Parameters:
        runId - Run ID
      • stopRun

        void stopRun​(String runId)
        Stops given Defensics run.
        Parameters:
        runId - Run ID
      • downloadReport

        InputStream downloadReport​(String resultId,
                                   String reportType)
        Downloads Defensics report of given type for given result IDs. Caller has to close the stream.
        Parameters:
        resultId - Run IDs for which to generate report
        reportType - Report type
        Returns:
        Report as a stream
      • downloadResultPackage

        InputStream downloadResultPackage​(String resultId)
        Downloads Defensics result package for given result ID. Result package contains Defensics result files in ZIP archive. Caller has to close the stream.
        Parameters:
        resultId - Result ID to include in the result package
        Returns:
        Result package as an inputstream. Contains Zip-package
      • getSuite

        Optional<Suite> getSuite​(String suiteFeature,
                                 String suiteVersion)
        Get single suite by the it's feature and version.
        Parameters:
        suiteFeature - the feature of suite to get
        suiteVersion - the version of suite to get
        Returns:
        Suite