Class: A2::Subcommand::Infra::ListMissingNodesCount
- Inherits:
-
CmdParse::Command
- Object
- CmdParse::Command
- A2::Subcommand::Infra::ListMissingNodesCount
- Defined in:
- lib/a2/subcommands/infra.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ ListMissingNodesCount
constructor
A new instance of ListMissingNodesCount.
Constructor Details
#initialize ⇒ ListMissingNodesCount
Returns a new instance of ListMissingNodesCount.
16 17 18 19 20 21 22 |
# File 'lib/a2/subcommands/infra.rb', line 16 def initialize super('list-missing-nodes', takes_commands: false) @opt = {} .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
#execute ⇒ Object
24 25 26 |
# 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 |