Class: Commands::AbstractListCommand
Direct Known Subclasses
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#all ⇒ Object
Returns the value of attribute all.
-
#max_results ⇒ Object
Returns the value of attribute max_results.
-
#no_steps ⇒ Object
Returns the value of attribute no_steps.
-
#state ⇒ Object
Returns the value of attribute state.
Attributes inherited from Command
#arg, #commands, #description, #logger, #name
Instance Method Summary collapse
Methods inherited from Command
#get_field, #has_value, #have, #initialize, #option, #require, #require_single_jobflow, #resolve, #validate
Constructor Details
This class inherits a constructor from Commands::Command
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
934 935 936 |
# File 'lib/commands.rb', line 934 def active @active end |
#all ⇒ Object
Returns the value of attribute all.
934 935 936 |
# File 'lib/commands.rb', line 934 def all @all end |
#max_results ⇒ Object
Returns the value of attribute max_results.
934 935 936 |
# File 'lib/commands.rb', line 934 def max_results @max_results end |
#no_steps ⇒ Object
Returns the value of attribute no_steps.
934 935 936 |
# File 'lib/commands.rb', line 934 def no_steps @no_steps end |
#state ⇒ Object
Returns the value of attribute state.
934 935 936 |
# File 'lib/commands.rb', line 934 def state @state end |
Instance Method Details
#enact(client) ⇒ Object
936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 |
# File 'lib/commands.rb', line 936 def enact(client) = {} states = [] if get_field(:jobflow, []).size > 0 then = { 'JobFlowIds' => get_field(:jobflow) } else if get_field(:active) then states = %w(RUNNING SHUTTING_DOWN STARTING WAITING BOOTSTRAPPING) end if get_field(:states) then states += get_field(states) end if get_field(:active) || get_field(:states) then = { 'JobFlowStates' => states } elsif get_field(:all) then = { } else = { 'CreatedAfter' => (Time.now - (2 * 24 * 3600)).xmlschema } end end result = client.describe_jobflow() # add the described jobflow to the supplied jobflows commands.[:jobflow] += result['JobFlows'].map { |x| x['JobFlowId'] } commands.[:jobflow].uniq! return result end |