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 - Submit control to second stage of CAC
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
463 464 465 |
# File 'lib/emasser/get.rb', line 463 def self.exit_on_failure? true end |
Instance Method Details
#add ⇒ Object
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 |
# File 'lib/emasser/post.rb', line 433 def add body = SwaggerClient::CacRequestPostBody.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 = SwaggerClient::CacApi.new.add_s_ystem_c_ac(body_array, [:systemId]) puts to_output_hash(result).green rescue SwaggerClient::ApiError => e puts 'Exception when calling ApprovalChainApi->add_s_ystem_c_ac'.red puts to_output_hash(e) end end |
#controls ⇒ Object
476 477 478 479 480 481 482 483 484 485 486 487 488 |
# File 'lib/emasser/get.rb', line 476 def controls = (@_initializer).keys = to_input_hash(, ) begin # Get location of one or many controls in CAC result = SwaggerClient::CACApi.new.get_system_cac([:systemId], ) puts to_output_hash(result).green rescue SwaggerClient::ApiError => e puts 'Exception when calling ApprovalChainApi->get_system_cac'.red puts to_output_hash(e) end end |