Create an EMS notification
You can use the following workflow to create a new EMS notification destination to receive selected event messages.
Step 1: Configure the system-wide email settings
You can issue the following API call to configure the system-wide email settings.
This REST API call uses the following method and endpoint.
HTTP method | Path |
---|---|
PATCH |
/api/support/ems |
Synchronous
In addition to the parameters common with all REST API calls, the following parameters are also used in the curl examples for this step.
Parameter | Type | Required | Description |
---|---|---|---|
mail_from |
Query |
Yes |
Sets the |
mail_server |
Query |
Yes |
Configures the target SMTP mail server. |
curl --request PATCH \
--location "https://$FQDN_IP/api/support/ems?mail_from=administrator@mycompany.com&mail_server=mail@mycompany.com" \
--include \
--header "Accept: */*" \
--header "Authorization: Basic $BASIC_AUTH"
Step 2: Define a message filter
You can issue an API call to define a filter rule to match the messages.
This REST API call uses the following method and endpoint.
HTTP method | Path |
---|---|
POST |
/api/support/ems/filters |
Synchronous
In addition to the parameters common with all REST API calls, the following parameters are also used in the curl examples for this step.
Parameter | Type | Required | Description |
---|---|---|---|
Filter |
Body |
Yes |
Includes the values for the filter configuration. |
curl --request POST \
--location "https://$FQDN_IP/api/support/ems/filters" \
--include \
--header "Accept: */*" \
--header "Authorization: Basic $BASIC_AUTH" \
--data @JSONinput
{
"name": "test-filter",
"rules.type": ["include"],
"rules.message_criteria.severities": ["emergency"]
}
Step 3: Create a message destination
You can issue an API call to create a message destination.
This REST API call uses the following method and endpoint.
HTTP method | Path |
---|---|
POST |
/api/support/ems/destinations |
Synchronous
In addition to the parameters common with all REST API calls, the following parameters are also used in the curl examples for this step.
Parameter | Type | Required | Description |
---|---|---|---|
Destination configuration |
Body |
Yes |
Includes the values for the event destination. |
curl --request POST \
--location "https://$FQDN_IP/api/support/ems/destinations" \
--include \
--header "Accept: */*" \
--header "Authorization: Basic $BASIC_AUTH" \
--data @JSONinput
{
"name": "test-destination",
"type": "email",
"destination": "administrator@mycompany.com",
"filters.name": ["important-events"]
}