Class: RbVmomi::PBM
- Inherits:
-
Connection
- Object
- TrivialSoap
- Connection
- RbVmomi::PBM
- Defined in:
- lib/rbvmomi/pbm.rb
Overview
A connection to one vSphere ProfileBasedManagement endpoint.
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 ProfileBasedManagement endpoint.
Instance Method Summary collapse
- #pretty_print(pp) ⇒ Object
- #rev=(x) ⇒ Object
-
#serviceContent ⇒ Object
Alias to serviceInstance.PbmRetrieveServiceContent.
-
#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 ProfileBasedManagement endpoint
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rbvmomi/pbm.rb', line 21 def self.connect vim, opts = {} fail unless opts.is_a? Hash opts[:host] = vim.host opts[:ssl] = true unless opts.member? :ssl or opts[:"no-ssl"] opts[:insecure] ||= false opts[:port] ||= (opts[:ssl] ? 443 : 80) opts[:path] ||= '/pbm/sdk' opts[:ns] ||= 'urn:pbm' rev_given = opts[:rev] != nil opts[:rev] = '1.0' unless rev_given opts[:debug] = (!ENV['RBVMOMI_DEBUG'].empty? rescue false) unless opts.member? :debug new(opts).tap do |pbm| pbm.vcSessionCookie = vim..split('"')[1] end end |
Instance Method Details
#pretty_print(pp) ⇒ Object
60 61 62 |
# File 'lib/rbvmomi/pbm.rb', line 60 def pretty_print pp pp.text "PBM(#{@opts[:host]})" end |
#rev=(x) ⇒ Object
42 43 44 45 |
# File 'lib/rbvmomi/pbm.rb', line 42 def rev= x super @serviceContent = nil end |
#serviceContent ⇒ Object
Alias to serviceInstance.PbmRetrieveServiceContent
55 56 57 |
# File 'lib/rbvmomi/pbm.rb', line 55 def serviceContent @serviceContent ||= serviceInstance.PbmRetrieveServiceContent end |
#serviceInstance ⇒ Object
Return the ServiceInstance
The ServiceInstance is the root of the vSphere inventory.
50 51 52 |
# File 'lib/rbvmomi/pbm.rb', line 50 def serviceInstance @serviceInstance ||= VIM::PbmServiceInstance self, 'ServiceInstance' end |
#vcSessionCookie=(cookie) ⇒ Object
38 39 40 |
# File 'lib/rbvmomi/pbm.rb', line 38 def vcSessionCookie= @vcSessionCookie = end |