class A2::Subcommand::Infra::ListMissingNodesCount

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/a2/subcommands/infra.rb, line 16
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

Public Instance Methods

execute() click to toggle source
# File lib/a2/subcommands/infra.rb, line 24
def execute
  puts JSON.pretty_generate(A2::Client.new(command_parser.data).list_all_missing_nodes_count(@opt[:durations]))
end