mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
add existing ec2 stuff to bin/fog
This commit is contained in:
parent
909a648b53
commit
4bab2f4e7a
1 changed files with 25 additions and 0 deletions
25
bin/fog
25
bin/fog
|
@ -9,15 +9,40 @@ elsif File.exists?(File.expand_path('~/.fog'))
|
||||||
@credentials = YAML.load(File.open(File.expand_path('~/.fog')).read)
|
@credentials = YAML.load(File.open(File.expand_path('~/.fog')).read)
|
||||||
end
|
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(
|
@s3 = Fog::AWS::S3.new(
|
||||||
:aws_access_key_id => @credentials['aws_access_key_id'],
|
:aws_access_key_id => @credentials['aws_access_key_id'],
|
||||||
:aws_secret_access_key => @credentials['aws_secret_access_key']
|
:aws_secret_access_key => @credentials['aws_secret_access_key']
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def addresses
|
||||||
|
@ec2.addresses
|
||||||
|
end
|
||||||
|
|
||||||
def buckets
|
def buckets
|
||||||
@s3.buckets
|
@s3.buckets
|
||||||
end
|
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
|
ARGV.clear # Avoid passing args to IRB
|
||||||
IRB.setup(nil)
|
IRB.setup(nil)
|
||||||
@irb = IRB::Irb.new(nil)
|
@irb = IRB::Irb.new(nil)
|
||||||
|
|
Loading…
Reference in a new issue