Class: A2::Subcommand::NodeMgmt::BulkDeleteByFilter

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

Instance Method Summary collapse

Methods included from Paginated

#generate_paginated_json_filters, #generate_paginated_query_string, #with_paginated_filter_json, #with_paginated_filter_query

Methods included from Filtered

#generate_json_filters, #generate_query_filters, #parse_filters, #query_filter?, #set_custom_opts!, #set_filter_optparse_options!, #with_filter_query

Methods included from Approved

#ask_for_approval, #with_approval

Constructor Details

#initializeBulkDeleteByFilter

Returns a new instance of BulkDeleteByFilter.



56
57
58
# File 'lib/a2/subcommands/node_mgmt.rb', line 56

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

Instance Method Details

#executeObject



60
61
62
63
64
65
66
# File 'lib/a2/subcommands/node_mgmt.rb', line 60

def execute
  with_paginated_filter_json do |json|
    with_approval("delete nodes using filter") do
      puts JSON.pretty_generate(A2::Client.new(command_parser.data).bulk_delete_managed_nodes_by_filter(json))
    end
  end
end