class Bosh::AwsCliPlugin::Migration
Attributes
config[R]
ec2[R]
elb[R]
logger[R]
rds[R]
route53[R]
s3[R]
Public Class Methods
new(config, receipt_bucket_name)
click to toggle source
# File lib/bosh_cli_plugin_aws/migration.rb, line 7 def initialize(config, receipt_bucket_name) @config = config @receipt_bucket_name = receipt_bucket_name aws_config = config['aws'] @s3 = S3.new(aws_config) @elb = ELB.new(aws_config) @ec2 = EC2.new(aws_config) @rds = RDS.new(aws_config) @route53 = Route53.new(aws_config) @logger = Bosh::Clouds::Config.logger end
Public Instance Methods
load_receipt(receipt_name)
click to toggle source
# File lib/bosh_cli_plugin_aws/migration.rb, line 35 def load_receipt(receipt_name) YAML.load(s3.fetch_object_contents(@receipt_bucket_name, "receipts/#{receipt_name}.yml")) end
run()
click to toggle source
# File lib/bosh_cli_plugin_aws/migration.rb, line 19 def run say "Executing migration #{self.class.name}" execute end
save_receipt(receipt_name, receipt)
click to toggle source
# File lib/bosh_cli_plugin_aws/migration.rb, line 24 def save_receipt(receipt_name, receipt) receipt_yaml = YAML.dump(receipt) s3.upload_to_bucket(@receipt_bucket_name, "receipts/#{receipt_name}.yml", receipt_yaml) File.open("#{receipt_name}.yml", "w+") do |f| f.write(receipt_yaml) end say "details in S3 receipt: #{receipt_name} and file: #{receipt_name}.yml" end