conoha 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/conoha +6 -1
- data/exe/conoharant +22 -0
- data/lib/conoha.rb +0 -20
- data/lib/conoha/util.rb +22 -0
- 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: 2bba341ad5843b6533ad8eb71b9c422b24ab79f3
|
4
|
+
data.tar.gz: 343c61e0b27f778a2a338078562cf15ea579ba8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19a0f02a6debe27af3537a56b03dd2efe5ae6259f7e8e5c4cbf4346e447382fd45c133d038f0a5538200717848679821aea5f11cdf3e1a5a2ed95bfd9ef843ad
|
7
|
+
data.tar.gz: 2d2873c4271e5c3633e65153909b3b50c82a046711a07618f2ccc552cf2e0ad6395e58be85671cf9b8da70f841b6e8f2a4d48e83c83a8c1259d34252c5fb8055
|
data/exe/conoha
CHANGED
@@ -42,7 +42,12 @@ when 'ipaddress'
|
|
42
42
|
exit 1 if ARGV.size != 1
|
43
43
|
pp Conoha.ip_address_of server_id(ARGV.first)
|
44
44
|
when 'create'
|
45
|
-
|
45
|
+
begin
|
46
|
+
pp Conoha.create *ARGV
|
47
|
+
rescue => e
|
48
|
+
STDERR.puts e.to_s
|
49
|
+
exit 1
|
50
|
+
end
|
46
51
|
when 'delete'
|
47
52
|
exit 1 if ARGV.size != 1
|
48
53
|
puts Conoha.delete server_id(ARGV.first)
|
data/exe/conoharant
CHANGED
@@ -30,6 +30,7 @@ def dump_conoharant_status(status)
|
|
30
30
|
end
|
31
31
|
|
32
32
|
require 'conoha'
|
33
|
+
require 'conoha/version'
|
33
34
|
Conoha.init!
|
34
35
|
begin
|
35
36
|
Conoha.vps_list
|
@@ -48,6 +49,27 @@ puts "Authentication OK."
|
|
48
49
|
|
49
50
|
arg = ARGV.first
|
50
51
|
case arg
|
52
|
+
when 'version', '--version', '-v'
|
53
|
+
puts ConohaVersion::ITSELF
|
54
|
+
when 'up'
|
55
|
+
begin
|
56
|
+
server_id = Conoha.create config['os'], config['ram']
|
57
|
+
rescue => e
|
58
|
+
STDERR.puts e.to_s
|
59
|
+
exit 1
|
60
|
+
end
|
61
|
+
puts server_id
|
62
|
+
loop do
|
63
|
+
sleep 10
|
64
|
+
result = Conoha.status_of server_id
|
65
|
+
break if result == "ACTIVE"
|
66
|
+
puts "# Current status is \"#{result}\", not \"ACTIVE\"."
|
67
|
+
puts "# Re-check after 10 seconds..."
|
68
|
+
end
|
69
|
+
puts "# OK!"
|
70
|
+
status['status'] = 'running'
|
71
|
+
status['id'] = server_id
|
72
|
+
dump_conoharant_status status
|
51
73
|
when 'ssh', 'mosh'
|
52
74
|
connection = arg # 'ssh' or 'mosh'
|
53
75
|
if status['status'] != 'running'
|
data/lib/conoha.rb
CHANGED
@@ -181,26 +181,6 @@ EOS
|
|
181
181
|
@@public_key
|
182
182
|
end
|
183
183
|
|
184
|
-
def self.image_ref_from_os(os)
|
185
|
-
dictionary = {
|
186
|
-
'ubuntu' => '4952b4e5-67bb-4f84-991f-9f3f1647d63d', # Ubuntu 14.04 amd64
|
187
|
-
'centos66' => '14961158-a69c-4af1-b375-b9a72982837d', # CentOS 6.6
|
188
|
-
'centos67' => '91944101-df61-4c41-b7c5-76cebfc48318', # CentOS 6.7
|
189
|
-
'centos71' => 'edc9457e-e4a8-4974-8217-c254d215b460', # CentOS 7.1
|
190
|
-
'arch' => 'fe22a9e4-8ba1-4ea3-90ce-d59d5e5b35b9', # Arch
|
191
|
-
}
|
192
|
-
if dictionary.keys.include? os
|
193
|
-
dictionary[os]
|
194
|
-
else
|
195
|
-
STDERR.print <<EOS
|
196
|
-
select os name from the following list:
|
197
|
-
|
198
|
-
#{dictionary.keys.map { |e| " #{e}" }.join("\n")}
|
199
|
-
EOS
|
200
|
-
exit 1
|
201
|
-
end
|
202
|
-
end
|
203
|
-
|
204
184
|
def self.flavor_ref(ram)
|
205
185
|
dictionary = {
|
206
186
|
'g-1gb' => '7eea7469-0d85-4f82-8050-6ae742394681',
|
data/lib/conoha/util.rb
CHANGED
@@ -60,3 +60,25 @@ end
|
|
60
60
|
def ipv4(ip_address)
|
61
61
|
ip_address.select { |e| e =~ /\d+\.\d+\.\d+\.\d+/ }.first
|
62
62
|
end
|
63
|
+
|
64
|
+
# @return [String] UUID of image
|
65
|
+
# @params [String] os OS name
|
66
|
+
# @raise [StandardError] When the OS name isn't be contained.
|
67
|
+
def image_ref_from_os(os)
|
68
|
+
dictionary = {
|
69
|
+
'ubuntu' => '4952b4e5-67bb-4f84-991f-9f3f1647d63d', # Ubuntu 14.04 amd64
|
70
|
+
'centos66' => '14961158-a69c-4af1-b375-b9a72982837d', # CentOS 6.6
|
71
|
+
'centos67' => '91944101-df61-4c41-b7c5-76cebfc48318', # CentOS 6.7
|
72
|
+
'centos71' => 'edc9457e-e4a8-4974-8217-c254d215b460', # CentOS 7.1
|
73
|
+
'arch' => 'fe22a9e4-8ba1-4ea3-90ce-d59d5e5b35b9', # Arch
|
74
|
+
}
|
75
|
+
if dictionary.keys.include? os
|
76
|
+
dictionary[os]
|
77
|
+
else
|
78
|
+
raise StandardError.new <<EOS
|
79
|
+
Select os name from the following list:
|
80
|
+
|
81
|
+
#{dictionary.keys.join("\n")}
|
82
|
+
EOS
|
83
|
+
end
|
84
|
+
end
|
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.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|