Class: Dydra::Command::Status

Inherits:
Dydra::Command show all
Defined in:
lib/dydra/command/status.rb

Overview

Shows pending, running, and completed jobs.

Instance Method Summary (collapse)

Methods inherited from Dydra::Command

#abort, #basename, #catch_errors, #debug?, #initialize, #parse_repository_specs, #parse_resource_specs, #require_gem!, #stderr, #stdout, #validate_repository_specs, #validate_resource_specs, #verbose?, #wrap_errors

Methods included from Dydra::Client

authenticate!, credentials_file, delete, get, get_json, post, reset!, resource, rpc, setup?

Constructor Details

This class inherits a constructor from Dydra::Command

Instance Method Details

- execute(job_uuid = nil)

This method returns an undefined value.

Parameters:

  • job_uuid (String) (defaults to: nil)


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/dydra/command/status.rb', line 9

def execute(job_uuid = nil)
  if job_uuid
    job = Job.new(job_uuid)
    case status = job.status
      when :pending
        puts "The job #{job} is currently pending to run."
      when :running
        puts "The job #{job} is currently running."
      when :aborted
        puts "The job #{job} was aborted."
      when :failed
        puts "The job #{job} failed."
      when :completed
        puts "The job #{job} has completed."
      else
        puts "The job #{job} has a status of '#{status}'."
    end
  else
    # TODO: show the status for all jobs
  end
end