yao 0.2.0 → 0.2.1

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: a3a5021c146bff1c64911c5250a1be2c4b7d4265
4
- data.tar.gz: 0b13bab38ce68fcce56529ac6e278249409f29ee
3
+ metadata.gz: a43847afb896259ec838b7c1868c57657092a245
4
+ data.tar.gz: 60410d2891988b2acb4894e8cbffd09b81e007f5
5
5
  SHA512:
6
- metadata.gz: c42887a7dcb25eb98cce0e81fa08fcd985d05967563bb386a17e194c34e731327b6917a7cbf99a4b49c738a088f9edee020ee650076ca0196db14ee0d4b5ea81
7
- data.tar.gz: 094cccc00b4fc3c16c3c6b33b9eb9b3b32108e76db605b236e78e34f21be479793d728d17e1ce259a18cafa8975f2a62e16e0360df823e34523cffe7711a0725
6
+ metadata.gz: e2a41e0532be69ffeef29dc41a86106217dc2b364e66bc3de22cc84c888ec01386f70b916f37b93d0d1f664b7a1fe7bef188e08c3acf82a41697ea8c8c9dfc68
7
+ data.tar.gz: 1ccf43b776c2319282165759adcb01c1445f459dc50ff5f4204265d1b919757e2ea887b82ed870b493742323f2c7310098c7873832617fb171119bc242b3c1b7
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ ## v0.2.1
2
+
3
+ * Fix `resources_name_in_json` is still remaining by @pyama86
4
+ * Add `Yao::Server.start` by @pyama86
5
+
6
+ See more: (v0.2.0...v0.2.1)[https://github.com/yaocloud/yao/compare/v0.2.0...v0.2.1]
@@ -5,7 +5,7 @@ module Yao::Resources
5
5
  req.body = query.to_json
6
6
  req.headers['Content-Type'] = 'application/json'
7
7
  end
8
- return_resource(res.body[resource_name_in_json])
8
+ return_resource(resource_from_json(res.body))
9
9
  end
10
10
 
11
11
  private
@@ -7,7 +7,9 @@ module Yao::Resources
7
7
  self.resources_name = "os-keypairs"
8
8
 
9
9
  def self.list(query={})
10
- return_resources(GET(resources_name, query).body[resources_name_in_json].map{|r| r[resource_name_in_json] })
10
+ return_resources(
11
+ resources_from_json(GET(resources_name, query).body).map{|r| resource_params(r)}
12
+ )
11
13
  end
12
14
  end
13
15
  end
@@ -21,6 +21,9 @@ module Yao::Resources
21
21
  self.service = "compute"
22
22
  self.resource_name = "server"
23
23
  self.resources_name = "servers"
24
+ def self.start(id)
25
+ action(id, "os-start" => nil)
26
+ end
24
27
 
25
28
  def self.shutoff(id)
26
29
  action(id, "os-stop" => nil)
@@ -34,6 +37,10 @@ module Yao::Resources
34
37
  action(id,"resize" => { "flavorRef" => flavor_id })
35
38
  end
36
39
 
40
+ class << self
41
+ alias :stop :shutoff
42
+ end
43
+
37
44
  extend MetadataAvailable
38
45
  extend Action
39
46
  end
data/lib/yao/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yao
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yao
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uchio, KONDO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-11 00:00:00.000000000 Z
11
+ date: 2015-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -159,6 +159,7 @@ extra_rdoc_files: []
159
159
  files:
160
160
  - ".gitignore"
161
161
  - ".travis.yml"
162
+ - CHANGELOG.md
162
163
  - CODE_OF_CONDUCT.md
163
164
  - Gemfile
164
165
  - LICENSE.txt