Class: A2::Subcommand::NodeMgmt::Delete

Inherits:
CmdParse::Command
  • Object
show all
Includes:
Approved
Defined in:
lib/a2/subcommands/node_mgmt.rb

Instance Method Summary collapse

Methods included from Approved

#ask_for_approval, #with_approval

Constructor Details

#initializeDelete

Returns a new instance of Delete.



27
28
29
# File 'lib/a2/subcommands/node_mgmt.rb', line 27

def initialize
  super('delete', takes_commands: false)
end

Instance Method Details

#execute(id) ⇒ Object



31
32
33
34
35
# File 'lib/a2/subcommands/node_mgmt.rb', line 31

def execute(id)
  with_approval("delete node #{id}") do
    puts JSON.pretty_generate(A2::Client.new(command_parser.data).delete_managed_node(id))
  end
end