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 argument

API parameter

Description

Required?

--servicename
service_name

Name of the service for which the new health policy rule will be created.

Yes

--rulename
rule_name

Name of the service health policy rule to be created.

Yes

--interval
interval

Time to wait, in minutes, before triggering actions in succession.

Yes

--when
when

Define a condition to trigger actions defined in the policy rule. For example, [{‘sensor’: ‘System CPU Utilization’, ‘condition’: ‘greater_than’, ‘duration’: 15, ‘value’: 80}]

Yes

--resourcesetname
resource_set_name

Name of the resource set in the service.

 

--match
match

Criteria for triggering actions. A value of all triggers actions if all rules match. A value of any triggers actions if any rule matches.

 

--actiontypename
action_type_name

Name of the action to be triggered.

 

--actionparam
action_param

Value for each parameter required for specified action type.

 

--notifyto
notify_to

Email address in the To field for notification actions.

 

--notifycc
notify_cc

Email address in the CC field for notification actions.

 

--notifybcc
notify_bcc

Email address in the BCC field for notification actions.

 

--notifysubject
notify_subject

Text to include in the subject line of the email for notification actions.

 

--notifybody
notify_body

Text 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.

 

 

gcac

GenericCloudAPIClient 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 argument

API parameter

Description

Required?

--service
service

Name or GUID of the service.

Yes

--rule
rule

Name 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.

 

 

gcac

GenericCloudAPIClient 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 argument

API parameter

Description

Required?

--service
service

Name 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.

 

--filter
filters

Filter the output according to the specified criteria.

 

 

gcac

GenericCloudAPIClient 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 argument

API parameter

Description

Required?

--service
service

Name or GUID of the service.

Yes

--rule
rule

Name 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.

 

--disable
disable

Disable 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.

 

 

gcac

GenericCloudAPIClient instance/user authentication.

 

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*