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: ed03013c914dcb9864ddd15863a8ea6ff53bcae8
4
- data.tar.gz: df5058d91da52223655eeb3a7a144441a0c4b3b0
3
+ metadata.gz: 593b781b629e27154fdc45233705b174ec00a7ac
4
+ data.tar.gz: c326875037021e46d56d49993ee7c171169d4c20
5
5
  SHA512:
6
- metadata.gz: 1d5e6e195d81ef2f071fe2e840580fab2b89add0f19954f5f68f37882364e39309bfddafbda62ab6517d444e683f0fc539bc4948c8568814dd2a885c86571b48
7
- data.tar.gz: a16f37c56c3e38e89c205495f43f518f114be8e7f3d19bebda581fff2694b46984d09486c2b444b6af87c22a113126c55e7ecd89d1287b5dfcaa2dea6b652be8
6
+ metadata.gz: 7b73100addbed962fa020daf9f9926f5a916ebcd9fc9964c3c356d663d5012ae980fe1a2ae5c2f636ff886c2a14da65726414c097a9740331fe4cab5e54be63e
7
+ data.tar.gz: 672f4d86de32f4fe747b72f5d4754a4adb9037041aa7f03768dd704032246355e8e1166e62a375cb892e277f136ceca6dad9e62fb27208b15de16bb1f27c6630
@@ -1,5 +1,9 @@
1
1
  # Changelog of fog-sakuracloud
2
2
 
3
+ ## v0.1.1
4
+
5
+ - Add: Associate IP address to disk
6
+
3
7
  ## v0.1.0
4
8
 
5
9
  - Add: Network resources
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Sakuracloud
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -22,6 +22,7 @@ module Fog
22
22
  request :list_plans
23
23
  request :create_disk
24
24
  request :configure_disk
25
+ request :associate_ip_to_disk
25
26
  request :attach_disk
26
27
  request :delete_disk
27
28
  request :list_archives
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.0
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-22 00:00:00.000000000 Z
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