netscaler 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +7 -12
- data/Gemfile.lock +32 -36
- data/LICENSE.txt +1 -1
- data/README.md +3 -2
- data/Rakefile +14 -2
- data/VERSION +1 -1
- data/lib/netscaler/cs/vserver.rb +1 -1
- data/lib/netscaler/lb/vserver.rb +1 -1
- data/lib/netscaler/lb/vserver/bind.rb +1 -1
- data/lib/netscaler/lb/vserver/unbind.rb +5 -0
- data/lib/netscaler/service.rb +1 -3
- data/lib/netscaler/system/interface.rb +2 -6
- data/netscaler.gemspec +13 -22
- data/spec/csvserver_spec.rb +20 -5
- data/spec/interface_spec.rb +26 -0
- data/spec/lbmonitor_spec.rb +106 -0
- data/spec/lbvserver_spec.rb +55 -7
- data/spec/node_spec.rb +38 -0
- data/spec/server_spec.rb +19 -0
- data/spec/service_spec.rb +67 -2
- data/spec/servicegroup_spec.rb +13 -10
- data/spec/spec_helper.rb +1 -2
- data/spec/sslcertkey_spec.rb +13 -0
- data/spec/sslvserver_spec.rb +29 -0
- metadata +10 -63
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbc215e89d20371590562dfd5776de2cb5cc26f5
|
4
|
+
data.tar.gz: 357329039b92c07c81f472cd89d2a5163a27bd11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 353a7edf02ddde19e4efe1d8af19a7305eb2cd8d50fd5def6d9af19befbd4494c65c29298dc365ad8879f53a8c99ea1fe3f5cdafe797c953e2e4a1c558258358
|
7
|
+
data.tar.gz: b814c7748005b344e7b6dd4f734fdbbd063ad81119a7bb7a3c21b695581748427aa10faac93f2de822ed18de665e68d18457744bbaadc8b6cda5a8adb40252fb
|
data/Gemfile
CHANGED
@@ -1,19 +1,14 @@
|
|
1
|
-
source
|
2
|
-
|
3
|
-
# Example:
|
4
|
-
# gem "activesupport", ">= 2.3.5"
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
gem 'rest-client', '2.0.2'
|
5
3
|
|
6
|
-
# Add dependencies to develop your gem here.
|
7
|
-
# Include everything needed to run rake, tests, features, etc.
|
8
4
|
group :development do
|
9
5
|
gem 'rspec', '~> 3.2'
|
10
|
-
gem 'rdoc', '~>
|
6
|
+
gem 'rdoc', '~> 5.1.0'
|
11
7
|
gem 'bundler'
|
12
8
|
gem 'jeweler', '~> 2.3.5'
|
13
|
-
gem 'simplecov', '~> 0.10'
|
14
|
-
gem 'simplecov-rcov'
|
15
9
|
end
|
16
10
|
|
17
|
-
|
18
|
-
gem '
|
19
|
-
gem '
|
11
|
+
group :test do
|
12
|
+
gem 'simplecov', '~> 0.15.1', :require => false
|
13
|
+
gem 'codecov', :require => false
|
14
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
addressable (2.
|
5
|
-
public_suffix (~> 2.0, >= 2.0.2)
|
4
|
+
addressable (2.4.0)
|
6
5
|
builder (3.2.3)
|
6
|
+
codecov (0.1.10)
|
7
|
+
json
|
8
|
+
simplecov
|
9
|
+
url
|
7
10
|
descendants_tracker (0.0.4)
|
8
11
|
thread_safe (~> 0.3, >= 0.3.1)
|
9
12
|
diff-lcs (1.3)
|
@@ -13,52 +16,48 @@ GEM
|
|
13
16
|
faraday (0.9.2)
|
14
17
|
multipart-post (>= 1.2, < 3)
|
15
18
|
git (1.3.0)
|
16
|
-
github_api (0.
|
17
|
-
addressable (~> 2.
|
18
|
-
descendants_tracker (~> 0.0.
|
19
|
+
github_api (0.16.0)
|
20
|
+
addressable (~> 2.4.0)
|
21
|
+
descendants_tracker (~> 0.0.4)
|
19
22
|
faraday (~> 0.8, < 0.10)
|
20
|
-
hashie (>=
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
hashie (3.5.5)
|
23
|
+
hashie (>= 3.4)
|
24
|
+
mime-types (>= 1.16, < 3.0)
|
25
|
+
oauth2 (~> 1.0)
|
26
|
+
hashie (3.5.6)
|
25
27
|
highline (1.7.8)
|
26
28
|
http-cookie (1.0.3)
|
27
29
|
domain_name (~> 0.5)
|
28
|
-
jeweler (2.3.
|
30
|
+
jeweler (2.3.7)
|
29
31
|
builder
|
30
|
-
bundler (>= 1
|
32
|
+
bundler (>= 1)
|
31
33
|
git (>= 1.2.5)
|
32
|
-
github_api (~> 0.
|
34
|
+
github_api (~> 0.16.0)
|
33
35
|
highline (>= 1.6.15)
|
34
36
|
nokogiri (>= 1.5.10)
|
35
37
|
psych (~> 2.2)
|
36
38
|
rake
|
37
39
|
rdoc
|
38
40
|
semver2
|
39
|
-
json (2.0
|
41
|
+
json (2.1.0)
|
40
42
|
jwt (1.5.6)
|
41
|
-
mime-types (3
|
42
|
-
|
43
|
-
|
44
|
-
mini_portile2 (2.0.0)
|
45
|
-
multi_json (1.12.1)
|
43
|
+
mime-types (2.99.3)
|
44
|
+
mini_portile2 (2.3.0)
|
45
|
+
multi_json (1.12.2)
|
46
46
|
multi_xml (0.6.0)
|
47
47
|
multipart-post (2.0.0)
|
48
48
|
netrc (0.11.0)
|
49
|
-
nokogiri (1.
|
50
|
-
mini_portile2 (~> 2.
|
51
|
-
oauth2 (1.
|
52
|
-
faraday (>= 0.8, < 0.
|
49
|
+
nokogiri (1.8.1)
|
50
|
+
mini_portile2 (~> 2.3.0)
|
51
|
+
oauth2 (1.4.0)
|
52
|
+
faraday (>= 0.8, < 0.13)
|
53
53
|
jwt (~> 1.0)
|
54
54
|
multi_json (~> 1.3)
|
55
55
|
multi_xml (~> 0.5)
|
56
56
|
rack (>= 1.2, < 3)
|
57
57
|
psych (2.2.4)
|
58
|
-
public_suffix (2.0.5)
|
59
58
|
rack (2.0.3)
|
60
|
-
rake (12.
|
61
|
-
rdoc (
|
59
|
+
rake (12.1.0)
|
60
|
+
rdoc (5.1.0)
|
62
61
|
rest-client (2.0.2)
|
63
62
|
http-cookie (>= 1.0.2, < 2.0)
|
64
63
|
mime-types (>= 1.16, < 4.0)
|
@@ -77,31 +76,28 @@ GEM
|
|
77
76
|
rspec-support (~> 3.6.0)
|
78
77
|
rspec-support (3.6.0)
|
79
78
|
semver2 (3.4.2)
|
80
|
-
simplecov (0.
|
79
|
+
simplecov (0.15.1)
|
81
80
|
docile (~> 1.1.0)
|
82
81
|
json (>= 1.8, < 3)
|
83
82
|
simplecov-html (~> 0.10.0)
|
84
|
-
simplecov-html (0.10.
|
85
|
-
simplecov-rcov (0.2.3)
|
86
|
-
simplecov (>= 0.4.1)
|
83
|
+
simplecov-html (0.10.2)
|
87
84
|
thread_safe (0.3.6)
|
88
85
|
unf (0.1.4)
|
89
86
|
unf_ext
|
90
87
|
unf_ext (0.0.7.4)
|
88
|
+
url (0.3.2)
|
91
89
|
|
92
90
|
PLATFORMS
|
93
91
|
ruby
|
94
92
|
|
95
93
|
DEPENDENCIES
|
96
94
|
bundler
|
95
|
+
codecov
|
97
96
|
jeweler (~> 2.3.5)
|
98
|
-
|
99
|
-
|
100
|
-
rdoc (~> 4.2)
|
101
|
-
rest-client (~> 2.0)
|
97
|
+
rdoc (~> 5.1.0)
|
98
|
+
rest-client (= 2.0.2)
|
102
99
|
rspec (~> 3.2)
|
103
|
-
simplecov (~> 0.
|
104
|
-
simplecov-rcov
|
100
|
+
simplecov (~> 0.15.1)
|
105
101
|
|
106
102
|
BUNDLED WITH
|
107
103
|
1.14.6
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
[![Build Status](https://travis-ci.org/
|
1
|
+
[![Build Status](https://travis-ci.org/bitflingr/netscaler.svg?branch=master)](https://travis-ci.org/bitflingr/netscaler)
|
2
|
+
[![codecov](https://codecov.io/gh/bitflingr/netscaler/branch/master/graph/badge.svg)](https://codecov.io/gh/bitflingr/netscaler)
|
2
3
|
|
3
4
|
# Netscaler Gem
|
4
5
|
|
@@ -82,6 +83,6 @@ Otherwise if there are features that are missing or bugs in the code that need f
|
|
82
83
|
|
83
84
|
## Copyright
|
84
85
|
|
85
|
-
Copyright (c)
|
86
|
+
Copyright (c) 2017 Jarrett Irons. See LICENSE.txt for
|
86
87
|
further details.
|
87
88
|
|
data/Rakefile
CHANGED
@@ -15,7 +15,7 @@ require 'jeweler'
|
|
15
15
|
Jeweler::Tasks.new do |gem|
|
16
16
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
17
|
gem.name = 'netscaler'
|
18
|
-
gem.homepage = 'http://github.com/
|
18
|
+
gem.homepage = 'http://github.com/bitflingr/netscaler'
|
19
19
|
gem.license = 'MIT'
|
20
20
|
gem.summary = 'Netscaler api working against the Citrix Nitro api.'
|
21
21
|
gem.description = 'Netscaler api working against the Citrix Nitro api. Currently supports Nitro 9.3. Hope to add support for 10.X. Currently has support for som basics such as adding servers/services/servicegroups.'
|
@@ -38,7 +38,7 @@ end
|
|
38
38
|
# spec.rcov = true
|
39
39
|
# end
|
40
40
|
|
41
|
-
task :default => :spec
|
41
|
+
task :default => [:spec]
|
42
42
|
|
43
43
|
require 'rdoc/task'
|
44
44
|
Rake::RDocTask.new do |rdoc|
|
@@ -51,3 +51,15 @@ Rake::RDocTask.new do |rdoc|
|
|
51
51
|
end
|
52
52
|
|
53
53
|
CLOBBER.include('coverage')
|
54
|
+
|
55
|
+
|
56
|
+
namespace :codecov do
|
57
|
+
desc 'Uploads the latest simplecov result set to codecov.io'
|
58
|
+
task :upload do
|
59
|
+
require 'simplecov'
|
60
|
+
require 'codecov'
|
61
|
+
|
62
|
+
formatter = SimpleCov::Formatter::Codecov.new
|
63
|
+
formatter.format(SimpleCov::ResultMerger.merged_result)
|
64
|
+
end
|
65
|
+
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.3
|
data/lib/netscaler/cs/vserver.rb
CHANGED
data/lib/netscaler/lb/vserver.rb
CHANGED
@@ -20,7 +20,7 @@ module Netscaler
|
|
20
20
|
|
21
21
|
def responder_policy(payload)
|
22
22
|
raise ArgumentError, 'payload cannot be null' if payload.nil?
|
23
|
-
validate_payload(payload, [:name, :
|
23
|
+
validate_payload(payload, [:name, :policyName, :priority])
|
24
24
|
return @netscaler.adapter.post_no_body("config/lbvserver_responderpolicy_binding/#{payload['name']}?action=bind/", {'params' => {'action' => 'bind'}, 'lbvserver_responderpolicy_binding' => payload})
|
25
25
|
end
|
26
26
|
end
|
@@ -19,6 +19,11 @@ module Netscaler
|
|
19
19
|
return @netscaler.adapter.post_no_body("config/lbvserver_service_binding/#{payload['name']}?action=bind/", {'params' => {'action' => 'unbind'}, 'lbvserver_rewritepolicy_binding' => payload})
|
20
20
|
end
|
21
21
|
|
22
|
+
def responder_policy(payload)
|
23
|
+
raise ArgumentError, 'payload cannot be null' if payload.nil?
|
24
|
+
validate_payload(payload, [:name, :policyName])
|
25
|
+
return @netscaler.adapter.post_no_body("config/lbvserver_service_binding/#{payload['name']}?action=bind/", {'params' => {'action' => 'unbind'}, 'lbvserver_rewritepolicy_binding' => payload})
|
26
|
+
end
|
22
27
|
|
23
28
|
end
|
24
29
|
end
|
data/lib/netscaler/service.rb
CHANGED
@@ -60,10 +60,8 @@ module Netscaler
|
|
60
60
|
if payload[:name] != nil then
|
61
61
|
validate_payload(payload, [:name])
|
62
62
|
@netscaler.adapter.get("stat/service/#{payload[:name]}")
|
63
|
-
elsif payload == {} then
|
64
|
-
@netscaler.adapter.get('stat/service')
|
65
63
|
else
|
66
|
-
|
64
|
+
@netscaler.adapter.get('stat/service')
|
67
65
|
end
|
68
66
|
end
|
69
67
|
|
@@ -11,10 +11,8 @@ module Netscaler
|
|
11
11
|
if payload[:name] != nil then
|
12
12
|
validate_payload(payload, [:name])
|
13
13
|
return @netscaler.adapter.get("config/interface/#{payload[:name]}")
|
14
|
-
elsif payload == {} then
|
15
|
-
return @netscaler.adapter.get('config/interface/')
|
16
14
|
else
|
17
|
-
|
15
|
+
return @netscaler.adapter.get('config/interface/')
|
18
16
|
end
|
19
17
|
end
|
20
18
|
|
@@ -23,10 +21,8 @@ module Netscaler
|
|
23
21
|
if payload[:name] != nil then
|
24
22
|
validate_payload(payload, [:name])
|
25
23
|
return @netscaler.adapter.get("stat/interface/#{payload[:name]}")
|
26
|
-
elsif payload == {} then
|
27
|
-
return @netscaler.adapter.get('stat/interface')
|
28
24
|
else
|
29
|
-
|
25
|
+
return @netscaler.adapter.get('stat/interface')
|
30
26
|
end
|
31
27
|
end
|
32
28
|
|
data/netscaler.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: netscaler 0.8.
|
5
|
+
# stub: netscaler 0.8.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "netscaler".freeze
|
9
|
-
s.version = "0.8.
|
9
|
+
s.version = "0.8.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Jeremy Custenborder".freeze, "David Andrew".freeze, "Jarrett Irons".freeze]
|
14
|
-
s.date = "2017-
|
14
|
+
s.date = "2017-09-27"
|
15
15
|
s.description = "Netscaler api working against the Citrix Nitro api. Currently supports Nitro 9.3. Hope to add support for 10.X. Currently has support for som basics such as adding servers/services/servicegroups.".freeze
|
16
16
|
s.email = ["jeremy@scarcemedia.com".freeze, "david.andrew@webtrends.com".freeze, "jarrett.irons@gmail.com".freeze]
|
17
17
|
s.extra_rdoc_files = [
|
@@ -70,8 +70,11 @@ Gem::Specification.new do |s|
|
|
70
70
|
"netscaler.gemspec",
|
71
71
|
"spec/cspolicylabel_spec.rb",
|
72
72
|
"spec/csvserver_spec.rb",
|
73
|
+
"spec/interface_spec.rb",
|
74
|
+
"spec/lbmonitor_spec.rb",
|
73
75
|
"spec/lbvserver_spec.rb",
|
74
76
|
"spec/netscaler_spec.rb",
|
77
|
+
"spec/node_spec.rb",
|
75
78
|
"spec/policy_stringmap_spec.rb",
|
76
79
|
"spec/responder_spec.rb",
|
77
80
|
"spec/rewrite_spec.rb",
|
@@ -83,7 +86,7 @@ Gem::Specification.new do |s|
|
|
83
86
|
"spec/sslvserver_spec.rb",
|
84
87
|
"spec/systemfile_spec.rb"
|
85
88
|
]
|
86
|
-
s.homepage = "http://github.com/
|
89
|
+
s.homepage = "http://github.com/bitflingr/netscaler".freeze
|
87
90
|
s.licenses = ["MIT".freeze]
|
88
91
|
s.rubygems_version = "2.6.11".freeze
|
89
92
|
s.summary = "Netscaler api working against the Citrix Nitro api.".freeze
|
@@ -92,36 +95,24 @@ Gem::Specification.new do |s|
|
|
92
95
|
s.specification_version = 4
|
93
96
|
|
94
97
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
95
|
-
s.add_runtime_dependency(%q<
|
96
|
-
s.add_runtime_dependency(%q<rest-client>.freeze, ["~> 2.0"])
|
97
|
-
s.add_runtime_dependency(%q<json>.freeze, ["~> 2.0.2"])
|
98
|
+
s.add_runtime_dependency(%q<rest-client>.freeze, ["= 2.0.2"])
|
98
99
|
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.2"])
|
99
|
-
s.add_development_dependency(%q<rdoc>.freeze, ["~>
|
100
|
+
s.add_development_dependency(%q<rdoc>.freeze, ["~> 5.1.0"])
|
100
101
|
s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
|
101
102
|
s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.3.5"])
|
102
|
-
s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.10"])
|
103
|
-
s.add_development_dependency(%q<simplecov-rcov>.freeze, [">= 0"])
|
104
103
|
else
|
105
|
-
s.add_dependency(%q<
|
106
|
-
s.add_dependency(%q<rest-client>.freeze, ["~> 2.0"])
|
107
|
-
s.add_dependency(%q<json>.freeze, ["~> 2.0.2"])
|
104
|
+
s.add_dependency(%q<rest-client>.freeze, ["= 2.0.2"])
|
108
105
|
s.add_dependency(%q<rspec>.freeze, ["~> 3.2"])
|
109
|
-
s.add_dependency(%q<rdoc>.freeze, ["~>
|
106
|
+
s.add_dependency(%q<rdoc>.freeze, ["~> 5.1.0"])
|
110
107
|
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
111
108
|
s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.5"])
|
112
|
-
s.add_dependency(%q<simplecov>.freeze, ["~> 0.10"])
|
113
|
-
s.add_dependency(%q<simplecov-rcov>.freeze, [">= 0"])
|
114
109
|
end
|
115
110
|
else
|
116
|
-
s.add_dependency(%q<
|
117
|
-
s.add_dependency(%q<rest-client>.freeze, ["~> 2.0"])
|
118
|
-
s.add_dependency(%q<json>.freeze, ["~> 2.0.2"])
|
111
|
+
s.add_dependency(%q<rest-client>.freeze, ["= 2.0.2"])
|
119
112
|
s.add_dependency(%q<rspec>.freeze, ["~> 3.2"])
|
120
|
-
s.add_dependency(%q<rdoc>.freeze, ["~>
|
113
|
+
s.add_dependency(%q<rdoc>.freeze, ["~> 5.1.0"])
|
121
114
|
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
122
115
|
s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.5"])
|
123
|
-
s.add_dependency(%q<simplecov>.freeze, ["~> 0.10"])
|
124
|
-
s.add_dependency(%q<simplecov-rcov>.freeze, [">= 0"])
|
125
116
|
end
|
126
117
|
end
|
127
118
|
|
data/spec/csvserver_spec.rb
CHANGED
@@ -38,27 +38,36 @@ describe Netscaler::Cs::Vserver do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
context 'when using the show method in Cs::Vserver' do
|
41
|
+
context 'when using the show|stat method in Cs::Vserver' do
|
42
42
|
it 'with no param used it will return all vservers' do
|
43
|
-
|
44
|
-
expect(
|
43
|
+
expect(connection.cs.vserver.show).to be_kind_of(Hash)
|
44
|
+
expect(connection.cs.vserver.stat).to be_kind_of(Hash)
|
45
45
|
end
|
46
46
|
|
47
47
|
it 'supplying the name parameter will return Hash' do
|
48
|
-
|
49
|
-
expect(
|
48
|
+
expect(connection.cs.vserver.show :name => 'foo').to be_kind_of(Hash)
|
49
|
+
expect(connection.cs.vserver.stat :name => 'foo').to be_kind_of(Hash)
|
50
50
|
end
|
51
51
|
|
52
52
|
it 'when showing a particular lb vserver string is invalid' do
|
53
53
|
expect {
|
54
54
|
connection.cs.vserver.show('asdf')
|
55
55
|
}.to raise_error(TypeError, /conver(t|sion)/)
|
56
|
+
|
57
|
+
expect {
|
58
|
+
connection.cs.vserver.stat('asdf')
|
59
|
+
}.to raise_error(TypeError, /conver(t|sion)/)
|
60
|
+
|
56
61
|
end
|
57
62
|
|
58
63
|
it 'when showing a particular lb vserver :name is required' do
|
59
64
|
expect {
|
60
65
|
connection.cs.vserver.show(:foo => 'bar')
|
61
66
|
}.to raise_error(ArgumentError, /name/)
|
67
|
+
|
68
|
+
expect {
|
69
|
+
connection.cs.vserver.stat(:foo => 'bar')
|
70
|
+
}.to raise_error(ArgumentError, /name/)
|
62
71
|
end
|
63
72
|
end
|
64
73
|
|
@@ -127,7 +136,13 @@ describe Netscaler::Cs::Vserver do
|
|
127
136
|
expect(result).to be_kind_of(Hash)
|
128
137
|
unbind_result = connection.cs.vserver.unbind.cs_policy :name => 'foo'
|
129
138
|
expect(unbind_result).to be_kind_of(Hash)
|
139
|
+
end
|
140
|
+
end
|
130
141
|
|
142
|
+
context 'when []binding default lb vserver to cs vserver' do
|
143
|
+
it 'should return a Hash if all required args are supplied' do
|
144
|
+
result = connection.cs.vserver.bind.lbvserver :name => 'foo', :lbvserver =>'bar'
|
145
|
+
expect(result).to be_kind_of(Hash)
|
131
146
|
end
|
132
147
|
end
|
133
148
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
require 'netscaler'
|
3
|
+
require 'netscaler/mock_adapter'
|
4
|
+
|
5
|
+
describe Netscaler::Lb::Monitor do
|
6
|
+
|
7
|
+
connection = Netscaler::Connection.new 'hostname' => 'foo', 'password' => 'bar', 'username' => 'bar'
|
8
|
+
connection.adapter = Netscaler::MockAdapter.new :body => '{ "errorcode": 0, "message": "Done" }'
|
9
|
+
|
10
|
+
%w(stat show).each do |toggle_action|
|
11
|
+
context "when #{toggle_action}ing a interface" do
|
12
|
+
it 'return hash when name is not supplied' do
|
13
|
+
expect(
|
14
|
+
connection.system.interface.send(toggle_action)
|
15
|
+
).to be_kind_of(Hash)
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
it 'return hash when supplied all required params' do
|
20
|
+
result = connection.system.interface.send(toggle_action, {:name => 'foo'})
|
21
|
+
expect(result).to be_kind_of(Hash)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,106 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
require 'netscaler'
|
3
|
+
require 'netscaler/mock_adapter'
|
4
|
+
|
5
|
+
describe Netscaler::Lb::Monitor do
|
6
|
+
|
7
|
+
connection = Netscaler::Connection.new 'hostname' => 'foo', 'password' => 'bar', 'username' => 'bar'
|
8
|
+
connection.adapter = Netscaler::MockAdapter.new :body => '{ "errorcode": 0, "message": "Done" }'
|
9
|
+
|
10
|
+
%w(add remove).each do |toggle_action|
|
11
|
+
context "when #{toggle_action}ing a lbmonitor" do
|
12
|
+
it 'a monitorName is required' do
|
13
|
+
expect {
|
14
|
+
connection.lb.monitor.send(toggle_action, {:type => 'HTTP'})
|
15
|
+
}.to raise_error(ArgumentError, /monitorName/)
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'a type is required' do
|
19
|
+
expect {
|
20
|
+
connection.lb.monitor.send(toggle_action, {:monitorName => 'foo'})
|
21
|
+
}.to raise_error(ArgumentError, /type/)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'return hash when supplied all required params' do
|
25
|
+
result = connection.lb.monitor.send(toggle_action, {:monitorName => 'foo', :type => 'HTTP'})
|
26
|
+
expect(result).to be_kind_of(Hash)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
%w(bind unbind).each do |toggle_action|
|
32
|
+
context "when #{toggle_action}ing a lbmonitor" do
|
33
|
+
it 'a monitorName is required' do
|
34
|
+
expect {
|
35
|
+
connection.lb.monitor.send(toggle_action, {:type => 'HTTP'})
|
36
|
+
}.to raise_error(ArgumentError, /monitorName/)
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'a entityName is required' do
|
40
|
+
expect {
|
41
|
+
connection.lb.monitor.send(toggle_action, {:entityName => 'HTTP'})
|
42
|
+
}.to raise_error(ArgumentError, /monitorName/)
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'a monitorName is required' do
|
46
|
+
expect {
|
47
|
+
connection.lb.monitor.send(toggle_action, {:entityType => 'HTTP'})
|
48
|
+
}.to raise_error(ArgumentError, /monitorName/)
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'a entityType only accepts service[group] as acceptable values' do
|
52
|
+
expect {
|
53
|
+
connection.lb.monitor.send(toggle_action, {:monitorName => 'foo', :entityName => 'bar', :entityType => 'HTTP'})
|
54
|
+
}.to raise_error(ArgumentError, /entityType/)
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'a returns when supplied all required params' do
|
58
|
+
expect(
|
59
|
+
connection.lb.monitor.send(toggle_action, {
|
60
|
+
:monitorName => 'foo',
|
61
|
+
:entityName => 'bar',
|
62
|
+
:entityType => 'service'})
|
63
|
+
).to be_kind_of(Hash)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
context 'when showing a lbmonitor' do
|
68
|
+
it 'a monitorName is required' do
|
69
|
+
expect {
|
70
|
+
connection.lb.monitor.show :blah => 'foo'
|
71
|
+
}.to raise_error(ArgumentError, /monitorName/)
|
72
|
+
end
|
73
|
+
|
74
|
+
it 'return hash when supplied all required params' do
|
75
|
+
result = connection.lb.monitor.show :monitorName => 'foo'
|
76
|
+
expect(result).to be_kind_of(Hash)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
context 'when showing bindings of a lbmonitor' do
|
81
|
+
it 'a monitorName is required' do
|
82
|
+
expect {
|
83
|
+
connection.lb.monitor.show_binding :entityType => 'foo'
|
84
|
+
}.to raise_error(ArgumentError, /monitorName/)
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'a entityType is required' do
|
88
|
+
expect {
|
89
|
+
connection.lb.monitor.show_binding :monitorName => 'HTTP'
|
90
|
+
}.to raise_error(ArgumentError, /entityType/)
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'returns error if entityType does not equal service or servicegroup' do
|
94
|
+
expect{connection.lb.monitor.show_binding :monitorName => 'foo', :entityType => 'HTTP'}.to raise_error(ArgumentError, /entityType/)
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'return hash when supplied all required params' do
|
98
|
+
result = connection.lb.monitor.show_binding :monitorName => 'foo', :entityType => 'service'
|
99
|
+
expect(result).to be_kind_of(Hash)
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
data/spec/lbvserver_spec.rb
CHANGED
@@ -38,27 +38,37 @@ describe Netscaler::Lb::Vserver do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
context 'when
|
41
|
+
context 'when show|stat method in Lb::Vserver' do
|
42
42
|
it 'with no param used it will return all vservers' do
|
43
|
-
|
44
|
-
expect(
|
43
|
+
expect(connection.lb.vserver.show).to be_kind_of(Hash)
|
44
|
+
expect(connection.lb.vserver.stat).to be_kind_of(Hash)
|
45
45
|
end
|
46
46
|
|
47
47
|
it 'supplying the name parameter will return Hash' do
|
48
|
-
|
49
|
-
expect(
|
48
|
+
expect(connection.lb.vserver.show :name => 'foo').to be_kind_of(Hash)
|
49
|
+
expect(connection.lb.vserver.stat :name => 'foo').to be_kind_of(Hash)
|
50
50
|
end
|
51
51
|
|
52
52
|
it 'when showing a particular lb vserver string is invalid' do
|
53
53
|
expect {
|
54
54
|
connection.lb.vserver.show('asdf')
|
55
55
|
}.to raise_error(TypeError, /conver(t|sion)/)
|
56
|
+
|
57
|
+
expect {
|
58
|
+
connection.lb.vserver.stat('asdf')
|
59
|
+
}.to raise_error(TypeError, /conver(t|sion)/)
|
60
|
+
|
56
61
|
end
|
57
62
|
|
58
63
|
it 'when showing a particular lb vserver :name is required' do
|
59
64
|
expect {
|
60
65
|
connection.lb.vserver.show(:foo => 'bar')
|
61
66
|
}.to raise_error(ArgumentError, /name/)
|
67
|
+
#This should be updated to match the show method.
|
68
|
+
expect {
|
69
|
+
connection.lb.vserver.stat(:foo => 'bar')
|
70
|
+
}.to raise_error(ArgumentError, /name/)
|
71
|
+
|
62
72
|
end
|
63
73
|
end
|
64
74
|
|
@@ -81,7 +91,7 @@ describe Netscaler::Lb::Vserver do
|
|
81
91
|
end
|
82
92
|
end
|
83
93
|
|
84
|
-
context 'when
|
94
|
+
context 'when show lbvserver bindings' do
|
85
95
|
it 'should throw an error if there is no arg' do
|
86
96
|
expect {
|
87
97
|
connection.lb.vserver.show_binding()
|
@@ -172,4 +182,42 @@ describe Netscaler::Lb::Vserver do
|
|
172
182
|
end
|
173
183
|
end
|
174
184
|
|
175
|
-
|
185
|
+
context 'when [un]binding responder policies to lb vserver' do
|
186
|
+
it 'should throw an error if :name arg is not given' do
|
187
|
+
expect {
|
188
|
+
connection.lb.vserver.bind.responder_policy :policyName => 'bar', :priority => '10'
|
189
|
+
}.to raise_error(ArgumentError, /name/)
|
190
|
+
|
191
|
+
expect {
|
192
|
+
connection.lb.vserver.unbind.responder_policy :policyName => 'bar', :priority => '10'
|
193
|
+
}.to raise_error(ArgumentError, /name/)
|
194
|
+
|
195
|
+
end
|
196
|
+
|
197
|
+
it 'should throw an error if :policyName arg is not given' do
|
198
|
+
expect {
|
199
|
+
connection.lb.vserver.bind.responder_policy :name => 'foo', :priority => '10'
|
200
|
+
}.to raise_error(ArgumentError, /policyName/)
|
201
|
+
|
202
|
+
expect {
|
203
|
+
connection.lb.vserver.unbind.responder_policy :name => 'foo', :priority => '10'
|
204
|
+
}.to raise_error(ArgumentError, /policyName/)
|
205
|
+
end
|
206
|
+
|
207
|
+
it 'should throw an error if :priority arg is not given' do
|
208
|
+
expect {
|
209
|
+
connection.lb.vserver.bind.responder_policy :name => 'foo', :policyName => 'bar'
|
210
|
+
}.to raise_error(ArgumentError, /priority/)
|
211
|
+
end
|
212
|
+
|
213
|
+
it 'should return a Hash if all require arguments are supplied' do
|
214
|
+
expect(
|
215
|
+
connection.lb.vserver.bind.responder_policy :name => 'foo', :policyName => 'bar', :priority => '10'
|
216
|
+
).to be_kind_of(Hash)
|
217
|
+
expect(
|
218
|
+
connection.lb.vserver.unbind.responder_policy :name => 'foo', :policyName => 'bar'
|
219
|
+
).to be_kind_of(Hash)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
end
|
data/spec/node_spec.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
require 'netscaler'
|
3
|
+
require 'netscaler/mock_adapter'
|
4
|
+
|
5
|
+
describe Netscaler::Lb::Monitor do
|
6
|
+
|
7
|
+
connection = Netscaler::Connection.new 'hostname' => 'foo', 'password' => 'bar', 'username' => 'bar'
|
8
|
+
connection.adapter = Netscaler::MockAdapter.new :body => '{ "errorcode": 0, "message": "Done" }'
|
9
|
+
|
10
|
+
context 'when .show a ha.node' do
|
11
|
+
it 'a id is required' do
|
12
|
+
expect {
|
13
|
+
connection.ha.node.show :id => nil
|
14
|
+
}.to raise_error(ArgumentError, /id/)
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'returns a Hash object if all necessary args are supplied.' do
|
18
|
+
expect(
|
19
|
+
connection.ha.node.show(:id => 'foo_80')
|
20
|
+
).to be_kind_of(Hash)
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'returns a Hash object if 0 args are supplied' do
|
24
|
+
expect(
|
25
|
+
connection.ha.node.show
|
26
|
+
).to be_kind_of(Hash)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'when .stat a ha.node' do
|
31
|
+
it 'returns a Hash object if 0 args are supplied' do
|
32
|
+
expect(
|
33
|
+
connection.ha.node.stat
|
34
|
+
).to be_kind_of(Hash)
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
data/spec/server_spec.rb
CHANGED
@@ -85,4 +85,23 @@ describe Netscaler::Server do
|
|
85
85
|
expect(result).to be_kind_of(Hash)
|
86
86
|
end
|
87
87
|
end
|
88
|
+
|
89
|
+
|
90
|
+
context 'when show a service' do
|
91
|
+
it 'server is required' do
|
92
|
+
expect {
|
93
|
+
connection.server.show(:bar => 'foo')
|
94
|
+
}.to raise_error(ArgumentError, /server/)
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'returns a Hash object if all necessary args are supplied' do
|
98
|
+
result = connection.server.show(:server => 'foo')
|
99
|
+
expect(result).to be_kind_of(Hash)
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'returns a Hash object if 0 args are supplied' do
|
103
|
+
result = connection.server.show
|
104
|
+
expect(result).to be_kind_of(Hash)
|
105
|
+
end
|
106
|
+
end
|
88
107
|
end
|
data/spec/service_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
2
2
|
require 'netscaler'
|
3
3
|
require 'netscaler/mock_adapter'
|
4
4
|
|
5
|
-
describe Netscaler::
|
5
|
+
describe Netscaler::Service do
|
6
6
|
connection = Netscaler::Connection.new 'hostname'=> 'foo', 'password' => 'bar', 'username'=> 'bar'
|
7
7
|
connection.adapter = Netscaler::MockAdapter.new :body => '{ "errorcode": 0, "message": "Done" }'
|
8
8
|
|
@@ -11,6 +11,9 @@ describe Netscaler::Server do
|
|
11
11
|
expect {
|
12
12
|
connection.service.add(:serverName => 'foo', :serviceType => 'HTTP', :port => '80')
|
13
13
|
}.to raise_error(ArgumentError, /name/)
|
14
|
+
expect {
|
15
|
+
connection.service.remove(:serverName => 'foo', :serviceType => 'HTTP', :port => '80')
|
16
|
+
}.to raise_error(ArgumentError, /name/)
|
14
17
|
end
|
15
18
|
|
16
19
|
it 'a serverName is required' do
|
@@ -31,11 +34,73 @@ describe Netscaler::Server do
|
|
31
34
|
}.to raise_error(ArgumentError, /port/)
|
32
35
|
end
|
33
36
|
|
34
|
-
|
35
37
|
it 'returns a Hash object if all necessary args are supplied' do
|
36
38
|
result = connection.service.add(:name => 'foo_80', :serverName => 'foo', :serviceType => 'HTTP', :port => '80')
|
37
39
|
expect(result).to be_kind_of(Hash)
|
38
40
|
end
|
39
41
|
end
|
40
42
|
|
43
|
+
context 'when removing a new service' do
|
44
|
+
it 'a name is required' do
|
45
|
+
expect {
|
46
|
+
connection.service.remove(:serverName => 'foo', :serviceType => 'HTTP', :port => '80')
|
47
|
+
}.to raise_error(ArgumentError, /name/)
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'returns a Hash object if all necessary args are supplied' do
|
51
|
+
result = connection.service.remove(:name => 'foo_80')
|
52
|
+
expect(result).to be_kind_of(Hash)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
context 'when show a service' do
|
57
|
+
it 'serviceName is required' do
|
58
|
+
expect {
|
59
|
+
connection.service.show(:name => 'foo')
|
60
|
+
}.to raise_error(ArgumentError, /serviceName/)
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'returns a Hash object if all necessary args are supplied' do
|
64
|
+
result = connection.service.show(:serviceName => 'foo_80')
|
65
|
+
expect(result).to be_kind_of(Hash)
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'returns a Hash object if 0 args are supplied' do
|
69
|
+
result = connection.service.show
|
70
|
+
expect(result).to be_kind_of(Hash)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
context 'when stat a service' do
|
75
|
+
it 'returns a Hash object if all necessary args are supplied' do
|
76
|
+
result = connection.service.stat(:name => 'foo_80')
|
77
|
+
expect(result).to be_kind_of(Hash)
|
78
|
+
end
|
79
|
+
|
80
|
+
it 'returns a Hash object if 0 args are supplied' do
|
81
|
+
result = connection.service.stat
|
82
|
+
expect(result).to be_kind_of(Hash)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
context 'when enable|disable|show_binding a service' do
|
87
|
+
it 'returns a Hash object if all necessary args are supplied' do
|
88
|
+
expect(connection.service.show_binding(:name => 'foo_80')).to be_kind_of(Hash)
|
89
|
+
expect(connection.service.enable(:name => 'foo_80')).to be_kind_of(Hash)
|
90
|
+
expect(connection.service.disable(:name => 'foo_80')).to be_kind_of(Hash)
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'returns an error when 0 arguments are supplied.' do
|
94
|
+
expect {
|
95
|
+
connection.service.show_binding
|
96
|
+
}.to raise_error(ArgumentError, /wrong number/)
|
97
|
+
expect {
|
98
|
+
connection.service.enable
|
99
|
+
}.to raise_error(ArgumentError, /wrong number/)
|
100
|
+
expect {
|
101
|
+
connection.service.disable
|
102
|
+
}.to raise_error(ArgumentError, /wrong number/)
|
103
|
+
|
104
|
+
end
|
105
|
+
end
|
41
106
|
end
|
data/spec/servicegroup_spec.rb
CHANGED
@@ -8,7 +8,6 @@ describe Netscaler::ServiceGroup do
|
|
8
8
|
connection.adapter = Netscaler::MockAdapter.new :body => '{ "errorcode": 0, "message": "Done" }'
|
9
9
|
|
10
10
|
context 'when adding a new servicegroup' do
|
11
|
-
|
12
11
|
it 'a name is required' do
|
13
12
|
expect {
|
14
13
|
connection.servicegroups.add({ 'serviceType' => 'tcp' })
|
@@ -21,10 +20,13 @@ describe Netscaler::ServiceGroup do
|
|
21
20
|
}.to raise_error(ArgumentError, /serviceType/)
|
22
21
|
end
|
23
22
|
|
23
|
+
it 'returns a Hash object if all necessary args are supplied' do
|
24
|
+
result = connection.servicegroups.add :serviceGroupName => 'foo', 'serviceType' => 'bar'
|
25
|
+
expect(result).to be_kind_of(Hash)
|
26
|
+
end
|
24
27
|
end
|
25
28
|
|
26
29
|
context 'when removing a servicegroup' do
|
27
|
-
|
28
30
|
it 'has to require a serviceGroupName' do
|
29
31
|
expect {
|
30
32
|
connection.servicegroups.remove()
|
@@ -35,15 +37,13 @@ describe Netscaler::ServiceGroup do
|
|
35
37
|
end
|
36
38
|
|
37
39
|
it 'returns a Hash object if all necessary args are supplied' do
|
38
|
-
result = connection.servicegroups.
|
40
|
+
result = connection.servicegroups.remove :serviceGroupName => 'foo'
|
39
41
|
expect(result).to be_kind_of(Hash)
|
40
42
|
end
|
41
|
-
|
42
43
|
end
|
43
44
|
|
44
45
|
|
45
46
|
context 'when binding a new server to servicegroup' do
|
46
|
-
|
47
47
|
it 'a Service group name is required' do
|
48
48
|
expect {
|
49
49
|
connection.servicegroups.bind({ 'port'=> '8080', 'ip' => '199.199.199.199' })
|
@@ -62,10 +62,13 @@ describe Netscaler::ServiceGroup do
|
|
62
62
|
}.to raise_error(ArgumentError, /port/)
|
63
63
|
end
|
64
64
|
|
65
|
+
it 'returns a Hash object if all necessary args are supplied' do
|
66
|
+
result = connection.servicegroups.bind :serviceGroupName => 'foo', :port => '80', :serverName => 'foo_80'
|
67
|
+
expect(result).to be_kind_of(Hash)
|
68
|
+
end
|
65
69
|
end
|
66
70
|
|
67
71
|
context 'when unbinding a server from servicegroup' do
|
68
|
-
|
69
72
|
it 'a Service group name is required' do
|
70
73
|
expect {
|
71
74
|
connection.servicegroups.unbind({ 'port' => '8080', 'ip' => '199.199.199.199' })
|
@@ -84,11 +87,14 @@ describe Netscaler::ServiceGroup do
|
|
84
87
|
}.to raise_error(ArgumentError, /port/)
|
85
88
|
end
|
86
89
|
|
90
|
+
it 'returns a Hash object if all necessary args are supplied' do
|
91
|
+
result = connection.servicegroups.unbind :serviceGroupName => 'foo', :port => '80', :serverName => 'foo_80'
|
92
|
+
expect(result).to be_kind_of(Hash)
|
93
|
+
end
|
87
94
|
end
|
88
95
|
|
89
96
|
%w(enable disable).each do |toggle_action|
|
90
97
|
context "when running servicegroup.#{toggle_action}" do
|
91
|
-
|
92
98
|
it ':serviceGroupName is required' do
|
93
99
|
expect {
|
94
100
|
connection.servicegroups.send(toggle_action, {})
|
@@ -99,11 +105,9 @@ describe Netscaler::ServiceGroup do
|
|
99
105
|
result = connection.servicegroups.send(toggle_action, :serviceGroupName => 'foo')
|
100
106
|
expect(result).to be_kind_of(Hash)
|
101
107
|
end
|
102
|
-
|
103
108
|
end
|
104
109
|
|
105
110
|
context "when #{toggle_action} a server in servicegroup" do
|
106
|
-
|
107
111
|
it ':serviceGroupName is required' do
|
108
112
|
expect {
|
109
113
|
connection.servicegroups.send("#{toggle_action}_server", {:serverName => 'foo', :port => '80'})
|
@@ -126,7 +130,6 @@ describe Netscaler::ServiceGroup do
|
|
126
130
|
result = connection.servicegroups.send("#{toggle_action}_server", {:serviceGroupName => 'bar', :serverName => 'foo', :port => '80'})
|
127
131
|
expect(result).to be_kind_of(Hash)
|
128
132
|
end
|
129
|
-
|
130
133
|
end
|
131
134
|
|
132
135
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
require 'simplecov'
|
2
|
-
require '
|
2
|
+
require 'codecov'
|
3
3
|
|
4
4
|
class SimpleCov::Formatter::MergedFormatter
|
5
5
|
def format(result)
|
6
6
|
SimpleCov::Formatter::HTMLFormatter.new.format(result)
|
7
|
-
SimpleCov::Formatter::RcovFormatter.new.format(result)
|
8
7
|
end
|
9
8
|
end
|
10
9
|
|
data/spec/sslcertkey_spec.rb
CHANGED
@@ -31,4 +31,17 @@ describe Netscaler::System::File do
|
|
31
31
|
expect(result).to be_kind_of(Hash)
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
context 'when removing a certkey' do
|
36
|
+
it 'a certkey is required' do
|
37
|
+
expect {
|
38
|
+
connection.ssl.certkey.remove :foo => 'bar'
|
39
|
+
}.to raise_error(ArgumentError, /certkey/)
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'return hash when supplied all required params' do
|
43
|
+
result = connection.ssl.certkey.remove :certkey => 'foo'
|
44
|
+
expect(result).to be_kind_of(Hash)
|
45
|
+
end
|
46
|
+
end
|
34
47
|
end
|
data/spec/sslvserver_spec.rb
CHANGED
@@ -182,4 +182,33 @@ describe Netscaler::Cs::Vserver do
|
|
182
182
|
|
183
183
|
end
|
184
184
|
end
|
185
|
+
|
186
|
+
context 'when [un]binding ecccurve to ssl vserver' do
|
187
|
+
it 'should throw an error if :vservername arg is not given' do
|
188
|
+
expect {
|
189
|
+
connection.ssl.vserver.bind.ecccurve :ecccurvename => 'foo'
|
190
|
+
}.to raise_error(ArgumentError, /vservername/)
|
191
|
+
expect {
|
192
|
+
connection.ssl.vserver.unbind.ecccurve :policyname => 'foo'
|
193
|
+
}.to raise_error(ArgumentError, /vservername/)
|
194
|
+
end
|
195
|
+
|
196
|
+
it 'should throw an error if :ecccurvename arg is not given' do
|
197
|
+
expect {
|
198
|
+
connection.ssl.vserver.bind.ecccurve :vservername => 'foo'
|
199
|
+
}.to raise_error(ArgumentError, /ecccurvename/)
|
200
|
+
expect {
|
201
|
+
connection.ssl.vserver.unbind.ecccurve :vservername => 'foo'
|
202
|
+
}.to raise_error(ArgumentError, /ecccurvename/)
|
203
|
+
end
|
204
|
+
|
205
|
+
it 'should return a Hash if all require arguments are supplied' do
|
206
|
+
result = connection.ssl.vserver.bind.ecccurve :vservername => 'foo', :ecccurvename => 'bar'
|
207
|
+
expect(result).to be_kind_of(Hash)
|
208
|
+
unbind_result = connection.ssl.vserver.unbind.ecccurve :vservername => 'foo', :ecccurvename => 'bar'
|
209
|
+
expect(unbind_result).to be_kind_of(Hash)
|
210
|
+
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
185
214
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netscaler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Custenborder
|
@@ -10,48 +10,20 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-09-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: nokogiri
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
requirements:
|
19
|
-
- - "~>"
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 1.6.7.2
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
requirements:
|
26
|
-
- - "~>"
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
version: 1.6.7.2
|
29
15
|
- !ruby/object:Gem::Dependency
|
30
16
|
name: rest-client
|
31
17
|
requirement: !ruby/object:Gem::Requirement
|
32
18
|
requirements:
|
33
|
-
- -
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: '2.0'
|
36
|
-
type: :runtime
|
37
|
-
prerelease: false
|
38
|
-
version_requirements: !ruby/object:Gem::Requirement
|
39
|
-
requirements:
|
40
|
-
- - "~>"
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '2.0'
|
43
|
-
- !ruby/object:Gem::Dependency
|
44
|
-
name: json
|
45
|
-
requirement: !ruby/object:Gem::Requirement
|
46
|
-
requirements:
|
47
|
-
- - "~>"
|
19
|
+
- - '='
|
48
20
|
- !ruby/object:Gem::Version
|
49
21
|
version: 2.0.2
|
50
22
|
type: :runtime
|
51
23
|
prerelease: false
|
52
24
|
version_requirements: !ruby/object:Gem::Requirement
|
53
25
|
requirements:
|
54
|
-
- -
|
26
|
+
- - '='
|
55
27
|
- !ruby/object:Gem::Version
|
56
28
|
version: 2.0.2
|
57
29
|
- !ruby/object:Gem::Dependency
|
@@ -74,14 +46,14 @@ dependencies:
|
|
74
46
|
requirements:
|
75
47
|
- - "~>"
|
76
48
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
49
|
+
version: 5.1.0
|
78
50
|
type: :development
|
79
51
|
prerelease: false
|
80
52
|
version_requirements: !ruby/object:Gem::Requirement
|
81
53
|
requirements:
|
82
54
|
- - "~>"
|
83
55
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
56
|
+
version: 5.1.0
|
85
57
|
- !ruby/object:Gem::Dependency
|
86
58
|
name: bundler
|
87
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,34 +82,6 @@ dependencies:
|
|
110
82
|
- - "~>"
|
111
83
|
- !ruby/object:Gem::Version
|
112
84
|
version: 2.3.5
|
113
|
-
- !ruby/object:Gem::Dependency
|
114
|
-
name: simplecov
|
115
|
-
requirement: !ruby/object:Gem::Requirement
|
116
|
-
requirements:
|
117
|
-
- - "~>"
|
118
|
-
- !ruby/object:Gem::Version
|
119
|
-
version: '0.10'
|
120
|
-
type: :development
|
121
|
-
prerelease: false
|
122
|
-
version_requirements: !ruby/object:Gem::Requirement
|
123
|
-
requirements:
|
124
|
-
- - "~>"
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
version: '0.10'
|
127
|
-
- !ruby/object:Gem::Dependency
|
128
|
-
name: simplecov-rcov
|
129
|
-
requirement: !ruby/object:Gem::Requirement
|
130
|
-
requirements:
|
131
|
-
- - ">="
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version: '0'
|
134
|
-
type: :development
|
135
|
-
prerelease: false
|
136
|
-
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
requirements:
|
138
|
-
- - ">="
|
139
|
-
- !ruby/object:Gem::Version
|
140
|
-
version: '0'
|
141
85
|
description: Netscaler api working against the Citrix Nitro api. Currently supports
|
142
86
|
Nitro 9.3. Hope to add support for 10.X. Currently has support for som basics
|
143
87
|
such as adding servers/services/servicegroups.
|
@@ -202,8 +146,11 @@ files:
|
|
202
146
|
- netscaler.gemspec
|
203
147
|
- spec/cspolicylabel_spec.rb
|
204
148
|
- spec/csvserver_spec.rb
|
149
|
+
- spec/interface_spec.rb
|
150
|
+
- spec/lbmonitor_spec.rb
|
205
151
|
- spec/lbvserver_spec.rb
|
206
152
|
- spec/netscaler_spec.rb
|
153
|
+
- spec/node_spec.rb
|
207
154
|
- spec/policy_stringmap_spec.rb
|
208
155
|
- spec/responder_spec.rb
|
209
156
|
- spec/rewrite_spec.rb
|
@@ -214,7 +161,7 @@ files:
|
|
214
161
|
- spec/sslcertkey_spec.rb
|
215
162
|
- spec/sslvserver_spec.rb
|
216
163
|
- spec/systemfile_spec.rb
|
217
|
-
homepage: http://github.com/
|
164
|
+
homepage: http://github.com/bitflingr/netscaler
|
218
165
|
licenses:
|
219
166
|
- MIT
|
220
167
|
metadata: {}
|