mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[bluebox] rename blocks to compute for consistency
This commit is contained in:
parent
3d3d247a99
commit
a637504d18
18 changed files with 26 additions and 26 deletions
|
@ -4,14 +4,14 @@ module Fog
|
|||
extend Fog::Provider
|
||||
|
||||
service_path 'fog/bluebox'
|
||||
service :blocks
|
||||
service :compute
|
||||
|
||||
def self.new(attributes = {})
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Fog::Bluebox#new is deprecated, use Fog::Bluebox::Blocks#new instead[/]"
|
||||
warning = "[yellow][WARN] Fog::Bluebox#new is deprecated, use Fog::Bluebox::Compute#new instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::Bluebox::Blocks.new(attributes)
|
||||
Fog::Bluebox::Compute.new(attributes)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -10,21 +10,21 @@ module Bluebox
|
|||
def [](service)
|
||||
@@connections ||= Hash.new do |hash, key|
|
||||
hash[key] = case key
|
||||
when :blocks
|
||||
Fog::Bluebox::Blocks.new
|
||||
when :compute
|
||||
Fog::Bluebox::Compute.new
|
||||
end
|
||||
end
|
||||
@@connections[service]
|
||||
end
|
||||
|
||||
def services
|
||||
[:blocks]
|
||||
[:compute]
|
||||
end
|
||||
|
||||
for collection in Fog::Bluebox::Blocks.collections
|
||||
for collection in Fog::Bluebox::Compute.collections
|
||||
module_eval <<-EOS, __FILE__, __LINE__
|
||||
def #{collection}
|
||||
self[:blocks].#{collection}
|
||||
self[:compute].#{collection}
|
||||
end
|
||||
EOS
|
||||
end
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
module Fog
|
||||
module Bluebox
|
||||
class Blocks < Fog::Service
|
||||
class Compute < Fog::Service
|
||||
|
||||
requires :bluebox_api_key, :bluebox_customer_id
|
||||
|
||||
model_path 'fog/bluebox/models/blocks'
|
||||
model_path 'fog/bluebox/models/compute'
|
||||
model :flavor
|
||||
collection :flavors
|
||||
model :image
|
||||
|
@ -12,7 +12,7 @@ module Fog
|
|||
model :server
|
||||
collection :servers
|
||||
|
||||
request_path 'fog/bluebox/requests/blocks'
|
||||
request_path 'fog/bluebox/requests/compute'
|
||||
request :create_block
|
||||
request :destroy_block
|
||||
request :get_block
|
|
@ -2,7 +2,7 @@ require 'fog/model'
|
|||
|
||||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
|
||||
class Flavor < Fog::Model
|
||||
|
|
@ -3,7 +3,7 @@ require 'fog/bluebox/models/flavor'
|
|||
|
||||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
|
||||
class Flavors < Fog::Collection
|
||||
|
|
@ -2,7 +2,7 @@ require 'fog/model'
|
|||
|
||||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
|
||||
class Image < Fog::Model
|
||||
|
|
@ -3,7 +3,7 @@ require 'fog/bluebox/models/image'
|
|||
|
||||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
|
||||
class Images < Fog::Collection
|
||||
|
|
@ -2,7 +2,7 @@ require 'fog/model'
|
|||
|
||||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
|
||||
class BlockInstantiationError < StandardError; end
|
||||
|
|
@ -3,7 +3,7 @@ require 'fog/bluebox/models/server'
|
|||
|
||||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
|
||||
class Servers < Fog::Collection
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Create a new block
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Destroy a block
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Get details of a block.
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Get list of blocks
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Get details of a product
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Get list of products
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Get details of a template
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Get list of OS templates
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module Bluebox
|
||||
class Blocks
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Reboot block
|
Loading…
Reference in a new issue