Class: A2::Subcommand::NodeMgmt::Delete
- Inherits:
-
CmdParse::Command
- Object
- CmdParse::Command
- A2::Subcommand::NodeMgmt::Delete
- Includes:
- Approved
- Defined in:
- lib/a2/subcommands/node_mgmt.rb
Instance Method Summary collapse
- #execute(id) ⇒ Object
-
#initialize ⇒ Delete
constructor
A new instance of Delete.
Methods included from Approved
#add_approval_option!, #ask_for_approval, #with_approval
Constructor Details
#initialize ⇒ Delete
Returns a new instance of Delete.
27 28 29 30 |
# File 'lib/a2/subcommands/node_mgmt.rb', line 27 def initialize super('delete', takes_commands: false) @opt = add_approval_option!() end |
Instance Method Details
#execute(id) ⇒ Object
32 33 34 35 36 |
# File 'lib/a2/subcommands/node_mgmt.rb', line 32 def execute(id) with_approval(message: "delete node #{id}", auto_approved: @opt[:auto_approved]) do puts JSON.pretty_generate(A2::Client.new(command_parser.data).delete_managed_node(id)) end end |