Class: Contexto::Contextualize
- Inherits:
-
Object
- Object
- Contexto::Contextualize
- Defined in:
- lib/contexto/contextualize.rb
Overview
ECS class
Instance Attribute Summary collapse
-
#display ⇒ Object
readonly
Returns the value of attribute display.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Contextualize
constructor
A new instance of Contextualize.
- #run ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Contextualize
Returns a new instance of Contextualize.
9 10 11 12 13 14 15 16 |
# File 'lib/contexto/contextualize.rb', line 9 def initialize(params = {}) @cluster = params.fetch(:cluster) if params[:cluster] @service = params.fetch(:service) if params[:service] @container = params.fetch(:container) if params[:container] @rake = params.fetch(:rake) if params[:rake] @console = params.fetch(:console) @display = Contexto::Display.new end |
Instance Attribute Details
#display ⇒ Object (readonly)
Returns the value of attribute display.
7 8 9 |
# File 'lib/contexto/contextualize.rb', line 7 def display @display end |
Instance Method Details
#run ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/contexto/contextualize.rb', line 18 def run if (@console || @rake) task = describe_tasks ec2_instance_id = describe_container_instance(task[:container_instance_arn]) @ssh = Contexto::SSH.new(describe_instances(ec2_instance_id), @cluster, @service, @container) if @console @ssh.console elsif @rake @ssh.rake(@rake) end return end if !@cluster clusters return end cluster puts "\n" if !@service services end if @service puts "\n" service puts "\n" tasks end end |