Skip to content

Commit

Permalink
Add 'get_list_view' method for getting a vSphere ListView ref
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed Mar 30, 2014
1 parent 4901bb8 commit a47829e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/vpoller/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def get_container_view(self, obj_type, container=None):
obj_type (list): A list of managed object types
Returns:
A container view refence to the discovered managed objects
A container view ref to the discovered managed objects
"""
if not container:
Expand All @@ -228,6 +228,23 @@ def get_container_view(self, obj_type, container=None):

return view_ref

def get_list_view(self, obj):
"""
Get a vSphere List View reference
Args:
obj (list): A list of managed object to include in the List View
Returns:
A list view ref to the managed objects
"""
logging.debug('[%s] Getting list view ref for %s objects', self.host, [o.name for o in obj])

view_ref = self.si.content.viewManager.CreateListView(obj=obj)

return view_ref

class VConnectorDatabase(object):
"""
VConnectorDatabase class
Expand Down

0 comments on commit a47829e

Please sign in to comment.