Module: Fog::Slicehost

Defined in:
lib/fog/slicehost.rb,
lib/fog/slicehost/models/image.rb,
lib/fog/slicehost/models/flavor.rb,
lib/fog/slicehost/models/images.rb,
lib/fog/slicehost/models/server.rb,
lib/fog/slicehost/models/flavors.rb,
lib/fog/slicehost/models/servers.rb,
lib/fog/slicehost/requests/get_image.rb,
lib/fog/slicehost/requests/get_slice.rb,
lib/fog/slicehost/requests/get_flavor.rb,
lib/fog/slicehost/requests/get_images.rb,
lib/fog/slicehost/requests/get_slices.rb,
lib/fog/slicehost/requests/get_backups.rb,
lib/fog/slicehost/requests/get_flavors.rb,
lib/fog/slicehost/requests/create_slice.rb,
lib/fog/slicehost/requests/delete_slice.rb,
lib/fog/slicehost/requests/reboot_slice.rb

Defined Under Namespace

Classes: Flavor, Flavors, Image, Images, Mock, Real, Server, Servers

Class Method Summary collapse

Class Method Details

.new(options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/fog/slicehost.rb', line 4

def self.new(options={})

  unless @required
    require 'fog/slicehost/models/flavor'
    require 'fog/slicehost/models/flavors'
    require 'fog/slicehost/models/image'
    require 'fog/slicehost/models/images'
    require 'fog/slicehost/models/server'
    require 'fog/slicehost/models/servers'
    require 'fog/slicehost/requests/create_slice'
    require 'fog/slicehost/requests/delete_slice'
    require 'fog/slicehost/requests/get_backups'
    require 'fog/slicehost/requests/get_flavor'
    require 'fog/slicehost/requests/get_flavors'
    require 'fog/slicehost/requests/get_image'
    require 'fog/slicehost/requests/get_images'
    require 'fog/slicehost/requests/get_slice'
    require 'fog/slicehost/requests/get_slices'
    require 'fog/slicehost/requests/reboot_slice'
    @required = true
  end

  unless options[:slicehost_password]
    raise ArgumentError.new('slicehost_password is required to access slicehost')
  end
  if Fog.mocking?
    Fog::Slicehost::Mock.new(options)
  else
    Fog::Slicehost::Real.new(options)
  end
end

.reset_data(keys = Mock.data.keys) ⇒ Object



36
37
38
# File 'lib/fog/slicehost.rb', line 36

def self.reset_data(keys=Mock.data.keys)
  Mock.reset_data(keys)
end