HP Operations Manager for Windows

 

IOvPmdPolicyManager Interface Reference

Entry point for Policy Management. More...

import "pmad.idl";

Inheritance diagram for IOvPmdPolicyManager:

IOvPmdPolicyManager2 IOvPmdPolicyManager3 IOvPmdPolicyManager80 List of all members.

Public Types

enum   OVPMAD_INSTALLED { OVPMAD_INSTALLED_ALL = 0, OVPMAD_INSTALLED_ONLY = 1, OVPMAD_UNINSTALLED_ONLY = 2 }
enum   OVPMAD_ASSIGNED { OVPMAD_ASSIGNED_ALL = 0, OVPMAD_ASSIGNED_ONLY = 1, OVPMAD_UNASSIGNED_ONLY = 2 }

Public Member Functions

HRESULT  GetTopGroupList ([out, retval]SAFEARRAY(IDispatch *)*ppGroups)
HRESULT  GetPolicyGroup ([in]BSTR sGroupID,[out, retval]IOvPmdPolicyGroup **ppGroup)
HRESULT  GetPolicyGroupByName ([in]BSTR sGroupName,[out, retval]IOvPmdPolicyGroup **ppGroup)
HRESULT  GetPolicyTypeList ([out, retval]SAFEARRAY(IDispatch *)*ppPolTypes)
HRESULT  GetPolicyType ([in]BSTR sName,[in]BSTR sVersion,[out, retval]IOvPmdLogicalPolicyType **ppType)
HRESULT  GetPolicyTypeById ([in]BSTR sTypeID,[out, retval]IOvPmdLogicalPolicyType **ppType)
HRESULT  GetLogicalPolicyByInstanceId ([in]BSTR sInstanceID,[out, retval]IOvPmdLogicalPolicy **ppPolicy)
HRESULT  GetLogicalPolicyByLogicalId ([in]BSTR sLogicalID,[out, retval]IOvPmdLogicalPolicy **ppPolicy)
HRESULT  GetPackageList ([out, retval]SAFEARRAY(IDispatch *)*ppPackageList)
HRESULT  GetPackage ([in]BSTR sName,[in]BSTR sVersion,[out, retval]IOvPmdPackage **ppPackage)
HRESULT  GetPackageById ([in]BSTR sInstanceID,[out, retval]IOvPmdPackage **ppPackage)
HRESULT  GetJobList ([out, retval]SAFEARRAY(IDispatch *)*ppJobList)
HRESULT  GetJobScheduler ([out, retval]IDispatch **ppJobScheduler)
HRESULT  QueryNodes ([in] VARIANT_BOOL bWithPackages,[out, retval]SAFEARRAY(IDispatch *)*ppNodeList)
HRESULT  QueryLogicalPolicies ([in]IOvPmdLogicalPolicyType *pType,[in]BSTR sName,[in]BSTR sVersion,[in]BSTR sLogicalId,[in]BSTR sCreatedBy,[in]BSTR sInstanceId,[in]VARIANT_BOOL bAllVersions,[in]OVPMAD_INSTALLED eInstalled,[in]OVPMAD_ASSIGNED eAssigned,[out, retval]SAFEARRAY(IDispatch *)*ppPolicies)
HRESULT  ImportLogicalPolicyFromFile ([in]BSTR sPathName,[in]VARIANT_BOOL bForce,[out, retval]IOvPmdLogicalPolicy **ppPolicy)
HRESULT  ExportToFile ([in] BSTR sPathName)
HRESULT  ConnectDB (void)
HRESULT  DBConnected ([out, retval] VARIANT_BOOL *pbVal)
HRESULT  AddPolicyGroup ([in]BSTR sName,[in]BSTR sGroupID,[out, retval] IOvPmdPolicyGroup **ppGroup)
HRESULT  AddPolicyType ([in]BSTR sLogicalID,[in]BSTR sName,[in]BSTR sVersion,[in]BSTR sEditorClassId,[in]BSTR sPolProcessId,[in]BSTR sDescription,[in]VARIANT_BOOL bAllowsMultiplePolicies,[in]VARIANT_BOOL bAllowsMultiplePolicyVersions,[out, retval]IOvPmdLogicalPolicyType **ppType)
HRESULT  CreateNode ([in] BSTR sNodeID,[out, retval] IOvPmdNode **ppNode)
HRESULT  CVar ([in]SAFEARRAY(IDispatch *) pInArray,[out, retval] VARIANT *pOutVariant)

Detailed Description

The interface IOvPmdPolicyManager is the entry point to any other PMAD object. It provides access methods to these objects (for versioned objects, these methods return the highest version), as well as methods to query certain objects.
Since:
6.x

Member Enumeration Documentation

enum IOvPmdPolicyManager::OVPMAD_ASSIGNED
 

Enumeration used to query policies with their policy group assignment status as search criteria.

Since:
6.x
Enumerator:
OVPMAD_ASSIGNED_ALL  All policies.
OVPMAD_ASSIGNED_ONLY  Only policies that are assigned to a policy group.
OVPMAD_UNASSIGNED_ONLY  Only policies that are not assigned to a policy group.
enum IOvPmdPolicyManager::OVPMAD_INSTALLED
 

Enumeration used to query policies with the installation status as search criteria.

Since:
6.x
Enumerator:
OVPMAD_INSTALLED_ALL  All policies.
OVPMAD_INSTALLED_ONLY  Only policies that are installed on at least one managed node.
OVPMAD_UNINSTALLED_ONLY  Only policies that are not installed on any managed node.

Member Function Documentation

HRESULT IOvPmdPolicyManager::AddPolicyGroup [in] BSTR  sName,
[in] BSTR  sGroupID,
[out, retval] IOvPmdPolicyGroup **  ppGroup
 
Semantics:
Adds a new top-level policy group if it does not already exist.
Parameters:
sName  - Name of the new policy group.
sGroupID  - Unique ID (GUID as a string without brackets) for the new group. If a top-level group with the specified name already exists, this value is ignored. If an empty string is specified, a GUID is generated by PMAD itself.
ppGroup  - IOvPmdPolicyGroup interface pointer to the created group. If a top-level group with the specified name already exists, the interface of this group is returned with S_FALSE as a return value.
Possible errors:
A top-level group with the same name and a different ID (or vice versa) already exists
Database communication errors
Since:
6.x
HRESULT IOvPmdPolicyManager::ConnectDB void   ) 
 
Semantics:
This method creates the connection to the database, and initializes internal data structures. It must be called by each client before calling any other method of this interface. If PMAD is already connected, this operation does nothing.
Possible errors:
Database communication errors
Since:
6.x
HRESULT IOvPmdPolicyManager::CreateNode [in] BSTR  sNodeID,
[out, retval] IOvPmdNode **  ppNode
 
Semantics:
This method creates the PMAD node object in memory (if it is not yet there), and returns the interface pointer to this object. Before calling this method, the node has to be defined in the WMI model as an instance of OV_ManagedNode with the specified 'sNodeID' (GUID) as key. This is typically done by using the Node Editor UI or the corresponding WMI API. If the PMAD node object was already created in memory, the method simply returns the interface pointer to this existing node object. In this case, the method behaves like a typical get operation.
Parameters:
sNodeID  - ID (GUID with brackets) of the managed node. The length is 38 characters.
ppNode  - Interface pointer to the new node.
Possible errors:
Node not defined in WMI
WMI connection errors
Database communication errors
Since:
6.x
HRESULT IOvPmdPolicyManager::CVar [in] SAFEARRAY(IDispatch *)  pInArray,
[out, retval] VARIANT *  pOutVariant
 
Semantics:
This method converts all SAFEARRAYs returned by a PMAD method into VARIANTS. Calling this function is necessary if you want to access the data returned by PMAD interfaces in VB script. For example, to access the list of policy type versions returned by the method IOvPmdPolicyManager::GetPolicyTypeList(...), you need to write the following lines in VB script:

Dim pmad Set pmad = CreateObject("PMAD.OvPmdPolicyManager") pmad.ConnectDB Dim policyTypeList
policyTypeList = pmad.CVar(pmad.GetPolicyTypeList)
Parameters:
pInArray  - SAFEARRAY of IDispatch interface pointers.
pOutVariant  - VARIANT that contains a SAFEARRAY of VARIANTS containing IDispatch interface pointers.
Possible errors:
Since:
6.x
HRESULT IOvPmdPolicyManager::DBConnected [out, retval] VARIANT_BOOL *  pbVal  ) 
 
Semantics:
Property containing the DB connection status.
Parameters:
pbVal  - The connection status:
  • VARIANT_TRUE = connected to DB
  • VARIANT_FALSE = not connected to DB
Possible errors:
Database communication errors
Sample C++ call:
To get the DBConnected property from PMAD, you need to get the interface IOvPmdPolicyManager and perform a call:
VARIANT_BOOL variantIsConnected;
HRESULT hr = pIOvPmdPolicyManager->get_DBConnected(&variantIsConnected);
Since:
6.x
HRESULT IOvPmdPolicyManager::ExportToFile [in] BSTR  sPathName  ) 
 
Semantics:
Exports all policy versions that are available on the server to external files in the specified directory. In addition, a configuration file ("config.mm") containing the policy-to-policy group assignments is exported. It can be used by the command-line tool "ovpmutil" to upload the policies and policy groups again.
Parameters:
sPathName  - Name of the directory where the exported files are created.
Possible errors:
See IOvPmdLogicalPolicy::ExportToFile(...) for possible errors
Database communication errors
Since:
6.x
HRESULT IOvPmdPolicyManager::GetJobList [out, retval] SAFEARRAY(IDispatch *)*  ppJobList  ) 
 
Semantics:
Returns a list of IDispatch pointers to all job entries that are currently in the job queue.
Parameters:
ppJobList  - SAFEARRAY of IDispatch interface pointers to the deployment job entries. Use the method "IOvPmdPolicyManager::CVar(...)" to access the elements of the array within a VB script.
Possible errors:
Database communication errors
Since:
6.x
HRESULT IOvPmdPolicyManager::GetJobScheduler [out, retval] IDispatch **  ppJobScheduler  ) 
 
Semantic:
Returns the pointer to the one and only job scheduler object.
Parameters:
ppJobScheduler  - IDispatch pointer to the job scheduler object.
Possible errors:
Since:
6.x
HRESULT IOvPmdPolicyManager::GetLogicalPolicyByInstanceId [in] BSTR  sInstanceID,
[out, retval] IOvPmdLogicalPolicy **  ppPolicy
 
Semantics:
Returns the specified policy version.
Parameters:
sInstanceID  - Policy (instance) ID (GUID without brackets).
ppPolicy  - IOvPmdLogicalPolicy interface pointer to the specified policy version. If the policy version does not exist, S_FALSE is returned.
Possible errors:
Database communication errors
Policy version does not exist
Since:
6.x
HRESULT IOvPmdPolicyManager::GetLogicalPolicyByLogicalId [in] BSTR  sLogicalID,
[out, retval] IOvPmdLogicalPolicy **  ppPolicy
 
Semantics:
Returns the latest (highest) version of the specified policy.
Parameters:
sLogicalID  - Policy (logical) ID (GUID without brackets).
ppPolicy  - IOvPmdLogicalPolicy interface pointer to the latest (highest) version of the specified policy. If the policy does not exist, S_FALSE is returned.
Possible errors:
Database communication errors
Policy does not exist
Since:
6.x
HRESULT IOvPmdPolicyManager::GetPackage [in] BSTR  sName,
[in] BSTR  sVersion,
[out, retval] IOvPmdPackage **  ppPackage
 
Semantics:
Returns the deployment package version specified by its name and version string.
Parameters:
sName  - Name of the package.
sVersion  - Version string of the package (for example, "3.50.0" or "0003.0050.0000"). If null or empty, the method returns the latest version of the package.
ppPackage  - IOvPmdPackage interface pointer to the specified package version. If the package version does not exist, an error is returned.
Possible errors:
Database communication errors
Package version does not exist
Since:
6.x
HRESULT IOvPmdPolicyManager::GetPackageById [in] BSTR  sInstanceID,
[out, retval] IOvPmdPackage **  ppPackage
 
Semantics:
Returns a deployment package version specified by its package version (instance) ID.
Parameters:
sInstanceID  - Version (instance) ID (GUID without brackets) of the package version.
ppPackage  - IOvPmdPackage interface pointer to the specified package version. If the package version does not exist, an error is returned.
Possible errors:
Database communication errors
Package version does not exist
Since:
6.x
HRESULT IOvPmdPolicyManager::GetPolicyGroup [in] BSTR  sGroupID,
[out, retval] IOvPmdPolicyGroup **  ppGroup
 
Semantics:
Return a policy group that is specified by its unique identifier (GUID).
Parameters:
sGroupID  - The ID of the policy group (GUID without brackets as a string).
ppGroup  - IOvPmdPolicyGroup interface pointer to the specified policy group. If the group does not exist, S_FALSE is returned.
Possible errors:
Database communication errors
Policy group does not exist
Since:
6.x
HRESULT IOvPmdPolicyManager::GetPolicyGroupByName [in] BSTR  sGroupName,
[out, retval] IOvPmdPolicyGroup **  ppGroup
 
Semantics:
Return a policy group specified by its name, which is not contained in any other group (top-level policy groups only).
Parameters:
sGroupName  - Name of the policy group.
ppGroup  - IOvPmdPolicyGroup interface pointer to the specified top-level policy group. If the policy group does not exist, S_FALSE is returned.
Possible errors:
Database communication errors
Policy group does not exist
Since:
6.x
HRESULT IOvPmdPolicyManager::GetPolicyType [in] BSTR  sName,
[in] BSTR  sVersion,
[out, retval] IOvPmdLogicalPolicyType **  ppType
 
Semantics:
Returns a policy type version specified by its name and version string.
Parameters:
sName  - Name of the type.
sVersion  - Version string of the policy type (for example, "3" or "0003"). If it is empty, the method returns the latest version of the policy type. However, if the version number is specified, the method returns this version or a higher one if the specified version does not exist.
ppType  - IOvPmdLogicalPolicyType interface pointer to the specified policy type version. If the policy type does not exist, S_FALSE is returned.
Possible errors:
Database communication errors
Policy type does not exist
Since:
6.x
HRESULT IOvPmdPolicyManager::GetPolicyTypeById [in] BSTR  sTypeID,
[out, retval] IOvPmdLogicalPolicyType **  ppType
 
Semantics:
This method returns the latest available version of the policy type with the specified type (logical) ID.
Parameters:
sTypeID  - Policy type (logical) ID (GUID without brackets).
ppType  - IOvPmdLogicalPolicyType interface pointer to the latest available version of the policy type with the specified type (logical) ID. If the policy type does not exist, S_FALSE is returned.
Possible errors:
Database communication errors
Policy type does not exist
Since:
6.x
HRESULT IOvPmdPolicyManager::GetPolicyTypeList [out, retval] SAFEARRAY(IDispatch *)*  ppPolTypes  ) 
 
Semantics:
Return the latest (highest) version of all policy types.
Parameters:
ppPolTypes  - SAFEARRAY of IDispatch interface pointers to the policy type versions. Use the method "IOvPmdPolicyManager::CVar(...)" to access the elements of the array within a VB script.
Possible errors:
Database communication errors
Since:
6.x
HRESULT IOvPmdPolicyManager::GetTopGroupList [out, retval] SAFEARRAY(IDispatch *)*  ppGroups  ) 
 
Semantics:
Return the list of all top-level policy groups (that is, policy groups that are not contained in other groups).
Parameters:
ppGroups  - SAFEARRAY of IDispatch interface pointers to the top-level policy groups. Use the method "IOvPmdPolicyManager::CVar(...)" to access the elements of the array within a VB script.
Possible errors:
Database communication errors
Since:
6.x
HRESULT IOvPmdPolicyManager::QueryLogicalPolicies [in] IOvPmdLogicalPolicyType pType,
[in] BSTR  sName,
[in] BSTR  sVersion,
[in] BSTR  sLogicalId,
[in] BSTR  sCreatedBy,
[in] BSTR  sInstanceId,
[in] VARIANT_BOOL  bAllVersions,
[in] OVPMAD_INSTALLED  eInstalled,
[in] OVPMAD_ASSIGNED  eAssigned,
[out, retval] SAFEARRAY(IDispatch *)*  ppPolicies
 
Semantics:
Returns an array of policy versions for which the specified attribute values match.
Parameters:
pType  - If not NULL, all returned policy versions belong to the specified policy type.
sName  - If not empty, all returned policy versions have the specified name.
sVersion  - If not empty, all returned policy versions have the specified version.
sLogicalId  - If not empty, all returned policies have the specified policy (logical) ID.
sCreatedBy  - If not empty, all returned policies have been created by the specified user.
sInstanceId  - If not empty, the specified policy version (by its instance ID) is returned.
bAllVersions  - If VARIANT_FALSE, only the latest version of all policies is returned.
eInstalled  - If the value is OVPMAD_INSTALLED_ONLY, only policy versions that are installed on at least one managed node are returned. If the value is OVPMAD_UNINSTALLED_ONLY, only policy versions that are not installed on any managed node node are returned.
eAssigned  - If the value is OVPMAD_ASSIGNED_ONLY, only policy versions that are assigned to at least one policy group are returned. If the value is OVPMAD_UNASSIGNED_ONLY, only policy versions that are not assigned to any policy group are returned.
ppPolicies  - SAFEARRAY of IDispatch interface pointers to all policy versions matching the specified criteria. Use the method "IOvPmdPolicyManager::CVar(...)" to access the elements of the array within a VB script.
Possible errors:
Database communication errors
Since:
6.x
HRESULT IOvPmdPolicyManager::QueryNodes [in] VARIANT_BOOL  bWithPackages,
[out, retval] SAFEARRAY(IDispatch *)*  ppNodeList
 
Semantics:
Returns an array of nodes objects.
Parameters:
bWithPackages  - If VARIANT_TRUE, only the nodes on which at least one package has been installed are returned. If VARIANT_TRUE, the method returns those nodes on which no package is installed.
ppNodeList  - SAFEARRAY of IDispatch interface pointers to the nodes that match the specified criteria. Use the method "IOvPmdPolicyManager::CVar(...)" to access the elements of the array within a VB script.
Possible errors:
Database communication errors
Since:
6.x