conoha 0.0.7 → 0.0.8
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 -1
- data/lib/conoha.rb +10 -30
- 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: 5d106d33ee7ffc508d7b8ff0bafd93fed38f81d4
|
4
|
+
data.tar.gz: 769fcb65ce90be7b0bf87dee78fd6586f862b0d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 980120acc774cb59ced07ee731c031c7d7034288f4fbe27c8a8cb4a384f8910964d6880278b36a1f817891b5ee1334fcd54b029a7ade87b97b6e63fc7b5fca3d
|
7
|
+
data.tar.gz: 35d8922b6b2a66520db2e34e7dd797c34691c351d661b8cdde774e7b16ac13e3daa0882b0c6a41c24f7b45b666e22a361893c61389646c07e1327240a7337931
|
data/README.md
CHANGED
@@ -127,7 +127,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/kaosf/
|
|
127
127
|
- [x] delete image
|
128
128
|
- [ ] public keys
|
129
129
|
- [x] make as a gem
|
130
|
-
- [
|
130
|
+
- [x] remove `curl` command from authenticate
|
131
131
|
- [ ] help message
|
132
132
|
- [ ] subcommand help messages
|
133
133
|
|
data/lib/conoha.rb
CHANGED
@@ -10,24 +10,12 @@ class Conoha
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.authenticate!
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
# auth: {
|
20
|
-
# passwordCredentials: {
|
21
|
-
# username: $USERNAME,
|
22
|
-
# password: $PASSWORD
|
23
|
-
# },
|
24
|
-
# tenant_id: $TENANT_ID
|
25
|
-
# }
|
26
|
-
#}.to_json
|
27
|
-
#req.body = payload
|
28
|
-
#res = https.request(req)
|
29
|
-
|
30
|
-
req_json = JSON.generate({
|
13
|
+
uri = URI.parse 'https://identity.tyo1.conoha.io/v2.0/tokens'
|
14
|
+
https = Net::HTTP.new(uri.host, uri.port)
|
15
|
+
https.use_ssl = true
|
16
|
+
req = Net::HTTP::Post.new(uri.request_uri)
|
17
|
+
req['Content-Type'] = 'application/json'
|
18
|
+
payload = {
|
31
19
|
auth: {
|
32
20
|
passwordCredentials: {
|
33
21
|
username: @@username,
|
@@ -35,18 +23,10 @@ class Conoha
|
|
35
23
|
},
|
36
24
|
tenantId: @@tenant_id
|
37
25
|
}
|
38
|
-
}
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
https://identity.tyo1.conoha.io/v2.0/tokens 2> /dev/null
|
43
|
-
EOS
|
44
|
-
result = `#{command}`
|
45
|
-
|
46
|
-
#token = JSON.parse(res.body)["access"]["token"]["id"]
|
47
|
-
token = JSON.parse(result)["access"]["token"]["id"]
|
48
|
-
|
49
|
-
@@authtoken = token
|
26
|
+
}.to_json
|
27
|
+
req.body = payload
|
28
|
+
res = https.request(req)
|
29
|
+
@@authtoken = JSON.parse(res.body)["access"]["token"]["id"]
|
50
30
|
save_config!
|
51
31
|
end
|
52
32
|
|
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.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|