This operation creates an alert.
Request
Syntax
Send the request using either XML or JSON:
-
XML
POST <webservice>/AlertRule HTTP/1.1 Host: <host name> Accept: application/xml Authtoken: <authentication token> Content-type: application/xml <create_alerts.xml>
-
JSON
POST <webservice>/AlertRule HTTP/1.1 Host: <host name> Accept: application/json Authtoken: <authentication token> Content-type: application/json <create_alerts.json>
where <webservice> is the root path used to route the API requests to the Web Server.
For more information, see Available Web Services for REST API.
Request Headers
Name |
Description |
---|---|
Host |
The host name of the Web Server or Web Console used in the API request. |
Accept |
The format of the response. Valid values are: application/xml or application/json. |
Authtoken |
The authentication token received after successfully logging on. For details on receiving an authentication token, see Authentication. |
Content-type |
The media type contained in the request body. |
Request Body
Download the XML or JSON file required for this request: create_alerts.xml or create_alerts.json. The following table displays the parameters for the request body.
Parameter |
Description |
Element |
Parent Element |
|||
---|---|---|---|---|---|---|
alertSeverity |
The alert severity. Valid values are:
|
alertDetail |
CVGui_AlertRuleCreateReq |
|||
alertType |
The alert type. Valid values are:
|
alertDetail |
CVGui_AlertRuleCreateReq |
|||
senderDisplayName |
The display name of the sender of the alert. |
alertDetail |
CVGui_AlertRuleCreateReq |
|||
senderEmailId |
The email address of the sender of the alert. |
alertDetail |
CVGui_AlertRuleCreateReq |
|||
_type_ |
The type of entity to associate with the alert. Use the _type_ parameter to associate a group of entities or individual entities. For example,
To associate all entities of a specific type, the valid values are:
|
associations |
CVGui_CommCellTreeNode |
|||
ID of the entity |
The system-generated ID of the entity in the _type_ parameter in the <associations> element. For example, if _type_="3", then the clientId parameter is included in the <associations> element: |
associations |
CVGui_CommCellTreeNode |
|||
Name of the entity |
The name of the entity in the _type_ parameter in the <associations> element. For example, if _type_="3", then the clientName parameter is included in the <associations> element: |
associations |
CVGui_CommCellTreeNode |
|||
exclude |
The option to exclude the entity defined in the <associations> element. In the following example, all clients except client001 are associated with the alert:
Valid value is 1. If there are no entities to exclude, remove the <flag> element from the XML. |
flags |
associations |
|||
alertName |
The name of the alert. |
alertrule |
alertDetail |
|||
_type_ |
Valid value is 79 when the applicationId parameter is used, for example:
|
appTypeFilter |
appTypeFilterList |
|||
applicationId |
This parameter is available for alert types that can be associated with agents. Filters the entities in the <associations> element. Valid values are:
|
appTypeFilter |
appTypeFilterList |
|||
_type_ |
Valid value is 78 when the appGroupId parameter is used, for example:
|
appTypeFilter |
appTypeFilterList |
|||
appGroupId |
This parameter is available for alert types that can be associated with agents. Filters the entities in the <associations> element. Some agent types in the appGroupId parameter represent a group of agents. For example, Valid values are: Database
|
appTypeFilter |
appTypeFilterList |
|||
criteria |
The alert criteria. Valid values are:
|
criteria |
alertDetail |
|||
unit |
The measurement unit of the alert criteria.
|
paramsList |
criteria |
|||
type |
The data type of the alert criteria, which is always the integer data type. The valid value is 1. |
paramsList |
criteria |
|||
value |
The value of n in the alert criteria. |
paramsList |
criteria |
|||
paramIndex |
The index or location of the |
paramsList |
criteria |
|||
localeID |
The destination of the alert notification. |
locale |
alertDetail |
|||
val |
The notification type for the alert. To add more than one notification type, open the .xml file and add the <notifType> node for each notification type, for example:
Valid values are:
|
notifType |
alertDetail |
|||
cmdPath |
The file path to the command processor executable file. |
runCommand (optional) |
alertDetail |
|||
arguments |
The argument values. Add quotation marks around each value to resolve potential white space issues, for example: "<DETECTED CRITERIA>" See Available Alert Tokens for a list of tokens or arguments. |
runCommand (optional) |
alertDetail |
|||
userName |
The userName of the user who has permissions to modify the alert. |
credentials |
runCommand (optional) |
|||
password |
The password of the user who has permissions to modify the alert. |
credentials |
runCommand (optional) |
|||
domainName |
The domain name of the user who has permissions to modify the alert. |
credentials |
runCommand (optional) |
|||
_type_ |
Valid value is 15. |
userGroupList |
userGroupList |
|||
userGroupName |
The name of the user group that receives the alert notification. |
userGroupList |
alertDetail |
|||
userGroupId |
The system-generated ID assigned to the user group. |
userGroupList |
userGroupList |
|||
_type_ |
Valid value is 13. |
userList |
userList |
|||
userName |
The name of the user who receives the alert notification. |
userList |
userList |
|||
userId |
The system-generated ID assigned to the user. |
userList |
userList |
|||
val |
The email address of the user who receives the alert notification. This user does not have a user ID in the CommServe database. |
nonGalaxyUserList |
regNonGalaxyUserList |
|||
val |
The email address of the user who receives email notifications when the alert is escalated. This user does not have a user ID in the CommServe database. |
nonGalaxyUserList |
EscNonGalaxyUserList |
|||
nonGalaxyUser |
The email address of the user. This user email address is the Cc or Bcc recipient. This user does not have a user ID in the CommServe database. |
nonGalaxyUserList |
nonGalaxyList |
|||
escalationLevel |
The option to indicate if the Cc or Bcc user email addresses are added to the regular alert notification or the escalated alert notification. These users do not have user IDs in the CommServe database. Valid values are:
|
nonGalaxyUserList |
nonGalaxyList |
|||
recipientType |
The option to add the user email address as the Cc or Bcc recipient. These users do not have user IDs in the CommServe database. Valid values are:
|
nonGalaxyUserList |
nonGalaxyList |
|||
persistTimeSeconds |
regularOption |
alertDetail |
||||
delayTimeSeconds |
regularOption |
alertDetail |
||||
reportingOptions |
The option to set notification criteria. Valid values are:
|
regularOption |
alertDetail |
|||
escalationSeverity |
The severity of the alert. Valid values are:
|
escalationSeverity |
alertDetail |
Response
Response Parameters
Parameter |
Description |
Element |
---|---|---|
errorCode |
The possible error codes. Valid values are:
|
CVGui_GenericResp |
errorMessage |
The description of the error code. Not all error codes have an error message. |
CVGui_GenericResp |
Examples
Sample Request
POST <webservice>/AlertRule HTTP/1.1
Host: client.mydomain.com
Accept: application/xml
Authtoken: QSDK 38568012f4d1e8ee1841d283a47aa3ba78e124ea58354b5fc6
0f4dab8a63347d05cf5552484dafda3bfa4c5db84e580b1cb37bcf8e65b39f7f
8549a443e6f78a2c7be3f31b3d845e24776c835e498e8e883bb40c46bd15af4f
40ca94e823acedcdd4e9659e74b34a07a85c4586cd2ed914b6dce015874783ef7
68fda78183a4208930954a377f66eb56c8b92cexampl4s437a19317ca6ce7f323
3d5a01aca35dbad93468b833f2cf71010809006a937670adce711ca8be46638e8
Content-type: application/xml
<CVGui_AlertRuleCreateReq>
<alertDetail alertSeverity="0" alertType="10" senderDisplayName="John Doe" senderEmailId="jdoe@example.com" notifTypeListOperationType="0">
<EntityList associationsOperationType="0">
<associations _type_="28" clientGroupId="3" clientGroupName="basic"/>
</EntityList>
<EscUserGroupList userGroupListOperationType="0"/>
<EscUserList userListOperationType="0"/>
<EscnonGalaxyUserList nonGalaxyUserOperationType="0"/>
<alertrule _type_="64" alertId="" alertName="failed attempts alert"/>
<criteria criteria="2"/>
<locale localeID="0"/>
<nonGalaxyUserList nonGalaxyUserOperationType="0"/>
<notifType val="1"/>
<notifType val="8192"/>
<userGroupList userGroupListOperationType="0">
<userGroupList _type_="15" userGroupId="1" userGroupName="master"/>
</userGroupList>
<userList userListOperationType="0">
<userList _type_="13" userId="3" userName="jdoe"/>
</userList>
</alertDetail>
</CVGui_AlertRuleCreateReq>
Sample Response
This is the response when the alert is created.
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<CVGui_AlertCreateResp alertId="49"/>
This is the response when the alert is not created.
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<CVGui_GenericResp errorCode="720902" errorMessage="Error controlling alert system for CommCell."/>