yao 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yao/resources.rb +1 -0
- data/lib/yao/resources/aggregates.rb +23 -0
- data/lib/yao/resources/loadbalancer_pool.rb +6 -0
- data/lib/yao/version.rb +1 -1
- data/test/yao/resources/test_aggregates.rb +26 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2228f363d1c7fd089fbb7fc716772978f37a6a5a
|
4
|
+
data.tar.gz: dfb81b0742416b34fa593518a4851833e51120af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e059289fe4031e3105bfa8ef7256523580344e1d031cc68f8afc7a8cc696b1cfe80bf67fb1cd0ba5cf61cef6ea03669d7e92008e1537ec7dea569900bc6fc64a
|
7
|
+
data.tar.gz: ae5e7546b84b01eca06bfb4a27e65b8e6655c6162074c073858dfa7552b9c06697d8293e12395a1b4ab93ddc9c451768ad24c1db1433c273428eb434c5e5e604
|
data/lib/yao/resources.rb
CHANGED
@@ -8,6 +8,7 @@ module Yao
|
|
8
8
|
autoload :SecurityGroup, "yao/resources/security_group"
|
9
9
|
autoload :SecurityGroupRule, "yao/resources/security_group_rule"
|
10
10
|
autoload :Hypervisor, "yao/resources/hypervisor"
|
11
|
+
autoload :Aggregates, "yao/resources/aggregates"
|
11
12
|
autoload :Keypair, "yao/resources/keypair"
|
12
13
|
autoload :FloatingIP, "yao/resources/floating_ip"
|
13
14
|
autoload :Network, "yao/resources/network"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'date'
|
2
|
+
|
3
|
+
module Yao::Resources
|
4
|
+
class Aggregates < Base
|
5
|
+
friendly_attributes :availability_zone, :deleted, :hosts, :metadata, :name
|
6
|
+
|
7
|
+
def created_at
|
8
|
+
Date.parse(self["created_at"])
|
9
|
+
end
|
10
|
+
|
11
|
+
def updated_at
|
12
|
+
Date.parse(self["updated_at"]) if self["updated_at"]
|
13
|
+
end
|
14
|
+
|
15
|
+
def deleted_at
|
16
|
+
Date.parse(self["deleted_at"]) if self["deleted_at"]
|
17
|
+
end
|
18
|
+
|
19
|
+
self.service = "compute"
|
20
|
+
self.resources_name = "aggregates"
|
21
|
+
self.resources_path = "os-aggregates"
|
22
|
+
end
|
23
|
+
end
|
data/lib/yao/version.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
require "date"
|
2
|
+
|
3
|
+
class TestRole < Test::Unit::TestCase
|
4
|
+
def test_server_aggregates
|
5
|
+
params = {
|
6
|
+
"availability_zone" => "nova",
|
7
|
+
"deleted" => false,
|
8
|
+
"hosts" => ["host1", "host2"],
|
9
|
+
"metadata" => {"foo" => "bar"},
|
10
|
+
"name" => "nova",
|
11
|
+
"created_at" => "2015-08-27T09:49:58-05:00",
|
12
|
+
"updated_at" => "2015-08-27T09:49:58-05:00",
|
13
|
+
"deleted_at" => "2015-08-27T09:49:58-05:00",
|
14
|
+
}
|
15
|
+
|
16
|
+
aggregates = Yao::Aggregates.new(params)
|
17
|
+
assert_equal(aggregates.availability_zone, "nova")
|
18
|
+
assert_equal(aggregates.deleted, false)
|
19
|
+
assert_equal(aggregates.hosts, ["host1", "host2"])
|
20
|
+
assert_equal(aggregates.metadata, {"foo" => "bar"})
|
21
|
+
assert_equal(aggregates.name, "nova")
|
22
|
+
assert_equal(aggregates.created_at, Date.parse("2015-08-27T09:49:58-05:00"))
|
23
|
+
assert_equal(aggregates.created_at, Date.parse("2015-08-27T09:49:58-05:00"))
|
24
|
+
assert_equal(aggregates.created_at, Date.parse("2015-08-27T09:49:58-05:00"))
|
25
|
+
end
|
26
|
+
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.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Uchio, KONDO
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -178,6 +178,7 @@ files:
|
|
178
178
|
- lib/yao/plugins/registry.rb
|
179
179
|
- lib/yao/resources.rb
|
180
180
|
- lib/yao/resources/action.rb
|
181
|
+
- lib/yao/resources/aggregates.rb
|
181
182
|
- lib/yao/resources/base.rb
|
182
183
|
- lib/yao/resources/flavor.rb
|
183
184
|
- lib/yao/resources/floating_ip.rb
|
@@ -185,6 +186,7 @@ files:
|
|
185
186
|
- lib/yao/resources/hypervisor.rb
|
186
187
|
- lib/yao/resources/image.rb
|
187
188
|
- lib/yao/resources/keypair.rb
|
189
|
+
- lib/yao/resources/loadbalancer_pool.rb
|
188
190
|
- lib/yao/resources/metadata_available.rb
|
189
191
|
- lib/yao/resources/meter.rb
|
190
192
|
- lib/yao/resources/network.rb
|
@@ -209,6 +211,7 @@ files:
|
|
209
211
|
- test/fixtures/dummy.key
|
210
212
|
- test/fixtures/dummy.pem
|
211
213
|
- test/support/auth_stub.rb
|
214
|
+
- test/yao/resources/test_aggregates.rb
|
212
215
|
- test/yao/resources/test_role.rb
|
213
216
|
- test/yao/resources/test_security_group.rb
|
214
217
|
- test/yao/resources/test_security_group_rule.rb
|
@@ -251,6 +254,7 @@ test_files:
|
|
251
254
|
- test/fixtures/dummy.key
|
252
255
|
- test/fixtures/dummy.pem
|
253
256
|
- test/support/auth_stub.rb
|
257
|
+
- test/yao/resources/test_aggregates.rb
|
254
258
|
- test/yao/resources/test_role.rb
|
255
259
|
- test/yao/resources/test_security_group.rb
|
256
260
|
- test/yao/resources/test_security_group_rule.rb
|