Class: A2::Subcommand::Infra::ShowNodeRun
- Inherits:
-
CmdParse::Command
- Object
- CmdParse::Command
- A2::Subcommand::Infra::ShowNodeRun
- Defined in:
- lib/a2/subcommands/infra.rb
Instance Method Summary collapse
- #execute(node_id, run_id) ⇒ Object
-
#initialize ⇒ ShowNodeRun
constructor
A new instance of ShowNodeRun.
Constructor Details
#initialize ⇒ ShowNodeRun
Returns a new instance of ShowNodeRun.
69 70 71 72 73 74 75 |
# File 'lib/a2/subcommands/infra.rb', line 69 def initialize super('show-node-run', takes_commands: false) @opt = {} .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 |
Instance Method Details
#execute(node_id, run_id) ⇒ Object
77 78 79 80 81 82 |
# 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 |