Service-level objectives API - POST an SLO alert
Creates a new service-level objective (SLO) alert.
The request consumes an application/json
payload.
POST | SaaS | https://{your-environment-id}.live.dynatrace.com/api/v2/slo/{id}/alert |
Environment ActiveGateCluster ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/slo/{id}/alert |
Authentication
To execute this request, you need an access token with slo.write
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameters
The start of the requested timeframe.
You can use one of the following formats:
- Timestamp in UTC milliseconds.
- Human-readable format of
2021-01-25T05:57:01.123+01:00
. If no time zone is specified, UTC is used. You can use a space character instead of theT
. Seconds and fractions of a second are optional. - Relative timeframe, back from now. The format is
now-NU/A
, whereN
is the amount of time,U
is the unit of time, andA
is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example,now-1y/w
is one year back, aligned by a week. You can also specify relative timeframe without an alignment:now-NU
. Supported time units for the relative timeframe are:m
: minutesh
: hoursd
: daysw
: weeksM
: monthsy
: years
If not set, the relative timeframe of two weeks is used (now-2w
).
The end of the requested timeframe.
You can use one of the following formats:
- Timestamp in UTC milliseconds.
- Human-readable format of
2021-01-25T05:57:01.123+01:00
. If no time zone is specified, UTC is used. You can use a space character instead of theT
. Seconds and fractions of a second are optional. - Relative timeframe, back from now. The format is
now-NU/A
, whereN
is the amount of time,U
is the unit of time, andA
is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example,now-1y/w
is one year back, aligned by a week. You can also specify relative timeframe without an alignment:now-NU
. Supported time units for the relative timeframe are:m
: minutesh
: hoursd
: daysw
: weeksM
: monthsy
: years
If not set, the current timestamp is used.
The timeframe to calculate the SLO values:
CURRENT
: SLO's own timeframe.GTF
: timeframe specified by from and to parameters.
If not set, the CURRENT
value is used.
CURRENT
GTF
The ID of the required SLO.
The JSON body of the request. Contains the parameters of the new SLO alert.
Request body objects
The AbstractSloAlertDto
object
Name of the alert.
Threshold of the alert. Status alerts trigger if they fall below this value, burn rate alerts trigger if they exceed the value.
Defines the actual set of fields depending on the value. See one of the following objects:
BURN_RATE
-> BurnRateAlertSTATUS
-> StatusAlert
BURN_RATE
STATUS
Request body JSON model
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"alertName": "Payment service availability burn rate alert","alertThreshold": 10,"alertType": "BURN_RATE"}
Response
Response codes
Success. The new alert has been created. The response contains the parameters of the new alert. The location response header contains the ID of the new alert.
Precondition for creating an SLO alert not fulfilled. The SLO func metric cannot be created or is not created by the SLO.
Response body objects
The EntityShortRepresentation
object
The short representation of a Dynatrace entity.
A short description of the Dynatrace entity.
The ID of the Dynatrace entity.
The name of the Dynatrace entity.
Response body JSON model
{"description": "Dynatrace entity for the REST API example","id": "6a98d7bc-abb9-44f8-ae6a-73e68e71812a","name": "Dynatrace entity"}