mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
![sawanoboly](/assets/img/avatar_default.png)
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
50 lines
1.2 KiB
Ruby
50 lines
1.2 KiB
Ruby
# coding: utf-8
|
|
|
|
module Fog
|
|
module Volume
|
|
class SakuraCloud
|
|
class Real
|
|
def list_disks(options = {})
|
|
request(
|
|
:headers => {
|
|
'Authorization' => "Basic #{@auth_encord}"
|
|
},
|
|
:method => 'GET',
|
|
:path => "#{Fog::SakuraCloud::SAKURACLOUD_API_ENDPOINT}/disk"
|
|
)
|
|
end
|
|
end
|
|
|
|
class Mock
|
|
def list_disks(options = {})
|
|
response = Excon::Response.new
|
|
response.status = 200
|
|
response.body = {
|
|
"Disks" =>
|
|
[
|
|
{"Index" => 0,
|
|
"ID" =>112600053890,
|
|
"Name" =>"foober1",
|
|
"Connection" => "virtio",
|
|
"Availability"=>"available",
|
|
"SizeMB"=>20480,
|
|
"Plan"=> {},
|
|
"SourceDisk" => nil,
|
|
"SourceArchive" => {}},
|
|
{"Index" => 1,
|
|
"ID" =>112600053891,
|
|
"Name" =>"foober2",
|
|
"Connection" => "virtio",
|
|
"Availability"=>"available",
|
|
"SizeMB"=>20480,
|
|
"Plan"=> {},
|
|
"SourceDisk" => nil,
|
|
"SourceArchive" => {}}
|
|
]
|
|
}
|
|
response
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|