yao 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25050407994239664ed794476f785770eee9f35ec4b408c4d56d16397e61d573
4
- data.tar.gz: eb715c80c47212ac8d1812b7de154fe60268b28532de2c61c7b303ad6c077bc2
3
+ metadata.gz: 373001764a5572a4e77738677211b5353ed59b8d5780ce624e50c2ba833e3472
4
+ data.tar.gz: f479d7b733fb3f8ca8864cece19e2b68aa1b2df6c79f4dbb94bf50cab72825a8
5
5
  SHA512:
6
- metadata.gz: 7424508d48a8836a09ba560e1cfa1fe108fcc22b043f5914e9056e352830ed32974ae94b8db3946cf9f52af51fbce2f8599c36487c1208d8fc841d2fff69af2b
7
- data.tar.gz: 7ed3b0b32af6d772a79830ec0dfa8cb517d0d3e2bbdac948648e2b056f2eb6495b650c4d8e5f85d69effb5741ce64d424fdf6bb9189efac9b96d963002b4cfc1
6
+ metadata.gz: 2c703c74cc9247729d051b40dae3429d43e3fd7a61e266cc279b346501580ee51fdcfaa54242bd2d6e68c269deb3b5ea13d2c20f05434a84dcd47dc2c122c94b
7
+ data.tar.gz: 6db4d3ef6ad0db7c7b746226da14d0b9367d64bd2e5560d1eba0d2e5012065a274679ae6bca676555694d11258d3d37f44e8db053797f972ccf8ac7a9f708b79
@@ -17,5 +17,15 @@ module Yao::Resources
17
17
  self.service = "compute"
18
18
  self.resource_name = "flavor"
19
19
  self.resources_name = "flavors"
20
+
21
+ class << self
22
+ def list_detail(query={})
23
+ return_resources(
24
+ resources_from_json(
25
+ GET([resources_path, "detail"].join("/"), query).body
26
+ )
27
+ )
28
+ end
29
+ end
20
30
  end
21
31
  end
@@ -0,0 +1,21 @@
1
+ module Yao::Resources
2
+ class Volume < Base
3
+ friendly_attributes :name, :size, :volume_type
4
+
5
+ map_attribute_to_attribute 'os-vol-tenant-attr:tenant_id' => :tenant_id
6
+
7
+ self.service = "volumev3"
8
+ self.resource_name = "volume"
9
+ self.resources_name = "volumes"
10
+
11
+ class << self
12
+ def list_detail(query={})
13
+ return_resources(
14
+ resources_from_json(
15
+ GET([resources_path, "detail"].join("/"), query).body
16
+ )
17
+ )
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,10 @@
1
+ module Yao::Resources
2
+ class VolumeType < Base
3
+ friendly_attributes :name, :description, :is_public
4
+
5
+ self.service = "volumev3"
6
+ self.resource_name = "volume_type"
7
+ self.resources_name = "volume_types"
8
+ self.resources_path = "types"
9
+ end
10
+ end
data/lib/yao/resources.rb CHANGED
@@ -25,6 +25,8 @@ module Yao
25
25
  autoload :User, "yao/resources/user"
26
26
  autoload :Role, "yao/resources/role"
27
27
  autoload :RoleAssignment, "yao/resources/role_assignment"
28
+ autoload :Volume, "yao/resources/volume"
29
+ autoload :VolumeType, "yao/resources/volume_type"
28
30
 
29
31
  autoload :Resource, "yao/resources/resource"
30
32
  autoload :Meter, "yao/resources/meter"
data/lib/yao/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yao
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -0,0 +1,12 @@
1
+ class TestRole < Test::Unit::TestCase
2
+ def test_volume
3
+ params = {
4
+ 'name' => 'cinder',
5
+ 'size' => 10
6
+ }
7
+
8
+ volume = Yao::Volume.new(params)
9
+ assert_equal('cinder', volume.name)
10
+ assert_equal(10, volume.size)
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ class TestRole < Test::Unit::TestCase
2
+ def test_volume
3
+ params = {
4
+ 'name' => 'test_volume',
5
+ 'description'=> 'this is test volume',
6
+ 'is_public' => true
7
+ }
8
+
9
+ volume = Yao::VolumeType.new(params)
10
+ assert_equal('test_volume', volume.name)
11
+ assert_equal('this is test volume', volume.description)
12
+ assert_equal(true, volume.is_public)
13
+ end
14
+ 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.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uchio, KONDO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-08 00:00:00.000000000 Z
11
+ date: 2018-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -209,6 +209,8 @@ files:
209
209
  - lib/yao/resources/subnet.rb
210
210
  - lib/yao/resources/tenant.rb
211
211
  - lib/yao/resources/user.rb
212
+ - lib/yao/resources/volume.rb
213
+ - lib/yao/resources/volume_type.rb
212
214
  - lib/yao/setup.rb
213
215
  - lib/yao/token.rb
214
216
  - lib/yao/tokenv3.rb
@@ -232,6 +234,8 @@ files:
232
234
  - test/yao/resources/test_security_group.rb
233
235
  - test/yao/resources/test_security_group_rule.rb
234
236
  - test/yao/resources/test_user.rb
237
+ - test/yao/resources/test_volume.rb
238
+ - test/yao/resources/test_volume_type.rb
235
239
  - test/yao/test_auth.rb
236
240
  - test/yao/test_authv3.rb
237
241
  - test/yao/test_client.rb
@@ -287,6 +291,8 @@ test_files:
287
291
  - test/yao/resources/test_security_group.rb
288
292
  - test/yao/resources/test_security_group_rule.rb
289
293
  - test/yao/resources/test_user.rb
294
+ - test/yao/resources/test_volume.rb
295
+ - test/yao/resources/test_volume_type.rb
290
296
  - test/yao/test_auth.rb
291
297
  - test/yao/test_authv3.rb
292
298
  - test/yao/test_client.rb