def get_container_view(service_instance, obj_type, container=None):
 if (not container):
  container = service_instance.content.rootFolder
 view_ref = service_instance.content.viewManager.CreateContainerView(container=container, type=obj_type, recursive=True)
 return view_ref

def get_container_view ( service_instance , obj_type , container = None ) : if ( not container ) : container = service_instance . content . rootFolder view_ref = service_instance . content . viewManager . CreateContainerView ( container = container , type = obj_type , recursive = True ) return view_ref
get a vsphere container view reference to all objects of type obj_type it is up to the caller to take care of destroying the view when no longer needed .