Unsupported content

 

This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

health-policy-rule

This topic describes the verbs, command-line arguments, and API parameters available for the health-policy-rule noun in the BMC Cloud Lifecycle Management SDK.

create

Use health-policy-rule-create from the command line to create a service health policy rule.

Command-line syntax
clm health-policy-rule-create [-h] [--waitfor TIME_OUT_SECONDS] --servicename NAME --rulename NAME --interval NUMBER --when SENSOR=NAME,CONDITION=<GREATER_THAN|GREATER_THAN_OR_EQUAL|LESS_THAN|LESS_THAN_OR_EQUAL|EQUAL>,
VALUE=THRESHOLD_VALUE,DURATION=TIME_IN_SECONDS [SENSOR=NAME,CONDITION=<GREATER_THAN|GREATER_THAN_OR_EQUAL|LESS_THAN|LESS_THAN_OR_EQUAL|EQUAL>,
VALUE=THRESHOLD_VALUE,DURATION=TIME_IN_SECONDS ...] [--resourcesetname NAME] [--match ALL|ANY] [--actiontypename NAME] [--actionparam NAME] [--notifyto EMAIL_ADDRESS [EMAIL_ADDRESS ...]] [--notifycc EMAIL_ADDRESS [EMAIL_ADDRESS ...]] [--notifybcc EMAIL_ADDRESS [EMAIL_ADDRESS ...]] [--notifysubject TEXT_CONTENT] [--notifybody TEXT_CONTENT]

Use health_policy_rule_create in the API to create a service health policy rule. This command returns an  OpsManager API object with the same attributes and relationships.

API syntax
obj = health_policy_rule_create(gcac, service_name=None, resource_set_name=None, rule_name=None, interval=None, when=None, match=None, notify_to=None, notify_cc=None, notify_bcc=None, notify_subject=None, notify_body=None, action_type_name=None, action_param=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--servicenameservice_nameName of the service for which the new health policy rule will be created.Yes
--rulenamerule_nameName of the service health policy rule to be created.Yes
--intervalintervalTime to wait, in minutes, before triggering actions in succession.Yes
--whenwhenDefine a condition to trigger actions defined in the policy rule. For example, [{‘sensor’: ‘System CPU Utilization’, ‘condition’: ‘greater_than’, ‘duration’: 15, ‘value’: 80}]Yes
--resourcesetnameresource_set_nameName of the resource set in the service. 
--matchmatchCriteria for triggering actions. A value of all triggers actions if all rules match. A value of any triggers actions if any rule matches. 
--actiontypenameaction_type_nameName of the action to be triggered. 
--actionparamaction_paramValue for each parameter required for specified action type. 
--notifytonotify_toEmail address in the To field for notification actions. 
--notifyccnotify_ccEmail address in the CC field for notification actions. 
--notifybccnotify_bccEmail address in the BCC field for notification actions. 
--notifysubjectnotify_subjectText to include in the subject line of the email for notification actions. 
--notifybodynotify_bodyText to include in the body of the email for notification actions. 
--waitfor 

Time in seconds to wait for a response from the server, otherwise return running task details.

 
 gcacGenericCloudAPIClient instance/user authentication. 

delete

Use health-policy-rule-delete from the command line to delete the specified service health policy rule.

Command-line syntax
clm health-policy-rule-delete [-h] [--waitfor TIME_OUT_SECONDS] --service NAME|id:<GUID> --rule NAME|id:<GUID>

Use health_policy_rule_delete in the API to delete the specified service health policy rule. This command returns an OpsManager API object with the same attributes and relationships.

API syntax
obj = health_policy_rule_delete(gcac, service=None, rule=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--serviceserviceName or GUID of the service.Yes
--ruleruleName or GUID of the service health policy rule to delete.Yes
--waitfor 

Time in seconds to wait for a response from the server, otherwise return running task details.

 
 gcacGenericCloudAPIClient instance/user authentication. 

list

Use health-policy-rule-list from the command line to list available service health policy rules for the specified service.

Command-line syntax
clm health-policy-rule-list [-h] [-l] [-u] [-n] [-s] [-k FIELD_NAME [FIELD_NAME ...]] [--filter FIELD_NAME=VALUE [FIELD_NAME=VALUE ...]] --service NAME

Use health_policy_rule_list in the API to list available service health policy rules for the specified service. This command returns a list of PolicyRule API objects with the same attributes and relationships.

API syntax
obj = health_policy_rule_list(gcac, service=None, filters=None)

obj[n].guid returns the GUID
obj[n].name returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--serviceserviceName or GUID of the service for which to list service health policy rules.Yes
-l List all fields. This parameter does not need a value. 
-u List only GUIDs. This parameter does not need a value. 
-n List only names. This parameter does not need a value. 
-s List GUIDs, names, and status (if applicable). This parameter does not need a value. 
-k List the field names specified in the value for this parameter. 
--filterfiltersFilter the output according to the specified criteria. 
 gcacGenericCloudAPIClient instance/user authentication. 

update

Use health-policy-rule-update from the command line to enable or disable the specified service health policy rule.

Command-line syntax
clm health-policy-rule-update [-h] [--waitfor TIME_OUT_SECONDS] --service NAME|id:<GUID> --rule NAME|id:<GUID> [--enable | --disable]

Use health_policy_rule_update in the API to enable or disable the specified service health policy rule. This command returns an OpsManager API object with the same attributes and relationships.

API syntax
obj = health_policy_rule_update(gcac, service=None, rule=None, enable=None disable=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--serviceserviceName or GUID of the service.Yes
--ruleruleName or GUID of the service health policy rule to update.Yes
--enable enable

Enable the service health policy rule. This parameter does not need a value for the command line. For the API, specify true, false, or None.

 
--disabledisableDisable the service health policy rule. This parameter does not need a value for the command line. For the API, specify true, false, or None. 
--waitfor 

Time in seconds to wait for a response from the server, otherwise return running task details.

 
 gcacGenericCloudAPIClient instance/user authentication. 

This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

Comments