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.



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.



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.



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.



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.



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

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

#deviceSOAP::RPC::Driver

Handle for the vzadevm interface of the Virtuozzo API.



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

def device
  @device ||= Virtuozzo::SOAP::Drivers::Device.new(@endpoint)
end

#env_samplemSOAP::RPC::Driver

Handle for the env_samplem interface of the Virtuozzo API.



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

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

#environmentSOAP::RPC::Driver

Handle for the vzaenvm interface of the Virtuozzo API.



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

def environment
  @environment ||= Virtuozzo::SOAP::Drivers::Environment.new(@endpoint)
end

#event_logSOAP::RPC::Driver

Handle for the event_log interface of the Virtuozzo API.



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.



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.



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.



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.



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

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

#networkSOAP::RPC::Driver

Handle for the vzanetworkm interface of the Virtuozzo API.



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

def network
  @network ||= Virtuozzo::SOAP::Drivers::Network.new(@endpoint)
end

#op_logSOAP::RPC::Driver

Handle for the op_log interface of the Virtuozzo API.



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

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

#perf_monSOAP::RPC::Driver

Handle for the perf_mon interface of the Virtuozzo API.



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

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

#processSOAP::RPC::Driver

Handle for the vzaprocessmm interface of the Virtuozzo API.



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

def process
  @process ||= Virtuozzo::SOAP::Drivers::Process.new(@endpoint)
end

#process_infoSOAP::RPC::Driver

Handle for the vzaproc_info interface of the Virtuozzo API.



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

def process_info
  @process_info ||= Virtuozzo::SOAP::Drivers::ProcessInfo.new(@endpoint)
end

#relocatorSOAP::RPC::Driver

Handle for the vzarelocator interface of the Virtuozzo API.



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.



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.



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.



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.



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.



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

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

#sessionSOAP::RPC::Driver

Handle for the sessionm interface of the Virtuozzo API.



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

def session
  @session ||= Virtuozzo::SOAP::Drivers::Session.new(@endpoint)
end

#supportSOAP::RPC::Driver

Handle for the vzasupport interface of the Virtuozzo API.



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

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

#templateSOAP::RPC::Driver

Handle for the vzapackagem interface of the Virtuozzo API.



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

def template
  @template ||= Virtuozzo::SOAP::Drivers::Template.new(@endpoint)
end

#up2dateSOAP::RPC::Driver

Handle for the vzaup2date interface of the Virtuozzo API.



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.



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

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