Class: Virtuozzo::SOAP::Connection
- Inherits:
-
Object
- Object
- Virtuozzo::SOAP::Connection
- 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
-
#device ⇒ SOAP::RPC::Driver
Handle for the vzadevm interface of the Virtuozzo API.
-
#environment ⇒ SOAP::RPC::Driver
Handle for the vzaenvm interface of the Virtuozzo API.
-
#initialize(host, username, password, opts = {}) ⇒ Connection
constructor
Establish a new session with the specified host using the supplied credentials and options.
-
#network ⇒ SOAP::RPC::Driver
Handle for the vzanetworkm interface of the Virtuozzo API.
-
#process ⇒ SOAP::RPC::Driver
Handle for the vzaprocessmm interface of the Virtuozzo API.
-
#process_info ⇒ SOAP::RPC::Driver
Handle for the vzaproc_info interface of the Virtuozzo API.
-
#relocator ⇒ SOAP::RPC::Driver
Handle for the vzarelocator interface of the Virtuozzo API.
-
#session ⇒ SOAP::RPC::Driver
Handle for the sessionm interface of the Virtuozzo API.
-
#support ⇒ SOAP::RPC::Driver
Handle for the vzasupport interface of the Virtuozzo API.
-
#template ⇒ SOAP::RPC::Driver
Handle for the vzapackagem interface of the Virtuozzo API.
-
#up2date ⇒ SOAP::RPC::Driver
Handle for the vzaup2date interface of the Virtuozzo API.
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.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/virtuozzo/soap.rb', line 46 def initialize(host, username, password, opts = {}) = { :debug => false, :verify_ssl => false, :realm => Virtuozzo::DEFAULT_REALM }.merge(opts) @endpoint = host @username = username @password = password @realm = [:realm] @session_id = nil disable_ssl_verification unless [:verify_ssl] setup_debug_mode([:debug]) if [:debug] establish_session setup_header_handler end |
Instance Method Details
#device ⇒ SOAP::RPC::Driver
Handle for the vzadevm interface of the Virtuozzo API.
102 103 104 |
# File 'lib/virtuozzo/soap.rb', line 102 def device @device ||= Virtuozzo::SOAP::Drivers::Device.new(@endpoint) end |
#environment ⇒ SOAP::RPC::Driver
Handle for the vzaenvm interface of the Virtuozzo API.
78 79 80 |
# File 'lib/virtuozzo/soap.rb', line 78 def environment @environment ||= Virtuozzo::SOAP::Drivers::Environment.new(@endpoint) end |
#network ⇒ SOAP::RPC::Driver
Handle for the vzanetworkm interface of the Virtuozzo API.
110 111 112 |
# File 'lib/virtuozzo/soap.rb', line 110 def network @network ||= Virtuozzo::SOAP::Drivers::Network.new(@endpoint) end |
#process ⇒ SOAP::RPC::Driver
Handle for the vzaprocessmm interface of the Virtuozzo API.
126 127 128 |
# File 'lib/virtuozzo/soap.rb', line 126 def process @process ||= Virtuozzo::SOAP::Drivers::Process.new(@endpoint) end |
#process_info ⇒ SOAP::RPC::Driver
Handle for the vzaproc_info interface of the Virtuozzo API.
118 119 120 |
# File 'lib/virtuozzo/soap.rb', line 118 def process_info @process_info ||= Virtuozzo::SOAP::Drivers::ProcessInfo.new(@endpoint) end |
#relocator ⇒ SOAP::RPC::Driver
Handle for the vzarelocator interface of the Virtuozzo API.
94 95 96 |
# File 'lib/virtuozzo/soap.rb', line 94 def relocator @relocator ||= Virtuozzo::SOAP::Drivers::Relocator.new(@endpoint) end |
#session ⇒ SOAP::RPC::Driver
Handle for the sessionm interface of the Virtuozzo API.
70 71 72 |
# File 'lib/virtuozzo/soap.rb', line 70 def session @session ||= Virtuozzo::SOAP::Drivers::Session.new(@endpoint) end |
#support ⇒ SOAP::RPC::Driver
Handle for the vzasupport interface of the Virtuozzo API.
142 143 144 |
# File 'lib/virtuozzo/soap.rb', line 142 def support @support ||= Virtuozzo::SOAP::Drivers::Support.new(@endpoint) end |
#template ⇒ SOAP::RPC::Driver
Handle for the vzapackagem interface of the Virtuozzo API.
86 87 88 |
# File 'lib/virtuozzo/soap.rb', line 86 def template @template ||= Virtuozzo::SOAP::Drivers::Template.new(@endpoint) end |
#up2date ⇒ SOAP::RPC::Driver
Handle for the vzaup2date interface of the Virtuozzo API.
134 135 136 |
# File 'lib/virtuozzo/soap.rb', line 134 def up2date @up2date ||= Virtuozzo::SOAP::Drivers::Up2date.new(@endpoint) end |