netscaler-cli 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,14 +1,6 @@
1
- source :rubygems
2
-
3
- gem 'log4r', '~> 1.1'
4
- gem 'savon', '~> 0.7.0'
5
- gem 'highline', '>= 1.6'
6
- gem 'choosy', '~> 0.2'
7
- gem 'json_pure', '~> 1.5.1', :require => 'json'
8
-
9
- group :development do
10
- gem 'rspec', :require => "spec"
11
- gem 'autotest'
12
- gem 'autotest-notification'
13
- end
1
+ # So that the netscaler.gemspec will load
2
+ require 'choosy'
3
+ require 'rake'
14
4
 
5
+ source :rubygems
6
+ gemspec
data/Gemfile.lock CHANGED
@@ -1,3 +1,13 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ netscaler-cli (0.5.1)
5
+ choosy (>= 0.4.3)
6
+ highline (>= 1.6)
7
+ json_pure (>= 1.5.1)
8
+ log4r (>= 1.1.9)
9
+ savon (= 0.7.9)
10
+
1
11
  GEM
2
12
  remote: http://rubygems.org/
3
13
  specs:
@@ -7,11 +17,10 @@ GEM
7
17
  autotest-notification (2.3.1)
8
18
  autotest (~> 4.3)
9
19
  builder (3.0.0)
10
- choosy (0.2.5)
20
+ choosy (0.4.3)
11
21
  crack (0.1.8)
12
22
  diff-lcs (1.1.2)
13
23
  highline (1.6.1)
14
- hirb (0.4.0)
15
24
  json_pure (1.5.1)
16
25
  log4r (1.1.9)
17
26
  rspec (2.5.0)
@@ -30,12 +39,8 @@ PLATFORMS
30
39
  ruby
31
40
 
32
41
  DEPENDENCIES
42
+ ZenTest
33
43
  autotest
34
44
  autotest-notification
35
- choosy (~> 0.2)
36
- highline (>= 1.6)
37
- hirb (~> 0.4.0)
38
- json_pure (~> 1.5.1)
39
- log4r (~> 1.1)
45
+ netscaler-cli!
40
46
  rspec
41
- savon (~> 0.7.0)
data/Rakefile CHANGED
@@ -5,54 +5,12 @@ require 'fileutils'
5
5
  require 'rake'
6
6
  require 'rubygems'
7
7
  require 'rspec/core/rake_task'
8
- require 'netscaler/version'
9
-
10
- include FileUtils
8
+ require 'choosy/rake'
11
9
 
12
10
  task :default => :spec
13
11
 
14
12
  desc "Run the RSpec tests"
15
13
  RSpec::Core::RakeTask.new :spec
16
14
 
17
- begin
18
- require 'jeweler'
19
- Jeweler::Tasks.new do |gem|
20
- gem.name = 'netscaler-cli'
21
- gem.version = Netscaler::Version.to_s
22
- gem.executables = %W{netscaler}
23
- gem.summary = 'Simple command line utilities for interacting remotely with a Netscaler load balancer.'
24
- gem.description = 'This gem installs several simple command line utilities locally. It uses the NSConfig.wsdl SOAP interface for remote access.'
25
- gem.email = ['madeonamac@gmail.com']
26
- gem.authors = ['Gabe McArthur']
27
- gem.homepage = 'http://github.com/gabemc/netscaler-cli'
28
- gem.files = FileList["[A-Z]*", "{bin,lib,spec}/**/*", "etc/Version"]
29
-
30
- gem.add_dependency 'log4r', '>=1.1.9'
31
- gem.add_dependency 'savon', '>=0.7.9'
32
- gem.add_dependency 'highline', '>=1.6'
33
- gem.add_dependency 'choosy', '>=0.2.4'
34
-
35
- gem.add_development_dependency 'rspec', '>=2.5.0'
36
- end
37
- rescue LoadError
38
- puts "Jeweler or dependencies are not available. Install it with: sudo gem install jeweler"
39
- end
40
-
41
- desc "Deploys the gem to rubygems.org"
42
- task :gem => :release do
43
- system("gem build netscaler-cli.gemspec")
44
- system("gem push netscaler-cli-#{Netscaler::Version.to_s}.gem")
45
- end
46
-
47
- desc "Does the full release cycle."
48
- task :deploy => [:gem, :clean] do
49
- end
50
-
51
15
  desc "Cleans the gem files up."
52
- task :clean do
53
- rm(Dir.glob('*.gemspec'))
54
- rm(Dir.glob('*.gem'))
55
- if File.directory?('pkg')
56
- rm_rf('pkg')
57
- end
58
- end
16
+ task :clean => ['gem:clean']
data/lib/VERSION.yml ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ date: 30/03/2011
3
+ version:
4
+ major: 0
5
+ minor: 5
6
+ tiny: 4
data/lib/netscaler/cli.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'netscaler/errors'
2
- require 'netscaler/version'
3
2
  require 'netscaler/config'
4
3
  require 'netscaler/executor'
5
4
  require 'netscaler/server/request'
@@ -41,7 +40,7 @@ module Netscaler
41
40
  printer :standard, :color => true, :headers => [:bold, :blue], :max_width => 80
42
41
 
43
42
  summary "This is a command line tool for interacting with Netscaler load balancer"
44
- header 'Description:'
43
+ heading 'Description:'
45
44
  para "There are several subcommands to do various things with the load balancer. Try 'netscaler help SUBCOMMAND' for more information about the particular command you want to use."
46
45
  para "Note that you can supply a configuration file, which would normally be found under ~/.netscaler-cli.yml. That file describes the relationship between your Netscaler load balancers and the aliases, usernames, and passwords that you supply for them. The file is in the general format:"
47
46
  para " netscaler.host.name.com:
@@ -50,15 +49,15 @@ module Netscaler
50
49
  password: is_optional_but_querried_if_not_found"
51
50
 
52
51
  # COMMANDS
53
- header 'Commands:'
52
+ heading 'Commands:'
54
53
  cmds.each do |cmd|
55
54
  command cmd
56
55
  end
57
- para ''
58
- help
56
+ para
57
+ command :help
59
58
 
60
59
  # OPTIONS
61
- header 'Global Options:'
60
+ heading 'Global Options:'
62
61
  string :netscaler, "The IP Address, hostname, or alias in the config file of the Netscaler load balancer. This is required." do
63
62
  depends_on :config
64
63
  required
@@ -77,10 +76,11 @@ module Netscaler
77
76
  default File.join(ENV['HOME'], '.netscaler-cli.yml')
78
77
  end
79
78
 
80
- header 'Informative:'
79
+ heading 'Informative:'
81
80
  boolean_ :debug, "Print extra debug information"
82
81
  boolean_ :json, "Prints out JSON instead of textual data"
83
- version Netscaler::Version.to_s.chomp!
82
+ help
83
+ version Choosy::Version.load(:file => __FILE__, :relpath => '..')
84
84
  end
85
85
  end#command
86
86
 
@@ -88,12 +88,12 @@ module Netscaler
88
88
  Choosy::Command.new :server do |s|
89
89
  executor Netscaler::Executor.new(Netscaler::Server::Request)
90
90
  summary "Enables, disbles, or lists servers in the load balancer"
91
- header 'Description:'
91
+ heading 'Description:'
92
92
  para "This is a tool for enabling and disabling a server in a Netscaler load balancer. The name of the server is required, as is the address of the Netscaler load balancer."
93
93
  para "By default, this command will tell you what the current status of the server is."
94
94
  para "If you want to list all of the services, use the --list flag."
95
95
 
96
- header 'Options:'
96
+ heading 'Options:'
97
97
  enum :action, [:enable, :disable, :list, :status], "Either [enable, disable, list]. 'list' will ignore additional arguments. Default action is 'status'" do
98
98
  default :status
99
99
  end
@@ -113,12 +113,12 @@ module Netscaler
113
113
  Choosy::Command.new :vserver do
114
114
  executor Netscaler::Executor.new(Netscaler::VServer::Request)
115
115
  summary "Enables, disables, binds or unbinds policies, or lists virtual servers."
116
- header 'Description:'
116
+ heading 'Description:'
117
117
  para "This is a tool for acting upon virtual servers (VIPs) in a Netscaler load balancer. The name of the virtual server is required."
118
118
  para "By default, this command will tell you what the current status of the server is."
119
119
  para "If you want to list all of the virtual servers, use the --list flag."
120
120
 
121
- header 'Options:'
121
+ heading 'Options:'
122
122
  enum :action, [:enable, :disable, :list, :bind, :unbind, :status], "Either [enable, disable, list, bind, unbind, status]. 'bind' and 'unbind' require the additional '--policy' flag. 'list' will ignore additional arguments. Default action is 'status'." do
123
123
  default :status
124
124
  end
@@ -162,10 +162,10 @@ module Netscaler
162
162
  Choosy::Command.new :service do
163
163
  executor Netscaler::Executor.new(Netscaler::Service::Request)
164
164
  summary "Enables, disables, binds or unbinds from a virtual server, a given service."
165
- header 'Description:'
165
+ heading 'Description:'
166
166
  para "This is a tool for enabling and disabling services in a Netscaler load balancer. The name of the service is required, as is the address of the Netscaler load balancer."
167
167
 
168
- header 'Options:'
168
+ heading 'Options:'
169
169
  enum :action, [:enable, :disable, :bind, :unbind, :status], "Either [enable, disable, bind, unbind, status] of a service. 'bind' and 'unbind' require the '--vserver' flag. Default is 'status'." do
170
170
  default :status
171
171
  end
@@ -196,10 +196,10 @@ module Netscaler
196
196
  Choosy::Command.new :servicegroup do
197
197
  executor Netscaler::Executor.new(Netscaler::ServiceGroup::Request)
198
198
  summary "Enables, disables, binds or unbinds from a virtual server, a given service group."
199
- header 'Description:'
199
+ heading 'Description:'
200
200
  para "This is a tool for enabling and disabling service groups in a Netscaler load balancer. The name of the service group is required, as is the address of the Netscaler load balancer."
201
201
 
202
- header 'Options:'
202
+ heading 'Options:'
203
203
  enum :action, [:enable, :disable, :bind, :unbind, :status], "Either [enable, disable, bind, unbind, status] of a service group. 'bind' and 'unbind' require the '--vserver' flag. Default is 'status'." do
204
204
  default :status
205
205
  end
metadata CHANGED
@@ -1,278 +1,176 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: netscaler-cli
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 5
8
- - 3
9
- version: 0.5.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.4
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Gabe McArthur
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-03-23 00:00:00 -07:00
18
- default_executable: netscaler
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2011-03-30 00:00:00.000000000 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
21
16
  name: log4r
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &84591540 !ruby/object:Gem::Requirement
24
18
  none: false
25
- requirements:
26
- - - ~>
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 1
30
- - 1
31
- version: "1.1"
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: 1.1.9
32
23
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: savon
36
24
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *84591540
26
+ - !ruby/object:Gem::Dependency
27
+ name: savon
28
+ requirement: &84572590 !ruby/object:Gem::Requirement
38
29
  none: false
39
- requirements:
40
- - - ~>
41
- - !ruby/object:Gem::Version
42
- segments:
43
- - 0
44
- - 7
45
- - 0
46
- version: 0.7.0
30
+ requirements:
31
+ - - =
32
+ - !ruby/object:Gem::Version
33
+ version: 0.7.9
47
34
  type: :runtime
48
- version_requirements: *id002
49
- - !ruby/object:Gem::Dependency
50
- name: highline
51
35
  prerelease: false
52
- requirement: &id003 !ruby/object:Gem::Requirement
36
+ version_requirements: *84572590
37
+ - !ruby/object:Gem::Dependency
38
+ name: highline
39
+ requirement: &84571900 !ruby/object:Gem::Requirement
53
40
  none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- segments:
58
- - 1
59
- - 6
60
- version: "1.6"
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '1.6'
61
45
  type: :runtime
62
- version_requirements: *id003
63
- - !ruby/object:Gem::Dependency
64
- name: choosy
65
46
  prerelease: false
66
- requirement: &id004 !ruby/object:Gem::Requirement
47
+ version_requirements: *84571900
48
+ - !ruby/object:Gem::Dependency
49
+ name: choosy
50
+ requirement: &84569690 !ruby/object:Gem::Requirement
67
51
  none: false
68
- requirements:
69
- - - ~>
70
- - !ruby/object:Gem::Version
71
- segments:
72
- - 0
73
- - 2
74
- version: "0.2"
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: 0.4.3
75
56
  type: :runtime
76
- version_requirements: *id004
77
- - !ruby/object:Gem::Dependency
78
- name: json_pure
79
57
  prerelease: false
80
- requirement: &id005 !ruby/object:Gem::Requirement
58
+ version_requirements: *84569690
59
+ - !ruby/object:Gem::Dependency
60
+ name: json_pure
61
+ requirement: &84569230 !ruby/object:Gem::Requirement
81
62
  none: false
82
- requirements:
83
- - - ~>
84
- - !ruby/object:Gem::Version
85
- segments:
86
- - 1
87
- - 5
88
- - 1
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
89
66
  version: 1.5.1
90
67
  type: :runtime
91
- version_requirements: *id005
92
- - !ruby/object:Gem::Dependency
93
- name: rspec
94
68
  prerelease: false
95
- requirement: &id006 !ruby/object:Gem::Requirement
69
+ version_requirements: *84569230
70
+ - !ruby/object:Gem::Dependency
71
+ name: rspec
72
+ requirement: &84568800 !ruby/object:Gem::Requirement
96
73
  none: false
97
- requirements:
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- segments:
101
- - 0
102
- version: "0"
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
103
78
  type: :development
104
- version_requirements: *id006
105
- - !ruby/object:Gem::Dependency
106
- name: autotest
107
79
  prerelease: false
108
- requirement: &id007 !ruby/object:Gem::Requirement
80
+ version_requirements: *84568800
81
+ - !ruby/object:Gem::Dependency
82
+ name: autotest
83
+ requirement: &84568380 !ruby/object:Gem::Requirement
109
84
  none: false
110
- requirements:
111
- - - ">="
112
- - !ruby/object:Gem::Version
113
- segments:
114
- - 0
115
- version: "0"
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
116
89
  type: :development
117
- version_requirements: *id007
118
- - !ruby/object:Gem::Dependency
119
- name: autotest-notification
120
90
  prerelease: false
121
- requirement: &id008 !ruby/object:Gem::Requirement
91
+ version_requirements: *84568380
92
+ - !ruby/object:Gem::Dependency
93
+ name: autotest-notification
94
+ requirement: &84567990 !ruby/object:Gem::Requirement
122
95
  none: false
123
- requirements:
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- segments:
127
- - 0
128
- version: "0"
96
+ requirements:
97
+ - - ! '>='
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
129
100
  type: :development
130
- version_requirements: *id008
131
- - !ruby/object:Gem::Dependency
132
- name: log4r
133
- prerelease: false
134
- requirement: &id009 !ruby/object:Gem::Requirement
135
- none: false
136
- requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- segments:
140
- - 1
141
- - 1
142
- - 9
143
- version: 1.1.9
144
- type: :runtime
145
- version_requirements: *id009
146
- - !ruby/object:Gem::Dependency
147
- name: savon
148
- prerelease: false
149
- requirement: &id010 !ruby/object:Gem::Requirement
150
- none: false
151
- requirements:
152
- - - ">="
153
- - !ruby/object:Gem::Version
154
- segments:
155
- - 0
156
- - 7
157
- - 9
158
- version: 0.7.9
159
- type: :runtime
160
- version_requirements: *id010
161
- - !ruby/object:Gem::Dependency
162
- name: highline
163
- prerelease: false
164
- requirement: &id011 !ruby/object:Gem::Requirement
165
- none: false
166
- requirements:
167
- - - ">="
168
- - !ruby/object:Gem::Version
169
- segments:
170
- - 1
171
- - 6
172
- version: "1.6"
173
- type: :runtime
174
- version_requirements: *id011
175
- - !ruby/object:Gem::Dependency
176
- name: choosy
177
- prerelease: false
178
- requirement: &id012 !ruby/object:Gem::Requirement
179
- none: false
180
- requirements:
181
- - - ">="
182
- - !ruby/object:Gem::Version
183
- segments:
184
- - 0
185
- - 2
186
- - 4
187
- version: 0.2.4
188
- type: :runtime
189
- version_requirements: *id012
190
- - !ruby/object:Gem::Dependency
191
- name: rspec
192
101
  prerelease: false
193
- requirement: &id013 !ruby/object:Gem::Requirement
102
+ version_requirements: *84567990
103
+ - !ruby/object:Gem::Dependency
104
+ name: ZenTest
105
+ requirement: &84567530 !ruby/object:Gem::Requirement
194
106
  none: false
195
- requirements:
196
- - - ">="
197
- - !ruby/object:Gem::Version
198
- segments:
199
- - 2
200
- - 5
201
- - 0
202
- version: 2.5.0
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
203
111
  type: :development
204
- version_requirements: *id013
205
- description: This gem installs several simple command line utilities locally. It uses the NSConfig.wsdl SOAP interface for remote access.
206
- email:
112
+ prerelease: false
113
+ version_requirements: *84567530
114
+ description: This gem installs several simple command line utilities locally. It
115
+ uses the NSConfig.wsdl SOAP interface for remote access.
116
+ email:
207
117
  - madeonamac@gmail.com
208
- executables:
118
+ executables:
209
119
  - netscaler
210
120
  extensions: []
211
-
212
- extra_rdoc_files:
213
- - README.markdown
214
- files:
121
+ extra_rdoc_files: []
122
+ files:
123
+ - Rakefile
215
124
  - Gemfile
216
- - Gemfile.lock
217
125
  - README.markdown
218
- - Rakefile
126
+ - Gemfile.lock
219
127
  - bin/netscaler
220
- - lib/VERSION
128
+ - lib/netscaler/server/request.rb
129
+ - lib/netscaler/server/response.rb
221
130
  - lib/netscaler/base_request.rb
131
+ - lib/netscaler/servicegroup/request.rb
132
+ - lib/netscaler/servicegroup/response.rb
222
133
  - lib/netscaler/cli.rb
223
134
  - lib/netscaler/config.rb
224
- - lib/netscaler/errors.rb
225
135
  - lib/netscaler/executor.rb
136
+ - lib/netscaler/vserver/request.rb
137
+ - lib/netscaler/vserver/response.rb
226
138
  - lib/netscaler/logging.rb
227
- - lib/netscaler/server/request.rb
228
- - lib/netscaler/server/response.rb
139
+ - lib/netscaler/errors.rb
229
140
  - lib/netscaler/service/request.rb
230
141
  - lib/netscaler/service/response.rb
231
- - lib/netscaler/servicegroup/request.rb
232
- - lib/netscaler/servicegroup/response.rb
233
142
  - lib/netscaler/transaction.rb
234
- - lib/netscaler/version.rb
235
- - lib/netscaler/vserver/request.rb
236
- - lib/netscaler/vserver/response.rb
143
+ - lib/VERSION.yml
237
144
  - spec/netscaler/cli_spec.rb
238
- - spec/netscaler/config_spec.rb
239
145
  - spec/netscaler/configs/bad-yaml.yml
240
146
  - spec/netscaler/configs/missing-username.yml
241
147
  - spec/netscaler/configs/simple-config.yml
148
+ - spec/netscaler/config_spec.rb
242
149
  - spec/spec_helpers.rb
243
150
  has_rdoc: true
244
151
  homepage: http://github.com/gabemc/netscaler-cli
245
152
  licenses: []
246
-
247
153
  post_install_message:
248
154
  rdoc_options: []
249
-
250
- require_paths:
155
+ require_paths:
251
156
  - lib
252
- required_ruby_version: !ruby/object:Gem::Requirement
157
+ required_ruby_version: !ruby/object:Gem::Requirement
253
158
  none: false
254
- requirements:
255
- - - ">="
256
- - !ruby/object:Gem::Version
257
- segments:
258
- - 0
259
- version: "0"
260
- required_rubygems_version: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - ! '>='
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ required_rubygems_version: !ruby/object:Gem::Requirement
261
164
  none: false
262
- requirements:
263
- - - ">="
264
- - !ruby/object:Gem::Version
265
- segments:
266
- - 0
267
- version: "0"
165
+ requirements:
166
+ - - ! '>='
167
+ - !ruby/object:Gem::Version
168
+ version: 1.3.6
268
169
  requirements: []
269
-
270
170
  rubyforge_project:
271
- rubygems_version: 1.3.7
171
+ rubygems_version: 1.6.1
272
172
  signing_key:
273
173
  specification_version: 3
274
- summary: Simple command line utilities for interacting remotely with a Netscaler load balancer.
275
- test_files:
276
- - spec/netscaler/cli_spec.rb
277
- - spec/netscaler/config_spec.rb
278
- - spec/spec_helpers.rb
174
+ summary: Simple command line utilities for interacting remotely with a Netscaler load
175
+ balancer.
176
+ test_files: []
data/lib/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.5.3
@@ -1,12 +0,0 @@
1
- require 'scanf'
2
-
3
- module Netscaler
4
- class Version
5
- CURRENT = File.read(File.join(File.dirname(__FILE__), '..', 'VERSION'))
6
- MAJOR, MINOR, TINY = CURRENT.scanf('%d.%d.%d')
7
-
8
- def self.to_s
9
- CURRENT
10
- end
11
- end
12
- end