mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
tidy up ec2 models
This commit is contained in:
parent
bb7c79295e
commit
319967df7d
6 changed files with 16 additions and 16 deletions
|
@ -8,8 +8,8 @@ module Fog
|
||||||
|
|
||||||
class Addresses < Fog::Collection
|
class Addresses < Fog::Collection
|
||||||
|
|
||||||
def all
|
def all(public_ip = [])
|
||||||
data = connection.describe_addresses.body
|
data = connection.describe_addresses(public_ip).body
|
||||||
addresses = []
|
addresses = []
|
||||||
data['addressesSet'].each do |address|
|
data['addressesSet'].each do |address|
|
||||||
addresses << Fog::AWS::EC2::Address.new({
|
addresses << Fog::AWS::EC2::Address.new({
|
||||||
|
|
|
@ -8,8 +8,8 @@ module Fog
|
||||||
|
|
||||||
class KeyPairs < Fog::Collection
|
class KeyPairs < Fog::Collection
|
||||||
|
|
||||||
def all(key_names = [])
|
def all(key_name = [])
|
||||||
data = connection.describe_key_pairs(key_names).body
|
data = connection.describe_key_pairs(key_name).body
|
||||||
key_pairs = []
|
key_pairs = []
|
||||||
data['keySet'].each do |key|
|
data['keySet'].each do |key|
|
||||||
key_pairs << Fog::AWS::EC2::KeyPair.new({
|
key_pairs << Fog::AWS::EC2::KeyPair.new({
|
||||||
|
|
|
@ -8,8 +8,8 @@ module Fog
|
||||||
|
|
||||||
class Volumes < Fog::Collection
|
class Volumes < Fog::Collection
|
||||||
|
|
||||||
def all(volume_ids = [])
|
def all(volume_id = [])
|
||||||
data = connection.describe_volumes(volume_ids)
|
data = connection.describe_volumes(volume_id)
|
||||||
volumes = []
|
volumes = []
|
||||||
data['volumeSet'].each do |volume|
|
data['volumeSet'].each do |volume|
|
||||||
volumes << Fog::AWS::EC2::Volume.new({
|
volumes << Fog::AWS::EC2::Volume.new({
|
||||||
|
|
Loading…
Add table
Reference in a new issue