delphix 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/delphix.rb +7 -7
- data/lib/delphix/version.rb +1 -1
- data/lib/delphix/web_response.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb7da681701744add184a1eb1ab58a7ce6fabf63
|
4
|
+
data.tar.gz: 9f1bc95f502e0f56f0a3e7eaa55c21392420db08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f96f7d43aa4e350373cfeb0eccc4ec257d3fbcd38368232f776ecaee997274f70c30b35263c904952d07097cdb8de21b82e0852926e808a5722ea391ff857f00
|
7
|
+
data.tar.gz: 56c2ad466c132d1c09bd9d69a6b7d561a473a9e17d9dbd1c39d87b9ce9f3e868ccb2c67e996b44801fca7bd29f52b5da4ce116d99b8878ef5220580f1c9a0891
|
data/lib/delphix.rb
CHANGED
@@ -29,7 +29,7 @@ require_relative 'delphix/version'
|
|
29
29
|
# to only one instance that is globally available.
|
30
30
|
#
|
31
31
|
# @example
|
32
|
-
# To establish a session with the Delphix appliance and get a
|
32
|
+
# To establish a session with the Delphix appliance and get a cookies for
|
33
33
|
# your effort you issue the following sequence:
|
34
34
|
#
|
35
35
|
# * Configure the Delphix client to use the specified version of the API, in
|
@@ -106,23 +106,23 @@ module Delphix
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def self.session
|
109
|
-
Delphix.default_header('Cookie',
|
109
|
+
Delphix.default_header('Cookie', cookies)
|
110
110
|
@session ||= login(@api_user, @api_passwd)
|
111
111
|
end
|
112
112
|
|
113
113
|
# Establish a session with the Delphix engine and return an identifier
|
114
|
-
# through browser
|
114
|
+
# through browser cookies. This session will be reused in subsequent calls,
|
115
115
|
# the same session credentials and state are preserved without requiring a
|
116
116
|
# re-authentication call. Sessions do not persisit between incovations.
|
117
117
|
#
|
118
|
-
# @return [Hash]
|
119
|
-
# containing the new session
|
118
|
+
# @return [Hash] cookies
|
119
|
+
# containing the new session cookies
|
120
120
|
#
|
121
121
|
# @api public
|
122
|
-
def self.
|
122
|
+
def self.cookies
|
123
123
|
@resp ||= Delphix.post session_url,
|
124
124
|
type: 'APISession', version: @api_version
|
125
|
-
@resp.
|
125
|
+
@resp.cookies
|
126
126
|
end
|
127
127
|
|
128
128
|
# Authenticates the session so that API calls can be made. Only supports basic
|
data/lib/delphix/version.rb
CHANGED
data/lib/delphix/web_response.rb
CHANGED
@@ -42,22 +42,22 @@ module Delphix
|
|
42
42
|
# @return [#headers]
|
43
43
|
attr_reader :headers
|
44
44
|
# @!attribute [r] method
|
45
|
-
# The current session
|
45
|
+
# The current session cookies.
|
46
46
|
# @return [#raw_body]
|
47
|
-
attr_reader :
|
47
|
+
attr_reader :cookies
|
48
48
|
|
49
49
|
def initialize(response)
|
50
50
|
@code = response.code
|
51
51
|
@headers = response.headers
|
52
52
|
@raw_body = response
|
53
53
|
@body = @raw_body
|
54
|
-
@
|
54
|
+
@cookies = response.cookies
|
55
55
|
|
56
56
|
Delphix.last_response = {
|
57
57
|
code: response.code,
|
58
58
|
headers: response.headers,
|
59
59
|
body: JSON.parse(response.body),
|
60
|
-
|
60
|
+
cookies: response.cookies,
|
61
61
|
description: response.description
|
62
62
|
}.recursively_normalize_keys
|
63
63
|
|