yao 0.13.4 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rubocop.yml +19 -0
- data/.github/workflows/ubuntu-rvm.yml +1 -1
- data/.github/workflows/ubuntu.yml +1 -1
- data/.rubocop.yml +3 -6
- data/lib/yao/auth.rb +18 -0
- data/lib/yao/client.rb +1 -1
- data/lib/yao/config.rb +19 -0
- data/lib/yao/faraday_middlewares.rb +37 -3
- data/lib/yao/mode.rb +4 -0
- data/lib/yao/plugins/default_client_generator.rb +0 -1
- data/lib/yao/plugins/registry.rb +2 -1
- data/lib/yao/resources/action.rb +7 -0
- data/lib/yao/resources/aggregates.rb +1 -0
- data/lib/yao/resources/base.rb +22 -1
- data/lib/yao/resources/compute_services.rb +8 -1
- data/lib/yao/resources/flavor.rb +2 -0
- data/lib/yao/resources/floating_ip.rb +2 -0
- data/lib/yao/resources/hypervisor.rb +1 -1
- data/lib/yao/resources/image.rb +2 -0
- data/lib/yao/resources/loadbalancer.rb +4 -0
- data/lib/yao/resources/loadbalancer_healthmonitor.rb +3 -0
- data/lib/yao/resources/loadbalancer_listener.rb +2 -0
- data/lib/yao/resources/loadbalancer_pool.rb +6 -0
- data/lib/yao/resources/loadbalancer_pool_member.rb +21 -0
- data/lib/yao/resources/metadata_available.rb +21 -0
- data/lib/yao/resources/meter.rb +8 -1
- data/lib/yao/resources/network.rb +1 -0
- data/lib/yao/resources/network_associationable.rb +1 -0
- data/lib/yao/resources/old_sample.rb +4 -0
- data/lib/yao/resources/port.rb +2 -0
- data/lib/yao/resources/port_associationable.rb +1 -0
- data/lib/yao/resources/project.rb +6 -0
- data/lib/yao/resources/resource.rb +8 -2
- data/lib/yao/resources/restfully_accessible.rb +15 -0
- data/lib/yao/resources/role.rb +6 -4
- data/lib/yao/resources/role_assignment.rb +1 -0
- data/lib/yao/resources/router.rb +9 -0
- data/lib/yao/resources/sample.rb +4 -0
- data/lib/yao/resources/security_group.rb +1 -0
- data/lib/yao/resources/security_group_rule.rb +10 -0
- data/lib/yao/resources/server.rb +20 -0
- data/lib/yao/resources/server_group.rb +1 -1
- data/lib/yao/resources/server_usage_associationable.rb +12 -0
- data/lib/yao/resources/subnet.rb +1 -0
- data/lib/yao/resources/tenant.rb +6 -0
- data/lib/yao/resources/tenant_associationable.rb +1 -0
- data/lib/yao/resources/user.rb +2 -0
- data/lib/yao/resources.rb +3 -0
- data/lib/yao/token.rb +1 -0
- data/lib/yao/version.rb +1 -1
- data/test/yao/resources/test_base.rb +11 -0
- data/test/yao/resources/test_image.rb +5 -0
- data/test/yao/resources/test_project.rb +20 -1
- data/test/yao/resources/test_server_group.rb +1 -1
- data/test/yao/test_client.rb +0 -1
- data/yao.gemspec +1 -1
- metadata +7 -5
@@ -254,4 +254,23 @@ class TestProject < TestYaoResource
|
|
254
254
|
assert_instance_of(Array, project.servers)
|
255
255
|
assert_requested(stub)
|
256
256
|
end
|
257
|
-
|
257
|
+
|
258
|
+
def test_server_usage
|
259
|
+
stub = stub_request(:get, "https://example.com:12345/os-simple-tenant-usage/0123456789abcdef0123456789abcdef")
|
260
|
+
.to_return(
|
261
|
+
status: 200,
|
262
|
+
body: <<-JSON,
|
263
|
+
{
|
264
|
+
"tenant_usage": {
|
265
|
+
"total_memory_mb_usage": 1024
|
266
|
+
}
|
267
|
+
}
|
268
|
+
JSON
|
269
|
+
headers: {'Content-Type' => 'application/json'}
|
270
|
+
)
|
271
|
+
|
272
|
+
project = Yao::Project::new("id" => "0123456789abcdef0123456789abcdef")
|
273
|
+
usage = project.server_usage
|
274
|
+
assert_equal(1024, usage["total_memory_mb_usage"])
|
275
|
+
end
|
276
|
+
end
|
data/test/yao/test_client.rb
CHANGED
data/yao.gemspec
CHANGED
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.14.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:
|
11
|
+
date: 2021-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.0
|
47
|
+
version: 1.8.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.0
|
54
|
+
version: 1.8.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: faraday_middleware
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,6 +74,7 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- ".github/workflows/macos.yml"
|
77
|
+
- ".github/workflows/rubocop.yml"
|
77
78
|
- ".github/workflows/ubuntu-rvm.yml"
|
78
79
|
- ".github/workflows/ubuntu.yml"
|
79
80
|
- ".gitignore"
|
@@ -131,6 +132,7 @@ files:
|
|
131
132
|
- lib/yao/resources/security_group_rule.rb
|
132
133
|
- lib/yao/resources/server.rb
|
133
134
|
- lib/yao/resources/server_group.rb
|
135
|
+
- lib/yao/resources/server_usage_associationable.rb
|
134
136
|
- lib/yao/resources/subnet.rb
|
135
137
|
- lib/yao/resources/tenant.rb
|
136
138
|
- lib/yao/resources/tenant_associationable.rb
|
@@ -213,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
215
|
- !ruby/object:Gem::Version
|
214
216
|
version: '0'
|
215
217
|
requirements: []
|
216
|
-
rubygems_version: 3.
|
218
|
+
rubygems_version: 3.2.32
|
217
219
|
signing_key:
|
218
220
|
specification_version: 4
|
219
221
|
summary: Yet Another OpenStack API Wrapper that rocks!!
|