conoha 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/exe/conoharant +14 -0
- data/lib/conoha.rb +6 -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: f41ee42c0f0098bf3b05802d35a6707d717d45a1
|
4
|
+
data.tar.gz: e68e7f4b8ce9b6cd90f01702a3d3d1c3eec12ac6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8280fe6a8af21f48ea8056e6fcd4ec8815d599a98ee9fa85f457cecce55259fae779e082cd92bda6dabde1e9581615eef6e622b010cbb3ae191909c6aba0f15
|
7
|
+
data.tar.gz: 77049d6f8806c7ebc8147bcb48dbada534119d18fd7056cdb43b13117c48cd6a0f4e67cd4a4b98de4381df421cca40ad165cd5a9461db794b0bcefb8e8fa93d1
|
data/README.md
CHANGED
data/exe/conoharant
CHANGED
@@ -108,6 +108,14 @@ when 'restore'
|
|
108
108
|
ram = config['ram']
|
109
109
|
puts "conoha restore #{image_id} #{ram}"
|
110
110
|
server_id = Conoha.create_from_image image_id, ram
|
111
|
+
loop do
|
112
|
+
sleep 10
|
113
|
+
result = Conoha.status_of server_id
|
114
|
+
break if result == "ACTIVE"
|
115
|
+
puts "# Current status is \"#{result}\", not \"ACTIVE\"."
|
116
|
+
puts "# Re-check after 10 seconds..."
|
117
|
+
end
|
118
|
+
puts "# OK!"
|
111
119
|
status['status'] = 'running'
|
112
120
|
status['id'] = server_id
|
113
121
|
dump_conoharant_status status
|
@@ -131,6 +139,12 @@ when 'browse'
|
|
131
139
|
command = "xdg-open http://#{ipaddress}#{port}"
|
132
140
|
puts command
|
133
141
|
system command
|
142
|
+
when 'sftp'
|
143
|
+
server_id = status['id']
|
144
|
+
ipaddress = ipv4(Conoha.ip_address_of(server_id))
|
145
|
+
command = "sftp #{ipaddress}"
|
146
|
+
puts command
|
147
|
+
system command
|
134
148
|
else
|
135
149
|
STDERR.puts 'Invalid argument.'
|
136
150
|
exit 1
|
data/lib/conoha.rb
CHANGED
@@ -63,6 +63,12 @@ class Conoha
|
|
63
63
|
JSON.parse(res.body)["server"]["addresses"].values[0].map{ |e| e["addr"] }
|
64
64
|
end
|
65
65
|
|
66
|
+
def self.status_of(server_id)
|
67
|
+
uri = "https://compute.tyo1.conoha.io/v2/#{tenant_id}/servers/#{server_id}"
|
68
|
+
res = https_get uri, authtoken
|
69
|
+
JSON.parse(res.body)["server"]["status"]
|
70
|
+
end
|
71
|
+
|
66
72
|
def self.boot(server_id)
|
67
73
|
uri = "https://compute.tyo1.conoha.io/v2/#{tenant_id}/servers/#{server_id}/action"
|
68
74
|
res = https_post uri, {"os-start": nil}, 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.2.
|
4
|
+
version: 0.2.2
|
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-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|