Class: PuppetX::Puppetlabs::Transport::Nsx
- Inherits:
-
Object
- Object
- PuppetX::Puppetlabs::Transport::Nsx
- Defined in:
- lib/puppet_x/puppetlabs/transport/nsx.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#rest ⇒ Object
Returns the value of attribute rest.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #connect ⇒ Object
-
#initialize(option) ⇒ Nsx
constructor
A new instance of Nsx.
Constructor Details
#initialize(option) ⇒ Nsx
Returns a new instance of Nsx.
9 10 11 12 13 14 15 |
# File 'lib/puppet_x/puppetlabs/transport/nsx.rb', line 9 def initialize(option) @name = option[:name] @user = option[:username] @password = option[:password] @host = option[:server] Puppet.debug("#{self.class} initializing connection to: #{@host}") end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
7 8 9 |
# File 'lib/puppet_x/puppetlabs/transport/nsx.rb', line 7 def host @host end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/puppet_x/puppetlabs/transport/nsx.rb', line 7 def name @name end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
7 8 9 |
# File 'lib/puppet_x/puppetlabs/transport/nsx.rb', line 7 def password @password end |
#rest ⇒ Object
Returns the value of attribute rest.
6 7 8 |
# File 'lib/puppet_x/puppetlabs/transport/nsx.rb', line 6 def rest @rest end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
7 8 9 |
# File 'lib/puppet_x/puppetlabs/transport/nsx.rb', line 7 def user @user end |
Instance Method Details
#connect ⇒ Object
17 18 19 |
# File 'lib/puppet_x/puppetlabs/transport/nsx.rb', line 17 def connect @rest ||= RestClient::Resource.new("https://#{@host}/", :user => @user, :password => @password, :timeout => 300 ) end |