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 CHANGED
@@ -1,6 +1,2 @@
1
- # So that the netscaler.gemspec will load
2
- require 'choosy'
3
- require 'rake'
4
-
5
1
  source :rubygems
6
2
  gemspec
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 (= 0.7.9)
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.8)
21
- crack (0.1.8)
20
+ choosy (0.4.9)
22
21
  diff-lcs (1.1.2)
23
- highline (1.6.1)
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.7.9)
42
+ savon (0.9.2)
35
43
  builder (>= 2.1.2)
36
- crack (>= 0.1.4)
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
@@ -1,6 +1,6 @@
1
1
  ---
2
- date: 31/03/2011
2
+ date: 10/06/2011
3
3
  version:
4
+ tiny: 7
4
5
  major: 0
5
6
  minor: 5
6
- tiny: 6
@@ -20,7 +20,7 @@ module Netscaler
20
20
 
21
21
  log.debug("Calling: #{name}")
22
22
 
23
- result = client.send("#{name}!") do |soap|
23
+ result = client.request name do
24
24
  soap.namespace = Netscaler::NSCONFIG_NAMESPACE
25
25
  soap.input = name
26
26
  body = Hash.new
@@ -18,7 +18,13 @@ module Netscaler
18
18
 
19
19
  @@log.level = debug ? Log4r::DEBUG : Log4r::INFO
20
20
 
21
- Savon::Request.logger = @@log
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
- log.debug("Logging in to the Netscaler host.")
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
- response = client.login! do |soap|
31
- soap.namespace = Netscaler::NSCONFIG_NAMESPACE
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
- auth_cookie = response.http['Set-Cookie']
40
- client.request.headers['Cookie'] = auth_cookie
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! do |soap|
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
- version: 0.5.6
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
- date: 2011-03-31 00:00:00.000000000 -07:00
13
- default_executable:
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
- requirement: &81821240 !ruby/object:Gem::Requirement
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
- prerelease: false
25
- version_requirements: *81821240
26
- - !ruby/object:Gem::Dependency
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
27
37
  name: savon
28
- requirement: &81820850 !ruby/object:Gem::Requirement
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
29
40
  none: false
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: 0.7.9
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
- prerelease: false
36
- version_requirements: *81820850
37
- - !ruby/object:Gem::Dependency
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
38
53
  name: highline
39
- requirement: &81820490 !ruby/object:Gem::Requirement
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
40
56
  none: false
41
- requirements:
42
- - - ! '>='
43
- - !ruby/object:Gem::Version
44
- version: '1.6'
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
- prerelease: false
47
- version_requirements: *81820490
48
- - !ruby/object:Gem::Dependency
66
+ version_requirements: *id003
67
+ - !ruby/object:Gem::Dependency
49
68
  name: choosy
50
- requirement: &81819880 !ruby/object:Gem::Requirement
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
- prerelease: false
58
- version_requirements: *81819880
59
- - !ruby/object:Gem::Dependency
82
+ version_requirements: *id004
83
+ - !ruby/object:Gem::Dependency
60
84
  name: json_pure
61
- requirement: &81814170 !ruby/object:Gem::Requirement
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
- prerelease: false
69
- version_requirements: *81814170
70
- - !ruby/object:Gem::Dependency
98
+ version_requirements: *id005
99
+ - !ruby/object:Gem::Dependency
71
100
  name: rspec
72
- requirement: &81813930 !ruby/object:Gem::Requirement
101
+ prerelease: false
102
+ requirement: &id006 !ruby/object:Gem::Requirement
73
103
  none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ hash: 3
108
+ segments:
109
+ - 0
110
+ version: "0"
78
111
  type: :development
79
- prerelease: false
80
- version_requirements: *81813930
81
- - !ruby/object:Gem::Dependency
112
+ version_requirements: *id006
113
+ - !ruby/object:Gem::Dependency
82
114
  name: autotest
83
- requirement: &81813230 !ruby/object:Gem::Requirement
115
+ prerelease: false
116
+ requirement: &id007 !ruby/object:Gem::Requirement
84
117
  none: false
85
- requirements:
86
- - - ! '>='
87
- - !ruby/object:Gem::Version
88
- version: '0'
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ hash: 3
122
+ segments:
123
+ - 0
124
+ version: "0"
89
125
  type: :development
90
- prerelease: false
91
- version_requirements: *81813230
92
- - !ruby/object:Gem::Dependency
126
+ version_requirements: *id007
127
+ - !ruby/object:Gem::Dependency
93
128
  name: autotest-notification
94
- requirement: &81812960 !ruby/object:Gem::Requirement
129
+ prerelease: false
130
+ requirement: &id008 !ruby/object:Gem::Requirement
95
131
  none: false
96
- requirements:
97
- - - ! '>='
98
- - !ruby/object:Gem::Version
99
- version: '0'
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ hash: 3
136
+ segments:
137
+ - 0
138
+ version: "0"
100
139
  type: :development
101
- prerelease: false
102
- version_requirements: *81812960
103
- - !ruby/object:Gem::Dependency
140
+ version_requirements: *id008
141
+ - !ruby/object:Gem::Dependency
104
142
  name: ZenTest
105
- requirement: &81812680 !ruby/object:Gem::Requirement
143
+ prerelease: false
144
+ requirement: &id009 !ruby/object:Gem::Requirement
106
145
  none: false
107
- requirements:
108
- - - ! '>='
109
- - !ruby/object:Gem::Version
110
- version: '0'
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ hash: 3
150
+ segments:
151
+ - 0
152
+ version: "0"
111
153
  type: :development
112
- prerelease: false
113
- version_requirements: *81812680
114
- description: This gem installs several simple command line utilities locally. It
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
- files:
123
- - Rakefile
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/logging.rb
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/cli_spec.rb
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/config_spec.rb
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
- require_paths:
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
- version: '0'
163
- required_rubygems_version: !ruby/object:Gem::Requirement
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.6.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
+