1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/aws/requests/emr/set_termination_protection.rb
Bob Briski 0002ea89ef Added EMR functions for AWS
* describe_job_flows does not return Properties for the HadoopJarStepConfig
* All other methods work as advertised
2011-09-16 16:59:28 -07:00

39 lines
1.3 KiB
Ruby

module Fog
module AWS
class EMR
class Real
require 'fog/aws/parsers/emr/set_termination_protection'
# locks a job flow so the Amazon EC2 instances in the cluster cannot be terminated by user intervention.
# http://docs.amazonwebservices.com/ElasticMapReduce/latest/API/API_SetTerminationProtection.html
# ==== Parameters
# * JobFlowIds <~String list> - list of strings that uniquely identify the job flows to protect
# * TerminationProtected <~Boolean> - indicates whether to protect the job flow
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>
def set_termination_protection(is_protected, options={})
if job_ids = options.delete('JobFlowIds')
options.merge!(Fog::AWS.serialize_keys('JobFlowIds', job_ids))
end
request({
'Action' => 'SetTerminationProtection',
'TerminationProtected' => is_protected,
:parser => Fog::Parsers::AWS::EMR::SetTerminationProtection.new,
}.merge(options))
end
end
class Mock
def set_termination_protection(db_name, options={})
Fog::Mock.not_implemented
end
end
end
end
end