Class: A2::Subcommand::Infra::ListMissingNodesCount

Inherits:
CmdParse::Command
  • Object
show all
Defined in:
lib/a2/subcommands/infra.rb

Instance Method Summary collapse

Constructor Details

#initializeListMissingNodesCount

Returns a new instance of ListMissingNodesCount.



17
18
19
20
21
22
23
# File 'lib/a2/subcommands/infra.rb', line 17

def initialize
  super('list-missing-nodes', takes_commands: false)
  @opt = {}
  options.on('-d', '--durations DURATIONS', "A comma-separated list of durations. A valid duration is any number zero or greater with one of these characters 'h', 'd', 'w', or 'M'. 'h' is hours 'd' is days 'w' is weeks 'M' is months Will contain one or many.") do |durations|
    @opt[:durations] = durations.split(',').join('&durations=').prepend('?durations=')
  end
end

Instance Method Details

#executeObject



25
26
27
# File 'lib/a2/subcommands/infra.rb', line 25

def execute
  puts JSON.pretty_generate(A2::Client.new(command_parser.data).list_all_missing_nodes_count(@opt[:durations]))
end