class Fog::Compute::CloudAtCost::Mock

noinspection RubyStringKeysInHashInspection

noinspection RubyStringKeysInHashInspection

noinspection RubyStringKeysInHashInspection

Public Class Methods

new(options={}) click to toggle source
# File lib/fog/cloudatcost/compute.rb, line 33
def initialize(options={})
  @api_key = options[:api_key]
  @email   = options[:email]
end

Public Instance Methods

console(id, hostname) click to toggle source
# File lib/fog/cloudatcost/requests/console.rb, line 17
def console(id, hostname)
  response         = Excon::Response.new
  response.status  = 200
  response.body    = {
    'server_id'  => Fog::Mock.random_numbers(1).to_i,
    'api'        => 'v1',
    'status'     => 'ok',
    'console'    => 'http:\/\/panel.cloudatcost.com:12345\/console.html?servername=123456&hostname=1.1.1.1&sshkey=123456&sha1hash=aBcDeFgG',
    'time'       => 12312323,
  }
  response
end
create_server(cpu, ram, storage, template_id) click to toggle source
# File lib/fog/cloudatcost/requests/create_server.rb, line 17
def create_server(cpu, ram, storage, template_id)
  response         = Excon::Response.new
  response.status  = 200
  response.body    = {
    'result'     => 'successful',
    'api'        => 'v1',
    'action'     => 'build',
    'status'     => 'ok',
    'taskid'     => 123123123123,
    'time'       => 12312323,
  }
  response
end
delete_server(id) click to toggle source
# File lib/fog/cloudatcost/requests/delete_server.rb, line 17
def delete_server(id)
  response         = Excon::Response.new
  response.status  = 200
  response.body    = {
    'result'     => 'successful',
    'api'        => 'v1',
    'action'     => 'delete',
    'status'     => 'ok',
    'taskid'     => 123123123123,
    'time'       => 12312323,
  }
  response
end
list_servers() click to toggle source
# File lib/fog/cloudatcost/requests/list_servers.rb, line 16
def list_servers
  response = Excon::Response.new
  response.status = 200
  response.body = {
      'status' => 'OK',
      'servers'  => self.data[:data]
  }
  response
end
list_tasks() click to toggle source
# File lib/fog/cloudatcost/requests/list_tasks.rb, line 16
def list_tasks
  response = Excon::Response.new
  response.status = 200
  response.body = {
      'status' => 'OK',
      'servers'  => self.data[:data]
  }
  response
end
list_templates() click to toggle source
# File lib/fog/cloudatcost/requests/list_templates.rb, line 16
def list_templates
  response = Excon::Response.new
  response.status = 200
  response.body = {
      'status' => 'OK',
      'servers'  => self.data[:data]
  }
  response
end
power_off(id) click to toggle source
# File lib/fog/cloudatcost/requests/power_off.rb, line 17
def power_off(id)
  response         = Excon::Response.new
  response.status  = 200
  response.body    = {
    'server_id'   => Fog::Mock.random_numbers(1).to_i,
    'api'        => 'v1',
    'status'     => 'ok',
    'result'     => 'successful',
    'action'     => 'poweroff',
    'time'       => 12312323,
    'taskid'     => 123123123123
  }
  response
end
power_on(id) click to toggle source
# File lib/fog/cloudatcost/requests/power_on.rb, line 17
def power_on(id)
  response         = Excon::Response.new
  response.status  = 200
  response.body    = {
    'server_id'   => Fog::Mock.random_numbers(1).to_i,
    'api'        => 'v1',
    'status'     => 'ok',
    'result'     => 'successful',
    'action'     => 'poweron',
    'time'       => 12312323,
    'taskid'     => 123123123123
  }
  response
end
rename_server(id, name) click to toggle source
# File lib/fog/cloudatcost/requests/rename_server.rb, line 17
def rename_server(id, name)
  response         = Excon::Response.new
  response.status  = 200
  response.body    = {
    'server_id'   => Fog::Mock.random_numbers(1).to_i,
    'api'        => "v1",
    'status'     => "ok",
    'result'     => "successful",
    'time'       => 12312323,
  }
  response
end
reset(id) click to toggle source
# File lib/fog/cloudatcost/requests/reset.rb, line 17
def reset(id)
  response         = Excon::Response.new
  response.status  = 200
  response.body    = {
    'server_id'   => Fog::Mock.random_numbers(1).to_i,
    'api'        => 'v1',
    'status'     => 'ok',
    'result'     => 'successful',
    'action'     => 'reset',
    'time'       => 12312323,
    'taskid'     => 123123123123
  }
  response
end
reverse_dns(id, hostname) click to toggle source
# File lib/fog/cloudatcost/requests/reverse_dns.rb, line 17
def reverse_dns(id, hostname)
  response         = Excon::Response.new
  response.status  = 200
  response.body    = {
    'server_id'   => Fog::Mock.random_numbers(1).to_i,
    'api'        => 'v1',
    'status'     => 'ok',
    'result'     => 'successful',
    'time'       => 12312323,
  }
  response
end
run_mode(id, action) click to toggle source
# File lib/fog/cloudatcost/requests/run_mode.rb, line 17
def run_mode(id, action)
  response         = Excon::Response.new
  response.status  = 200
  response.body    = {
    'server_id'   => Fog::Mock.random_numbers(1).to_i,
    'api'        => 'v1',
    'status'     => 'ok',
    'result'     => 'successful',
    'time'       => 12312323,
  }
  response
end