Class: A2::Subcommand::NodeMgmt::BulkDeleteById

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

#initializeBulkDeleteById

Returns a new instance of BulkDeleteById.



39
40
41
# File 'lib/a2/subcommands/node_mgmt.rb', line 39

def initialize
  super('bulk-delete-by-ids', takes_commands: false)
end

Instance Method Details

#execute(ids) ⇒ Object



43
44
45
46
47
# File 'lib/a2/subcommands/node_mgmt.rb', line 43

def execute(ids)
  with_approval("delete nodes") do
    puts JSON.pretty_generate(A2::Client.new(command_parser.data).bulk_delete_managed_nodes_by_id(id))
  end
end