-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ssl vservers and a host of other things to support features i'm using
- Loading branch information
Showing
8 changed files
with
151 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'netscaler/ssl/vserver' | ||
require 'netscaler/ssl/vserver/bind' | ||
require 'netscaler/ssl/vserver/unbind' | ||
|
||
module Netscaler | ||
class Ssl | ||
|
||
def initialize(netscaler) | ||
@netscaler = netscaler | ||
end | ||
|
||
def vserver | ||
Vserver.new @netscaler | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
require 'netscaler/netscaler_service' | ||
|
||
module Netscaler | ||
class Ssl | ||
class Vserver < NetscalerService | ||
def initialize(netscaler) | ||
@netscaler=netscaler | ||
end | ||
|
||
def show(payload={}) | ||
if payload[:name] != nil then | ||
validate_payload(payload, [:name]) | ||
return @netscaler.adapter.get("config/sslvserver/#{payload[:name]}") | ||
elsif payload == {} then | ||
return @netscaler.adapter.get('config/sslvserver/') | ||
else | ||
raise ArgumentError, 'payload supplied must have been missing :name' | ||
end | ||
end | ||
|
||
def show_binding(payload) | ||
raise ArgumentError, 'payload cannot be null' if payload.nil? | ||
validate_payload(payload, [:name]) | ||
return @netscaler.adapter.get("config/sslvserver_binding/#{payload[:name]}") | ||
end | ||
|
||
def remove(payload) # :args: :name | ||
raise ArgumentError, 'payload cannot be null' if payload.nil? | ||
validate_payload(payload, [:name]) | ||
return @netscaler.adapter.delete("config/sslvserver/#{payload[:name]}") | ||
end | ||
|
||
def add(payload) | ||
raise ArgumentError, 'payload cannot be null' if payload.nil? | ||
validate_payload(payload, [:name, :serviceType, :ipv46, :port]) | ||
return @netscaler.adapter.post_no_body('config/sslvserver/', {'sslvserver' => payload}) | ||
end | ||
|
||
def stat(payload) | ||
raise ArgumentError, 'payload cannot be null' if payload.nil? | ||
validate_payload(payload, [:name]) | ||
return @netscaler.adapter.get("stat/sslvserver/#{payload[:name]}") | ||
end | ||
|
||
def bind | ||
Bind.new @netscaler | ||
end | ||
|
||
def unbind | ||
Unbind.new @netscaler | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Netscaler | ||
class Ssl | ||
class Vserver | ||
class Bind < NetscalerService | ||
def initialize(netscaler) | ||
@netscaler=netscaler | ||
end | ||
|
||
def sslcertkey(payload) | ||
raise ArgumentError, 'payload cannot be null' if payload.nil? | ||
validate_payload(payload, [:vservername, :certkeyname]) | ||
puts "config/sslvserver_sslcertkey_binding/#{payload[:vservername]}" | ||
return @netscaler.adapter.post_no_body("config/sslvserver_sslcertkey_binding/#{payload[:vservername]}", {'params' => {'action' => 'bind'}, 'sslvserver_sslcertkey_binding' => payload}) | ||
end | ||
|
||
end | ||
end | ||
end | ||
end | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module Netscaler | ||
class Ssl | ||
class Vserver | ||
class Unbind < NetscalerService | ||
def initialize(netscaler) | ||
@netscaler=netscaler | ||
end | ||
|
||
def sslcertkey(payload) | ||
raise ArgumentError, 'payload cannot be null' if payload.nil? | ||
validate_payload(payload, [:vservername, :certkeyname]) | ||
return @netscaler.adapter.post_no_body("config/sslvserver_sslcertkey_binding/#{payload[:vservername]}?action=unbind/", {'params' => {'action' => 'unbind'}, 'sslvserver_sslcertkey_binding' => payload}) | ||
end | ||
|
||
end | ||
end | ||
end | ||
end |