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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DefensicsApiClient.DefensicsClientException
High level exception thrown when Defensics API client cannot do given operation succesfully.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Run
createTestRun()
Creates new test run.void
deleteRun(String runId)
Removes the Run.InputStream
downloadReport(String resultId, String reportType)
Downloads Defensics report of given type for given result IDs.InputStream
downloadResultPackage(String resultId)
Downloads Defensics result package for given result ID.Map<String,HealthCheckResult>
getHealthChecks()
Get detailed healthcheck information.Optional<Run>
getRun(String runId)
Gets run for given ID.Optional<SuiteInstance>
getRunSuiteInstance(String runId)
Get suite instance currently assigned to run configuration.Optional<VersionInformation>
getServerVersion()
Fetches API server version information.Optional<Suite>
getSuite(String suiteFeature, String suiteVersion)
Get single suite by the it's feature and version.List<SuiteInstance>
getSuiteInstances()
void
setTestConfigurationSettings(String runId, SettingCliArgs settings)
Adds additional configuration settings for suite and monitor.void
startRun(String runId)
Starts Defensics run.void
stopRun(String runId)
Stops given Defensics run.void
uploadTestPlan(String configurationId, InputStream testplanStream)
Uploads and assigns a Defensics testplan to the test configuration of run with given ID.
-
-
-
Method Detail
-
getHealthChecks
Map<String,HealthCheckResult> getHealthChecks()
Get detailed healthcheck information.- Returns:
- Healthcheck information as a map
- Throws:
DefensicsApiClient.DefensicsClientException
- if healthcheck information could not be fetched (eg. server down, TLS configuration wrong, wrong token).
-
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 IDtestplanStream
- 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 changedsettings
- 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
-
getSuiteInstances
List<SuiteInstance> getSuiteInstances()
-
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 reportreportType
- 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
-
-