Class: Simplenet::Client::Connection
- Inherits:
-
Object
- Object
- Simplenet::Client::Connection
- Defined in:
- lib/simplenet/client/connection.rb
Instance Attribute Summary collapse
-
#simplenet_url ⇒ Object
readonly
Returns the value of attribute simplenet_url.
Instance Method Summary collapse
- #anycastips ⇒ Object
- #anycasts ⇒ Object
- #datacenters ⇒ Object
- #firewalls ⇒ Object
-
#initialize(config) ⇒ Connection
constructor
A new instance of Connection.
- #interfaces ⇒ Object
- #ips ⇒ Object
- #policies(netapp, owner) ⇒ Object
- #subnets ⇒ Object
- #switches ⇒ Object
- #vlans ⇒ Object
- #zones ⇒ Object
Constructor Details
#initialize(config) ⇒ Connection
Returns a new instance of Connection.
6 7 8 9 10 11 |
# File 'lib/simplenet/client/connection.rb', line 6 def initialize(config) url = config[:url] ver = config[:version] || "v1" @simplenet_url = "#{url}/#{ver}" end |
Instance Attribute Details
#simplenet_url ⇒ Object (readonly)
Returns the value of attribute simplenet_url.
4 5 6 |
# File 'lib/simplenet/client/connection.rb', line 4 def simplenet_url @simplenet_url end |
Instance Method Details
#anycastips ⇒ Object
37 38 39 |
# File 'lib/simplenet/client/connection.rb', line 37 def anycastips @anyi ||= Simplenet::Client::AnycastIp.new(@simplenet_url) end |
#anycasts ⇒ Object
33 34 35 |
# File 'lib/simplenet/client/connection.rb', line 33 def anycasts @anyc ||= Simplenet::Client::Anycast.new(@simplenet_url) end |
#datacenters ⇒ Object
17 18 19 |
# File 'lib/simplenet/client/connection.rb', line 17 def datacenters @dtct ||= Simplenet::Client::Datacenter.new(@simplenet_url) end |
#firewalls ⇒ Object
13 14 15 |
# File 'lib/simplenet/client/connection.rb', line 13 def firewalls @frwl ||= Simplenet::Client::Firewall.new(@simplenet_url) end |
#interfaces ⇒ Object
41 42 43 |
# File 'lib/simplenet/client/connection.rb', line 41 def interfaces @ifac ||= Simplenet::Client::Interface.new(@simplenet_url) end |
#ips ⇒ Object
25 26 27 |
# File 'lib/simplenet/client/connection.rb', line 25 def ips @ip ||= Simplenet::Client::Ip.new(@simplenet_url) end |
#policies(netapp, owner) ⇒ Object
53 54 55 |
# File 'lib/simplenet/client/connection.rb', line 53 def policies(netapp, owner) @plcy ||= Simplenet::Client::Policy.new(@simplenet_url, netapp, owner) end |
#subnets ⇒ Object
29 30 31 |
# File 'lib/simplenet/client/connection.rb', line 29 def subnets @sbnt ||= Simplenet::Client::Subnet.new(@simplenet_url) end |
#switches ⇒ Object
45 46 47 |
# File 'lib/simplenet/client/connection.rb', line 45 def switches @swit ||= Simplenet::Client::Switch.new(@simplenet_url) end |