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 - Add one or many test results for a system
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from SubCommandBase
Methods included from OutputConverters
Methods included from InputConverters
Methods included from OptionsParser
#optional_options, #required_options
Class Method Details
.exit_on_failure? ⇒ Boolean
244 245 246 |
# File 'lib/emasser/get.rb', line 244 def self.exit_on_failure? true end |
Instance Method Details
#add ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/emasser/post.rb', line 63 def add body = EmassClient::TestResultsRequestPostBody.new body.cci = [:cci] 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(body_array, [:systemId]) 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
257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/emasser/get.rb', line 257 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 |