fog-sakuracloud 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 593b781b629e27154fdc45233705b174ec00a7ac
|
4
|
+
data.tar.gz: c326875037021e46d56d49993ee7c171169d4c20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b73100addbed962fa020daf9f9926f5a916ebcd9fc9964c3c356d663d5012ae980fe1a2ae5c2f636ff886c2a14da65726414c097a9740331fe4cab5e54be63e
|
7
|
+
data.tar.gz: 672f4d86de32f4fe747b72f5d4754a4adb9037041aa7f03768dd704032246355e8e1166e62a375cb892e277f136ceca6dad9e62fb27208b15de16bb1f27c6630
|
data/CHANGELOG.md
CHANGED
@@ -31,6 +31,17 @@ module Fog
|
|
31
31
|
service.configure_disk(@attributes[:id], sshkey_id )
|
32
32
|
true
|
33
33
|
end
|
34
|
+
|
35
|
+
def associate_ip(ipaddress, networkmasklen, defaultroute)
|
36
|
+
subnet ={
|
37
|
+
:ipaddress => ipaddress,
|
38
|
+
:networkmasklen => networkmasklen,
|
39
|
+
:defaultroute => defaultroute
|
40
|
+
}
|
41
|
+
requires :id
|
42
|
+
service.associate_ip_to_disk(@attributes[:id], subnet )
|
43
|
+
true
|
44
|
+
end
|
34
45
|
end
|
35
46
|
end
|
36
47
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Volume
|
5
|
+
class SakuraCloud
|
6
|
+
class Real
|
7
|
+
def associate_ip_to_disk( disk_id, subnet )
|
8
|
+
body = {
|
9
|
+
"UserIPAddress" => subnet[:ipaddress],
|
10
|
+
"UserSubnet" => {
|
11
|
+
"NetworkMaskLen" => subnet[:networkmasklen],
|
12
|
+
"DefaultRoute" => subnet[:defaultroute]
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
request(
|
17
|
+
:headers => {
|
18
|
+
'Authorization' => "Basic #{@auth_encord}"
|
19
|
+
},
|
20
|
+
:expects => [200],
|
21
|
+
:method => 'PUT',
|
22
|
+
:path => "#{Fog::SakuraCloud::SAKURACLOUD_API_ENDPOINT}/disk/#{disk_id.to_s}/config",
|
23
|
+
:body => Fog::JSON.encode(body)
|
24
|
+
)
|
25
|
+
end
|
26
|
+
end # Real
|
27
|
+
|
28
|
+
class Mock
|
29
|
+
def associate_ip_to_disk( disk_id, subnet )
|
30
|
+
response = Excon::Response.new
|
31
|
+
response.status = 200
|
32
|
+
response.body = {
|
33
|
+
}
|
34
|
+
response
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end # SakuraCloud
|
38
|
+
end # Volume
|
39
|
+
end # Fog
|
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: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawanoboly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -294,6 +294,7 @@ files:
|
|
294
294
|
- lib/fog/sakuracloud/requests/network/delete_switch.rb
|
295
295
|
- lib/fog/sakuracloud/requests/network/list_routers.rb
|
296
296
|
- lib/fog/sakuracloud/requests/network/list_switches.rb
|
297
|
+
- lib/fog/sakuracloud/requests/volume/associate_ip_to_disk.rb
|
297
298
|
- lib/fog/sakuracloud/requests/volume/attach_disk.rb
|
298
299
|
- lib/fog/sakuracloud/requests/volume/configure_disk.rb
|
299
300
|
- lib/fog/sakuracloud/requests/volume/create_disk.rb
|