conoha 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/README.md +1 -1
- data/conoha.gemspec +4 -4
- data/exe/conoharant +3 -1
- data/lib/conoha.rb +11 -6
- data/lib/conoha/version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08efbeb2adcb082922b6449cc5ba9d350f3142c3
|
4
|
+
data.tar.gz: 0e1154adce0023bfbe0d7a3f4b0b7c2bd01b9807
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffbb04f40a8d3ff7544133f0540fe52df5a04bea9fc591b778f3628ad9bc181edda998c5041fe62e271b7187c0b5d5fd4b5f0b5a6dba73edc09750346935f614
|
7
|
+
data.tar.gz: 513cd536da2a1c68a253c00c0d01556d7d1203a2839989a9e63844bc10eda880a7a6a4ad2932e557bf2b23286b75dde51c97a39bd734096926eb1f6a2417d307
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
data/conoha.gemspec
CHANGED
@@ -19,10 +19,10 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_development_dependency "bundler", "~> 1.
|
23
|
-
spec.add_development_dependency "rake", "~> 10.
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
23
|
+
spec.add_development_dependency "rake", "~> 10.4"
|
24
24
|
spec.add_development_dependency "test-unit", "~> 3.1.3"
|
25
25
|
spec.add_development_dependency "test-unit-notify", "~> 1.0.4"
|
26
|
-
spec.add_development_dependency "guard", "~> 2.13
|
27
|
-
spec.add_development_dependency "guard-test", "~> 2.0
|
26
|
+
spec.add_development_dependency "guard", "~> 2.13"
|
27
|
+
spec.add_development_dependency "guard-test", "~> 2.0"
|
28
28
|
end
|
data/exe/conoharant
CHANGED
@@ -26,7 +26,9 @@ require 'conoha/util'
|
|
26
26
|
# Dump current status to ".conoharant/status.yml"
|
27
27
|
# @params [Hash] status
|
28
28
|
def dump_conoharant_status(status)
|
29
|
-
File.open('.conoharant/status.yml', 'w')
|
29
|
+
File.open('.conoharant/status.yml', 'w') do |f|
|
30
|
+
f.print(YAML.dump(status))
|
31
|
+
end
|
30
32
|
end
|
31
33
|
|
32
34
|
require 'conoha/version'
|
data/lib/conoha.rb
CHANGED
@@ -69,16 +69,19 @@ class Conoha
|
|
69
69
|
JSON.parse(res.body)["server"]["status"]
|
70
70
|
end
|
71
71
|
|
72
|
-
|
72
|
+
# @param [String] action "os-start" or "os-stop"
|
73
|
+
def self.server_action(server_id, action)
|
73
74
|
uri = "https://compute.tyo1.conoha.io/v2/#{tenant_id}/servers/#{server_id}/action"
|
74
|
-
res = https_post uri, {
|
75
|
+
res = https_post uri, {action => nil}, authtoken
|
75
76
|
res.code == '202' ? 'OK' : 'Error'
|
76
77
|
end
|
77
78
|
|
79
|
+
def self.boot(server_id)
|
80
|
+
server_action server_id, "os-start"
|
81
|
+
end
|
82
|
+
|
78
83
|
def self.shutdown(server_id)
|
79
|
-
|
80
|
-
res = https_post uri, {"os-stop" => nil}, authtoken
|
81
|
-
res.code == '202' ? 'OK' : 'Error'
|
84
|
+
server_action server_id, "os-stop"
|
82
85
|
end
|
83
86
|
|
84
87
|
def self.images
|
@@ -166,7 +169,9 @@ EOS
|
|
166
169
|
public_key: @@public_key,
|
167
170
|
authtoken: @@authtoken,
|
168
171
|
})
|
169
|
-
File.open(config_file_path, 'w')
|
172
|
+
File.open(config_file_path, 'w') do |f|
|
173
|
+
f.write s
|
174
|
+
end
|
170
175
|
end
|
171
176
|
|
172
177
|
def self.tenant_id
|
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.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.11'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.11'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '10.
|
33
|
+
version: '10.4'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '10.
|
40
|
+
version: '10.4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: test-unit
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,28 +72,28 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2.13
|
75
|
+
version: '2.13'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 2.13
|
82
|
+
version: '2.13'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: guard-test
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 2.0
|
89
|
+
version: '2.0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 2.0
|
96
|
+
version: '2.0'
|
97
97
|
description: ConoHa VPS CLI Tool
|
98
98
|
email:
|
99
99
|
- ka.kaosf@gmail.com
|
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.
|
142
|
+
rubygems_version: 2.5.1
|
143
143
|
signing_key:
|
144
144
|
specification_version: 4
|
145
145
|
summary: ConoHa VPS CLI Tool
|