conoha 0.9.0 → 0.9.1
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/README.md +5 -0
 - data/exe/conoha +7 -0
 - data/lib/conoha.rb +10 -3
 - data/lib/conoha/version.rb +1 -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: 8d322e4f2ffd6a6db55b56af31417c5f0c1fdb11
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: c87a759cb19ae7da91fac60a4e3b214dda2f67cf
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: c8b2591106cd60f5d63adafa53c86303047a6e80f80640cd44eeb1ba156c3f46daf2f433a80d8d148845ed09373b68a56934963ca0a67750b8055f1fc7644d5e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 91836f62b9e2aa708d999d6dfee7c478436b0bcbdd7d3462d2e5b97f9c449f0f26b53f70b906b5c0247114b2b45e392af93562870ca0808ee22edb893e2c5ad4
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -76,6 +76,11 @@ conoha shutdown 01234567-89ab-cdef-0123-456789abcdef 
     | 
|
| 
       76 
76 
     | 
    
         
             
            # Boot VPS
         
     | 
| 
       77 
77 
     | 
    
         
             
            conoha boot 01234567-89ab-cdef-0123-456789abcdef
         
     | 
| 
       78 
78 
     | 
    
         | 
| 
      
 79 
     | 
    
         
            +
            # Reboot VPS
         
     | 
| 
      
 80 
     | 
    
         
            +
            conoha reboot 01234567-89ab-cdef-0123-456789abcdef      # Shutdown -> Boot
         
     | 
| 
      
 81 
     | 
    
         
            +
            conoha reboot 01234567-89ab-cdef-0123-456789abcdef hard # Force shutdown -> Boot
         
     | 
| 
      
 82 
     | 
    
         
            +
            # For more information, ref. https://www.conoha.jp/docs/compute-reboot_vm.html
         
     | 
| 
      
 83 
     | 
    
         
            +
             
     | 
| 
       79 
84 
     | 
    
         
             
            # Rebuild (Re-install the OS)
         
     | 
| 
       80 
85 
     | 
    
         
             
            conoha rebuild 01234567-89ab-cdef-0123-456789abcdef ubuntu
         
     | 
| 
       81 
86 
     | 
    
         | 
    
        data/exe/conoha
    CHANGED
    
    | 
         @@ -88,6 +88,13 @@ when 'boot' 
     | 
|
| 
       88 
88 
     | 
    
         
             
            when 'shutdown'
         
     | 
| 
       89 
89 
     | 
    
         
             
              exit 1 if ARGV.size != 1
         
     | 
| 
       90 
90 
     | 
    
         
             
              puts Conoha.shutdown server_id(ARGV.first)
         
     | 
| 
      
 91 
     | 
    
         
            +
            when 'reboot'
         
     | 
| 
      
 92 
     | 
    
         
            +
              exit 1 if ARGV.size < 1
         
     | 
| 
      
 93 
     | 
    
         
            +
              if ARGV[1] == 'hard' || ARGV[1] == 'HARD'
         
     | 
| 
      
 94 
     | 
    
         
            +
                puts Conoha.reboot server_id(ARGV.first), 'HARD'
         
     | 
| 
      
 95 
     | 
    
         
            +
              else
         
     | 
| 
      
 96 
     | 
    
         
            +
                puts Conoha.reboot server_id(ARGV.first)
         
     | 
| 
      
 97 
     | 
    
         
            +
              end
         
     | 
| 
       91 
98 
     | 
    
         
             
            when 'imagelist'
         
     | 
| 
       92 
99 
     | 
    
         
             
              pp Conoha.images
         
     | 
| 
       93 
100 
     | 
    
         
             
            when 'imagecreate'
         
     | 
    
        data/lib/conoha.rb
    CHANGED
    
    | 
         @@ -143,10 +143,11 @@ class Conoha 
     | 
|
| 
       143 
143 
     | 
    
         
             
                JSON.parse(res.body)["server"]["status"]
         
     | 
| 
       144 
144 
     | 
    
         
             
              end
         
     | 
| 
       145 
145 
     | 
    
         | 
| 
       146 
     | 
    
         
            -
              # @param [String] action "os-start"  
     | 
| 
       147 
     | 
    
         
            -
               
     | 
| 
      
 146 
     | 
    
         
            +
              # @param [String] action "os-start", "os-stop" or "reboot"
         
     | 
| 
      
 147 
     | 
    
         
            +
              # @param [Hash|nil] action_value (default: nil)
         
     | 
| 
      
 148 
     | 
    
         
            +
              def self.server_action(server_id, action, action_value = nil)
         
     | 
| 
       148 
149 
     | 
    
         
             
                uri = "https://compute.#{region}.conoha.io/v2/#{tenant_id}/servers/#{server_id}/action"
         
     | 
| 
       149 
     | 
    
         
            -
                res = https_post uri, {action =>  
     | 
| 
      
 150 
     | 
    
         
            +
                res = https_post uri, {action => action_value}, authtoken
         
     | 
| 
       150 
151 
     | 
    
         
             
                res.code == '202' ? 'OK' : 'Error'
         
     | 
| 
       151 
152 
     | 
    
         
             
              end
         
     | 
| 
       152 
153 
     | 
    
         | 
| 
         @@ -158,6 +159,12 @@ class Conoha 
     | 
|
| 
       158 
159 
     | 
    
         
             
                server_action server_id, "os-stop"
         
     | 
| 
       159 
160 
     | 
    
         
             
              end
         
     | 
| 
       160 
161 
     | 
    
         | 
| 
      
 162 
     | 
    
         
            +
              # @param [String] server_id
         
     | 
| 
      
 163 
     | 
    
         
            +
              # @param [String] type "SOFT" or "HARD" (ref. https://www.conoha.jp/docs/compute-reboot_vm.html)
         
     | 
| 
      
 164 
     | 
    
         
            +
              def self.reboot(server_id, type = "SOFT")
         
     | 
| 
      
 165 
     | 
    
         
            +
                server_action(server_id, "reboot", { "type" => type })
         
     | 
| 
      
 166 
     | 
    
         
            +
              end
         
     | 
| 
      
 167 
     | 
    
         
            +
             
     | 
| 
       161 
168 
     | 
    
         
             
              def self.images
         
     | 
| 
       162 
169 
     | 
    
         
             
                uri = "https://compute.#{region}.conoha.io/v2/#{tenant_id}/images"
         
     | 
| 
       163 
170 
     | 
    
         
             
                res = https_get uri, authtoken
         
     | 
    
        data/lib/conoha/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: conoha
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.9. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.9.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - ka
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2016-07- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2016-07-26 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     |