When creating an alert, you have to specify the AlertDesc
instance.
According to the alerting mode (scheduled or real-time), the following fields are mandatory:
Field
|
Mandatory for
|
Example
|
NAME
|
Scheduled Real-time
|
-
|
USERNAME
|
Scheduled Real-time
|
-
|
GROUP
|
Scheduled Real-time
|
When using several groups, use commas as separators. For example,
'group1, group2'
|
QUERY_ARGS
|
Scheduled Real-time
|
For the query london flat refined on file
extension, language and source: 'cloudview.r=f%2FSource%2F4&cloudview.r=f%2FLanguage%2Fen&cloudview.r=%2Bf%2Ffile_extension%2F6&q=london%20flat&isDebugModeEnable=false&
lang=en'
|
PAGE
|
Scheduled
|
-
|
UI_LEVEL_QUERY_ARGS
|
Scheduled
|
For the query london flat refined on file
extension, language and source:
'cloudview.r=f%2FSource%2F4&cloudview.r=f%2FLanguage%2Fen&cloudview.r=%2Bf%2Ffile_extension%2F6&q=london%20flat'
|
The Description
field is optional.
Sample
import com.exalead.cloudview.alerting.v10.*;
.
.
AlertDesc alertDesc = new AlertDesc().withName(NAME).withUser(USERNAME).withGroup(GROUPS_SEPARATED_BY_COMMA)
.withQueryArgs(MASHUP_API_QUERY_ARGS);
alertDesc.withDescription(DESCRIPTION); // optional
alertDesc.withUiLevelQueryArgs(UI_LEVEL_QUERY_ARGS); // scheduled only, mandatory
alertDesc.withPage(PAGE); // scheduled only, mandatory
AddAlert mAMICmd = new AddAlert();
mAMICmd.withAlertDesc(alertDesc);
alertingManager.addAlert(mAMICmd);