Time to upgrade! NAM is scheduled for end of support. It's time to move to Dynatrace our all-in-one software intelligence platform.

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/cxf/api/v1/config/alerts/recipients/{id}

Parameters

Parameter Type Description In Required
id integer

Recipient ID.

path required
body

Recipient to be modified.

body optional

The ScriptRecipient object

Element Type Description Required
id integer optional
enabled boolean optional
description string optional
executable string optional
parameters string optional
recipientType string
  • USER = email recipient
  • TRAP = SNMP trap recipient
  • MOBILE = Slack recipient
  • SCRIPT = Script recipient
The recipientType element can hold these values.
optional

The TrapRecipient object

Element Type Description Required
id integer optional
enabled boolean optional
host string optional
port integer optional
readCommunityName string optional
recipientType string
  • USER = email recipient
  • TRAP = SNMP trap recipient
  • MOBILE = Slack recipient
  • SCRIPT = Script recipient
The recipientType element can hold these values.
optional

Possible values

Possible values for the recipientType element in the TrapRecipient object:

  • USER
  • TRAP
  • MOBILE
  • SCRIPT

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 recipientType element can hold these values.

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
The recipientType element can hold these values.

Possible values

Possible values for the recipientType element in the TrapRecipient object:

  • USER
  • TRAP
  • MOBILE
  • SCRIPT

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.