1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/bin/sakuracloud.rb
sawanoboly 453b021bbd writenig provider for sakuracloud ,wip
list ssh_keys and create disk

add models and requests for  create computer

create server at once

add bin and route file

update create_with

write getting_started wip. and create helper methods.

add sakura to mock_helper

add bin and route file

write getting_started wip. and create helper methods.

add mocks and test

create tests and write getting started

writenig provider for sakuracloud ,wip

list ssh_keys and create disk

add models and requests for  create computer

create server at once

add bin and route file

update create_with

write getting_started wip. and create helper methods.

add sakura to mock_helper

add bin and route file

write getting_started wip. and create helper methods.

add mocks and test

create tests and write getting started

mv getting_started to docs

mv getting_started to docs

use snake_case for models

fix: wrong usage of :aliases

update doc. replace to snake_case from class

update mocks format

Fix: remove commas for Ruby 1.8.7

duplicate example

use create method with option if atatch volume

remove empty line (checking travis works..)

fix args for core/provider.rb#service
2014-02-12 12:30:44 +09:00

36 lines
975 B
Ruby

class SakuraCloud < Fog::Bin
class << self
def class_for(key)
case key
when :compute
Fog::Compute::SakuraCloud
when :volume
Fog::Volume::SakuraCloud
else
raise ArgumentError, "Unrecognized service: #{key}"
end
end
def [](service)
@@connections ||= Hash.new do |hash, key|
hash[key] = case key
when :compute
Fog::Logger.warning("SakuraCloud[:compute] is not recommended, use Compute[:sakuracloud] for portability")
Fog::Compute.new(:provider => 'SakuraCloud')
when :volume
Fog::Logger.warning("SakuraCloud[:compute] is not recommended, use Compute[:SakuraCloud] for portability")
Fog::Compute.new(:provider => 'SakuraCloud')
else
raise ArgumentError, "Unrecognized service: #{key.inspect}"
end
end
@@connections[service]
end
def services
Fog::SakuraCloud.services
end
end
end