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
|
@ -5,7 +5,7 @@ module Fog
|
|||
class Address < Fog::Model
|
||||
|
||||
attr_accessor :instance_id,
|
||||
:public_ip
|
||||
:public_ip
|
||||
|
||||
def initialize(attributes = {})
|
||||
remap_attributes(attributes, {
|
||||
|
|
|
@ -8,8 +8,8 @@ module Fog
|
|||
|
||||
class Addresses < Fog::Collection
|
||||
|
||||
def all
|
||||
data = connection.describe_addresses.body
|
||||
def all(public_ip = [])
|
||||
data = connection.describe_addresses(public_ip).body
|
||||
addresses = []
|
||||
data['addressesSet'].each do |address|
|
||||
addresses << Fog::AWS::EC2::Address.new({
|
||||
|
|
|
@ -5,8 +5,8 @@ module Fog
|
|||
class KeyPair < Fog::Model
|
||||
|
||||
attr_accessor :fingerprint,
|
||||
:material,
|
||||
:name
|
||||
:material,
|
||||
:name
|
||||
|
||||
def initialize(attributes = {})
|
||||
remap_attributes(attributes, {
|
||||
|
|
|
@ -8,8 +8,8 @@ module Fog
|
|||
|
||||
class KeyPairs < Fog::Collection
|
||||
|
||||
def all(key_names = [])
|
||||
data = connection.describe_key_pairs(key_names).body
|
||||
def all(key_name = [])
|
||||
data = connection.describe_key_pairs(key_name).body
|
||||
key_pairs = []
|
||||
data['keySet'].each do |key|
|
||||
key_pairs << Fog::AWS::EC2::KeyPair.new({
|
||||
|
|
|
@ -5,13 +5,13 @@ module Fog
|
|||
class Volume < Fog::Model
|
||||
|
||||
attr_accessor :attachment_time,
|
||||
:availability_zone,
|
||||
:device,
|
||||
:instance_id
|
||||
:size,
|
||||
:snapshot_id,
|
||||
:status,
|
||||
:volume_id
|
||||
:availability_zone,
|
||||
:device,
|
||||
:instance_id
|
||||
:size,
|
||||
:snapshot_id,
|
||||
:status,
|
||||
:volume_id
|
||||
|
||||
def initialize(attributes = {})
|
||||
if attributes['attachmentSet']
|
||||
|
|
|
@ -8,8 +8,8 @@ module Fog
|
|||
|
||||
class Volumes < Fog::Collection
|
||||
|
||||
def all(volume_ids = [])
|
||||
data = connection.describe_volumes(volume_ids)
|
||||
def all(volume_id = [])
|
||||
data = connection.describe_volumes(volume_id)
|
||||
volumes = []
|
||||
data['volumeSet'].each do |volume|
|
||||
volumes << Fog::AWS::EC2::Volume.new({
|
||||
|
|
Loading…
Add table
Reference in a new issue