conoha 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d322e4f2ffd6a6db55b56af31417c5f0c1fdb11
4
- data.tar.gz: c87a759cb19ae7da91fac60a4e3b214dda2f67cf
3
+ metadata.gz: e6fb2275c7b8a0ad745c9a58c098a54aa154d9fc
4
+ data.tar.gz: f25a49bee97f120f50f2da13e05e6b65aa649553
5
5
  SHA512:
6
- metadata.gz: c8b2591106cd60f5d63adafa53c86303047a6e80f80640cd44eeb1ba156c3f46daf2f433a80d8d148845ed09373b68a56934963ca0a67750b8055f1fc7644d5e
7
- data.tar.gz: 91836f62b9e2aa708d999d6dfee7c478436b0bcbdd7d3462d2e5b97f9c449f0f26b53f70b906b5c0247114b2b45e392af93562870ca0808ee22edb893e2c5ad4
6
+ metadata.gz: 1b472e30ac3f1d4ffe7976a9afe6f03b3b67d98f0069c82fc43c150512c5ac3aa248b60841c0175af6e1f2eb1e5bf58e9d4ff8cb9e16264511c36e75bca66c2f
7
+ data.tar.gz: 817669cbe7475fb4bb447b86315b02f574eea2f96831c78c0195f6240c62ef5c9713d95e9e9a3b68e324742c121432465a51db2501d690a93c7325348bfae5d6
data/exe/conoha CHANGED
@@ -152,6 +152,9 @@ when 'dump'
152
152
  puts '# Error! Retry after 60 seconds...'
153
153
  end
154
154
  puts '# OK!'
155
+ when 'nametag'
156
+ exit 1 if ARGV.size < 1
157
+ puts Conoha.name_tag server_id(ARGV.first)
155
158
  else
156
159
  STDERR.puts 'Error'
157
160
  end
@@ -198,6 +198,12 @@ class Conoha
198
198
  JSON.parse(res.body)["server"]["id"]
199
199
  end
200
200
 
201
+ def self.name_tag(server_id)
202
+ uri = "https://compute.#{region}.conoha.io/v2/#{tenant_id}/servers/#{server_id}/metadata"
203
+ res = https_get uri, authtoken
204
+ JSON.parse(res.body)["metadata"]["instance_name_tag"]
205
+ end
206
+
201
207
  private
202
208
 
203
209
  @@config_loaded = false
@@ -1,3 +1,3 @@
1
1
  module ConohaVersion
2
- ITSELF = "0.9.1"
2
+ ITSELF = "0.9.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conoha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ka