Class: Fog::GoGrid::Compute::Mock
- Inherits:
-
Object
- Object
- Fog::GoGrid::Compute::Mock
- Defined in:
- lib/fog/compute/go_grid.rb,
lib/fog/compute/requests/go_grid/grid_ip_list.rb,
lib/fog/compute/requests/go_grid/grid_image_get.rb,
lib/fog/compute/requests/go_grid/grid_image_list.rb,
lib/fog/compute/requests/go_grid/grid_server_add.rb,
lib/fog/compute/requests/go_grid/grid_server_get.rb,
lib/fog/compute/requests/go_grid/grid_server_list.rb,
lib/fog/compute/requests/go_grid/grid_server_power.rb,
lib/fog/compute/requests/go_grid/common_lookup_list.rb,
lib/fog/compute/requests/go_grid/grid_server_delete.rb,
lib/fog/compute/requests/go_grid/grid_loadbalancer_list.rb
Class Method Summary collapse
Instance Method Summary collapse
- #common_lookup_list(lookup, options = {}) ⇒ Object
- #grid_image_get(options = {}) ⇒ Object
- #grid_image_list(options = {}) ⇒ Object
- #grid_ip_list(options = {}) ⇒ Object
- #grid_loadbalancer_list(options = {}) ⇒ Object
- #grid_server_add(image, ip, name, server_ram, options = {}) ⇒ Object
- #grid_server_delete(server) ⇒ Object
- #grid_server_get(servers) ⇒ Object
- #grid_server_list(options = {}) ⇒ Object
- #grid_server_power(server) ⇒ Object
-
#initialize(options = {}) ⇒ Mock
constructor
A new instance of Mock.
Constructor Details
#initialize(options = {}) ⇒ Mock
Returns a new instance of Mock.
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/fog/compute/go_grid.rb', line 41 def initialize(={}) unless .delete(:provider) location = caller.first warning = "[yellow][WARN] Fog::GoGrid::Compute.new is deprecated, use Fog::Compute.new(:provider => 'GoGrid') instead[/]" warning << " [light_black](" << location << ")[/] " Formatador.display_line(warning) end @go_grid_api_key = [:go_grid_api_key] @go_grid_shared_secret = [:go_grid_shared_secret] @data = self.class.data[@go_grid_api_key] end |
Class Method Details
.data ⇒ Object
29 30 31 32 33 |
# File 'lib/fog/compute/go_grid.rb', line 29 def self.data @data ||= Hash.new do |hash, key| hash[key] = {} end end |
.reset_data(keys = data.keys) ⇒ Object
35 36 37 38 39 |
# File 'lib/fog/compute/go_grid.rb', line 35 def self.reset_data(keys=data.keys) for key in [*keys] data.delete(key) end end |
Instance Method Details
#common_lookup_list(lookup, options = {}) ⇒ Object
29 30 31 |
# File 'lib/fog/compute/requests/go_grid/common_lookup_list.rb', line 29 def common_lookup_list(lookup, ={}) Fog::Mock.not_implemented end |
#grid_image_get(options = {}) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/fog/compute/requests/go_grid/grid_image_get.rb', line 29 def grid_image_get(={}) #response = Excon::Response.new #images = @data[:list].values #for image in images # case image['state'] # when 'Available' end |
#grid_image_list(options = {}) ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/fog/compute/requests/go_grid/grid_image_list.rb', line 32 def grid_image_list(={}) #response = Excon::Response.new #images = @data[:list].values #for image in images # case image['state'] # when 'Available' end |
#grid_ip_list(options = {}) ⇒ Object
31 32 33 |
# File 'lib/fog/compute/requests/go_grid/grid_ip_list.rb', line 31 def grid_ip_list(={}) Fog::Mock.not_implemented end |
#grid_loadbalancer_list(options = {}) ⇒ Object
29 30 31 |
# File 'lib/fog/compute/requests/go_grid/grid_loadbalancer_list.rb', line 29 def grid_loadbalancer_list(={}) Fog::Mock.not_implemented end |
#grid_server_add(image, ip, name, server_ram, options = {}) ⇒ Object
37 38 39 |
# File 'lib/fog/compute/requests/go_grid/grid_server_add.rb', line 37 def grid_server_add(image, ip, name, server_ram, ={}) Fog::Mock.not_implemented end |
#grid_server_delete(server) ⇒ Object
26 27 28 |
# File 'lib/fog/compute/requests/go_grid/grid_server_delete.rb', line 26 def grid_server_delete(server) Fog::Mock.not_implemented end |
#grid_server_get(servers) ⇒ Object
26 27 28 |
# File 'lib/fog/compute/requests/go_grid/grid_server_get.rb', line 26 def grid_server_get(servers) Fog::Mock.not_implemented end |
#grid_server_list(options = {}) ⇒ Object
31 32 33 |
# File 'lib/fog/compute/requests/go_grid/grid_server_list.rb', line 31 def grid_server_list(={}) Fog::Mock.not_implemented end |
#grid_server_power(server) ⇒ Object
27 28 29 |
# File 'lib/fog/compute/requests/go_grid/grid_server_power.rb', line 27 def grid_server_power(server) Fog::Mock.not_implemented end |