Class: A2::Subcommand::NodeMgmt::BulkDeleteById
- Inherits:
-
CmdParse::Command
- Object
- CmdParse::Command
- A2::Subcommand::NodeMgmt::BulkDeleteById
- Includes:
- Approved
- Defined in:
- lib/a2/subcommands/node_mgmt.rb
Instance Method Summary collapse
- #execute(ids) ⇒ Object
-
#initialize ⇒ BulkDeleteById
constructor
A new instance of BulkDeleteById.
Methods included from Approved
#add_approval_option!, #ask_for_approval, #with_approval
Constructor Details
#initialize ⇒ BulkDeleteById
Returns a new instance of BulkDeleteById.
40 41 42 43 |
# File 'lib/a2/subcommands/node_mgmt.rb', line 40 def initialize super('bulk-delete-by-ids', takes_commands: false) @opt = add_approval_option!() end |
Instance Method Details
#execute(ids) ⇒ Object
45 46 47 48 49 |
# File 'lib/a2/subcommands/node_mgmt.rb', line 45 def execute(ids) with_approval(message: "delete nodes", auto_approved: @opt[:auto_approved]) do puts JSON.pretty_generate(A2::Client.new(command_parser.data).bulk_delete_managed_nodes_by_id(id)) end end |