class AWS::EMR::JobFlowCollection


* {#created_after}
* {#created_before}
* {#with_state}
* {#with_id}
The filtering methods include:
job_flows.with_state(‘ENDED’).each {|job_flow| … }
# only job flows with a particular state
job_flows.each {|job_flow| … }
# all job flows
You can enumerate all job flows, or filter them.
# Enumerating Job Flows
job_flow.exists? #=> true/false
job_flow = emr.job_flows # makes no request
You can get a job flow by its ID.
# Getting a Job Flow
)
}
:slave_instance_type => ‘m1.small’,
:master_instance_type => ‘m1.small’,
:instance_count => 2,
:instances => {
job_flow = emr.job_flows.create(‘name’,
emr = AWS::EMR.new
Call {#create} to run a new job flow.
# Creating a Job Flow

def [] job_flow_id

Returns:
  • (JobFlow) - Returns a {JobFlow} with the given ID.

Parameters:
  • job_flow_id (String) --
def [] job_flow_id
  JobFlow.new(job_flow_id, :config => config)
end

def _each_item options = {}, &block

def _each_item options = {}, &block
  resp = client.describe_job_flows(@filters.merge(options))
  resp.data[:job_flows].each do |details|
    job_flow = JobFlow.new_from(
      :describe_job_flows,
      details,
      details[:job_flow_id],
      :config => config)
    yield(job_flow)
  end
end

def create name, options = {}

Returns:
  • (JobFlow) -

Other tags:
    See: (Client#run_job_flow) -

Parameters:
  • options (Hash) --
  • name (String) --
def create name, options = {}
  options[:name] = name
  options[:ami_version] ||= 'latest'
  options[:instances] ||= {}
  resp = client.run_job_flow(options)
  self[resp.data[:job_flow_id]]
end

def created_after time

Returns:
  • (JobFlowCollection) -

Parameters:
  • time (Time, DateTime, Date) --
def created_after time
  time = time.iso8601 if time.respond_to?(:iso8601)
  filter(:created_after, time)
end

def created_before time

Returns:
  • (JobFlowCollection) -

Parameters:
  • time (Time, DateTime, Date) --
def created_before time
  time = time.iso8601 if time.respond_to?(:iso8601)
  filter(:created_before, time)
end

def filter name, value

Returns:
  • (JobFlowCollection) -

Parameters:
  • value (Mixed) --
  • name (String, Symbol) --
def filter name, value
  options = {}
  options[:filters] = @filters.merge(name.to_s.to_sym => value)
  options[:config] = config
  JobFlowCollection.new(options)
end

def initialize options = {}

Other tags:
    Api: - private
def initialize options = {}
  @filters = options[:filters] || {}
  super
end

def with_id *ids

Returns:
  • (JobFlowCollection) -

Parameters:
  • ids (String) -- One or more job flow ids to use as a filter.
def with_id *ids
  filter(:job_flow_ids, ids.flatten)
end

def with_state *states

Returns:
  • (JobFlowCollection) -

Parameters:
  • states (String) -- One or more job flow states to use as a filter.
def with_state *states
  filter(:job_flow_states, states.flatten)
end