Class: Capistrano::Autoscale::AWS::Instance
- Defined in:
- lib/capistrano/autoscale/aws/instance.rb
Constant Summary collapse
- STATE_RUNNING =
16
Instance Attribute Summary collapse
-
#aws_counterpart ⇒ Object
readonly
Returns the value of attribute aws_counterpart.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#private_ip ⇒ Object
readonly
Returns the value of attribute private_ip.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(id, private_ip, state) ⇒ Instance
constructor
A new instance of Instance.
- #running? ⇒ Boolean
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_counterpart ⇒ Object (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 |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/capistrano/autoscale/aws/instance.rb', line 9 def id @id end |
#private_ip ⇒ Object (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 |
#state ⇒ Object (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
18 19 20 |
# File 'lib/capistrano/autoscale/aws/instance.rb', line 18 def running? state == STATE_RUNNING end |