fog-sakuracloud 1.5.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.travis.yml +2 -0
 - data/CHANGELOG.md +5 -0
 - data/lib/fog/sakuracloud.rb +1 -0
 - data/lib/fog/sakuracloud/compute.rb +2 -12
 - data/lib/fog/sakuracloud/dns.rb +2 -12
 - data/lib/fog/sakuracloud/models/compute/server.rb +3 -3
 - data/lib/fog/sakuracloud/models/volume/disk.rb +4 -4
 - data/lib/fog/sakuracloud/network.rb +2 -12
 - data/lib/fog/sakuracloud/script.rb +2 -12
 - data/lib/fog/sakuracloud/utils/request.rb +25 -0
 - data/lib/fog/sakuracloud/version.rb +1 -1
 - data/lib/fog/sakuracloud/volume.rb +2 -12
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 897104786361cfe690b7b1f2578965818d31ad6f
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 0541082923de0d63f41810c91082a669e0cf50ac
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 464144e6b2575d09c15de82220f4044780d1c19fac34e546ae297bac95efa0796d5174b0fe9334c1ca14e546701a110f70fd8f837648b173baf5767f15e9ef86
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: ff5d5db70886fa695d67aa8fa03da6ed2b28ce1fb031e47c3c27fd82ac3993e595e776a2ca95a4a81434c756f36ea8ef6e7345b51a1cb7ffaac12fdc4d4994c0
         
     | 
    
        data/.travis.yml
    CHANGED
    
    
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/lib/fog/sakuracloud.rb
    CHANGED
    
    
| 
         @@ -27,6 +27,8 @@ module Fog 
     | 
|
| 
       27 
27 
     | 
    
         
             
                  request      :list_zones
         
     | 
| 
       28 
28 
     | 
    
         | 
| 
       29 
29 
     | 
    
         
             
                  class Real
         
     | 
| 
      
 30 
     | 
    
         
            +
                    include Fog::SakuraCloud::Utils::Request
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
       30 
32 
     | 
    
         
             
                    def initialize(options = {})
         
     | 
| 
       31 
33 
     | 
    
         
             
                      @auth_encode = Base64.strict_encode64([
         
     | 
| 
       32 
34 
     | 
    
         
             
                        options[:sakuracloud_api_token],
         
     | 
| 
         @@ -41,18 +43,6 @@ module Fog 
     | 
|
| 
       41 
43 
     | 
    
         | 
| 
       42 
44 
     | 
    
         
             
                      @connection = Fog::Core::Connection.new(@sakuracloud_api_url)
         
     | 
| 
       43 
45 
     | 
    
         
             
                    end
         
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
                    def request(params)
         
     | 
| 
       46 
     | 
    
         
            -
                      response = parse @connection.request(params)
         
     | 
| 
       47 
     | 
    
         
            -
                      response
         
     | 
| 
       48 
     | 
    
         
            -
                    end
         
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
                    private
         
     | 
| 
       51 
     | 
    
         
            -
                    def parse(response)
         
     | 
| 
       52 
     | 
    
         
            -
                      return response if response.body.empty?
         
     | 
| 
       53 
     | 
    
         
            -
                      response.body = Fog::JSON.decode(response.body)
         
     | 
| 
       54 
     | 
    
         
            -
                      response
         
     | 
| 
       55 
     | 
    
         
            -
                    end
         
     | 
| 
       56 
46 
     | 
    
         
             
                  end
         
     | 
| 
       57 
47 
     | 
    
         | 
| 
       58 
48 
     | 
    
         
             
                  class Mock
         
     | 
    
        data/lib/fog/sakuracloud/dns.rb
    CHANGED
    
    | 
         @@ -17,6 +17,8 @@ module Fog 
     | 
|
| 
       17 
17 
     | 
    
         
             
                  request      :modify_zone
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
                  class Real
         
     | 
| 
      
 20 
     | 
    
         
            +
                    include Fog::SakuraCloud::Utils::Request
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
       20 
22 
     | 
    
         
             
                    def initialize(options = {})
         
     | 
| 
       21 
23 
     | 
    
         
             
                      @auth_encode = Base64.strict_encode64([
         
     | 
| 
       22 
24 
     | 
    
         
             
                        options[:sakuracloud_api_token],
         
     | 
| 
         @@ -31,18 +33,6 @@ module Fog 
     | 
|
| 
       31 
33 
     | 
    
         | 
| 
       32 
34 
     | 
    
         
             
                      @connection = Fog::Core::Connection.new(@sakuracloud_api_url)
         
     | 
| 
       33 
35 
     | 
    
         
             
                    end
         
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
                    def request(params)
         
     | 
| 
       36 
     | 
    
         
            -
                      response = parse @connection.request(params)
         
     | 
| 
       37 
     | 
    
         
            -
                      response
         
     | 
| 
       38 
     | 
    
         
            -
                    end
         
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
                    private
         
     | 
| 
       41 
     | 
    
         
            -
                    def parse(response)
         
     | 
| 
       42 
     | 
    
         
            -
                      return response if response.body.empty?
         
     | 
| 
       43 
     | 
    
         
            -
                      response.body = Fog::JSON.decode(response.body)
         
     | 
| 
       44 
     | 
    
         
            -
                      response
         
     | 
| 
       45 
     | 
    
         
            -
                    end
         
     | 
| 
       46 
36 
     | 
    
         
             
                  end
         
     | 
| 
       47 
37 
     | 
    
         | 
| 
       48 
38 
     | 
    
         
             
                  class Mock
         
     | 
| 
         @@ -20,17 +20,17 @@ module Fog 
     | 
|
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
                    def boot
         
     | 
| 
       22 
22 
     | 
    
         
             
                      requires :id
         
     | 
| 
       23 
     | 
    
         
            -
                      service.boot_server( 
     | 
| 
      
 23 
     | 
    
         
            +
                      service.boot_server(id)
         
     | 
| 
       24 
24 
     | 
    
         
             
                    end
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
26 
     | 
    
         
             
                    def stop(force = false)
         
     | 
| 
       27 
27 
     | 
    
         
             
                      requires :id
         
     | 
| 
       28 
     | 
    
         
            -
                      service.stop_server( 
     | 
| 
      
 28 
     | 
    
         
            +
                      service.stop_server(id, force)
         
     | 
| 
       29 
29 
     | 
    
         
             
                    end
         
     | 
| 
       30 
30 
     | 
    
         | 
| 
       31 
31 
     | 
    
         
             
                    def delete(force = false, disks = [])
         
     | 
| 
       32 
32 
     | 
    
         
             
                      requires :id
         
     | 
| 
       33 
     | 
    
         
            -
                      service.delete_server( 
     | 
| 
      
 33 
     | 
    
         
            +
                      service.delete_server(id, force, disks)
         
     | 
| 
       34 
34 
     | 
    
         
             
                      true
         
     | 
| 
       35 
35 
     | 
    
         
             
                    end
         
     | 
| 
       36 
36 
     | 
    
         
             
                    alias_method :destroy, :delete
         
     | 
| 
         @@ -32,13 +32,13 @@ module Fog 
     | 
|
| 
       32 
32 
     | 
    
         | 
| 
       33 
33 
     | 
    
         
             
                    def configure(sshkey_id)
         
     | 
| 
       34 
34 
     | 
    
         
             
                      requires :id
         
     | 
| 
       35 
     | 
    
         
            -
                      service.configure_disk( 
     | 
| 
      
 35 
     | 
    
         
            +
                      service.configure_disk(id, sshkey_id )
         
     | 
| 
       36 
36 
     | 
    
         
             
                      true
         
     | 
| 
       37 
37 
     | 
    
         
             
                    end
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
                    def carve_hostname_on_disk(hostname)
         
     | 
| 
       40 
40 
     | 
    
         
             
                      requires :id
         
     | 
| 
       41 
     | 
    
         
            -
                      service.carve_hostname_on_disk( 
     | 
| 
      
 41 
     | 
    
         
            +
                      service.carve_hostname_on_disk(id, hostname )
         
     | 
| 
       42 
42 
     | 
    
         
             
                      true
         
     | 
| 
       43 
43 
     | 
    
         
             
                    end
         
     | 
| 
       44 
44 
     | 
    
         | 
| 
         @@ -54,7 +54,7 @@ module Fog 
     | 
|
| 
       54 
54 
     | 
    
         
             
                        :defaultroute => defaultroute
         
     | 
| 
       55 
55 
     | 
    
         
             
                      }
         
     | 
| 
       56 
56 
     | 
    
         
             
                      requires :id
         
     | 
| 
       57 
     | 
    
         
            -
                      service.associate_ip_to_disk( 
     | 
| 
      
 57 
     | 
    
         
            +
                      service.associate_ip_to_disk(id, subnet )
         
     | 
| 
       58 
58 
     | 
    
         
             
                      true
         
     | 
| 
       59 
59 
     | 
    
         
             
                    end
         
     | 
| 
       60 
60 
     | 
    
         | 
| 
         @@ -62,7 +62,7 @@ module Fog 
     | 
|
| 
       62 
62 
     | 
    
         
             
                      note_ids = []
         
     | 
| 
       63 
63 
     | 
    
         
             
                      note_ids << notes
         
     | 
| 
       64 
64 
     | 
    
         
             
                      requires :id
         
     | 
| 
       65 
     | 
    
         
            -
                      service.register_note_to_disk( 
     | 
| 
      
 65 
     | 
    
         
            +
                      service.register_note_to_disk(id, note_ids.flatten )
         
     | 
| 
       66 
66 
     | 
    
         
             
                      true
         
     | 
| 
       67 
67 
     | 
    
         
             
                    end
         
     | 
| 
       68 
68 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -28,6 +28,8 @@ module Fog 
     | 
|
| 
       28 
28 
     | 
    
         
             
                  request      :delete_interface
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
30 
     | 
    
         
             
                  class Real
         
     | 
| 
      
 31 
     | 
    
         
            +
                    include Fog::SakuraCloud::Utils::Request
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
       31 
33 
     | 
    
         
             
                    def initialize(options = {})
         
     | 
| 
       32 
34 
     | 
    
         
             
                      @auth_encode = Base64.strict_encode64([
         
     | 
| 
       33 
35 
     | 
    
         
             
                        options[:sakuracloud_api_token],
         
     | 
| 
         @@ -42,18 +44,6 @@ module Fog 
     | 
|
| 
       42 
44 
     | 
    
         | 
| 
       43 
45 
     | 
    
         
             
                      @connection = Fog::Core::Connection.new(@sakuracloud_api_url)
         
     | 
| 
       44 
46 
     | 
    
         
             
                    end
         
     | 
| 
       45 
     | 
    
         
            -
             
     | 
| 
       46 
     | 
    
         
            -
                    def request(params)
         
     | 
| 
       47 
     | 
    
         
            -
                      response = parse @connection.request(params)
         
     | 
| 
       48 
     | 
    
         
            -
                      response
         
     | 
| 
       49 
     | 
    
         
            -
                    end
         
     | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
       51 
     | 
    
         
            -
                    private
         
     | 
| 
       52 
     | 
    
         
            -
                    def parse(response)
         
     | 
| 
       53 
     | 
    
         
            -
                      return response if response.body.empty?
         
     | 
| 
       54 
     | 
    
         
            -
                      response.body = Fog::JSON.decode(response.body)
         
     | 
| 
       55 
     | 
    
         
            -
                      response
         
     | 
| 
       56 
     | 
    
         
            -
                    end
         
     | 
| 
       57 
47 
     | 
    
         
             
                  end
         
     | 
| 
       58 
48 
     | 
    
         | 
| 
       59 
49 
     | 
    
         
             
                  class Mock
         
     | 
| 
         @@ -17,6 +17,8 @@ module Fog 
     | 
|
| 
       17 
17 
     | 
    
         
             
                  request      :delete_note
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
                  class Real
         
     | 
| 
      
 20 
     | 
    
         
            +
                    include Fog::SakuraCloud::Utils::Request
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
       20 
22 
     | 
    
         
             
                    def initialize(options = {})
         
     | 
| 
       21 
23 
     | 
    
         
             
                      @auth_encode = Base64.strict_encode64([
         
     | 
| 
       22 
24 
     | 
    
         
             
                        options[:sakuracloud_api_token],
         
     | 
| 
         @@ -31,18 +33,6 @@ module Fog 
     | 
|
| 
       31 
33 
     | 
    
         | 
| 
       32 
34 
     | 
    
         
             
                      @connection = Fog::Core::Connection.new(@sakuracloud_api_url)
         
     | 
| 
       33 
35 
     | 
    
         
             
                    end
         
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
                    def request(params)
         
     | 
| 
       36 
     | 
    
         
            -
                      response = parse @connection.request(params)
         
     | 
| 
       37 
     | 
    
         
            -
                      response
         
     | 
| 
       38 
     | 
    
         
            -
                    end
         
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
                    private
         
     | 
| 
       41 
     | 
    
         
            -
                    def parse(response)
         
     | 
| 
       42 
     | 
    
         
            -
                      return response if response.body.empty?
         
     | 
| 
       43 
     | 
    
         
            -
                      response.body = Fog::JSON.decode(response.body)
         
     | 
| 
       44 
     | 
    
         
            -
                      response
         
     | 
| 
       45 
     | 
    
         
            -
                    end
         
     | 
| 
       46 
36 
     | 
    
         
             
                  end
         
     | 
| 
       47 
37 
     | 
    
         | 
| 
       48 
38 
     | 
    
         
             
                  class Mock
         
     | 
| 
         @@ -0,0 +1,25 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Fog
         
     | 
| 
      
 2 
     | 
    
         
            +
              module SakuraCloud
         
     | 
| 
      
 3 
     | 
    
         
            +
                module Utils
         
     | 
| 
      
 4 
     | 
    
         
            +
                  module Request
         
     | 
| 
      
 5 
     | 
    
         
            +
                    def request(params)
         
     | 
| 
      
 6 
     | 
    
         
            +
                      response = parse @connection.request(params)
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                      response
         
     | 
| 
      
 9 
     | 
    
         
            +
                      ## SakuraCloud API returns Japanese message.
         
     | 
| 
      
 10 
     | 
    
         
            +
                      #  This wrapper decodes and show message to be human readble.
         
     | 
| 
      
 11 
     | 
    
         
            +
                    rescue Excon::Errors::HTTPStatusError => e
         
     | 
| 
      
 12 
     | 
    
         
            +
                      Fog::Logger.warning ::JSON.parse(e.response.body)['error_msg']
         
     | 
| 
      
 13 
     | 
    
         
            +
                      raise e
         
     | 
| 
      
 14 
     | 
    
         
            +
                    end
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
                    private
         
     | 
| 
      
 17 
     | 
    
         
            +
                    def parse(response)
         
     | 
| 
      
 18 
     | 
    
         
            +
                      return response if response.body.empty?
         
     | 
| 
      
 19 
     | 
    
         
            +
                      response.body = Fog::JSON.decode(response.body)
         
     | 
| 
      
 20 
     | 
    
         
            +
                      response
         
     | 
| 
      
 21 
     | 
    
         
            +
                    end
         
     | 
| 
      
 22 
     | 
    
         
            +
                  end
         
     | 
| 
      
 23 
     | 
    
         
            +
                end
         
     | 
| 
      
 24 
     | 
    
         
            +
              end
         
     | 
| 
      
 25 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -27,6 +27,8 @@ module Fog 
     | 
|
| 
       27 
27 
     | 
    
         
             
                  request      :carve_hostname_on_disk
         
     | 
| 
       28 
28 
     | 
    
         | 
| 
       29 
29 
     | 
    
         
             
                  class Real
         
     | 
| 
      
 30 
     | 
    
         
            +
                    include Fog::SakuraCloud::Utils::Request
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
       30 
32 
     | 
    
         
             
                    def initialize(options = {})
         
     | 
| 
       31 
33 
     | 
    
         
             
                      @auth_encode = Base64.strict_encode64([
         
     | 
| 
       32 
34 
     | 
    
         
             
                        options[:sakuracloud_api_token],
         
     | 
| 
         @@ -41,18 +43,6 @@ module Fog 
     | 
|
| 
       41 
43 
     | 
    
         | 
| 
       42 
44 
     | 
    
         
             
                      @connection = Fog::Core::Connection.new(@sakuracloud_api_url)
         
     | 
| 
       43 
45 
     | 
    
         
             
                    end
         
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
                    def request(params)
         
     | 
| 
       46 
     | 
    
         
            -
                      response = parse @connection.request(params)
         
     | 
| 
       47 
     | 
    
         
            -
                      response
         
     | 
| 
       48 
     | 
    
         
            -
                    end
         
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
                    private
         
     | 
| 
       51 
     | 
    
         
            -
                    def parse(response)
         
     | 
| 
       52 
     | 
    
         
            -
                      return response if response.body.empty?
         
     | 
| 
       53 
     | 
    
         
            -
                      response.body = Fog::JSON.decode(response.body)
         
     | 
| 
       54 
     | 
    
         
            -
                      response
         
     | 
| 
       55 
     | 
    
         
            -
                    end
         
     | 
| 
       56 
46 
     | 
    
         
             
                  end
         
     | 
| 
       57 
47 
     | 
    
         | 
| 
       58 
48 
     | 
    
         
             
                  class Mock
         
     | 
    
        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.6.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-12- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-12-20 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: fog-core
         
     | 
| 
         @@ -277,6 +277,7 @@ files: 
     | 
|
| 
       277 
277 
     | 
    
         
             
            - lib/fog/sakuracloud/requests/volume/list_plans.rb
         
     | 
| 
       278 
278 
     | 
    
         
             
            - lib/fog/sakuracloud/requests/volume/register_note_to_disk.rb
         
     | 
| 
       279 
279 
     | 
    
         
             
            - lib/fog/sakuracloud/script.rb
         
     | 
| 
      
 280 
     | 
    
         
            +
            - lib/fog/sakuracloud/utils/request.rb
         
     | 
| 
       280 
281 
     | 
    
         
             
            - lib/fog/sakuracloud/version.rb
         
     | 
| 
       281 
282 
     | 
    
         
             
            - lib/fog/sakuracloud/volume.rb
         
     | 
| 
       282 
283 
     | 
    
         
             
            - tests/helper.rb
         
     |