Class: DMiqVim
- Inherits:
-
MiqVim
- Object
- Handsoap::Service
- VimService
- MiqVimClientBase
- MiqVimInventory
- MiqVim
- DMiqVim
- Includes:
- DMiqVimSync, DRb::DRbUndumped
- Defined in:
- lib/VMwareWebService/DMiqVim.rb
Constant Summary
Constants included from VimPropMaps
VimPropMaps::CorePropMap, VimPropMaps::EmsRefreshPropMap, VimPropMaps::EventMonitorPropMap, VimPropMaps::FullPropMap, VimPropMaps::PropMapVCenter, VimPropMaps::UpdatePropMapsByType, VimPropMaps::VimCoreUpdaterPropMap
Instance Attribute Summary
Attributes inherited from MiqVim
#monitor_updates, #updateThread
Attributes inherited from MiqVimInventory
Attributes inherited from MiqVimClientBase
#connId, #password, #server, #username
Attributes inherited from VimService
#about, #apiVersion, #isVirtualCenter, #serviceInstanceMor, #session_cookie, #sic, #v2, #v20, #v4, #v5, #v6
Instance Method Summary collapse
- #connect ⇒ Object
- #connectionRemoved ⇒ Object
- #connectionRemoved? ⇒ Boolean
- #disconnect ⇒ Object
-
#initialize(server, username, password, broker, preLoad = false, debugUpdates = false, notifyMethod = nil, cacheScope = nil, maxWait = 60, maxObjects = 250) ⇒ DMiqVim
constructor
A new instance of DMiqVim.
- #monitor(preLoad) ⇒ Object
- #serverPrivateConnect ⇒ Object
- #serverPrivateDisconnect ⇒ Object
- #shutdownConnection ⇒ Object
Methods included from DMiqVimSync
Methods inherited from MiqVim
#getMiqCustomFieldsManager, #getVimAlarmManager, #getVimCluster, #getVimClusterByFilter, #getVimClusterByMor, #getVimCustomizationSpecManager, #getVimDataStore, #getVimDataStoreByMor, #getVimEventHistory, #getVimFolder, #getVimFolderByFilter, #getVimFolderByMor, #getVimHost, #getVimHostByFilter, #getVimHostByMor, #getVimPerfHistory, #getVimVm, #getVimVmByFilter, #getVimVmByMor
Methods included from MiqVimUpdate
#addObject, #debugUpdates=, #deleteObject, #forceFail, #monitorUpdates, #monitorUpdatesInitial, #monitorUpdatesSince, #notifyMethod=, #propUpdate, #stopUpdateMonitor, #updateDelay, #updateDelay=, #updateObject, #updateProps
Methods included from MiqVimVdlConnectionMod
#closeVdlConnection, #vdlConnection
Methods inherited from MiqVimInventory
#addDVPObj, #addDVSObj, #addDataStore, #addDataStoreObj, #addExtensionManager, #addHostSystem, #addHostSystemObj, #addLicenseManager, #addObjByMor, #addObjHash, #addProperty, #addStoragePodObj, #addToCollection, #addVirtualMachine, #allPropsFromCache, #applyFilter, #applySelSpec, #applySelector, #assert_no_locks, #browseDiagnosticLog, #browseDiagnosticLogEx, cacheScope, cacheScope=, #cacheStats, #cancelTask, #clusterComputeResourceByMor, #clusterComputeResources, #clusterComputeResourcesByFilter, #clusterComputeResourcesByMor, #computeResourceByMor, #computeResources, #computeResourcesByFilter, #computeResourcesByMor, #currentSession, #dataStoreByMor, #dataStores, #dataStoresByFilter, #dataStoresByFilter_local, #dataStoresByMor, #datacenterByMor, #datacenters, #datacentersByFilter, #datacentersByMor, #datastorePath, #deepClone, #deleteProperty, #dsName2mo, #dsName2mo_local, #dsName2path, dsPath?, #dsPath?, dsRelativePath, #dsRelativePath, #dupObj, #dvPortgroupByMor, #dvPortgroups, #dvPortgroupsByMor, #dvSwitchByMor, #dvSwitches, #dvSwitchesByMor, #extensionManagerByMor, #extensionManagersByFilter, #extensionManagersByMor, #folderByMor, #folders, #foldersByFilter, #foldersByMor, #getMoProp, #getMoPropMulti, #getMoPropMultiIter, #getMoProp_local, #getSelSpec, #getSelector, #getTaskMor, #getTasks, #getTasksByFilter, #hasProp?, #hostSystemByMor, #hostSystems, #hostSystemsByFilter, #hostSystemsByMor, #hostSystemsStorageDevice, #inventoryHash, #inventoryHash_locked, #isAlive?, #isDead, #isHostAgent?, #isVirtualCenter?, #keyExistsInCache?, #keyFromCache, #licenseManagerByMor, #licenseManagersByFilter, #licenseManagersByMor, #loadCache, #localVmPath, #logCacheCounts, #logUserEvent, #objFixUp, path2dsName, #path2dsName, #pollTask, #propFromCache, #propValue, #queryLogDescriptions, #refreshExtensionManager, #refreshLicenseManager, #refreshVirtualMachine, #removeExtensionManager, #removeLicenseManager, #removeObjByMor, #removeSelector, removeSelector, #removeVirtualMachine, #resetCache, #resourcePoolByMor, #resourcePools, #resourcePoolsByFilter, #resourcePoolsByMor, #selSpecToPropPath, setSelector, #setSelector, #snapshotFixup, #spec, #storagePodByMor, #storagePods, #storagePodsByMor, #updateSpec, #updateSpecByPropMap, #virtualAppByMor, #virtualApps, #virtualAppsByFilter, #virtualAppsByMor, #virtualMachineByMor, #virtualMachines, #virtualMachinesByFilter, #virtualMachinesByMor, #vmDatacenterName, #waitForTask
Methods included from MiqVimObjectSet
Methods included from MiqVimDump
#dumpAll, #dumpArray, #dumpClass, #dumpHash, #dumpHostInfo, #dumpMors, #dumpObj, #dumpToLog=, #globalIndent=, #indentedPrint
Methods included from VimPropMaps
Methods inherited from MiqVimClientBase
#acquireCloneTicket, #currentServerTime, #receiveTimeout, receiveTimeout, #receiveTimeout=, receiveTimeout=, #sdk_uri, #verify_callback
Methods inherited from VimService
#acquireCloneTicket, #acquireMksTicket, #acquireTicket, #addHost_Task, #addInternetScsiSendTargets, #addInternetScsiStaticTargets, #addStandaloneHost_Task, #browseDiagnosticLog, #cancelTask, #cancelWaitForUpdates, #cloneVM_Task, #continueRetrievePropertiesEx, #createAlarm, #createCollectorForEvents, #createCustomizationSpec, #createFilter, #createFolder, #createNasDatastore, #createSnapshot_Task, #createVM_Task, #currentTime, #customizationSpecItemToXml, #deleteCustomizationSpec, #deselectVnicForNicType, #destroyCollector, #destroyPropertyFilter, #destroy_Task, #disableRuleset, #doesCustomizationSpecExist, #enableRuleset, #enterMaintenanceMode_Task, #exitMaintenanceMode_Task, #getAlarm, #getCustomizationSpec, #logUserEvent, #login, #logout, #markAsTemplate, #markAsVirtualMachine, #migrateVM_Task, #moveIntoFolder_Task, #powerDownHostToStandBy_Task, #powerOffVM_Task, #powerOnVM_Task, #powerUpHostFromStandBy_Task, #queryAvailablePerfMetric, #queryDescriptions, #queryDvsConfigTarget, #queryNetConfig, #queryOptions, #queryPerf, #queryPerfComposite, #queryPerfProviderSummary, #readNextEvents, #readPreviousEvents, #rebootGuest, #rebootHost_Task, #reconfigVM_Task, #reconfigureAlarm, #refreshFirewall, #refreshNetworkSystem, #refreshServices, #registerVM_Task, #relocateVM_Task, #removeAlarm, #removeAllSnapshots_Task, #removeSnapshot_Task, #renameSnapshot, #rename_Task, #resetCollector, #resetVM_Task, #restartService, #retrieveProperties, #retrievePropertiesCompat, #retrievePropertiesEx, #retrievePropertiesIter, #retrieveServiceContent, #revertToCurrentSnapshot_Task, #revertToSnapshot_Task, #rewindCollector, #searchDatastoreSubFolders_Task, #searchDatastore_Task, #selectVnicForNicType, #setCollectorPageSize, #setField, #setTaskDescription, #setTaskState, #shutdownGuest, #shutdownHost_Task, #standbyGuest, #startService, #stopService, #suspendVM_Task, #uninstallService, #unregisterVM, #updateDefaultPolicy, #updateServicePolicy, #updateSoftwareInternetScsiEnabled, #waitForUpdates, #waitForUpdatesEx, #xmlToCustomizationSpecItem
Constructor Details
#initialize(server, username, password, broker, preLoad = false, debugUpdates = false, notifyMethod = nil, cacheScope = nil, maxWait = 60, maxObjects = 250) ⇒ DMiqVim
Returns a new instance of DMiqVim.
34 35 36 37 38 39 40 |
# File 'lib/VMwareWebService/DMiqVim.rb', line 34 def initialize(server, username, password, broker, preLoad = false, debugUpdates = false, notifyMethod = nil, cacheScope = nil, maxWait = 60, maxObjects = 250) super(server, username, password, cacheScope, monitor_updates = true, preLoad, debugUpdates, notifyMethod, maxWait, maxObjects) @broker = broker @connectionShuttingDown = false @connectionRemoved = false end |
Instance Method Details
#connect ⇒ Object
88 89 90 |
# File 'lib/VMwareWebService/DMiqVim.rb', line 88 def connect (true) end |
#connectionRemoved ⇒ Object
84 85 86 |
# File 'lib/VMwareWebService/DMiqVim.rb', line 84 def connectionRemoved @connectionRemoved = true end |
#connectionRemoved? ⇒ Boolean
80 81 82 |
# File 'lib/VMwareWebService/DMiqVim.rb', line 80 def connectionRemoved? @connectionRemoved end |
#disconnect ⇒ Object
92 93 94 |
# File 'lib/VMwareWebService/DMiqVim.rb', line 92 def disconnect (true) end |
#monitor(preLoad) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/VMwareWebService/DMiqVim.rb', line 42 def monitor(preLoad) log_prefix = "DMiqVim.monitor (#{@connId})" begin monitorUpdates(preLoad) rescue Exception => err # if handleSessionNotAuthenticated(err) # $vim_log.info "#{log_prefix}: Restarting Update Monitor" if $vim_log # retry # end $vim_log.info "#{log_prefix}: returned from monitorUpdates via #{err.class} exception" if $vim_log @error = err ensure $vim_log.info "#{log_prefix}: returned from monitorUpdates" if $vim_log if @updateMonitorReady && !@broker.shuttingDown @broker.connTrySync(:EX, server, username) do |key| @broker.removeMiqVimSS(key, self) end if @notifyMethod @notifyMethod.call(:server => @server, :username => @username, :op => 'MiqVimRemoved', :error => @error ) end end end end |
#serverPrivateConnect ⇒ Object
17 |
# File 'lib/VMwareWebService/DMiqVim.rb', line 17 alias_method :serverPrivateConnect, :connect |
#serverPrivateDisconnect ⇒ Object
18 |
# File 'lib/VMwareWebService/DMiqVim.rb', line 18 alias_method :serverPrivateDisconnect, :disconnect |
#shutdownConnection ⇒ Object
71 72 73 74 75 76 77 78 |
# File 'lib/VMwareWebService/DMiqVim.rb', line 71 def shutdownConnection return if @connectionShuttingDown log_prefix = "DMiqVim.shutdownConnection (#{@connId})" $vim_log.info "#{log_prefix}: for address=<#{@server}>, username=<#{@username}>...Starting" if $vim_log @connectionShuttingDown = true serverPrivateDisconnect if self.isAlive? $vim_log.info "#{log_prefix}: for address=<#{@server}>, username=<#{@username}>...Complete" if $vim_log end |