Class: RbVmomi::SMS
- Inherits:
-
Connection
- Object
- TrivialSoap
- Connection
- RbVmomi::SMS
- Defined in:
- lib/rbvmomi/sms.rb
Overview
A connection to one vSphere SMS endpoint.
Defined Under Namespace
Classes: SmsStorageManager
Constant Summary
Constants inherited from Connection
Instance Attribute Summary
Attributes inherited from Connection
#deserializer, #profile, #profile_summary, #profiling, #rev
Attributes inherited from TrivialSoap
#cookie, #debug, #http, #operation_id
Class Method Summary collapse
-
.connect(vim, opts = {}) ⇒ Object
Connect to a vSphere SMS endpoint.
Instance Method Summary collapse
- #pretty_print(pp) ⇒ Object
- #rev=(x) ⇒ Object
-
#serviceInstance ⇒ Object
Return the ServiceInstance.
- #vcSessionCookie=(cookie) ⇒ Object
Methods inherited from Connection
add_extension_dir, #call, #emit_request, extension_dirs, #initialize, #instanceUuid, loader, #obj2xml, #parse_response, reload_extensions, #reset_profiling, type, #type
Methods inherited from TrivialSoap
#close, #host, #initialize, on_connect, #request, #restart_http, #soap_envelope
Constructor Details
This class inherits a constructor from RbVmomi::Connection
Class Method Details
.connect(vim, opts = {}) ⇒ Object
Connect to a vSphere SMS endpoint
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rbvmomi/sms.rb', line 21 def self.connect vim, opts = {} raise unless opts.is_a? Hash opts[:host] = vim.host opts[:ssl] = true unless opts.member? :ssl or opts[:"no-ssl"] opts[:insecure] ||= true opts[:port] ||= (opts[:ssl] ? 443 : 80) opts[:path] ||= '/sms/sdk' opts[:ns] ||= 'urn:sms' rev_given = opts[:rev] != nil opts[:rev] = '4.0' unless rev_given opts[:debug] = (!ENV['RBVMOMI_DEBUG'].empty? rescue false) unless opts.member? :debug new(opts).tap do |sms| sms.vcSessionCookie = vim..split('"')[1] end end |
Instance Method Details
#pretty_print(pp) ⇒ Object
56 57 58 |
# File 'lib/rbvmomi/sms.rb', line 56 def pretty_print pp pp.text "SMS(#{@opts[:host]})" end |
#rev=(x) ⇒ Object
43 44 45 46 |
# File 'lib/rbvmomi/sms.rb', line 43 def rev= x super @serviceContent = nil end |
#serviceInstance ⇒ Object
Return the ServiceInstance
The ServiceInstance is the root of the vSphere inventory.
51 52 53 |
# File 'lib/rbvmomi/sms.rb', line 51 def serviceInstance @serviceInstance ||= VIM::SmsServiceInstance self, 'ServiceInstance' end |
#vcSessionCookie=(cookie) ⇒ Object
39 40 41 |
# File 'lib/rbvmomi/sms.rb', line 39 def vcSessionCookie= @vcSessionCookie = end |