Class: PuppetX::Puppetlabs::Transport::Nsx

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_x/puppetlabs/transport/nsx.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hostObject (readonly)

Returns the value of attribute host.



7
8
9
# File 'lib/puppet_x/puppetlabs/transport/nsx.rb', line 7

def host
  @host
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/puppet_x/puppetlabs/transport/nsx.rb', line 7

def name
  @name
end

#passwordObject (readonly)

Returns the value of attribute password.



7
8
9
# File 'lib/puppet_x/puppetlabs/transport/nsx.rb', line 7

def password
  @password
end

#restObject

Returns the value of attribute rest.



6
7
8
# File 'lib/puppet_x/puppetlabs/transport/nsx.rb', line 6

def rest
  @rest
end

#userObject (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

#connectObject



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