netscaler 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/VERSION +1 -1
- data/lib/netscaler/cs.rb +5 -0
- data/lib/netscaler/cs/policylabel.rb +31 -0
- data/netscaler.gemspec +5 -3
- data/spec/cspolicylabel_spec.rb +31 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmZiODc5NTU2ZGYwZDI5YmM0YzJhZmE0MGRjNGU2NWQ5N2NmYjdkYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDE2NjE5YjlhMmYzODcxY2NmYmIyNGIxNjk4ZGU4ODdiZWYzYzQ2MA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGZjNzBmZWM0Njc4Zjc1OGQ1MWEzOGNiNzQ3M2EzYmFjOWY5NjNjYzQ3YzMx
|
10
|
+
NDE5OGRmMWRiNWMyMGE5NDRmNjc2M2U5ZTFlOWMyYmJjODhmYzVlNzA4OGUz
|
11
|
+
YmM3YTQ3Njk5N2Y4ZmY2ZDU3NjlmYjcyNTM0MmRjZDgyNDYyNTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODQ2ZjkyODNjNTE5MTBhMDU3Yjg3ZGRhOTlhNGVmZDEyZDlmMzA4YTMwZmVj
|
14
|
+
ODdkZjkyOGU2MmQzZTM0NDg4NjBiOTFiM2ViY2YxZGYxODVmOTE4YzdkOTk3
|
15
|
+
NzZiODIzZTc0MzNlZWMzNmZmNmU2ZDNmODBjNWJiOWFkNjVkNzU=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.8.0
|
data/lib/netscaler/cs.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'netscaler/cs/policy'
|
2
|
+
require 'netscaler/cs/policylabel'
|
2
3
|
require 'netscaler/cs/vserver'
|
3
4
|
require 'netscaler/cs/vserver/bind'
|
4
5
|
require 'netscaler/cs/vserver/unbind'
|
@@ -18,5 +19,9 @@ module Netscaler
|
|
18
19
|
Policy.new @netscaler
|
19
20
|
end
|
20
21
|
|
22
|
+
def policylabel
|
23
|
+
Policylabel.new @netscaler
|
24
|
+
end
|
25
|
+
|
21
26
|
end
|
22
27
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'netscaler/netscaler_service'
|
2
|
+
|
3
|
+
module Netscaler
|
4
|
+
class Cs
|
5
|
+
class Policylabel < NetscalerService
|
6
|
+
|
7
|
+
def initialize(netscaler)
|
8
|
+
@netscaler=netscaler
|
9
|
+
end
|
10
|
+
|
11
|
+
def show(payload={})
|
12
|
+
if payload[:name] != nil then
|
13
|
+
validate_payload(payload, [:name])
|
14
|
+
return @netscaler.adapter.get("config/cspolicylabel/#{payload[:name]}")
|
15
|
+
elsif payload == {} then
|
16
|
+
return @netscaler.adapter.get('config/cspolicylabel/')
|
17
|
+
else
|
18
|
+
raise ArgumentError, 'payload supplied must have been missing :name'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def show_binding(payload)
|
23
|
+
raise ArgumentError, 'payload cannot be null' if payload.nil?
|
24
|
+
validate_payload(payload, [:name])
|
25
|
+
return @netscaler.adapter.get("config/cspolicylabel_binding/#{payload[:name]}")
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
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.
|
5
|
+
# stub: netscaler 0.8.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "netscaler"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.8.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Jeremy Custenborder", "David Andrew", "Jarrett Irons"]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2016-02-25"
|
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."
|
16
16
|
s.email = ["jeremy@scarcemedia.com", "david.andrew@webtrends.com", "jarrett.irons@gmail.com"]
|
17
17
|
s.extra_rdoc_files = [
|
@@ -32,6 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
"lib/netscaler/connection.rb",
|
33
33
|
"lib/netscaler/cs.rb",
|
34
34
|
"lib/netscaler/cs/policy.rb",
|
35
|
+
"lib/netscaler/cs/policylabel.rb",
|
35
36
|
"lib/netscaler/cs/vserver.rb",
|
36
37
|
"lib/netscaler/cs/vserver/bind.rb",
|
37
38
|
"lib/netscaler/cs/vserver/unbind.rb",
|
@@ -64,6 +65,7 @@ Gem::Specification.new do |s|
|
|
64
65
|
"lib/netscaler/system.rb",
|
65
66
|
"lib/netscaler/system/file.rb",
|
66
67
|
"netscaler.gemspec",
|
68
|
+
"spec/cspolicylabel_spec.rb",
|
67
69
|
"spec/csvserver_spec.rb",
|
68
70
|
"spec/lbvserver_spec.rb",
|
69
71
|
"spec/netscaler_spec.rb",
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
require 'netscaler'
|
3
|
+
require 'netscaler/mock_adapter'
|
4
|
+
|
5
|
+
describe Netscaler::Server do
|
6
|
+
connection = Netscaler::Connection.new 'hostname'=> 'foo', 'password' => 'bar', 'username'=> 'bar'
|
7
|
+
connection.adapter = Netscaler::MockAdapter.new :body => '{ "errorcode": 0, "message": "Done" }'
|
8
|
+
|
9
|
+
context 'when showing a cspolicylabel' do
|
10
|
+
it 'a name is required' do
|
11
|
+
expect {
|
12
|
+
connection.cs.policylabel.show(:badname => 'foo')
|
13
|
+
}.to raise_error(ArgumentError, /name/)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'returns a Hash object if no args are passed' do
|
17
|
+
result = connection.cs.policylabel.show
|
18
|
+
expect(result).to be_kind_of(Hash)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'when showing a cspolicylabel bindings' do
|
23
|
+
it 'a name is required' do
|
24
|
+
expect {
|
25
|
+
connection.cs.policylabel.show_binding
|
26
|
+
}.to raise_error(ArgumentError, /wrong number/)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
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.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Custenborder
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|
@@ -164,6 +164,7 @@ files:
|
|
164
164
|
- lib/netscaler/connection.rb
|
165
165
|
- lib/netscaler/cs.rb
|
166
166
|
- lib/netscaler/cs/policy.rb
|
167
|
+
- lib/netscaler/cs/policylabel.rb
|
167
168
|
- lib/netscaler/cs/vserver.rb
|
168
169
|
- lib/netscaler/cs/vserver/bind.rb
|
169
170
|
- lib/netscaler/cs/vserver/unbind.rb
|
@@ -196,6 +197,7 @@ files:
|
|
196
197
|
- lib/netscaler/system.rb
|
197
198
|
- lib/netscaler/system/file.rb
|
198
199
|
- netscaler.gemspec
|
200
|
+
- spec/cspolicylabel_spec.rb
|
199
201
|
- spec/csvserver_spec.rb
|
200
202
|
- spec/lbvserver_spec.rb
|
201
203
|
- spec/netscaler_spec.rb
|