Class: Emasser::PAC
- Inherits:
-
SubCommandBase
- Object
- Thor
- SubCommandBase
- Emasser::PAC
- Defined in:
- lib/emasser/get.rb,
lib/emasser/post.rb
Overview
Add a Package Approval Chain (PAC)
Endpoints:
/api/systems/{systemId}/approval/pac - Initiate system workflow for review
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
502 503 504 |
# File 'lib/emasser/get.rb', line 502 def self.exit_on_failure? true end |
Instance Method Details
#add ⇒ Object
472 473 474 475 476 477 478 479 480 481 482 483 484 485 |
# File 'lib/emasser/post.rb', line 472 def add body = EmassClient::PacRequestBodyPost.new body.name = [:name] body.type = [:type] body.comments = [:comments] body_array = Array.new(1, body) result = EmassClient::PacApi.new.add_s_ystem_p_ac(body_array, [:systemId]) puts to_output_hash(result).green rescue EmassClient::ApiError => e puts 'Exception when calling ApprovalChainApi->add_s_ystem_c_ac'.red puts to_output_hash(e) end |
#package ⇒ Object
511 512 513 514 515 516 517 518 |
# File 'lib/emasser/get.rb', line 511 def package # Get location of system package in PAC result = EmassClient::PACApi.new.get_system_pac([:systemId]) puts to_output_hash(result).green rescue EmassClient::ApiError => e puts 'Exception when calling ApprovalChainApi->get_system_'.red puts to_output_hash(e) end |