occi-api 4.2.0.beta.16 → 4.2.0.beta.17
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 028662a3144ea5e6358cf09aa95bf695b34bbd7a
|
4
|
+
data.tar.gz: 75563451bd917491cdb3c2266940335011a2dd5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0174b927e6e39b06a9b2d7f4302a75cc38ef4c9b5d4055900496c210d42c65ace37ddd98886f98ed9b3f38d31a3623e041f6e8f0bc9471b07ac36f18f7b0178
|
7
|
+
data.tar.gz: 0d47b24bb194e2eb04f140ddcad0599e9a00e418c9969fbfddf1f3eeb8378dcfe530cd868c614cbcfee1b7a10dd16c8c27fdbfb9be288372ed0393011e4d77b0
|
@@ -3,6 +3,19 @@ module Occi::Api::Client
|
|
3
3
|
|
4
4
|
module ProtectedStubs
|
5
5
|
|
6
|
+
# Sets global connection options before the first call
|
7
|
+
# to a remote server is made. For example, this allows
|
8
|
+
# the configuration of a global connection timeout, including
|
9
|
+
# pre-authentication and authentication calls.
|
10
|
+
#
|
11
|
+
# @example
|
12
|
+
# configure_connection { :timeout => 180 }
|
13
|
+
#
|
14
|
+
# @param options [Hash] global options
|
15
|
+
def configure_connection(options)
|
16
|
+
raise Occi::Api::Client::Errors::NotImplementedError, "#{__method__} is just a stub!"
|
17
|
+
end
|
18
|
+
|
6
19
|
# Sets auth method and appropriate httparty attributes. Supported auth methods
|
7
20
|
# are: ["basic", "digest", "x509", "none"]
|
8
21
|
#
|
@@ -31,6 +31,9 @@ module Occi::Api::Client
|
|
31
31
|
# check the validity and canonize the endpoint URI
|
32
32
|
@endpoint = get_endpoint_uri(@options[:endpoint])
|
33
33
|
|
34
|
+
# set global connection options, such as timeout
|
35
|
+
configure_connection(@options)
|
36
|
+
|
34
37
|
# pass auth options
|
35
38
|
@auth_options = get_auth(@options[:auth])
|
36
39
|
|
@@ -40,8 +40,9 @@ module Occi::Api::Client
|
|
40
40
|
def initialize(options = {})
|
41
41
|
super options
|
42
42
|
|
43
|
+
# set a global base URI for all subsequent requests
|
44
|
+
# must be done after authN calls
|
43
45
|
self.class.base_uri @endpoint.to_s
|
44
|
-
self.class.default_timeout @options[:timeout].to_i unless @options[:timeout].blank?
|
45
46
|
|
46
47
|
# get model information from the endpoint
|
47
48
|
# and create Occi::Model instance
|
@@ -11,6 +11,12 @@ module Occi::Api::Client
|
|
11
11
|
logger
|
12
12
|
end
|
13
13
|
|
14
|
+
# @see Occi::Api::Client::ClientBase
|
15
|
+
def configure_connection(options)
|
16
|
+
# timeout is the only global connection option at the moment
|
17
|
+
self.class.default_timeout options[:timeout].to_i unless options[:timeout].blank?
|
18
|
+
end
|
19
|
+
|
14
20
|
# @see Occi::Api::Client::ClientBase
|
15
21
|
def get_auth(auth_options, fallback = false)
|
16
22
|
# select appropriate authN type
|
data/lib/occi/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: occi-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.0.beta.
|
4
|
+
version: 4.2.0.beta.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Feldhaus
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-02-
|
13
|
+
date: 2014-02-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: occi-core
|