add existing ec2 stuff to bin/fog

This commit is contained in:
Wesley Beary 2009-10-07 23:45:33 -07:00
parent 909a648b53
commit 4bab2f4e7a
1 changed files with 25 additions and 0 deletions

25
bin/fog
View File

@ -9,15 +9,40 @@ elsif File.exists?(File.expand_path('~/.fog'))
@credentials = YAML.load(File.open(File.expand_path('~/.fog')).read)
end
@ec2 = Fog::AWS::EC2.new(
:aws_access_key_id => @credentials['aws_access_key_id'],
:aws_secret_access_key => @credentials['aws_secret_access_key']
)
@s3 = Fog::AWS::S3.new(
:aws_access_key_id => @credentials['aws_access_key_id'],
:aws_secret_access_key => @credentials['aws_secret_access_key']
)
def addresses
@ec2.addresses
end
def buckets
@s3.buckets
end
def key_pairs
@ec2.key_pairs
end
def security_groups
@ec2.security_groups
end
def snapshots
@ec2.snapshots
end
def volumes
@ec2.volumes
end
ARGV.clear # Avoid passing args to IRB
IRB.setup(nil)
@irb = IRB::Irb.new(nil)