Class: Fog::Compute::Serverlove::Mock
- Inherits:
-
Object
- Object
- Fog::Compute::Serverlove::Mock
- Defined in:
- lib/fog/compute/serverlove.rb,
lib/fog/compute/serverlove/requests/create_image.rb,
lib/fog/compute/serverlove/requests/create_server.rb
Instance Method Summary collapse
- #create_image(options = {}) ⇒ Object
- #create_server(options = {}) ⇒ Object
-
#initialize(options) ⇒ Mock
constructor
A new instance of Mock.
- #request(options) ⇒ Object
Constructor Details
#initialize(options) ⇒ Mock
Returns a new instance of Mock.
41 42 43 44 |
# File 'lib/fog/compute/serverlove.rb', line 41 def initialize() @serverlove_uuid = [:serverlove_uuid] @serverlove_api_key = [:serverlove_api_key] end |
Instance Method Details
#create_image(options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fog/compute/serverlove/requests/create_image.rb', line 12 def create_image( = {}) response = Excon::Response.new response.status = 200 data = { "drive" => Fog::Mock.random_numbers(1000000).to_s, "name" => ["name"] || "Test", "size" => ["size"] || 12345 } response.body = data response end |
#create_server(options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fog/compute/serverlove/requests/create_server.rb', line 12 def create_server( = {}) response = Excon::Response.new response.status = 200 data = { "server" => Fog::Mock.random_numbers(1000000).to_s, "name" => ["name"] || "Test", "cpu" => ["cpu"] || 1000, "persistent" => ["persistent"] || false, "vnc:password" => ["vnc:password"] || "T35tServER!" } response.body = data response end |
#request(options) ⇒ Object
46 47 48 |
# File 'lib/fog/compute/serverlove.rb', line 46 def request() raise "Not implemented" end |