Class: Emasser::TestResults
- Inherits:
-
SubCommandBase
- Object
- Thor
- SubCommandBase
- Emasser::TestResults
- Defined in:
- lib/emasser/get.rb,
lib/emasser/post.rb
Overview
The Test Results endpoints provide the ability to add test results for a system’s Assessment Procedures (CCIs) which determine Security Control compliance.
Endpoint:
/api/systems/{systemId}/test-results
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from SubCommandBase
Methods included from OutputConverters
#change_to_datetime, #to_output_hash
Methods included from InputConverters
Methods included from OptionsParser
#optional_options, #required_options
Class Method Details
.exit_on_failure? ⇒ Boolean
252 253 254 |
# File 'lib/emasser/get.rb', line 252 def self.exit_on_failure? true end |
Instance Method Details
#add ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/emasser/post.rb', line 89 def add body = EmassClient::TestResultsGet.new body.assessment_procedure = [:assessmentProcedure] body.tested_by = [:testedBy] body.test_date = [:testDate] body.description = [:description] body.compliance_status = [:complianceStatus] body_array = Array.new(1, body) begin result = EmassClient::TestResultsApi .new.add_test_results_by_system_id([:systemId], body_array) puts to_output_hash(result).green rescue EmassClient::ApiError => e puts 'Exception when calling TestResultsApi->add_test_results_by_system_id'.red puts to_output_hash(e) end end |
#forSystem ⇒ Object
267 268 269 270 271 272 273 274 275 276 277 278 |
# File 'lib/emasser/get.rb', line 267 def forSystem = (@_initializer).keys = to_input_hash(, ) begin result = EmassClient::TestResultsApi.new.get_system_test_results([:systemId], ) puts to_output_hash(result).green rescue EmassClient::ApiError => e puts 'Exception when calling TestResultsApi->get_system_test_results'.red puts to_output_hash(e) end end |