Service-level objectives API - POST an SLO alert

Creates a new service-level objective (SLO) alert.

The request consumes an application/json payload.

POSTSaaShttps://{your-environment-id}.live.dynatrace.com/api/v2/slo/{id}/alert
Environment ActiveGateCluster ActiveGatehttps://{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

ParameterTypeDescriptionInRequired
fromstring

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 the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A 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: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of two weeks is used (now-2w).

queryoptional
tostring

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 the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A 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: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the current timestamp is used.

queryoptional
timeFramestring

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
queryoptional
idstring

The ID of the required SLO.

pathrequired
bodyAbstractSloAlertDto

The JSON body of the request. Contains the parameters of the new SLO alert.

bodyrequired

Request body objects

The AbstractSloAlertDto object

ElementTypeDescriptionRequired
alertNamestring

Name of the alert.

required
alertThresholdnumber

Threshold of the alert. Status alerts trigger if they fall below this value, burn rate alerts trigger if they exceed the value.

required
alertTypestring

Defines the actual set of fields depending on the value. See one of the following objects:

  • BURN_RATE -> BurnRateAlert
  • STATUS -> StatusAlert
  • BURN_RATE
  • STATUS
required

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

CodeTypeDescription
201EntityShortRepresentation

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.

400ErrorEnvelope

Failed. The input is invalid.

404ErrorEnvelope

Failed. The requested resource doesn't exist.

412ErrorEnvelope

Precondition for creating an SLO alert not fulfilled. The SLO func metric cannot be created or is not created by the SLO.

500ErrorEnvelope

Internal server error.

4XXErrorEnvelope

Client side error.

5XXErrorEnvelope

Server side error.

Response body objects

The EntityShortRepresentation object

The short representation of a Dynatrace entity.

ElementTypeDescription
descriptionstring

A short description of the Dynatrace entity.

idstring

The ID of the Dynatrace entity.

namestring

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"
}