delphix 0.4.0 → 0.4.1
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 +8 -31
- data/lib/delphix/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23b2e0d907e84294f429d51c4ae47b69becb0cfd
|
4
|
+
data.tar.gz: 5015f1056aa5fc815ebc81f1e888c5d6654ce067
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8c15024e86599f509f40c363ca642a30eb3bd03392395de56bdde1be4423c8ffe50a77d2f1835f7e605bb95ebbac2f8b2035fc30a1dadbb35db2e4985d95a1b
|
7
|
+
data.tar.gz: 800d8f6c4d1085a288392f0d4c09bef74829a43ad0427ad27f95eb59a3ec9d490d33227f95a304cd4b9023932dd8aebad7d2c46d5a95b66fc231558c0df8e567
|
data/lib/delphix.rb
CHANGED
@@ -52,8 +52,9 @@ module Delphix
|
|
52
52
|
|
53
53
|
API_ENDPOINT = '/resources/json/delphix'
|
54
54
|
HTTP_HEADERS = {
|
55
|
+
'Accept' => 'application/json; charset=UTF-8',
|
55
56
|
'Content-Type' => 'application/json; charset=UTF-8',
|
56
|
-
'User-Agent' => 'Delphix-Ruby-Client/'
|
57
|
+
'User-Agent' => 'Delphix-Ruby-Client/1.0.0'
|
57
58
|
}
|
58
59
|
|
59
60
|
# Default timeout value in seconds.
|
@@ -76,6 +77,9 @@ module Delphix
|
|
76
77
|
# @return [#body] parsed response body
|
77
78
|
# @return [#raw_body] un-parsed response body
|
78
79
|
attr_accessor :session
|
80
|
+
# @!attribute [rw] api_version
|
81
|
+
# @return [Hash] containing the major, minor and micro version numbers.
|
82
|
+
attr_accessor :api_version
|
79
83
|
# @!attribute [rw] server
|
80
84
|
# @return [String] Delphix server address
|
81
85
|
attr_accessor :server
|
@@ -85,33 +89,11 @@ module Delphix
|
|
85
89
|
# @!attribute [rw] api_passwd
|
86
90
|
# @return [String] password for authentication
|
87
91
|
attr_accessor :api_passwd
|
92
|
+
# @!attribute [rw] verbose
|
93
|
+
# @return [Nothing] enables verbosity
|
94
|
+
attr_accessor :verbose
|
88
95
|
end
|
89
96
|
|
90
|
-
# Defines custom setter that takes a string, splits on the `.` and setting
|
91
|
-
# the major, minor and micro versions.
|
92
|
-
#
|
93
|
-
# @param [String] name
|
94
|
-
# Name of the setter
|
95
|
-
#
|
96
|
-
# @param [String] version
|
97
|
-
# The version number, i.e. '1.2.3'
|
98
|
-
#
|
99
|
-
# @return [undefined]
|
100
|
-
#
|
101
|
-
def self.version_accessor(name, version = nil)
|
102
|
-
define_singleton_method("#{name}=") do |version|
|
103
|
-
instance_variable_set("@#{name}",
|
104
|
-
[:major, :minor, :micro].zip(version.split('.')).inject({}) {
|
105
|
-
|r, i| r[i[0]] = i[1]; r
|
106
|
-
}.merge(type: 'APIVersion')
|
107
|
-
)
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
# @!attribute [rw] api_version
|
112
|
-
# @return [Hash] containing the major, minor and micro version numbers.
|
113
|
-
self.version_accessor :api_version
|
114
|
-
|
115
97
|
# Returns the API endpoint for a given resource namespace by combining the
|
116
98
|
# server address with the appropriate HTTP headers.
|
117
99
|
#
|
@@ -124,11 +106,6 @@ module Delphix
|
|
124
106
|
'http://' + @server + resource
|
125
107
|
end
|
126
108
|
|
127
|
-
# Initiate a session with the Delphix appliance, get our cookies for the
|
128
|
-
# duration of this exchange.
|
129
|
-
#
|
130
|
-
# @return [undefined]
|
131
|
-
#
|
132
109
|
def self.session
|
133
110
|
Delphix.default_header(:cookies, cookies)
|
134
111
|
@session ||= login(@api_user, @api_passwd)
|
data/lib/delphix/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delphix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Harding
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hoodie
|