HP Operations Manager for Windows

OV_CalculationRule::Create()
OV_CalculationRule::Create_Trans()


OV_CalculationRule Create(
[in] string Caption,
[in] uint16 CalculationType,
[in] uint16 CalculationThresholdType,
[in, optional] uint16 SingleSetTo,
[in, optional] real32 SingleThreshold,
[in, optional] uint16 CriticalSetTo,
[in, optional] real32 CriticalThreshold,
[in, optional] uint16 MajorSetTo,
[in, optional] real32 MajorThreshold,
[in, optional] uint16 MinorSetTo,
[in, optional] real32 MinorThreshold,
[in, optional] uint16 WarningSetTo,
[in, optional] real32 WarningThreshold,
[in, optional] uint16 NormalSetTo,
[in, optional] real32 NormalThreshold,
[in, optional] string SettingID,
[in, optional] string Description)
OV_CalculationRule Create_Trans(
[in] string TransId,
[in] string Caption,
[in] uint16 CalculationType,
[in] uint16 CalculationThresholdType,
[in, optional] uint16 SingleSetTo,
[in, optional] real32 SingleThreshold,
[in, optional] uint16 CriticalSetTo,
[in, optional] real32 CriticalThreshold,
[in, optional] uint16 MajorSetTo,
[in, optional] real32 MajorThreshold,
[in, optional] uint16 MinorSetTo,
[in, optional] real32 MinorThreshold,
[in, optional] uint16 WarningSetTo,
[in, optional] real32 WarningThreshold,
[in, optional] uint16 NormalSetTo,
[in, optional] real32 NormalThreshold,
[in, optional] string SettingID,
[in, optional] string Description)

Parameters

TransId
Transaction ID returned from OV_Transaction::Start().
Caption
The Caption property of the instance of OV_CalculationRule to be created. If a calculation rule with the same Caption already exists, nothing happens, and the method fails with MDLAPI_E_CALCRULE_CAPTION_EXIST. If the Caption parameter is an empty string, or contains invalid characters or has more then 1024 characters, the method fails with MDLAPI_E_INVALID_CAPTION.
CalculationType
The CalculationType property of the instance of OV_CalculationRule to be created. Possible values for calculation type are: 0 (calculation_none) 1 (calculation_most_critical) 2 (calculation_single_threshold) 3 (calculation_multi_threshold)
CalculationThresholdType
The CalculationThresholdType property of the instance of OV_CalculationRule to be created. Possible values for the calculation threshold type are: 0 (threshold_not_applicable) 1 (threshold_by_number) 2 (threshold_by_percentage) If the CalculationType is 'none' or 'most_critical', the threshold type must be 'not_applicable'. If the threshold type is 'not_applicable', the values for single and multiple thresholds are undefined. If the threshold type is 'threshold_by_number', the values for single and multiple thresholds must be between the 1 and 1000. If the threshold type is 'by_percentage', the values for single and multiple thresholds must be between 0.1 and 1.0
SingleSetTo
The SingleSetTo property of the instance of OV_CalculationRule to be created. Possible values are: 0 (No SetTo Value) 1 (Unknown) 2 (Normal) 4 (Warning) 8 (Minor) 16 (Major) 32 (Critical) Optional parameter. Default is 0 - 'No ToSet Value'.
SingleThreshold
The SingleThreshold property of the instance of OV_CalculationRule to be created. Optional parameter. If the threshold type is 'threshold_by_number', the values for single and multiple thresholds must be between 1 and 1000. Default is 1. If the threshold type is 'by_percentage', the values for single and multiple thresholds must be between 0.1 and 1.0. Default is 0.66.
CriticalSetTo
The CriticalSetTo property of the instance of OV_CalculationRule to be created. Possible values are: 0 (No SetTo Value) 1 (Unknown) 2 (Normal) 4 (Warning) 8 (Minor) 16 (Major) 32 (Critical) Optional parameter. Default is 32 - 'Critical'.
CriticalThreshold
The CriticalThreshold property of the instance of OV_CalculationRule to be created. Optional parameter. If the threshold type is 'threshold_by_number', the values for single and multiple thresholds must be between the 1 and 1000. Default is 5. If the threshold type is 'by_percentage', the values for single and multiple thresholds must be between the 0.1 and 1.0. Default is 0.8.
MajorSetTo
The MajorSetTo property of the instance of OV_CalculationRule to be created. Possible values are: 0 (No SetTo Value) 1 (Unknown) 2 (Normal) 4 (Warning) 8 (Minor) 16 (Major) 32 (Critical) Optional parameter. Default is 16 - 'Major'.
MajorThreshold
The MajorThreshold property of the instance of OV_CalculationRule to be created. Optional parameter. If the threshold type is 'threshold_by_number', the values for single and multiple thresholds must be between the 1 and 1000. Default is 4. If the threshold type is 'by_percentage', the values for single and multiple thresholds must be between 0.1 and 1.0. Default is 0.66.
MinorSetTo
The MinorSetTo property of the instance of OV_CalculationRule to be created. Possible values are: 0 (No SetTo Value) 1 (Unknown) 2 (Normal) 4 (Warning) 8 (Minor) 16 (Major) 32 (Critical) Optional parameter. Default is 8 - 'Minor'.
MinorThreshold
The MinorThreshold property of the instance of OV_CalculationRule to be created. Optional parameter. If the threshold type is 'threshold_by_number', the values for single and multiple thresholds must be between 1 and 1000. Default is 3. If the threshold type is 'by_percentage', the values for single and multiple thresholds must be between 0.1 and 1.0. Default is 0.5.
WarningSetTo
The WarningSetTo property of the instance of OV_CalculationRule to be created. Possible values are: 0 (No SetTo Value) 1 (Unknown) 2 (Normal) 4 (Warning) 8 (Minor) 16 (Major) 32 (Critical) Optional parameter. Default is 4 - 'Warning'.
WarningThreshold
The WarningThreshold property of the instance of OV_CalculationRule to be created. Optional parameter. If the threshold type is 'threshold_by_number', the values for single and multiple thresholds must be between 1 and 1000. Default is 2. If the threshold type is 'by_percentage', the values for single and multiple thresholds must be between 0.1 and 1.0. Default is 0.4.
NormalSetTo
The NormalSetTo property of the instance of OV_CalculationRule to be created. Possible values are: 0 (No SetTo Value) 1 (Unknown) 2 (Normal) 4 (Warning) 8 (Minor) 16 (Major) 32 (Critical) Optional parameter. Default is 2 - 'Normal'.
NormalThreshold
The NormalThreshold property of the instance of OV_CalculationRule to be created. Optional parameter. If the threshold type is 'threshold_by_number', the values for single and multiple thresholds must be between 1 and 1000. Default is 1. If the threshold type is 'by_percentage', the values for single and multiple thresholds must be between 0.1 and 1.0. Default is 0.2.
SettingID
The SettingID property of an instance of the OV_CalculationRule to be created. Optional parameter. If you do not specify this parameter, or if it is equal to an empty string, it is created as a new GUID. If a calculation rule with the same SettingID already exists, nothing happens, and the method fails with MDLAPI_E_CALCRULE_SETTINGID_EXISTS.
Description
The Description property of the instance of OV_CalculationRule to be created. Optional parameter.

Calling Convention

These methods can be called from a WMI class or instance object.

Description

Creates a calculation rule (new instance of OV_CalculationRule).

If any calculation rule parameter is not valid, the method fails with MDLAPI_E_INVALID_PARAMETER.

Return Value

Instance of the newly created OV_CalculationRule.

Extended Status Codes

MDLAPI_E_INVALID_CAPTION
Specified object Caption parameter is not valid.
MDLAPI_E_CALCRULE_CAPTION_EXIST
Calculation rule with the same Caption already exists.
MDLAPI_E_INVALID_PARAMETER
Parameter is not valid.
MDLAPI_E_CALCRULE_SETTINGID_EXISTS
Calculation rule with the same SettingId already exists.
MDLAPI_E_TRANSACTION_NOT_EXIST
Transaction with the specified ID does not exist.