delphix 0.2.3 → 0.2.4
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: b82aa1028f0dd27b6a4b6af8719cbc7d20025c1f
|
4
|
+
data.tar.gz: eaca66468376585c2d53a1cc3283b4f41d09e1bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b8456d5f0482a0ee5384d42e6caa3aa50ca86ebb95f1c31bfd58c4cdb692a74a91729e8f0c18639feaa0371aa765c8fc9eb14b76442b75d7aca36cbd85a4f93
|
7
|
+
data.tar.gz: 4b2d68797514bb17063b3a1ebf2c4e0efa83499c2e6f1fe758b41d3d181e3f6a0edc64341a93be78f3c4707f0af9ba077f7f2d7bea70e5e750b882a8bd8212b3
|
data/lib/delphix.rb
CHANGED
@@ -36,7 +36,7 @@ require_relative 'delphix/version'
|
|
36
36
|
# hash format as `{ major: 1, micro: 0, minor: 0 }`, for example:
|
37
37
|
# Delphix.api_version = {
|
38
38
|
# type: 'APIVersion',
|
39
|
-
#
|
39
|
+
# version: { major: 1, micro: 0, minor: 0 }
|
40
40
|
# }
|
41
41
|
# * Specify the Delphix server to connect to.
|
42
42
|
# Delphix.server = 'delphix.example.com'
|
@@ -106,23 +106,23 @@ module Delphix
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def self.session
|
109
|
-
Delphix.default_header(
|
109
|
+
Delphix.default_header('Cookie', cookie)
|
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 cookie. 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] cookie
|
119
|
+
# containing the new session cookie
|
120
120
|
#
|
121
121
|
# @api public
|
122
|
-
def self.
|
122
|
+
def self.cookie
|
123
123
|
@resp ||= Delphix.post session_url,
|
124
124
|
type: 'APISession', version: @api_version
|
125
|
-
@resp.
|
125
|
+
@resp.cookie
|
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 cookie.
|
46
46
|
# @return [#raw_body]
|
47
|
-
attr_reader :
|
47
|
+
attr_reader :cookie
|
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
|
+
@cookie = response.cookie
|
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
|
+
cookie: response.cookie,
|
61
61
|
description: response.description
|
62
62
|
}.recursively_normalize_keys
|
63
63
|
|