Class: Emasser::CAC
- Inherits:
-
SubCommandBase
- Object
- Thor
- SubCommandBase
- Emasser::CAC
- Defined in:
- lib/emasser/get.rb,
lib/emasser/post.rb
Overview
Add a Control Approval Chain (CAC)
Endpoints:
/api/systems/{systemId}/approval/cac
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
502 503 504 |
# File 'lib/emasser/get.rb', line 502 def self.exit_on_failure? true end |
Instance Method Details
#add ⇒ Object
521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 |
# File 'lib/emasser/post.rb', line 521 def add body = EmassClient::CacGet.new body.control_acronym = [:controlAcronym] body.comments = [:comments] body_array = Array.new(1, body) begin # Get location of one or many controls in CAC result = EmassClient::CACApi.new.add_system_cac([:systemId], body_array) puts to_output_hash(result).green rescue EmassClient::ApiError => e puts 'Exception when calling ApprovalChainApi->add_system_cac'.red puts to_output_hash(e) end end |
#controls ⇒ Object
514 515 516 517 518 519 520 521 522 523 524 525 526 |
# File 'lib/emasser/get.rb', line 514 def controls = (@_initializer).keys = to_input_hash(, ) begin # Get location of one or many controls in CAC result = EmassClient::CACApi.new.get_system_cac([:systemId], ) puts to_output_hash(result).green rescue EmassClient::ApiError => e puts 'Exception when calling CACApi->get_system_cac'.red puts to_output_hash(e) end end |