openstack 3.3.0 → 3.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e45a4fa4b60e2d4c6ed538ad2f07b9d3f9c58cc0
4
- data.tar.gz: 1ca3386b95f1fcf1a348e48d117da534bcfd0c3f
3
+ metadata.gz: d6e25014771eb5812859b04fb7acf896ee96d34b
4
+ data.tar.gz: b4a28117aa9ffc2e98a9aef0f0293450864b772a
5
5
  SHA512:
6
- metadata.gz: 81adf1e03224df17c61fe9696abb83ae03dd97db7b45e39aa32f5847a0e48cec68835370b4643ad02aeb7dc5953d779422133be777f6e3d6bfa74fc76a225f64
7
- data.tar.gz: fcd9cff58a6f1438fe1d1a63d42e7cd91a7f3187b9fdb6f3d603525dd509233bfc9a289a2c874ebdece58f71991b77e93d9730e93f101c2f075d1906f98e0c30
6
+ metadata.gz: 51069cfbbf28c5bd741f0b1ba56f0bb73cedc453f9659ddcf1c0c73e1f39ad20c3b8922e22ea8c6060e736f0dcf6bafb00aca38126ebfa796e0ff3c5003e93c3
7
+ data.tar.gz: d7193403695d267378a18e983dcbf1ae317e3102c6a3096df7a873a990d246ed56f34fade63c2e02af9099e76fc0c602dabd39aeb8faeb651cfaf6c11a3f28c3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.0
1
+ 3.3.1
@@ -15,6 +15,7 @@ module OpenStack
15
15
 
16
16
  $:.unshift(File.dirname(__FILE__))
17
17
  require 'openstack/connection'
18
+ require 'openstack/metering/connection'
18
19
  require 'openstack/compute/connection'
19
20
  require 'openstack/compute/server'
20
21
  require 'openstack/compute/image'
@@ -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.0
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-08 00:00:00.000000000 Z
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