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
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
540 541 542 |
# File 'lib/emasser/get.rb', line 540 def self.exit_on_failure? true end |
Instance Method Details
#add ⇒ Object
557 558 559 560 561 562 563 564 565 566 567 568 569 570 |
# File 'lib/emasser/post.rb', line 557 def add body = EmassClient::PacGet.new body.name = [:name] body.workflow = [:workflow] body.comments = [:comments] body_array = Array.new(1, body) result = EmassClient::PACApi.new.add_system_pac([:systemId], body_array) puts to_output_hash(result).green rescue EmassClient::ApiError => e puts 'Exception when calling ApprovalChainApi->add_system_pac'.red puts to_output_hash(e) end |
#package ⇒ Object
549 550 551 552 553 554 555 556 |
# File 'lib/emasser/get.rb', line 549 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 PACApi->get_system_pac'.red puts to_output_hash(e) end |