Class: Capistrano::Autoscale::AWS::Snapshot
- Includes:
- Taggable
- Defined in:
- lib/capistrano/autoscale/aws/snapshot.rb
Instance Attribute Summary collapse
-
#aws_counterpart ⇒ Object
readonly
Returns the value of attribute aws_counterpart.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #create_tags ⇒ Object
- #delete ⇒ Object
-
#initialize(id) ⇒ Snapshot
constructor
A new instance of Snapshot.
Methods included from Taggable
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) ⇒ Snapshot
Returns a new instance of Snapshot.
11 12 13 14 |
# File 'lib/capistrano/autoscale/aws/snapshot.rb', line 11 def initialize(id) @id = id @aws_counterpart = ::Aws::EC2::Snapshot.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/snapshot.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/snapshot.rb', line 9 def id @id end |
Instance Method Details
#create_tags ⇒ Object
20 21 22 |
# File 'lib/capistrano/autoscale/aws/snapshot.rb', line 20 def .each { |key, value| tag(key, value) } end |
#delete ⇒ Object
16 17 18 |
# File 'lib/capistrano/autoscale/aws/snapshot.rb', line 16 def delete ec2_client.delete_snapshot snapshot_id: id end |