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
#ask_for_approval, #with_approval
Constructor Details
#initialize ⇒ Delete
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 |