Class: Capistrano::Autoscale::AWS::Snapshot

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Taggable

#tag, #tags

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_counterpartObject (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

#idObject (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_tagsObject



20
21
22
# File 'lib/capistrano/autoscale/aws/snapshot.rb', line 20

def create_tags
  aws_autoscale_snapshot_tags.each { |key, value| tag(key, value) }
end

#deleteObject



16
17
18
# File 'lib/capistrano/autoscale/aws/snapshot.rb', line 16

def delete
  ec2_client.delete_snapshot snapshot_id: id
end