openstack 3.3.0 → 3.3.1
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/VERSION +1 -1
- data/lib/openstack.rb +1 -0
- data/lib/openstack/connection.rb +3 -0
- data/lib/openstack/metering/connection.rb +30 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6e25014771eb5812859b04fb7acf896ee96d34b
|
4
|
+
data.tar.gz: b4a28117aa9ffc2e98a9aef0f0293450864b772a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51069cfbbf28c5bd741f0b1ba56f0bb73cedc453f9659ddcf1c0c73e1f39ad20c3b8922e22ea8c6060e736f0dcf6bafb00aca38126ebfa796e0ff3c5003e93c3
|
7
|
+
data.tar.gz: d7193403695d267378a18e983dcbf1ae317e3102c6a3096df7a873a990d246ed56f34fade63c2e02af9099e76fc0c602dabd39aeb8faeb651cfaf6c11a3f28c3
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.
|
1
|
+
3.3.1
|
data/lib/openstack.rb
CHANGED
data/lib/openstack/connection.rb
CHANGED
@@ -98,6 +98,8 @@ class Connection
|
|
98
98
|
OpenStack::Image::Connection.new(connection)
|
99
99
|
when "network"
|
100
100
|
OpenStack::Network::Connection.new(connection)
|
101
|
+
when "metering"
|
102
|
+
OpenStack::Metering::Connection.new(connection)
|
101
103
|
when "identity"
|
102
104
|
OpenStack::Identity::Connection.new(connection)
|
103
105
|
else
|
@@ -146,6 +148,7 @@ class Connection
|
|
146
148
|
@authok = false
|
147
149
|
@http = {}
|
148
150
|
@quantum_version = 'v2.0' if @service_type == 'network'
|
151
|
+
@quantum_version = 'v2' if @service_type == 'metering'
|
149
152
|
@endpoint_type = options[:endpoint_type] || "publicURL"
|
150
153
|
end
|
151
154
|
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module OpenStack
|
2
|
+
module Metering
|
3
|
+
|
4
|
+
class Connection
|
5
|
+
|
6
|
+
attr_accessor :connection
|
7
|
+
|
8
|
+
def initialize(connection)
|
9
|
+
@connection = connection
|
10
|
+
OpenStack::Authentication.init(@connection)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Returns true if the authentication was successful and returns false otherwise.
|
14
|
+
#
|
15
|
+
# cs.authok?
|
16
|
+
# => true
|
17
|
+
def authok?
|
18
|
+
@connection.authok
|
19
|
+
end
|
20
|
+
|
21
|
+
def query_samples(data = {})
|
22
|
+
response = @connection.req('POST', "/query/samples", {data: JSON.generate(data)})
|
23
|
+
OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)
|
24
|
+
JSON.parse(response.body)
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Prince
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2016-10-
|
15
|
+
date: 2016-10-11 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: mocha
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- lib/openstack/identity/tenant.rb
|
102
102
|
- lib/openstack/identity/user.rb
|
103
103
|
- lib/openstack/image/connection.rb
|
104
|
+
- lib/openstack/metering/connection.rb
|
104
105
|
- lib/openstack/network/connection.rb
|
105
106
|
- lib/openstack/network/network.rb
|
106
107
|
- lib/openstack/network/port.rb
|