Module Expr Str Import alias Import alias Import alias identifier Import alias identifier Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str Str Num NameLoad NameLoad NameLoad Num body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad Assign NameStore BinOpAdd NameLoad Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Str attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Str decorator_list FunctionDef arguments args NameParam defaults body Return Str decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Assign AttributeStore NameLoad attr Str Assign NameStore ListLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad For NameStore Call NameLoad NameLoad body If CompareEq AttributeLoad NameLoad attr NameLoad body Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Dict Str Str NameLoad NameLoad Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Dict Str Str NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore NameLoad For NameStore NameLoad body If CompareIn AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot NameLoad body Return Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore SubscriptLoad NameLoad Index Num If CompareGtE Call NameLoad NameLoad Num body Assign NameStore BinOpMod Str TupleLoad NameLoad SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str NameLoad Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad Return Assign NameStore Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str Return Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad If NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad Return NameLoad decorator_list
N/A N/A 
VMware PBM service client and PBM related utility methods

PBM is used for policy based placement in VMware datastores.
Refer http://goo.gl/GR2o6U for more details.
 N/A logging N/A os N/A six.moves.urllib.parse urlparse N/A six.moves.urllib.request urllib N/A suds.sax.element element oslo_vmware._i18n _LW oslo_vmware service oslo_vmware vim_util N/A SERVICE_TYPE PbmServiceInstance N/A LOG N/A N/A logging getLogger __name__ Pbm N/A N/A service Service N/A N/A Service class that provides access to the Storage Policy API. __init__ N/A N/A self protocol host port wsdl_url cacert insecure pool_maxsize N/A https localhost 443 None None True 10 N/A N/A Constructs a PBM service client object.

        :param protocol: http or https
        :param host: server IP address or host name
        :param port: port for connection
        :param wsdl_url: PBM WSDL url
        :param cacert: Specify a CA bundle file to use in verifying a
                       TLS (https) server certificate.
        :param insecure: Verify HTTPS connections using system certificates,
                         used only if cacert is not specified
        :param pool_maxsize: Maximum number of connections in http
                             connection pool
         N/A base_url N/A N/A N/A service Service build_base_url protocol host port N/A soap_url N/A base_url /pbm N/A N/A N/A N/A super Pbm self __init__ wsdl_url soap_url cacert insecure pool_maxsize N/A set_soap_cookie N/A N/A self cookie N/A N/A N/A Set the specified vCenter session cookie in the SOAP header

        :param cookie: cookie to set
         N/A elem N/A N/A N/A N/A element Element vcSessionCookie setText cookie N/A N/A N/A N/A self client set_options soapheaders elem N/A retrieve_service_content N/A N/A self N/A N/A N/A ref N/A N/A vim_util get_moref N/A service SERVICE_INSTANCE SERVICE_TYPE N/A N/A N/A self PbmRetrieveServiceContent ref N/A __repr__ N/A N/A self N/A N/A N/A PBM Object N/A __str__ N/A N/A self N/A N/A N/A PBM Object N/A N/A get_all_profiles N/A N/A session N/A N/A N/A Get all the profiles defined in VC server.

    :returns: PbmProfile data objects
    :raises: VimException, VimFaultException, VimAttributeException,
             VimSessionOverLoadException, VimConnectionException
     N/A N/A N/A LOG debug Fetching all the profiles defined in VC server. N/A pbm N/A session pbm N/A profile_manager N/A N/A pbm service_content profileManager N/A res_type N/A N/A N/A N/A pbm client factory create ns0:PbmProfileResourceType N/A N/A res_type resourceType STORAGE N/A profiles N/A N/A profile_ids N/A N/A session invoke_api pbm PbmQueryProfile profile_manager resourceType res_type N/A N/A N/A LOG debug Fetched profile IDs: %s. profile_ids N/A profile_ids N/A N/A profiles N/A N/A session invoke_api pbm PbmRetrieveContent profile_manager profileIds profile_ids N/A profiles N/A get_profile_id_by_name N/A N/A session profile_name N/A N/A N/A Get the profile UUID corresponding to the given profile name.

    :param profile_name: profile name whose UUID needs to be retrieved
    :returns: profile UUID string or None if profile not found
    :raises: VimException, VimFaultException, VimAttributeException,
             VimSessionOverLoadException, VimConnectionException
     N/A N/A N/A LOG debug Retrieving profile ID for profile: %s. profile_name N/A profile N/A get_all_profiles session N/A N/A N/A N/A profile name profile_name N/A N/A profile_id N/A profile profileId N/A N/A N/A LOG debug Retrieved profile ID: %(id)s for profile: %(name)s. N/A id name profile_id profile_name N/A profile_id N/A None N/A filter_hubs_by_profile N/A N/A session hubs profile_id N/A N/A N/A Filter and return hubs that match the given profile.

    :param hubs: PbmPlacementHub morefs
    :param profile_id: profile ID
    :returns: subset of hubs that match the given profile
    :raises: VimException, VimFaultException, VimAttributeException,
             VimSessionOverLoadException, VimConnectionException
     N/A N/A N/A LOG debug Filtering hubs: %(hubs)s that match profile: %(profile)s. N/A hubs profile hubs profile_id N/A pbm N/A session pbm N/A placement_solver N/A N/A pbm service_content placementSolver N/A filtered_hubs N/A N/A session invoke_api pbm PbmQueryMatchingHub placement_solver hubsToSearch hubs profile profile_id N/A N/A N/A LOG debug Filtered hubs: %s filtered_hubs N/A filtered_hubs N/A convert_datastores_to_hubs N/A N/A pbm_client_factory datastores N/A N/A N/A Convert given datastore morefs to PbmPlacementHub morefs.

    :param pbm_client_factory: Factory to create PBM API input specs
    :param datastores: list of datastore morefs
    :returns: list of PbmPlacementHub morefs
     N/A hubs N/A N/A ds datastores N/A N/A hub N/A N/A pbm_client_factory create ns0:PbmPlacementHub N/A N/A hub hubId N/A ds value N/A N/A hub hubType Datastore N/A N/A N/A hubs append hub N/A hubs N/A filter_datastores_by_hubs N/A N/A hubs datastores N/A N/A N/A Get filtered subset of datastores corresponding to the given hub list.

    :param hubs: list of PbmPlacementHub morefs
    :param datastores: all candidate datastores
    :returns: subset of datastores corresponding to the given hub list
     N/A filtered_dss N/A N/A hub_ids N/A N/A hub hubId N/A hub hubs N/A ds datastores N/A N/A N/A N/A ds value hub_ids N/A N/A N/A N/A filtered_dss append ds N/A filtered_dss N/A get_pbm_wsdl_location N/A N/A vc_version N/A N/A N/A Return PBM WSDL file location corresponding to VC version.

    :param vc_version: a dot-separated version string. For example, "1.2".
    :return: the pbm wsdl file location.
     N/A N/A vc_version N/A N/A N/A ver N/A N/A vc_version split . N/A major_minor N/A ver N/A 0 N/A N/A N/A len ver 2 N/A N/A major_minor N/A %s.%s N/A major_minor N/A ver N/A 1 N/A curr_dir N/A N/A N/A os path abspath N/A N/A N/A os path dirname __file__ N/A pbm_service_wsdl N/A N/A N/A os path join curr_dir wsdl major_minor pbmService.wsdl N/A N/A N/A N/A N/A os path exists pbm_service_wsdl N/A N/A N/A N/A LOG warning N/A _LW PBM WSDL file %s not found. pbm_service_wsdl N/A N/A pbm_wsdl N/A N/A urlparse urljoin file: N/A N/A urllib pathname2url pbm_service_wsdl N/A N/A N/A LOG debug Using PBM WSDL location: %s. pbm_wsdl N/A pbm_wsdl N/A get_profiles N/A N/A session vm N/A N/A N/A Query storage profiles associated with the given vm.

    :param session: VMwareAPISession instance
    :param vm: vm reference
    :return: profile IDs
     N/A pbm N/A session pbm N/A profile_manager N/A N/A pbm service_content profileManager N/A object_ref N/A N/A N/A N/A pbm client factory create ns0:PbmServerObjectRef N/A N/A object_ref key N/A vm value N/A N/A object_ref objectType virtualMachine N/A N/A N/A session invoke_api pbm PbmQueryAssociatedProfile profile_manager entity object_ref N/A get_profiles_by_ids N/A N/A session profile_ids N/A N/A N/A Get storage profiles by IDs.

    :param session: VMwareAPISession instance
    :param profile_ids: profile IDs
    :return: profile objects
     N/A profiles N/A N/A profile_ids N/A N/A pbm N/A session pbm N/A profile_manager N/A N/A pbm service_content profileManager N/A profiles N/A N/A session invoke_api pbm PbmRetrieveContent profile_manager profileIds profile_ids N/A profiles N/A