netscaler-cli 0.5.6 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +0 -4
- data/Gemfile.lock +17 -6
- data/lib/VERSION.yml +2 -2
- data/lib/netscaler/base_request.rb +1 -1
- data/lib/netscaler/logging.rb +15 -1
- data/lib/netscaler/transaction.rb +13 -16
- metadata +162 -110
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -6,7 +6,7 @@ PATH
|
|
6
6
|
highline (>= 1.6)
|
7
7
|
json_pure (>= 1.5.1)
|
8
8
|
log4r (>= 1.1.9)
|
9
|
-
savon (
|
9
|
+
savon (>= 0.7.9)
|
10
10
|
|
11
11
|
GEM
|
12
12
|
remote: http://rubygems.org/
|
@@ -17,12 +17,20 @@ GEM
|
|
17
17
|
autotest-notification (2.3.1)
|
18
18
|
autotest (~> 4.3)
|
19
19
|
builder (3.0.0)
|
20
|
-
choosy (0.4.
|
21
|
-
crack (0.1.8)
|
20
|
+
choosy (0.4.9)
|
22
21
|
diff-lcs (1.1.2)
|
23
|
-
|
22
|
+
gyoku (0.4.4)
|
23
|
+
builder (>= 2.1.2)
|
24
|
+
highline (1.6.2)
|
25
|
+
httpi (0.9.4)
|
26
|
+
pyu-ntlm-http (>= 0.1.3.1)
|
27
|
+
rack
|
24
28
|
json_pure (1.5.1)
|
25
29
|
log4r (1.1.9)
|
30
|
+
nokogiri (1.4.4)
|
31
|
+
nori (0.2.3)
|
32
|
+
pyu-ntlm-http (0.1.3.1)
|
33
|
+
rack (1.3.0)
|
26
34
|
rspec (2.5.0)
|
27
35
|
rspec-core (~> 2.5.0)
|
28
36
|
rspec-expectations (~> 2.5.0)
|
@@ -31,9 +39,12 @@ GEM
|
|
31
39
|
rspec-expectations (2.5.0)
|
32
40
|
diff-lcs (~> 1.1.2)
|
33
41
|
rspec-mocks (2.5.0)
|
34
|
-
savon (0.
|
42
|
+
savon (0.9.2)
|
35
43
|
builder (>= 2.1.2)
|
36
|
-
|
44
|
+
gyoku (>= 0.4.0)
|
45
|
+
httpi (>= 0.7.8)
|
46
|
+
nokogiri (>= 1.4.0)
|
47
|
+
nori (>= 0.2.0)
|
37
48
|
|
38
49
|
PLATFORMS
|
39
50
|
ruby
|
data/lib/VERSION.yml
CHANGED
data/lib/netscaler/logging.rb
CHANGED
@@ -18,7 +18,13 @@ module Netscaler
|
|
18
18
|
|
19
19
|
@@log.level = debug ? Log4r::DEBUG : Log4r::INFO
|
20
20
|
|
21
|
-
Savon
|
21
|
+
Savon.configure do |config|
|
22
|
+
config.log = debug ? true : false
|
23
|
+
config.log_level = :debug
|
24
|
+
config.logger = @@log
|
25
|
+
config.raise_errors = false
|
26
|
+
end
|
27
|
+
|
22
28
|
end
|
23
29
|
end
|
24
30
|
|
@@ -32,3 +38,11 @@ module Netscaler
|
|
32
38
|
end
|
33
39
|
end
|
34
40
|
end
|
41
|
+
|
42
|
+
# SHUT THE HELL UP!
|
43
|
+
module HTTPI
|
44
|
+
class << self
|
45
|
+
def log(*messages)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -20,24 +20,23 @@ module Netscaler
|
|
20
20
|
end
|
21
21
|
|
22
22
|
log.debug("Beginning the transaction execution: #{@config.host}")
|
23
|
-
|
24
|
-
client = Savon::Client.new(url) #"file://{File.expand_path('./etc/NSConfig.wsdl', File.dirname(__FILE__))}")
|
25
|
-
client.request.http.ssl_client_auth(:verify_mode => OpenSSL::SSL::VERIFY_NONE)
|
26
|
-
|
27
23
|
begin
|
28
|
-
|
24
|
+
client = Savon::Client.new do
|
25
|
+
wsdl.endpoint = url
|
26
|
+
wsdl.namespace = Netscaler::NSCONFIG_NAMESPACE
|
27
|
+
end
|
28
|
+
client.http.auth.ssl.verify_mode = :none
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
body = Hash.new
|
34
|
-
body['username'] = @config.username
|
35
|
-
body['password'] = @config.password
|
30
|
+
log.debug("Logging in to the Netscaler host.")
|
31
|
+
body = { :username => @config.username, :password => @config.password }
|
36
32
|
|
33
|
+
response = client.request :login do
|
34
|
+
#soap.namespace = Netscaler::NSCONFIG_NAMESPACE
|
37
35
|
soap.body = body
|
38
36
|
end
|
39
|
-
|
40
|
-
|
37
|
+
|
38
|
+
auth_cookie = response.http.headers['Set-Cookie']
|
39
|
+
client.http.headers['Cookie'] = auth_cookie
|
41
40
|
log.debug("Got authorization cookie: #{auth_cookie}")
|
42
41
|
|
43
42
|
log.debug("Yielding client control to the calling context")
|
@@ -51,9 +50,7 @@ module Netscaler
|
|
51
50
|
ensure
|
52
51
|
begin
|
53
52
|
log.debug("Logging out of the Netscaler host.")
|
54
|
-
client.logout
|
55
|
-
soap.namespace = Netscaler::NSCONFIG_NAMESPACE
|
56
|
-
end
|
53
|
+
client.request :logout
|
57
54
|
rescue Exception => e
|
58
55
|
log.fatal(e)
|
59
56
|
log.fatal("Unable to logout.")
|
metadata
CHANGED
@@ -1,176 +1,228 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: netscaler-cli
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 5
|
9
|
+
- 7
|
10
|
+
version: 0.5.7
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Gabe McArthur
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
17
|
+
|
18
|
+
date: 2011-06-10 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
16
21
|
name: log4r
|
17
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
18
24
|
none: false
|
19
|
-
requirements:
|
20
|
-
- -
|
21
|
-
- !ruby/object:Gem::Version
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 1
|
29
|
+
segments:
|
30
|
+
- 1
|
31
|
+
- 1
|
32
|
+
- 9
|
22
33
|
version: 1.1.9
|
23
34
|
type: :runtime
|
24
|
-
|
25
|
-
|
26
|
-
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
27
37
|
name: savon
|
28
|
-
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
29
40
|
none: false
|
30
|
-
requirements:
|
31
|
-
- -
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 63
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
- 9
|
48
|
+
- 2
|
49
|
+
version: 0.9.2
|
34
50
|
type: :runtime
|
35
|
-
|
36
|
-
|
37
|
-
- !ruby/object:Gem::Dependency
|
51
|
+
version_requirements: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
38
53
|
name: highline
|
39
|
-
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
56
|
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
61
|
+
segments:
|
62
|
+
- 1
|
63
|
+
- 6
|
64
|
+
version: "1.6"
|
45
65
|
type: :runtime
|
46
|
-
|
47
|
-
|
48
|
-
- !ruby/object:Gem::Dependency
|
66
|
+
version_requirements: *id003
|
67
|
+
- !ruby/object:Gem::Dependency
|
49
68
|
name: choosy
|
50
|
-
|
69
|
+
prerelease: false
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
51
71
|
none: false
|
52
|
-
requirements:
|
53
|
-
- -
|
54
|
-
- !ruby/object:Gem::Version
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 31
|
76
|
+
segments:
|
77
|
+
- 0
|
78
|
+
- 4
|
79
|
+
- 8
|
55
80
|
version: 0.4.8
|
56
81
|
type: :runtime
|
57
|
-
|
58
|
-
|
59
|
-
- !ruby/object:Gem::Dependency
|
82
|
+
version_requirements: *id004
|
83
|
+
- !ruby/object:Gem::Dependency
|
60
84
|
name: json_pure
|
61
|
-
|
85
|
+
prerelease: false
|
86
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
62
87
|
none: false
|
63
|
-
requirements:
|
64
|
-
- -
|
65
|
-
- !ruby/object:Gem::Version
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
hash: 1
|
92
|
+
segments:
|
93
|
+
- 1
|
94
|
+
- 5
|
95
|
+
- 1
|
66
96
|
version: 1.5.1
|
67
97
|
type: :runtime
|
68
|
-
|
69
|
-
|
70
|
-
- !ruby/object:Gem::Dependency
|
98
|
+
version_requirements: *id005
|
99
|
+
- !ruby/object:Gem::Dependency
|
71
100
|
name: rspec
|
72
|
-
|
101
|
+
prerelease: false
|
102
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
73
103
|
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
hash: 3
|
108
|
+
segments:
|
109
|
+
- 0
|
110
|
+
version: "0"
|
78
111
|
type: :development
|
79
|
-
|
80
|
-
|
81
|
-
- !ruby/object:Gem::Dependency
|
112
|
+
version_requirements: *id006
|
113
|
+
- !ruby/object:Gem::Dependency
|
82
114
|
name: autotest
|
83
|
-
|
115
|
+
prerelease: false
|
116
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
84
117
|
none: false
|
85
|
-
requirements:
|
86
|
-
- -
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
hash: 3
|
122
|
+
segments:
|
123
|
+
- 0
|
124
|
+
version: "0"
|
89
125
|
type: :development
|
90
|
-
|
91
|
-
|
92
|
-
- !ruby/object:Gem::Dependency
|
126
|
+
version_requirements: *id007
|
127
|
+
- !ruby/object:Gem::Dependency
|
93
128
|
name: autotest-notification
|
94
|
-
|
129
|
+
prerelease: false
|
130
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
95
131
|
none: false
|
96
|
-
requirements:
|
97
|
-
- -
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
hash: 3
|
136
|
+
segments:
|
137
|
+
- 0
|
138
|
+
version: "0"
|
100
139
|
type: :development
|
101
|
-
|
102
|
-
|
103
|
-
- !ruby/object:Gem::Dependency
|
140
|
+
version_requirements: *id008
|
141
|
+
- !ruby/object:Gem::Dependency
|
104
142
|
name: ZenTest
|
105
|
-
|
143
|
+
prerelease: false
|
144
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
106
145
|
none: false
|
107
|
-
requirements:
|
108
|
-
- -
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
hash: 3
|
150
|
+
segments:
|
151
|
+
- 0
|
152
|
+
version: "0"
|
111
153
|
type: :development
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
uses the NSConfig.wsdl SOAP interface for remote access.
|
116
|
-
email:
|
154
|
+
version_requirements: *id009
|
155
|
+
description: This gem installs several simple command line utilities locally. It uses the NSConfig.wsdl SOAP interface for remote access.
|
156
|
+
email:
|
117
157
|
- madeonamac@gmail.com
|
118
|
-
executables:
|
158
|
+
executables:
|
119
159
|
- netscaler
|
120
160
|
extensions: []
|
161
|
+
|
121
162
|
extra_rdoc_files: []
|
122
|
-
|
123
|
-
|
163
|
+
|
164
|
+
files:
|
124
165
|
- Gemfile
|
125
166
|
- README.markdown
|
126
167
|
- Gemfile.lock
|
168
|
+
- Rakefile
|
127
169
|
- bin/netscaler
|
128
|
-
- lib/netscaler/server/request.rb
|
129
|
-
- lib/netscaler/server/response.rb
|
130
|
-
- lib/netscaler/base_request.rb
|
131
|
-
- lib/netscaler/servicegroup/request.rb
|
132
|
-
- lib/netscaler/servicegroup/response.rb
|
133
|
-
- lib/netscaler/cli.rb
|
134
|
-
- lib/netscaler/config.rb
|
135
|
-
- lib/netscaler/executor.rb
|
136
|
-
- lib/netscaler/vserver/request.rb
|
137
170
|
- lib/netscaler/vserver/response.rb
|
138
|
-
- lib/netscaler/
|
171
|
+
- lib/netscaler/vserver/request.rb
|
172
|
+
- lib/netscaler/server/response.rb
|
173
|
+
- lib/netscaler/server/request.rb
|
139
174
|
- lib/netscaler/errors.rb
|
140
|
-
- lib/netscaler/service/request.rb
|
141
|
-
- lib/netscaler/service/response.rb
|
142
175
|
- lib/netscaler/transaction.rb
|
176
|
+
- lib/netscaler/service/response.rb
|
177
|
+
- lib/netscaler/service/request.rb
|
178
|
+
- lib/netscaler/logging.rb
|
179
|
+
- lib/netscaler/cli.rb
|
180
|
+
- lib/netscaler/base_request.rb
|
181
|
+
- lib/netscaler/executor.rb
|
182
|
+
- lib/netscaler/config.rb
|
183
|
+
- lib/netscaler/servicegroup/response.rb
|
184
|
+
- lib/netscaler/servicegroup/request.rb
|
143
185
|
- lib/VERSION.yml
|
144
|
-
- spec/netscaler/
|
186
|
+
- spec/netscaler/config_spec.rb
|
145
187
|
- spec/netscaler/configs/bad-yaml.yml
|
146
188
|
- spec/netscaler/configs/missing-username.yml
|
147
189
|
- spec/netscaler/configs/simple-config.yml
|
148
|
-
- spec/netscaler/
|
190
|
+
- spec/netscaler/cli_spec.rb
|
149
191
|
- spec/spec_helpers.rb
|
150
|
-
has_rdoc: true
|
151
192
|
homepage: http://github.com/gabemc/netscaler-cli
|
152
193
|
licenses: []
|
194
|
+
|
153
195
|
post_install_message:
|
154
196
|
rdoc_options: []
|
155
|
-
|
197
|
+
|
198
|
+
require_paths:
|
156
199
|
- lib
|
157
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
200
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
158
201
|
none: false
|
159
|
-
requirements:
|
160
|
-
- -
|
161
|
-
- !ruby/object:Gem::Version
|
162
|
-
|
163
|
-
|
202
|
+
requirements:
|
203
|
+
- - ">="
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
hash: 3
|
206
|
+
segments:
|
207
|
+
- 0
|
208
|
+
version: "0"
|
209
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
210
|
none: false
|
165
|
-
requirements:
|
166
|
-
- -
|
167
|
-
- !ruby/object:Gem::Version
|
211
|
+
requirements:
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
hash: 23
|
215
|
+
segments:
|
216
|
+
- 1
|
217
|
+
- 3
|
218
|
+
- 6
|
168
219
|
version: 1.3.6
|
169
220
|
requirements: []
|
221
|
+
|
170
222
|
rubyforge_project:
|
171
|
-
rubygems_version: 1.
|
223
|
+
rubygems_version: 1.8.2
|
172
224
|
signing_key:
|
173
225
|
specification_version: 3
|
174
|
-
summary: Simple command line utilities for interacting remotely with a Netscaler load
|
175
|
-
balancer.
|
226
|
+
summary: Simple command line utilities for interacting remotely with a Netscaler load balancer.
|
176
227
|
test_files: []
|
228
|
+
|