Alerts API - PUT an alert recipient

Applies to NAM 2019+

Updates the recipient specified by ID.

PUT
  • url https://{console-host}:{console-port}/cxf/api/v1/config/alerts/recipients/{id}

Parameters

Parameter Type Description In Required
id

Recipient ID.

path required

Response format

The AlertPublicRestErrorResponse object

Element Type Description
errorCode string
errorMessage string

The ScriptRecipient object

Element Type Description
id integer
enabled boolean
description string
executable string
parameters string
recipientType string
  • USER = email recipient
  • TRAP = SNMP trap recipient
  • MOBILE = Slack recipient
  • SCRIPT = Script recipient

The TrapRecipient object

Element Type Description
id integer
enabled boolean
host string
port integer
readCommunityName string
recipientType string
  • USER = email recipient
  • TRAP = SNMP trap recipient
  • MOBILE = Slack recipient
  • SCRIPT = Script recipient

Response codes

Code Description
200

Modified recipient.

400

The request was invalid.

Example

We used a POST https://address/cxf/api/v1/config/alerts/recipients/ request with an application/json payload to specify trap recipient as host 1.2.3.4, port 80, and recipientType TRAP, and enabled true.

{
  "enabled": true,
  "host": "1.2.3.4",
  "port": 80,
  "readCommunityName": "my-community-name",
  "recipientType": "TRAP"
}

The new recipient was assigned id 13, as we can see to a GET https://address/cxf/api/v1/config/alerts/recipients/ request to list all recipients.

To disable trap recipient 13, use the PUT https://address/cxf/api/v1/config/alerts/recipients/13 request with an application/json payload specifying that enabled is false.

{
  "enabled": false,
  "host": "1.2.3.4",
  "port": "80",
  "readCommunityName": "my-community-name",
  "recipientType": "TRAP"
}

If the request is successful, you will get a 200 response code and the Active switch for that trap recipient will be set to off in the NAM Console.