class A2::Subcommand::Infra::ShowNodeRun

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/a2/subcommands/infra.rb, line 69
def initialize
  super('show-node-run', takes_commands: false)
  @opt = {}
  options.on('-E', '--end-time END', "End time on the node's run. Formatted iso8601 (YYYY-MM-DD\'T\'HH:mm:ssZ)") do |end_time|
    @opt[:end_time] = end_time
  end
end

Public Instance Methods

execute(node_id, run_id) click to toggle source
# File lib/a2/subcommands/infra.rb, line 77
def execute(node_id, run_id)
  query_string = ''
  query_string = "?end_time=#{@opt[:end_time]}" if @opt[:end_time]

  puts JSON.pretty_generate(A2::Client.new(command_parser.data).show_node_run(node_id, run_id, query_string))
end