Class: A2::Subcommand::NodeMgmt::BulkDeleteByFilter
Instance Attribute Summary
Attributes inherited from Filtered
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ BulkDeleteByFilter
constructor
A new instance of BulkDeleteByFilter.
Methods included from Approved
#add_approval_option!, #ask_for_approval, #with_approval
Methods inherited from Paginated
#generate_paginated_query_string, #with_paginated_filter_json, #with_paginated_filter_query
Methods inherited from Filtered
#generate_json_filters, #generate_query_filters, #parse_filters, #set_custom_opts!, #set_filter_optparse_options!, #with_filter_query
Constructor Details
#initialize ⇒ BulkDeleteByFilter
Returns a new instance of BulkDeleteByFilter.
53 54 55 56 |
# File 'lib/a2/subcommands/node_mgmt.rb', line 53 def initialize super('bulk-delete-by-filter', takes_commands: false) @opt = add_approval_option!() end |
Instance Method Details
#execute ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/a2/subcommands/node_mgmt.rb', line 58 def execute with_paginated_filter_json do |json| with_approval(message: "delete nodes using filter", auto_approved: @opt[:auto_approved]) do puts JSON.pretty_generate(A2::Client.new(command_parser.data).bulk_delete_managed_nodes_by_filter(json)) end end end |