Class: AwsCli::CLI::Emr
- Inherits:
-
Thor
- Object
- Thor
- AwsCli::CLI::Emr
- Defined in:
- lib/awscli/cli/emr.rb
Instance Method Summary collapse
- #add_ig ⇒ Object
- #add_instances ⇒ Object
- #add_steps ⇒ Object
- #create ⇒ Object
- #delete ⇒ Object
- #list ⇒ Object
- #modify_instances ⇒ Object
- #termination_protection ⇒ Object
- #usage ⇒ Object
Instance Method Details
#add_ig ⇒ Object
126 127 128 129 130 131 132 |
# File 'lib/awscli/cli/emr.rb', line 126 def add_ig unless [:job_flow_id] and [:instance_groups] abort '--job-flow-id and --instance-groups are required' end create_emr_object @emr.add_instance_groups [:job_flow_id], [:instance_groups] end |
#add_instances ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'lib/awscli/cli/emr.rb', line 47 def add_instances if ![:job_flow_id] and ![:instance_count] and ![:instance_role] and ![:instance_type] puts 'These options are required --job-flow-id, --instance-count, --instance-role and --instance-type' exit end abort 'Invalid Instance Role' unless %w(MASTER CORE TASK).include?([:instance_role]) create_emr_object @emr.add_instance_group end |
#add_steps ⇒ Object
137 138 139 140 141 142 143 |
# File 'lib/awscli/cli/emr.rb', line 137 def add_steps unless [:job_flow_id] and [:steps] abort '--job-flow-id and --steps are required' end create_emr_object @emr.add_steps [:job_flow_id], [:steps] end |
#create ⇒ Object
114 115 116 117 118 119 120 121 |
# File 'lib/awscli/cli/emr.rb', line 114 def create unless [:name] puts 'These options are required --name' exit end create_emr_object @emr.create_job_flow end |
#delete ⇒ Object
30 31 32 33 |
# File 'lib/awscli/cli/emr.rb', line 30 def delete create_emr_object @emr.delete [:job_flow_ids] end |
#list ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/awscli/cli/emr.rb', line 20 def list if [:job_flow_status] abort 'Invalid job flow status' unless %w(RUNNING WAITING SHUTTING_DOWN STARTING).each_cons([:job_flow_status].size).include? [:job_flow_status] end create_emr_object @emr.list end |
#modify_instances ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/awscli/cli/emr.rb', line 60 def modify_instances if ![:instance_count] and ![:instance_group_id] puts 'These options are required --instance-count and --instance-group-id' exit end create_emr_object @emr.modify_instance_group end |
#termination_protection ⇒ Object
72 73 74 75 |
# File 'lib/awscli/cli/emr.rb', line 72 def termination_protection create_emr_object @emr.set_termination_protection [:job_flow_ids], [:termination_protection] end |
#usage ⇒ Object
10 11 12 13 14 |
# File 'lib/awscli/cli/emr.rb', line 10 def usage File.open(File.dirname(__FILE__) + '/UsageExamples/emr') do |file| puts file.read end end |