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 +4 -4
- data/lib/yao/resources/flavor.rb +10 -0
- data/lib/yao/resources/volume.rb +21 -0
- data/lib/yao/resources/volume_type.rb +10 -0
- data/lib/yao/resources.rb +2 -0
- data/lib/yao/version.rb +1 -1
- data/test/yao/resources/test_volume.rb +12 -0
- data/test/yao/resources/test_volume_type.rb +14 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 373001764a5572a4e77738677211b5353ed59b8d5780ce624e50c2ba833e3472
|
4
|
+
data.tar.gz: f479d7b733fb3f8ca8864cece19e2b68aa1b2df6c79f4dbb94bf50cab72825a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c703c74cc9247729d051b40dae3429d43e3fd7a61e266cc279b346501580ee51fdcfaa54242bd2d6e68c269deb3b5ea13d2c20f05434a84dcd47dc2c122c94b
|
7
|
+
data.tar.gz: 6db4d3ef6ad0db7c7b746226da14d0b9367d64bd2e5560d1eba0d2e5012065a274679ae6bca676555694d11258d3d37f44e8db053797f972ccf8ac7a9f708b79
|
data/lib/yao/resources/flavor.rb
CHANGED
@@ -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
|
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
@@ -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.
|
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-
|
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
|