mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Revert "move vcloud models to its directory since the format is common to both"
Conflicts with work freeformz is doing, reverting in favor of those changes for now.
This reverts commit 9907d4ed59
.
This commit is contained in:
parent
b1ba9f677a
commit
b554eb0bb4
13 changed files with 37 additions and 52 deletions
|
@ -1,7 +1,7 @@
|
|||
require 'fog/model'
|
||||
|
||||
module Fog
|
||||
module Vcloud
|
||||
module Terremark
|
||||
module Shared
|
||||
|
||||
class Address < Fog::Model
|
|
@ -1,22 +1,22 @@
|
|||
module Fog
|
||||
module Vcloud
|
||||
module Terremark
|
||||
module Shared
|
||||
|
||||
module Mock
|
||||
def addresses(options = {})
|
||||
Fog::Vcloud::Shared::Addresses.new(options.merge(:connection => self))
|
||||
Fog::Terremark::Shared::Addresses.new(options.merge(:connection => self))
|
||||
end
|
||||
end
|
||||
|
||||
module Real
|
||||
def addresses(options = {})
|
||||
Fog::Vcloud::Shared::Addresses.new(options.merge(:connection => self))
|
||||
Fog::Terremark::Shared::Addresses.new(options.merge(:connection => self))
|
||||
end
|
||||
end
|
||||
|
||||
class Addresses < Fog::Collection
|
||||
|
||||
model Fog::Vcloud::Shared::Address
|
||||
model Fog::Terremark::Shared::Address
|
||||
|
||||
def all
|
||||
load(connection.get_public_ips(vdc_id).body['PublicIpAddresses'])
|
|
@ -1,7 +1,7 @@
|
|||
require 'fog/model'
|
||||
|
||||
module Fog
|
||||
module Vcloud
|
||||
module Terremark
|
||||
module Shared
|
||||
|
||||
class Network < Fog::Model
|
|
@ -1,22 +1,22 @@
|
|||
module Fog
|
||||
module Vcloud
|
||||
module Terremark
|
||||
module Shared
|
||||
|
||||
module Mock
|
||||
def networks(options = {})
|
||||
Fog::Vcloud::Shared::Networks.new(options.merge(:connection => self))
|
||||
Fog::Terremark::Shared::Networks.new(options.merge(:connection => self))
|
||||
end
|
||||
end
|
||||
|
||||
module Real
|
||||
def networks(options = {})
|
||||
Fog::Vcloud::Shared::Networks.new(options.merge(:connection => self))
|
||||
Fog::Terremark::Shared::Networks.new(options.merge(:connection => self))
|
||||
end
|
||||
end
|
||||
|
||||
class Networks < Fog::Collection
|
||||
|
||||
model Fog::Vcloud::Shared::Network
|
||||
model Fog::Terremark::Shared::Network
|
||||
|
||||
def all
|
||||
data = connection.get_vdc(vdc_id).body['AvailableNetworks'].map do |network|
|
|
@ -1,7 +1,7 @@
|
|||
require 'fog/model'
|
||||
|
||||
module Fog
|
||||
module Vcloud
|
||||
module Terremark
|
||||
module Shared
|
||||
|
||||
class Server < Fog::Model
|
|
@ -1,25 +1,25 @@
|
|||
require 'fog/collection'
|
||||
require 'fog/vcloud/models/shared/server'
|
||||
require 'fog/terremark/models/shared/server'
|
||||
|
||||
module Fog
|
||||
module Vcloud
|
||||
module Terremark
|
||||
module Shared
|
||||
|
||||
module Mock
|
||||
def servers(options = {})
|
||||
Fog::Vcloud::Shared::Servers.new(options.merge(:connection => self))
|
||||
Fog::Terremark::Shared::Servers.new(options.merge(:connection => self))
|
||||
end
|
||||
end
|
||||
|
||||
module Real
|
||||
def servers(options = {})
|
||||
Fog::Vcloud::Shared::Servers.new(options.merge(:connection => self))
|
||||
Fog::Terremark::Shared::Servers.new(options.merge(:connection => self))
|
||||
end
|
||||
end
|
||||
|
||||
class Servers < Fog::Collection
|
||||
|
||||
model Fog::Vcloud::Shared::Server
|
||||
model Fog::Terremark::Shared::Server
|
||||
|
||||
def all
|
||||
data = connection.get_vdc(vdc_id).body['ResourceEntities'].select do |entity|
|
|
@ -1,7 +1,7 @@
|
|||
require 'fog/model'
|
||||
|
||||
module Fog
|
||||
module Vcloud
|
||||
module Terremark
|
||||
module Shared
|
||||
|
||||
class Task < Fog::Model
|
|
@ -1,25 +1,25 @@
|
|||
require 'fog/collection'
|
||||
require 'fog/vcloud/models/shared/server'
|
||||
require 'fog/terremark/models/shared/server'
|
||||
|
||||
module Fog
|
||||
module Vcloud
|
||||
module Terremark
|
||||
module Shared
|
||||
|
||||
module Mock
|
||||
def tasks
|
||||
Fog::Vcloud::Shared::Tasks.new(:connection => self)
|
||||
Fog::Terremark::Shared::Tasks.new(:connection => self)
|
||||
end
|
||||
end
|
||||
|
||||
module Real
|
||||
def tasks
|
||||
Fog::Vcloud::Shared::Tasks.new(:connection => self)
|
||||
Fog::Terremark::Shared::Tasks.new(:connection => self)
|
||||
end
|
||||
end
|
||||
|
||||
class Tasks < Fog::Collection
|
||||
|
||||
model Fog::Vcloud::Shared::Task
|
||||
model Fog::Terremark::Shared::Task
|
||||
|
||||
def all
|
||||
data = connection.get_tasks_list(task_list_id).body['Tasks']
|
|
@ -1,7 +1,7 @@
|
|||
require 'fog/model'
|
||||
|
||||
module Fog
|
||||
module Vcloud
|
||||
module Terremark
|
||||
module Shared
|
||||
|
||||
class Vdc < Fog::Model
|
|
@ -1,22 +1,22 @@
|
|||
module Fog
|
||||
module Vcloud
|
||||
module Terremark
|
||||
module Shared
|
||||
|
||||
module Mock
|
||||
def vdcs(options = {})
|
||||
Fog::Vcloud::Shared::Vdcs.new(options.merge(:connection => self))
|
||||
Fog::Terremark::Shared::Vdcs.new(options.merge(:connection => self))
|
||||
end
|
||||
end
|
||||
|
||||
module Real
|
||||
def vdcs(options = {})
|
||||
Fog::Vcloud::Shared::Vdcs.new(options.merge(:connection => self))
|
||||
Fog::Terremark::Shared::Vdcs.new(options.merge(:connection => self))
|
||||
end
|
||||
end
|
||||
|
||||
class Vdcs < Fog::Collection
|
||||
|
||||
model Fog::Vcloud::Shared::Vdc
|
||||
model Fog::Terremark::Shared::Vdc
|
||||
|
||||
def all
|
||||
data = connection.get_organization(organization_id).body['Links'].select do |entity|
|
|
@ -221,9 +221,16 @@ module Fog
|
|||
end
|
||||
|
||||
def shared_requires
|
||||
include Fog::Vcloud::Shared
|
||||
shared_requires
|
||||
|
||||
require 'fog/terremark/models/shared/address'
|
||||
require 'fog/terremark/models/shared/addresses'
|
||||
require 'fog/terremark/models/shared/network'
|
||||
require 'fog/terremark/models/shared/networks'
|
||||
require 'fog/terremark/models/shared/server'
|
||||
require 'fog/terremark/models/shared/servers'
|
||||
require 'fog/terremark/models/shared/task'
|
||||
require 'fog/terremark/models/shared/tasks'
|
||||
require 'fog/terremark/models/shared/vdc'
|
||||
require 'fog/terremark/models/shared/vdcs'
|
||||
require 'fog/terremark/parsers/shared/get_catalog'
|
||||
require 'fog/terremark/parsers/shared/get_catalog_item'
|
||||
require 'fog/terremark/parsers/shared/get_internet_services'
|
||||
|
|
|
@ -250,10 +250,6 @@ module Fog
|
|||
class <<self
|
||||
def new(credentials = {})
|
||||
unless @required
|
||||
require 'fog/vcloud/shared'
|
||||
include Fog::vcloud::Shared
|
||||
shared_requires
|
||||
|
||||
require 'fog/vcloud/parser'
|
||||
require 'fog/vcloud/terremark/vcloud'
|
||||
require 'fog/vcloud/terremark/ecloud'
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
module Fog
|
||||
module Vcloud
|
||||
module Shared
|
||||
def shared_requires
|
||||
require 'fog/vcloud/models/shared/address'
|
||||
require 'fog/vcloud/models/shared/addresses'
|
||||
require 'fog/vcloud/models/shared/network'
|
||||
require 'fog/vcloud/models/shared/networks'
|
||||
require 'fog/vcloud/models/shared/server'
|
||||
require 'fog/vcloud/models/shared/servers'
|
||||
require 'fog/vcloud/models/shared/task'
|
||||
require 'fog/vcloud/models/shared/tasks'
|
||||
require 'fog/vcloud/models/shared/vdc'
|
||||
require 'fog/vcloud/models/shared/vdcs'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue