fog-sakuracloud 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/fog/sakuracloud.rb +15 -2
- data/lib/fog/sakuracloud/compute.rb +3 -1
- data/lib/fog/sakuracloud/dns.rb +3 -1
- data/lib/fog/sakuracloud/models/volume/plan.rb +1 -0
- data/lib/fog/sakuracloud/network.rb +3 -1
- data/lib/fog/sakuracloud/requests/compute/boot_server.rb +1 -1
- data/lib/fog/sakuracloud/requests/compute/create_server.rb +1 -1
- data/lib/fog/sakuracloud/requests/compute/delete_server.rb +1 -1
- data/lib/fog/sakuracloud/requests/compute/list_plans.rb +1 -1
- data/lib/fog/sakuracloud/requests/compute/list_servers.rb +1 -1
- data/lib/fog/sakuracloud/requests/compute/list_ssh_keys.rb +1 -1
- data/lib/fog/sakuracloud/requests/compute/list_zones.rb +1 -1
- data/lib/fog/sakuracloud/requests/compute/stop_server.rb +1 -1
- data/lib/fog/sakuracloud/requests/dns/create_zone.rb +1 -1
- data/lib/fog/sakuracloud/requests/dns/delete_zone.rb +1 -1
- data/lib/fog/sakuracloud/requests/dns/list_zones.rb +1 -1
- data/lib/fog/sakuracloud/requests/dns/modify_zone.rb +1 -1
- data/lib/fog/sakuracloud/requests/network/connect_interface_to_switch.rb +1 -1
- data/lib/fog/sakuracloud/requests/network/create_router.rb +1 -1
- data/lib/fog/sakuracloud/requests/network/create_switch.rb +1 -1
- data/lib/fog/sakuracloud/requests/network/delete_interface.rb +1 -1
- data/lib/fog/sakuracloud/requests/network/delete_router.rb +1 -1
- data/lib/fog/sakuracloud/requests/network/delete_switch.rb +1 -1
- data/lib/fog/sakuracloud/requests/network/list_interfaces.rb +1 -1
- data/lib/fog/sakuracloud/requests/network/list_routers.rb +1 -1
- data/lib/fog/sakuracloud/requests/network/list_switches.rb +1 -1
- data/lib/fog/sakuracloud/requests/network/regist_interface_to_server.rb +1 -1
- data/lib/fog/sakuracloud/requests/script/create_note.rb +1 -1
- data/lib/fog/sakuracloud/requests/script/delete_note.rb +1 -1
- data/lib/fog/sakuracloud/requests/script/list_notes.rb +1 -1
- data/lib/fog/sakuracloud/requests/script/modify_note.rb +1 -1
- data/lib/fog/sakuracloud/requests/volume/associate_ip_to_disk.rb +1 -1
- data/lib/fog/sakuracloud/requests/volume/attach_disk.rb +1 -1
- data/lib/fog/sakuracloud/requests/volume/carve_hostname_on_disk.rb +1 -1
- data/lib/fog/sakuracloud/requests/volume/configure_disk.rb +1 -1
- data/lib/fog/sakuracloud/requests/volume/create_disk.rb +1 -1
- data/lib/fog/sakuracloud/requests/volume/delete_disk.rb +1 -1
- data/lib/fog/sakuracloud/requests/volume/list_archives.rb +1 -1
- data/lib/fog/sakuracloud/requests/volume/list_disks.rb +1 -1
- data/lib/fog/sakuracloud/requests/volume/list_plans.rb +26 -10
- data/lib/fog/sakuracloud/requests/volume/register_note_to_disk.rb +1 -1
- data/lib/fog/sakuracloud/script.rb +3 -1
- data/lib/fog/sakuracloud/version.rb +1 -1
- data/lib/fog/sakuracloud/volume.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44007b32b6e17b0fe4a28c84c57bc4e8848b4da6
|
4
|
+
data.tar.gz: f091a5cfcd6e290c829dc31502dd3a146bb8c31c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa9b69bdb76aabcec1945c580ec77bd267562473309101a5920978dc1177df88a032f455dff0fad173918cec77f854efb079cbc1247177f69ce4a91db9c0baf7
|
7
|
+
data.tar.gz: 386799b76c599ba970b03c7d91f3449beaa943775bb798827f0469792d8fa53a6a7cc907f69893ecd56e3f773fd08ac4923862cf829931a9d00604362b93412a
|
data/CHANGELOG.md
CHANGED
data/lib/fog/sakuracloud.rb
CHANGED
@@ -22,8 +22,6 @@ module Fog
|
|
22
22
|
extend Fog::Provider
|
23
23
|
|
24
24
|
SAKURACLOUD_API_VERSION = '1.1' unless defined? SAKURACLOUD_API_VERSION
|
25
|
-
SAKURACLOUD_API_ZONE = "is1b" unless defined? SAKURACLOUD_API_ZONE
|
26
|
-
SAKURACLOUD_API_ENDPOINT = "/cloud/zone/#{SAKURACLOUD_API_ZONE}/api/cloud/#{SAKURACLOUD_API_VERSION}/"
|
27
25
|
|
28
26
|
# Miscs
|
29
27
|
## Startup Script
|
@@ -34,5 +32,20 @@ module Fog
|
|
34
32
|
service(:network, 'Network')
|
35
33
|
service(:script, 'Script')
|
36
34
|
service(:dns, 'DNS')
|
35
|
+
|
36
|
+
|
37
|
+
def self.api_zones
|
38
|
+
@api_zones ||= ['tk1a','is1b', 'is1b', 'tk1v']
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.validate_api_zone!(api_zone, host=nil)
|
42
|
+
if !api_zones.include?(api_zone)
|
43
|
+
raise ArgumentError, "Unknown api_zone: #{api_zone.inspect}"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.build_endpoint(api_zone)
|
48
|
+
"/cloud/zone/#{api_zone}/api/cloud/#{SAKURACLOUD_API_VERSION}/"
|
49
|
+
end
|
37
50
|
end
|
38
51
|
end
|
@@ -4,7 +4,7 @@ module Fog
|
|
4
4
|
requires :sakuracloud_api_token
|
5
5
|
requires :sakuracloud_api_token_secret
|
6
6
|
|
7
|
-
recognizes :sakuracloud_api_url
|
7
|
+
recognizes :sakuracloud_api_url, :api_zone
|
8
8
|
|
9
9
|
model_path 'fog/sakuracloud/models/compute'
|
10
10
|
model :server
|
@@ -36,6 +36,8 @@ module Fog
|
|
36
36
|
Fog.credentials[:sakuracloud_api_token_secret] = options[:sakuracloud_api_token_secret]
|
37
37
|
|
38
38
|
@sakuracloud_api_url = options[:sakuracloud_api_url] || 'https://secure.sakura.ad.jp'
|
39
|
+
@api_zone = options[:api_zone] || 'is1b'
|
40
|
+
Fog::SakuraCloud.validate_api_zone!(@api_zone)
|
39
41
|
|
40
42
|
@connection = Fog::Core::Connection.new(@sakuracloud_api_url)
|
41
43
|
end
|
data/lib/fog/sakuracloud/dns.rb
CHANGED
@@ -4,7 +4,7 @@ module Fog
|
|
4
4
|
requires :sakuracloud_api_token
|
5
5
|
requires :sakuracloud_api_token_secret
|
6
6
|
|
7
|
-
recognizes :sakuracloud_api_url
|
7
|
+
recognizes :sakuracloud_api_url, :api_zone
|
8
8
|
|
9
9
|
model_path 'fog/sakuracloud/models/dns'
|
10
10
|
model :zone
|
@@ -26,6 +26,8 @@ module Fog
|
|
26
26
|
Fog.credentials[:sakuracloud_api_token_secret] = options[:sakuracloud_api_token_secret]
|
27
27
|
|
28
28
|
@sakuracloud_api_url = options[:sakuracloud_api_url] || 'https://secure.sakura.ad.jp'
|
29
|
+
@api_zone = options[:api_zone] || 'is1b'
|
30
|
+
Fog::SakuraCloud.validate_api_zone!(@api_zone)
|
29
31
|
|
30
32
|
@connection = Fog::Core::Connection.new(@sakuracloud_api_url)
|
31
33
|
end
|
@@ -4,7 +4,7 @@ module Fog
|
|
4
4
|
requires :sakuracloud_api_token
|
5
5
|
requires :sakuracloud_api_token_secret
|
6
6
|
|
7
|
-
recognizes :sakuracloud_api_url
|
7
|
+
recognizes :sakuracloud_api_url, :api_zone
|
8
8
|
|
9
9
|
model_path 'fog/sakuracloud/models/network'
|
10
10
|
model :router
|
@@ -36,6 +36,8 @@ module Fog
|
|
36
36
|
Fog.credentials[:sakuracloud_api_token_secret] = options[:sakuracloud_api_token_secret]
|
37
37
|
|
38
38
|
@sakuracloud_api_url = options[:sakuracloud_api_url] || 'https://secure.sakura.ad.jp'
|
39
|
+
@api_zone = options[:api_zone] || 'is1b'
|
40
|
+
Fog::SakuraCloud.validate_api_zone!(@api_zone)
|
39
41
|
|
40
42
|
@connection = Fog::Core::Connection.new(@sakuracloud_api_url)
|
41
43
|
end
|
@@ -16,7 +16,7 @@ module Fog
|
|
16
16
|
},
|
17
17
|
:expects => [200,202],
|
18
18
|
:method => 'DELETE',
|
19
|
-
:path => "#{Fog::SakuraCloud
|
19
|
+
:path => "#{Fog::SakuraCloud.build_endpoint(@api_zone)}/server/#{id}/power",
|
20
20
|
:body => Fog::JSON.encode(body)
|
21
21
|
)
|
22
22
|
true
|
@@ -26,7 +26,7 @@ module Fog
|
|
26
26
|
},
|
27
27
|
:expects => 201,
|
28
28
|
:method => 'POST',
|
29
|
-
:path => "#{Fog::SakuraCloud
|
29
|
+
:path => "#{Fog::SakuraCloud.build_endpoint(@api_zone)}/commonserviceitem",
|
30
30
|
:body => Fog::JSON.encode(body)
|
31
31
|
)
|
32
32
|
end
|
@@ -15,7 +15,7 @@ module Fog
|
|
15
15
|
'Authorization' => "Basic #{@auth_encode}"
|
16
16
|
},
|
17
17
|
:method => 'GET',
|
18
|
-
:path => "#{Fog::SakuraCloud
|
18
|
+
:path => "#{Fog::SakuraCloud.build_endpoint(@api_zone)}/commonserviceitem",
|
19
19
|
:query => URI.encode(Fog::JSON.encode(filter))
|
20
20
|
)
|
21
21
|
end
|
@@ -17,7 +17,7 @@ module Fog
|
|
17
17
|
},
|
18
18
|
:expects => 200,
|
19
19
|
:method => 'PUT',
|
20
|
-
:path => "#{Fog::SakuraCloud
|
20
|
+
:path => "#{Fog::SakuraCloud.build_endpoint(@api_zone)}/commonserviceitem/#{options[:id]}",
|
21
21
|
:body => Fog::JSON.encode(body)
|
22
22
|
)
|
23
23
|
end
|
@@ -11,7 +11,7 @@ module Fog
|
|
11
11
|
},
|
12
12
|
:expects => [200],
|
13
13
|
:method => 'PUT',
|
14
|
-
:path => "#{Fog::SakuraCloud
|
14
|
+
:path => "#{Fog::SakuraCloud.build_endpoint(@api_zone)}/interface/#{id}/to/switch/#{switch_id}"
|
15
15
|
)
|
16
16
|
response.body['Interface']['ID']
|
17
17
|
end
|
@@ -19,7 +19,7 @@ module Fog
|
|
19
19
|
'Authorization' => "Basic #{@auth_encode}"
|
20
20
|
},
|
21
21
|
:method => 'GET',
|
22
|
-
:path => "#{Fog::SakuraCloud
|
22
|
+
:path => "#{Fog::SakuraCloud.build_endpoint(@api_zone)}/interface",
|
23
23
|
:query => URI.encode(Fog::JSON.encode(filter))
|
24
24
|
)
|
25
25
|
end
|
@@ -19,7 +19,7 @@ module Fog
|
|
19
19
|
},
|
20
20
|
:expects => [201],
|
21
21
|
:method => 'POST',
|
22
|
-
:path => "#{Fog::SakuraCloud
|
22
|
+
:path => "#{Fog::SakuraCloud.build_endpoint(@api_zone)}/interface",
|
23
23
|
:body => Fog::JSON.encode(body)
|
24
24
|
)
|
25
25
|
response.body['Interface']['ID']
|
@@ -18,7 +18,7 @@ module Fog
|
|
18
18
|
},
|
19
19
|
:expects => [200],
|
20
20
|
:method => 'PUT',
|
21
|
-
:path => "#{Fog::SakuraCloud
|
21
|
+
:path => "#{Fog::SakuraCloud.build_endpoint(@api_zone)}/note/#{options[:id]}",
|
22
22
|
:body => Fog::JSON.encode(body)
|
23
23
|
)
|
24
24
|
end
|
@@ -19,7 +19,7 @@ module Fog
|
|
19
19
|
},
|
20
20
|
:expects => [200],
|
21
21
|
:method => 'PUT',
|
22
|
-
:path => "#{Fog::SakuraCloud
|
22
|
+
:path => "#{Fog::SakuraCloud.build_endpoint(@api_zone)}/disk/#{disk_id.to_s}/config",
|
23
23
|
:body => Fog::JSON.encode(body)
|
24
24
|
)
|
25
25
|
end
|
@@ -11,7 +11,7 @@ module Fog
|
|
11
11
|
},
|
12
12
|
:expects => [200],
|
13
13
|
:method => 'PUT',
|
14
|
-
:path => "#{Fog::SakuraCloud
|
14
|
+
:path => "#{Fog::SakuraCloud.build_endpoint(@api_zone)}/disk/#{disk_id.to_s}/to/server/#{server_id.to_s}"
|
15
15
|
)
|
16
16
|
end
|
17
17
|
end # Real
|
@@ -15,7 +15,7 @@ module Fog
|
|
15
15
|
},
|
16
16
|
:expects => [200],
|
17
17
|
:method => 'PUT',
|
18
|
-
:path => "#{Fog::SakuraCloud
|
18
|
+
:path => "#{Fog::SakuraCloud.build_endpoint(@api_zone)}/disk/#{disk_id.to_s}/config",
|
19
19
|
:body => Fog::JSON.encode(body)
|
20
20
|
)
|
21
21
|
end
|
@@ -15,7 +15,7 @@ module Fog
|
|
15
15
|
},
|
16
16
|
:expects => [200],
|
17
17
|
:method => 'PUT',
|
18
|
-
:path => "#{Fog::SakuraCloud
|
18
|
+
:path => "#{Fog::SakuraCloud.build_endpoint(@api_zone)}/disk/#{disk_id.to_s}/config",
|
19
19
|
:body => Fog::JSON.encode(body)
|
20
20
|
)
|
21
21
|
end
|
@@ -10,7 +10,7 @@ module Fog
|
|
10
10
|
'Authorization' => "Basic #{@auth_encode}"
|
11
11
|
},
|
12
12
|
:method => 'GET',
|
13
|
-
:path => "#{Fog::SakuraCloud
|
13
|
+
:path => "#{Fog::SakuraCloud.build_endpoint(@api_zone)}/product/disk"
|
14
14
|
)
|
15
15
|
end
|
16
16
|
end
|
@@ -20,16 +20,32 @@ module Fog
|
|
20
20
|
response = Excon::Response.new
|
21
21
|
response.status = 200
|
22
22
|
response.body = {
|
23
|
-
|
23
|
+
"DiskPlans" =>
|
24
24
|
[
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
25
|
+
{"Index"=>0,
|
26
|
+
"ID"=>4,
|
27
|
+
"Name"=>"SSDプラン",
|
28
|
+
"Availability"=>"available",
|
29
|
+
"Size"=>
|
30
|
+
[{"SizeMB"=>20480, "DisplaySize"=>20, "DisplaySuffix"=>"GB", "Availability"=>"available", "ServiceClass"=>"cloud/disk/ssd/20g"},
|
31
|
+
{"SizeMB"=>102400, "DisplaySize"=>100, "DisplaySuffix"=>"GB", "Availability"=>"available", "ServiceClass"=>"cloud/disk/ssd/100g"},
|
32
|
+
{"SizeMB"=>256000, "DisplaySize"=>250, "DisplaySuffix"=>"GB", "Availability"=>"available", "ServiceClass"=>"cloud/disk/ssd/250g"},
|
33
|
+
{"SizeMB"=>512000, "DisplaySize"=>500, "DisplaySuffix"=>"GB", "Availability"=>"available", "ServiceClass"=>"cloud/disk/ssd/500g"}]},
|
34
|
+
{"Index"=>1,
|
35
|
+
"ID"=>2,
|
36
|
+
"Name"=>"標準プラン",
|
37
|
+
"Availability"=>"available",
|
38
|
+
"Size"=>
|
39
|
+
[{"SizeMB"=>40960, "DisplaySize"=>40, "DisplaySuffix"=>"GB", "Availability"=>"available", "ServiceClass"=>"cloud/disk/iscsi/40g"},
|
40
|
+
{"SizeMB"=>61440, "DisplaySize"=>60, "DisplaySuffix"=>"GB", "Availability"=>"available", "ServiceClass"=>"cloud/disk/iscsi/60g"},
|
41
|
+
{"SizeMB"=>81920, "DisplaySize"=>80, "DisplaySuffix"=>"GB", "Availability"=>"available", "ServiceClass"=>"cloud/disk/iscsi/80g"},
|
42
|
+
{"SizeMB"=>102400, "DisplaySize"=>100, "DisplaySuffix"=>"GB", "Availability"=>"available", "ServiceClass"=>"cloud/disk/iscsi/100g"},
|
43
|
+
{"SizeMB"=>256000, "DisplaySize"=>250, "DisplaySuffix"=>"GB", "Availability"=>"available", "ServiceClass"=>"cloud/disk/iscsi/250g"},
|
44
|
+
{"SizeMB"=>512000, "DisplaySize"=>500, "DisplaySuffix"=>"GB", "Availability"=>"available", "ServiceClass"=>"cloud/disk/iscsi/500g"},
|
45
|
+
{"SizeMB"=>768000, "DisplaySize"=>750, "DisplaySuffix"=>"GB", "Availability"=>"available", "ServiceClass"=>"cloud/disk/iscsi/750g"},
|
46
|
+
{"SizeMB"=>1048576, "DisplaySize"=>1, "DisplaySuffix"=>"TB", "Availability"=>"available", "ServiceClass"=>"cloud/disk/iscsi/1t"},
|
47
|
+
{"SizeMB"=>2097152, "DisplaySize"=>2, "DisplaySuffix"=>"TB", "Availability"=>"available", "ServiceClass"=>"cloud/disk/iscsi/2t"},
|
48
|
+
{"SizeMB"=>4194304, "DisplaySize"=>4, "DisplaySuffix"=>"TB", "Availability"=>"available", "ServiceClass"=>"cloud/disk/iscsi/4t"}]}
|
33
49
|
]
|
34
50
|
}
|
35
51
|
response
|
@@ -15,7 +15,7 @@ module Fog
|
|
15
15
|
},
|
16
16
|
:expects => [200],
|
17
17
|
:method => 'PUT',
|
18
|
-
:path => "#{Fog::SakuraCloud
|
18
|
+
:path => "#{Fog::SakuraCloud.build_endpoint(@api_zone)}/disk/#{disk_id.to_s}/config",
|
19
19
|
:body => Fog::JSON.encode(body)
|
20
20
|
)
|
21
21
|
end
|
@@ -4,7 +4,7 @@ module Fog
|
|
4
4
|
requires :sakuracloud_api_token
|
5
5
|
requires :sakuracloud_api_token_secret
|
6
6
|
|
7
|
-
recognizes :sakuracloud_api_url
|
7
|
+
recognizes :sakuracloud_api_url, :api_zone
|
8
8
|
|
9
9
|
model_path 'fog/sakuracloud/models/script'
|
10
10
|
model :note
|
@@ -26,6 +26,8 @@ module Fog
|
|
26
26
|
Fog.credentials[:sakuracloud_api_token_secret] = options[:sakuracloud_api_token_secret]
|
27
27
|
|
28
28
|
@sakuracloud_api_url = options[:sakuracloud_api_url] || 'https://secure.sakura.ad.jp'
|
29
|
+
@api_zone = options[:api_zone] || 'is1b'
|
30
|
+
Fog::SakuraCloud.validate_api_zone!(@api_zone)
|
29
31
|
|
30
32
|
@connection = Fog::Core::Connection.new(@sakuracloud_api_url)
|
31
33
|
end
|
@@ -4,7 +4,7 @@ module Fog
|
|
4
4
|
requires :sakuracloud_api_token
|
5
5
|
requires :sakuracloud_api_token_secret
|
6
6
|
|
7
|
-
recognizes :sakuracloud_api_url
|
7
|
+
recognizes :sakuracloud_api_url, :api_zone
|
8
8
|
|
9
9
|
model_path 'fog/sakuracloud/models/volume'
|
10
10
|
model :archive
|
@@ -36,6 +36,8 @@ module Fog
|
|
36
36
|
Fog.credentials[:sakuracloud_api_token_secret] = options[:sakuracloud_api_token_secret]
|
37
37
|
|
38
38
|
@sakuracloud_api_url = options[:sakuracloud_api_url] || 'https://secure.sakura.ad.jp'
|
39
|
+
@api_zone = options[:api_zone] || 'is1b'
|
40
|
+
Fog::SakuraCloud.validate_api_zone!(@api_zone)
|
39
41
|
|
40
42
|
@connection = Fog::Core::Connection.new(@sakuracloud_api_url)
|
41
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-sakuracloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawanoboly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|