oslo_vmware.vim_util
Module¶The VMware API utility module.
oslo_vmware.vim_util.
WithRetrieval
(vim, retrieve_result)¶Bases: object
Context to retrieve results.
This context provides an iterator to retrieve results and cancel (when needed) retrieve operation on __exit__.
Example:
- with WithRetrieval(vim, retrieve_result) as objects:
- for obj in objects:
- # Use obj
oslo_vmware.vim_util.
build_object_spec
(client_factory, root_folder, traversal_specs)¶Builds the object spec.
Parameters: |
|
---|---|
Returns: | object spec |
oslo_vmware.vim_util.
build_property_filter_spec
(client_factory, property_specs, object_specs)¶Builds the property filter spec.
Parameters: |
|
---|---|
Returns: | property filter spec |
oslo_vmware.vim_util.
build_property_spec
(client_factory, type_='VirtualMachine', properties_to_collect=None, all_properties=False)¶Builds the property spec.
Parameters: |
|
---|---|
Returns: | property spec |
oslo_vmware.vim_util.
build_recursive_traversal_spec
(client_factory)¶Builds recursive traversal spec to traverse managed object hierarchy.
Parameters: | client_factory – factory to get API input specs |
---|---|
Returns: | recursive traversal spec |
oslo_vmware.vim_util.
build_selection_spec
(client_factory, name)¶Builds the selection spec.
Parameters: |
|
---|---|
Returns: | selection spec |
oslo_vmware.vim_util.
build_traversal_spec
(client_factory, name, type_, path, skip, select_set)¶Builds the traversal spec.
Parameters: |
|
---|---|
Returns: | traversal spec |
oslo_vmware.vim_util.
cancel_retrieval
(vim, retrieve_result)¶Cancels the retrieve operation if necessary.
Parameters: |
|
---|---|
Raises: | VimException, VimFaultException, VimAttributeException, VimSessionOverLoadException, VimConnectionException |
oslo_vmware.vim_util.
continue_retrieval
(vim, retrieve_result)¶Continue retrieving results, if available.
Parameters: |
|
---|---|
Raises: | VimException, VimFaultException, VimAttributeException, VimSessionOverLoadException, VimConnectionException |
oslo_vmware.vim_util.
find_extension
(vim, key)¶Looks for an existing extension.
Parameters: |
|
---|---|
Returns: | the data object Extension or None |
oslo_vmware.vim_util.
get_http_service_request_spec
(client_factory, method, uri)¶Build a HTTP service request spec.
Parameters: |
|
---|
oslo_vmware.vim_util.
get_inventory_path
(vim, entity_ref, max_objects=100)¶Get the inventory path of a managed entity.
Parameters: |
|
---|---|
Returns: | inventory path of the entity_ref |
oslo_vmware.vim_util.
get_moref
(value, type_)¶Get managed object reference.
Parameters: |
|
---|---|
Returns: | managed object reference with given value and type |
oslo_vmware.vim_util.
get_obj_spec
(client_factory, obj, select_set=None)¶Builds the Object Spec object.
oslo_vmware.vim_util.
get_object_properties
(vim, moref, properties_to_collect, skip_op_id=False)¶Get properties of the given managed object.
Parameters: |
|
---|---|
Returns: | properties of the given managed object |
Raises: | VimException, VimFaultException, VimAttributeException, VimSessionOverLoadException, VimConnectionException |
oslo_vmware.vim_util.
get_object_properties_dict
(vim, moref, properties_to_collect)¶Get properties of the given managed object as a dict.
Parameters: |
|
---|---|
Returns: | a dict of properties of the given managed object |
Raises: | VimException, VimFaultException, VimAttributeException, VimSessionOverLoadException, VimConnectionException |
oslo_vmware.vim_util.
get_object_property
(vim, moref, property_name, skip_op_id=False)¶Get property of the given managed object.
Parameters: |
|
---|---|
Returns: | property of the given managed object |
Raises: | VimException, VimFaultException, VimAttributeException, VimSessionOverLoadException, VimConnectionException |
oslo_vmware.vim_util.
get_objects
(vim, type_, max_objects, properties_to_collect=None, all_properties=False)¶Get all managed object references of the given type.
It is the caller’s responsibility to continue or cancel retrieval.
Parameters: |
|
---|---|
Returns: | all managed object references of the given type |
Raises: | VimException, VimFaultException, VimAttributeException, VimSessionOverLoadException, VimConnectionException |
oslo_vmware.vim_util.
get_prop_filter_spec
(client_factory, obj_spec, prop_spec)¶Builds the Property Filter Spec Object.
oslo_vmware.vim_util.
get_prop_spec
(client_factory, spec_type, properties)¶Builds the Property Spec Object.
oslo_vmware.vim_util.
get_properties_for_a_collection_of_objects
(vim, type_, obj_list, properties, max_objects=None)¶Gets the list of properties for the collection of objects of the type specified.
oslo_vmware.vim_util.
get_vc_version
(session)¶Return the dot-separated vCenter version string. For example, “1.2”.
Parameters: | session – vCenter soap session |
---|---|
Returns: | vCenter version |
oslo_vmware.vim_util.
propset_dict
(propset)¶Turn a propset list into a dictionary
PropSet is an optional attribute on ObjectContent objects that are returned by the VMware API.
You can read more about these at: | http://pubs.vmware.com/vsphere-51/index.jsp | #com.vmware.wssdk.apiref.doc/ | vmodl.query.PropertyCollector.ObjectContent.html
Parameters: | propset – a property “set” from ObjectContent |
---|---|
Returns: | dictionary representing property set |
oslo_vmware.vim_util.
register_extension
(vim, key, type, label='OpenStack', summary='OpenStack services', version='1.0')¶Create a new extention.
Parameters: |
|
---|
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.