Class: Capistrano::Autoscale::AWS::Instance

Inherits:
Base
  • Object
show all
Defined in:
lib/capistrano/autoscale/aws/instance.rb

Constant Summary collapse

STATE_RUNNING =
16

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#autoscaling_client, #aws_access_key_id, #aws_autoscale_ami_tags, #aws_autoscale_snapshot_tags, #aws_credentials, #aws_options, #aws_region, #aws_secret_access_key, #ec2_client

Constructor Details

#initialize(id, private_ip, state) ⇒ Instance

Returns a new instance of Instance.



11
12
13
14
15
16
# File 'lib/capistrano/autoscale/aws/instance.rb', line 11

def initialize(id, private_ip, state)
  @id = id
  @private_ip = private_ip
  @state = state
  @aws_counterpart = ::Aws::EC2::Instance.new id, client: ec2_client
end

Instance Attribute Details

#aws_counterpartObject (readonly)

Returns the value of attribute aws_counterpart.



9
10
11
# File 'lib/capistrano/autoscale/aws/instance.rb', line 9

def aws_counterpart
  @aws_counterpart
end

#idObject (readonly)

Returns the value of attribute id.



9
10
11
# File 'lib/capistrano/autoscale/aws/instance.rb', line 9

def id
  @id
end

#private_ipObject (readonly)

Returns the value of attribute private_ip.



9
10
11
# File 'lib/capistrano/autoscale/aws/instance.rb', line 9

def private_ip
  @private_ip
end

#stateObject (readonly)

Returns the value of attribute state.



9
10
11
# File 'lib/capistrano/autoscale/aws/instance.rb', line 9

def state
  @state
end

Instance Method Details

#running?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/capistrano/autoscale/aws/instance.rb', line 18

def running?
  state == STATE_RUNNING
end