Service level objectives API - POST an SLO

Creates a new service level objective.

The request consumes an application/json payload.

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/v2/slo
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/v2/slo
  • Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/v2/slo

Authentication

To execute this request, you need the Write SLO (slo.write) permission assigned to your API token. To learn how to obtain and use it, see Tokens and authentication.

Parameters

Parameter Type Description In Required
body SloCreate

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

body optional

Body format

The SloCreate object

Parameters of a new SLO.

Element Type Description Required
enabled boolean

The SLO is enabled (true) or disabled (false).

optional
name string

The name of the SLO.

optional
customDescription string

The custom description of the SLO (optional).

optional
metricExpression string

The percentage-based metric expression for the calculation of the SLO.

optional
evaluationType string

The evaluation type of the SLO.

optional
filter string

The entity filter for the SLO evaluation. Use the syntax of entity selector.

optional
target number

The target value of the SLO.

optional
warning number

The warning value of the SLO.

At warning state the SLO is still fulfilled but is getting close to failure.

optional
timeframe string

The timeframe for the SLO evaluation. Use the syntax of the global timeframe selector.

optional
useRateMetric boolean

The type of the metric to use for SLO calculation:

  • true: An existing percentage-based metric.
  • false: A ratio of two metrics.

For a list of available metrics, see Built-in metric page or try the GET metrics API call.

optional
metricRate string

The percentage-based metric for the calculation of the SLO.

Required when the useRateMetric is set to true.

optional
metricNumerator string

The metric for the count of successes (the numerator in rate calculation).

Required when the useRateMetric is set to false.

optional
metricDenominator string

The total count metric (the denominator in rate calculation).

Required when the useRateMetric is set to false.

optional

Response

Response codes

Code Description
201

Success. The new SLO has been created. Response doesn't have a body. The location response header contains the ID of the new SLO.

400

Failed. The input is invalid.

404

Failed. The requested resource doesn't exist.

409

Failed. Conflicting resource.

500

Internal server error.

Response body

A successful request doesn't return any content.