Class: Virtuozzo::SOAP::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/virtuozzo/soap.rb

Overview

The Connection class provides for establishing of a SOAP session with a Virtuozzo Agent using either an SSL-secured or unsecure HTTP connection. Session data is stored for each Connection instance allowing all messages sent to be properly authenticated according to the Virtuozzo SOAP API specifications.

Instance Method Summary collapse

Constructor Details

#initialize(host, username, password, opts = {}) ⇒ Connection

Establish a new session with the specified host using the supplied credentials and options.

The opts hash may define :debug to be either true, false or the ‘device’ to be used for wiredumps, defaults to false. If set to true STDERR will be used for wiredumps.

The opts hash may define :verify_ssl to be either true or false in regards to whether SSL certificates should be verified for the various SOAP::RPC::Driver connections. The default is false, causing no SSL certificate verification.

The opts hash may define a :realm for authentication. The default is the Virtuozzo system realm represented by the Virtuozzo::DEFAULT_REALM constant.

Parameters:

  • host (String)

    the host to connect to

  • username (String)

    the user to authenticate as

  • password (String)

    the password to use for authentication

  • opts (Hash) (defaults to: {})

    additional options for the connection



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/virtuozzo/soap.rb', line 64

def initialize(host, username, password, opts = {})
  options = {
    :debug => false,
    :verify_ssl => false,
    :realm => Virtuozzo::DEFAULT_REALM
  }.merge(opts)

  @endpoint = host
  @username = username
  @password = password
  @realm    = options[:realm]
  
  @session_id = nil

  disable_ssl_verification unless options[:verify_ssl]
  setup_debug_mode(options[:debug]) if options[:debug]
  establish_session
  setup_header_handler
end

Instance Method Details

#alertmSOAP::RPC::Driver

Handle for the alertm interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    alertm SOAP::RPC::Driver instance.



176
177
178
# File 'lib/virtuozzo/soap.rb', line 176

def alertm
  @alertm ||= Virtuozzo::SOAP::Drivers::Alertm.new(@endpoint)
end

#authmSOAP::RPC::Driver

Handle for the authm interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    authm SOAP::RPC::Driver instance.



184
185
186
# File 'lib/virtuozzo/soap.rb', line 184

def authm
  @authm ||= Virtuozzo::SOAP::Drivers::Authm.new(@endpoint)
end

#backupmSOAP::RPC::Driver

Handle for the backupm interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    backupm SOAP::RPC::Driver instance.



192
193
194
# File 'lib/virtuozzo/soap.rb', line 192

def backupm
  @backupm ||= Virtuozzo::SOAP::Drivers::Backupm.new(@endpoint)
end

#computermSOAP::RPC::Driver

Handle for the computerm interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    computerm SOAP::RPC::Driver instance.



200
201
202
# File 'lib/virtuozzo/soap.rb', line 200

def computerm
  @computerm ||= Virtuozzo::SOAP::Drivers::Computerm.new(@endpoint)
end

#devmSOAP::RPC::Driver

Handle for the vzadevm interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    vzadevm SOAP::RPC::Driver instance.



120
121
122
# File 'lib/virtuozzo/soap.rb', line 120

def devm
  @devm ||= Virtuozzo::SOAP::Drivers::Devm.new(@endpoint)
end

#env_samplemSOAP::RPC::Driver

Handle for the env_samplem interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    env_samplem SOAP::RPC::Driver instance.



168
169
170
# File 'lib/virtuozzo/soap.rb', line 168

def env_samplem
  @env_samplem ||= Virtuozzo::SOAP::Drivers::EnvSamplem.new(@endpoint)
end

#envmSOAP::RPC::Driver

Handle for the vzaenvm interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    vzaenvmm SOAP::RPC::Driver instance.



96
97
98
# File 'lib/virtuozzo/soap.rb', line 96

def envm
  @envm ||= Virtuozzo::SOAP::Drivers::Envm.new(@endpoint)
end

#event_logSOAP::RPC::Driver

Handle for the event_log interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    event_log SOAP::RPC::Driver instance.



208
209
210
# File 'lib/virtuozzo/soap.rb', line 208

def event_log
  @event_log ||= Virtuozzo::SOAP::Drivers::EventLog.new(@endpoint)
end

#filerSOAP::RPC::Driver

Handle for the filer interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    filer SOAP::RPC::Driver instance.



224
225
226
# File 'lib/virtuozzo/soap.rb', line 224

def filer
  @filer ||= Virtuozzo::SOAP::Drivers::Filer.new(@endpoint)
end

#firewallmSOAP::RPC::Driver

Handle for the firewallm interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    firewallm SOAP::RPC::Driver instance.



232
233
234
# File 'lib/virtuozzo/soap.rb', line 232

def firewallm
  @firewallm ||= Virtuozzo::SOAP::Drivers::Firewallm.new(@endpoint)
end

#licensemSOAP::RPC::Driver

Handle for the licensem interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    licensem SOAP::RPC::Driver instance.



240
241
242
# File 'lib/virtuozzo/soap.rb', line 240

def licensem
  @licensem ||= Virtuozzo::SOAP::Drivers::Licensem.new(@endpoint)
end

#mailerSOAP::RPC::Driver

Handle for the mailer interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    mailer SOAP::RPC::Driver instance.



248
249
250
# File 'lib/virtuozzo/soap.rb', line 248

def mailer
  @mailer ||= Virtuozzo::SOAP::Drivers::Mailer.new(@endpoint)
end

#networkmSOAP::RPC::Driver

Handle for the vzanetworkm interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    vzanetworkm SOAP::RPC::Driver instance.



128
129
130
# File 'lib/virtuozzo/soap.rb', line 128

def networkm
  @networkm ||= Virtuozzo::SOAP::Drivers::Networkm.new(@endpoint)
end

#op_logSOAP::RPC::Driver

Handle for the op_log interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    op_log SOAP::RPC::Driver instance.



256
257
258
# File 'lib/virtuozzo/soap.rb', line 256

def op_log
  @op_log ||= Virtuozzo::SOAP::Drivers::OpLog.new(@endpoint)
end

#packagemSOAP::RPC::Driver

Handle for the vzapackagem interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    vzapackagem SOAP::RPC::Driver instance.



104
105
106
# File 'lib/virtuozzo/soap.rb', line 104

def packagem
  @packagem ||= Virtuozzo::SOAP::Drivers::Packagem.new(@endpoint)
end

#perf_monSOAP::RPC::Driver

Handle for the perf_mon interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    perf_mon SOAP::RPC::Driver instance.



264
265
266
# File 'lib/virtuozzo/soap.rb', line 264

def perf_mon
  @perf_mon ||= Virtuozzo::SOAP::Drivers::PerfMon.new(@endpoint)
end

#proc_infoSOAP::RPC::Driver

Handle for the vzaproc_info interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    vzaproc_info SOAP::RPC::Driver instance.



136
137
138
# File 'lib/virtuozzo/soap.rb', line 136

def proc_info
  @proc_info ||= Virtuozzo::SOAP::Drivers::ProcInfo.new(@endpoint)
end

#processmSOAP::RPC::Driver

Handle for the vzaprocessmm interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    vzaprocessm SOAP::RPC::Driver instance.



144
145
146
# File 'lib/virtuozzo/soap.rb', line 144

def processm
  @processm ||= Virtuozzo::SOAP::Drivers::Processm.new(@endpoint)
end

#relocatorSOAP::RPC::Driver

Handle for the vzarelocator interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    vzarelocator SOAP::RPC::Driver instance.



112
113
114
# File 'lib/virtuozzo/soap.rb', line 112

def relocator
  @relocator ||= Virtuozzo::SOAP::Drivers::Relocator.new(@endpoint)
end

#res_logSOAP::RPC::Driver

Handle for the res_log interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    res_log SOAP::RPC::Driver instance.



272
273
274
# File 'lib/virtuozzo/soap.rb', line 272

def res_log
  @res_log ||= Virtuozzo::SOAP::Drivers::ResLog.new(@endpoint)
end

#resourcemSOAP::RPC::Driver

Handle for the resourcem interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    resourcem SOAP::RPC::Driver instance.



280
281
282
# File 'lib/virtuozzo/soap.rb', line 280

def resourcem
  @resourcem ||= Virtuozzo::SOAP::Drivers::Resourcem.new(@endpoint)
end

#schedulerSOAP::RPC::Driver

Handle for the scheduler interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    scheduler SOAP::RPC::Driver instance.



288
289
290
# File 'lib/virtuozzo/soap.rb', line 288

def scheduler
  @scheduler ||= Virtuozzo::SOAP::Drivers::Scheduler.new(@endpoint)
end

#server_groupSOAP::RPC::Driver

Handle for the server_group interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    server_group SOAP::RPC::Driver instance.



216
217
218
# File 'lib/virtuozzo/soap.rb', line 216

def server_group
  @server_group ||= Virtuozzo::SOAP::Drivers::ServerGroup.new(@endpoint)
end

#servicemSOAP::RPC::Driver

Handle for the servicem interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    servicem SOAP::RPC::Driver instance.



296
297
298
# File 'lib/virtuozzo/soap.rb', line 296

def servicem
  @servicem ||= Virtuozzo::SOAP::Drivers::Servicem.new(@endpoint)
end

#sessionmSOAP::RPC::Driver

Handle for the sessionm interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    sessionm SOAP::RPC::Driver instance.



88
89
90
# File 'lib/virtuozzo/soap.rb', line 88

def sessionm
  @sessionm ||= Virtuozzo::SOAP::Drivers::Sessionm.new(@endpoint)
end

#supportSOAP::RPC::Driver

Handle for the vzasupport interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    vzasupport SOAP::RPC::Driver instance.



160
161
162
# File 'lib/virtuozzo/soap.rb', line 160

def support
  @support ||= Virtuozzo::SOAP::Drivers::Support.new(@endpoint)
end

#up2dateSOAP::RPC::Driver

Handle for the vzaup2date interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    vzaup2date SOAP::RPC::Driver instance.



152
153
154
# File 'lib/virtuozzo/soap.rb', line 152

def up2date
  @up2date ||= Virtuozzo::SOAP::Drivers::Up2date.new(@endpoint)
end

#usermSOAP::RPC::Driver

Handle for the userm interface of the Virtuozzo API.

Returns:

  • (SOAP::RPC::Driver)

    userm SOAP::RPC::Driver instance.



304
305
306
# File 'lib/virtuozzo/soap.rb', line 304

def userm
  @userm ||= Virtuozzo::SOAP::Drivers::Userm.new(@endpoint)
end