Create a deployment alert for the given conditions.
REQUIRED | KEY | TYPE | DESCRIPTION | ||||||
---|---|---|---|---|---|---|---|---|---|
Yes | deploymentId | str | Unique string identifier for the deployment. | ||||||
Yes | alertName | str | Name of the alert. | ||||||
Yes | conditionConfig | AlertConditionConfig |
Condition to run the actions for the alert.
|
||||||
Yes | actionConfig | AlertActionConfig |
Configuration for the action of the alert.
|
KEY | TYPE | DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
success | Boolean | true if the call succeeded, false if there was an error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
result | MonitorAlert |
|
TYPE | WHEN |
---|---|
DataNotFoundError |
|
curl
curl "https://api.abacus.ai/api/v0/createDeploymentAlert" \
-X POST \
-H "apiKey:**********c74043986d6087446810a1"
-d
'{
"deploymentId": "",
"alertName": "my_alert",
"conditionConfig": '{"alertType": "PredictionCount", "threshold": 0.3, "aggregation_window": "12h", "aggregation_type": "avg"}',
"actionConfig": '{"action_type":"Email", "email_recipients":[""]}',
}'
-H "Content-Type: application/json"
{
"result": {
"name": "my_alert",
"monitorAlertId": "3bbe4e3aa",
"createdAt": "2023-12-07T18:06:30+00:00",
"projectId": "effc1220e",
"conditionConfig": {"threshold": 0.3, "alert_type": "PredictionCount", "aggregation_type": "avg", "aggregation_window": "12h"},
"actionConfig": {"action_type": "Email", "email_recipients": [""]},
"conditionDescription": "Deployment predition count has changed too much.",
"actionDescription": "Email: ['']",
"alertType": "PredictionCount",
"deploymentId": "61c198940"
},
"success": true
}
python
client.create_deployment_alert(deployment_id='', alert_name='my_alert',
condition_config={"threshold": 0.3, "alert_type": "PredictionCount", "aggregation_type": "avg", "aggregation_window": "12h"},
action_config={"action_type": "Email", "email_recipients": [""]})
MonitorAlert(
name='my_alert',
monitor_alert_id='de1679e08',
created_at='2024-07-17T06:49:28+00:00',
project_id='c9eb15741',
condition_config={'threshold': 0.3, 'alert_type': 'PredictionCount', 'aggregation_type': 'avg', 'aggregation_window': '12h'},
action_config={'action_type': 'Email', 'email_recipients': ['']},
condition_description='Deployment predition count has changed too much.',
action_description="Email: ['']",
alert_type='PredictionCount',
deployment_id='83404f41'
)