Class: AWS::EMR::JobFlow
- Inherits:
-
Core::Resource
- Object
- Core::Resource
- AWS::EMR::JobFlow
- Defined in:
- lib/aws/emr/job_flow.rb
Instance Attribute Summary collapse
-
#ami_version ⇒ String
readonly
The version of the AMI used to initialize Amazon EC2 instances in the job flow.
-
#availability_zone_name ⇒ String
readonly
The current value of availability_zone_name.
-
#bootstrap_actions ⇒ Array<Hash>
readonly
The current value of bootstrap_actions.
-
#created_at ⇒ Time
readonly
The current value of created_at.
-
#ec2_key_name ⇒ String
readonly
The current value of ec2_key_name.
-
#ec2_subnet_id ⇒ String
readonly
The current value of ec2_subnet_id.
-
#ended_at ⇒ Time
readonly
The current value of ended_at.
-
#hadoop_version ⇒ String
readonly
The current value of hadoop_version.
-
#instance_count ⇒ Integer
readonly
The current value of instance_count.
-
#instance_group_details ⇒ Array<Hash>
readonly
The current value of instance_group_details.
- #job_flow_id ⇒ String (also: #id) readonly
-
#keep_job_flow_alive_when_no_steps ⇒ Boolean
readonly
The current value of keep_job_flow_alive_when_no_steps.
-
#last_state_change_reason ⇒ String
readonly
The current value of last_state_change_reason.
-
#log_uri ⇒ String?
readonly
The location in Amazon S3 where log files for the job are stored.
-
#master_instance_id ⇒ String
readonly
The current value of master_instance_id.
-
#master_instance_type ⇒ Object
readonly
attributes from :instances.
-
#master_public_dns_name ⇒ String
readonly
The current value of master_public_dns_name.
-
#name ⇒ String
readonly
The name of the job flow.
-
#normalized_instance_hours ⇒ Integer
readonly
The current value of normalized_instance_hours.
-
#ready_at ⇒ Time
readonly
The current value of ready_at.
-
#slave_instance_id ⇒ String
readonly
The current value of slave_instance_id.
-
#started_at ⇒ Time
readonly
The current value of started_at.
-
#state ⇒ Object
readonly
attributes from :execution_status_detail.
-
#step_details ⇒ Array<Hash>
readonly
The current value of step_details.
-
#supported_products ⇒ Array<String>
readonly
A list of strings set by third party software when the job flow is launched.
-
#termination_protected ⇒ Boolean
readonly
The current value of termination_protected.
Instance Method Summary collapse
-
#add_steps(*steps) ⇒ nil
Adds one (or more) steps to the current job flow.
- #availability_zone ⇒ EC2::AvailabilityZone?
-
#disable_termination_protection ⇒ nil
Removes a lock on this job flow so the Amazon EC2 instances in the cluster may be terminated.
-
#enable_termination_protection ⇒ nil
Locks this job flow so the Amazon EC2 instances in the cluster cannot be terminated by user intervention, an API call, or in the event of a job-flow error.
-
#exists? ⇒ Boolean
Returns
true
if the job flow exists. - #instance_groups ⇒ InstanceGroupCollection
- #master_instance ⇒ EC2::Instance?
- #set_termination_protection(state) ⇒ nil
- #set_visible_to_all_users(state) ⇒ nil
- #slave_instance ⇒ EC2::Instance?
-
#terminate ⇒ nil
(also: #delete)
Terminates the current job flow.
Instance Attribute Details
#ami_version ⇒ String (readonly)
The version of the AMI used to initialize Amazon EC2 instances in the job flow.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def ami_version @ami_version end |
#availability_zone_name ⇒ String (readonly)
Returns the current value of availability_zone_name.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def availability_zone_name @availability_zone_name end |
#bootstrap_actions ⇒ Array<Hash> (readonly)
Returns the current value of bootstrap_actions.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def bootstrap_actions @bootstrap_actions end |
#created_at ⇒ Time (readonly)
Returns the current value of created_at.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def created_at @created_at end |
#ec2_key_name ⇒ String (readonly)
Returns the current value of ec2_key_name.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def ec2_key_name @ec2_key_name end |
#ec2_subnet_id ⇒ String (readonly)
Returns the current value of ec2_subnet_id.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def ec2_subnet_id @ec2_subnet_id end |
#ended_at ⇒ Time (readonly)
Returns the current value of ended_at.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def ended_at @ended_at end |
#hadoop_version ⇒ String (readonly)
Returns the current value of hadoop_version.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def hadoop_version @hadoop_version end |
#instance_count ⇒ Integer (readonly)
Returns the current value of instance_count.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def instance_count @instance_count end |
#instance_group_details ⇒ Array<Hash> (readonly)
Returns the current value of instance_group_details.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def instance_group_details @instance_group_details end |
#job_flow_id ⇒ String (readonly) Also known as: id
86 87 88 |
# File 'lib/aws/emr/job_flow.rb', line 86 def job_flow_id @job_flow_id end |
#keep_job_flow_alive_when_no_steps ⇒ Boolean (readonly)
Returns the current value of keep_job_flow_alive_when_no_steps.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def keep_job_flow_alive_when_no_steps @keep_job_flow_alive_when_no_steps end |
#last_state_change_reason ⇒ String (readonly)
Returns the current value of last_state_change_reason.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def last_state_change_reason @last_state_change_reason end |
#log_uri ⇒ String? (readonly)
The location in Amazon S3 where log files for the job are stored.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def log_uri @log_uri end |
#master_instance_id ⇒ String (readonly)
Returns the current value of master_instance_id.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def master_instance_id @master_instance_id end |
#master_instance_type ⇒ Object (readonly)
attributes from :instances
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def master_instance_type @master_instance_type end |
#master_public_dns_name ⇒ String (readonly)
Returns the current value of master_public_dns_name.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def master_public_dns_name @master_public_dns_name end |
#name ⇒ String (readonly)
The name of the job flow.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def name @name end |
#normalized_instance_hours ⇒ Integer (readonly)
Returns the current value of normalized_instance_hours.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def normalized_instance_hours @normalized_instance_hours end |
#ready_at ⇒ Time (readonly)
Returns the current value of ready_at.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def ready_at @ready_at end |
#slave_instance_id ⇒ String (readonly)
Returns the current value of slave_instance_id.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def slave_instance_id @slave_instance_id end |
#started_at ⇒ Time (readonly)
Returns the current value of started_at.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def started_at @started_at end |
#state ⇒ Object (readonly)
attributes from :execution_status_detail
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def state @state end |
#step_details ⇒ Array<Hash> (readonly)
Returns the current value of step_details.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def step_details @step_details end |
#supported_products ⇒ Array<String> (readonly)
A list of strings set by third party software when the job flow is launched. If you are not using third party software to manage the job flow this value is empty.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def supported_products @supported_products end |
#termination_protected ⇒ Boolean (readonly)
Returns the current value of termination_protected.
75 76 77 |
# File 'lib/aws/emr/job_flow.rb', line 75 def termination_protected @termination_protected end |
Instance Method Details
#add_steps(*steps) ⇒ nil
Adds one (or more) steps to the current job flow.
emr.job_flows['job-flow-id'].add_steps([{
:name => 'step-name',
:action_on_failure => 'TERMINATE_JOB_FLOW',
:hadoop_jar_step => {
:jar => 'path/to/a/jar/file',
:main_class => 'MainClassName',
:args => %w(arg1 arg2 arg3)],
:properties => [
{ :key => 'property-1-name', :value => 'property-1-value' }
{ :key => 'property-2-name', :value => 'property-2-value' }
],
}
}])
233 234 235 236 237 238 239 |
# File 'lib/aws/emr/job_flow.rb', line 233 def add_steps *steps = {} [:job_flow_id] = job_flow_id [:steps] = steps.flatten client.add_job_flow_steps() nil end |
#availability_zone ⇒ EC2::AvailabilityZone?
189 190 191 192 193 |
# File 'lib/aws/emr/job_flow.rb', line 189 def availability_zone if name = availability_zone_name AWS::EC2.new(:config => config).availability_zones[name] end end |
#disable_termination_protection ⇒ nil
Removes a lock on this job flow so the Amazon EC2 instances in the cluster may be terminated.
257 258 259 |
# File 'lib/aws/emr/job_flow.rb', line 257 def disable_termination_protection set_termination_protection(false) end |
#enable_termination_protection ⇒ nil
Locks this job flow so the Amazon EC2 instances in the cluster cannot be terminated by user intervention, an API call, or in the event of a job-flow error.
250 251 252 |
# File 'lib/aws/emr/job_flow.rb', line 250 def enable_termination_protection set_termination_protection(true) end |
#exists? ⇒ Boolean
Returns true
if the job flow exists.
290 291 292 |
# File 'lib/aws/emr/job_flow.rb', line 290 def exists? !get_resource.data[:job_flows].empty? end |
#instance_groups ⇒ InstanceGroupCollection
242 243 244 |
# File 'lib/aws/emr/job_flow.rb', line 242 def instance_groups InstanceGroupCollection.new(self) end |
#master_instance ⇒ EC2::Instance?
175 176 177 178 179 |
# File 'lib/aws/emr/job_flow.rb', line 175 def master_instance if instance_id = master_instance_id AWS::EC2.new(:config => config).instances[instance_id] end end |
#set_termination_protection(state) ⇒ nil
263 264 265 266 267 268 269 |
# File 'lib/aws/emr/job_flow.rb', line 263 def set_termination_protection state = {} [:termination_protected] = state [:job_flow_ids] = [job_flow_id] client.set_termination_protection() nil end |
#set_visible_to_all_users(state) ⇒ nil
273 274 275 276 277 278 279 |
# File 'lib/aws/emr/job_flow.rb', line 273 def set_visible_to_all_users state = {} [:visible_to_all_users] = state [:job_flow_ids] = [job_flow_id] client.set_visible_to_all_users() nil end |
#slave_instance ⇒ EC2::Instance?
182 183 184 185 186 |
# File 'lib/aws/emr/job_flow.rb', line 182 def slave_instance if instance_id = slave_instance_id AWS::EC2.new(:config => config).instances[instance_id] end end |
#terminate ⇒ nil Also known as: delete
Terminates the current job flow.
283 284 285 286 |
# File 'lib/aws/emr/job_flow.rb', line 283 def terminate client.terminate_job_flows(:job_flow_ids => [job_flow_id]) nil end |