• Home
  • Dynatrace API
  • Configuration
  • Anomaly detection
  • Disk event
  • POST an event

Disk events anomaly detection API - POST an event

Creates a new disk event rule.

The request consumes and produces an application/json payload.

Early Adopter

This request is an Early Adopter release and may be changed in non-compatible way.

POSTManaged https://{your-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/diskEvents
SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/anomalyDetection/diskEvents
Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/diskEvents

Authentication

To execute this request, you need an access token with Write configuration (WriteConfig) scope. To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
bodyDiskEventAnomalyDetectionConfig

JSON body of the request. Contains parameters of the new disk event rule.

bodyoptional

Request body objects

The DiskEventAnomalyDetectionConfig object

ElementTypeDescription
metadataConfigurationMetadata

Metadata useful for debugging

Can be null.

idstring

The ID of the disk event rule.

Can be null.

namestring

The name of the disk event rule.

enabledboolean

Disk event rule enabled/disabled.

metricstring

The metric to monitor.

The element can hold these values
  • LOW_DISK_SPACE
  • LOW_INODES
  • READ_TIME_EXCEEDING
  • WRITE_TIME_EXCEEDING
thresholdnumber

The threshold to trigger disk event.

  • A percentage for LowDiskSpace or LowInodes metrics.
  • In milliseconds for ReadTimeExceeding or WriteTimeExceeding metrics.
samplesinteger

The number of samples to evaluate.

violatingSamplesinteger

The number of samples that must violate the threshold to trigger an event. Must not exceed the number of evaluated samples.

diskNameFilterDiskNameFilter

Narrows the rule usage down to disks, matching the specified criteria.

Can be null.

tagFiltersTagFilter[]

Narrows the rule usage down to the hosts matching the specified tags.

Can be null.

hostGroupIdstring

Narrows the rule usage down to disks that run on hosts that themselves run on the specified host group.

Can be null.

The ConfigurationMetadata object

Metadata useful for debugging

ElementTypeDescription
configurationVersionsinteger[]

A sorted list of the version numbers of the configuration.

Can be null.

currentConfigurationVersionsstring[]

A sorted list of version numbers of the configuration.

Can be null.

clusterVersionstring

Dynatrace version.

Can be null.

The DiskNameFilter object

Narrows the rule usage down to disks, matching the specified criteria.

ElementTypeDescription
operatorstring

Comparison operator.

The element can hold these values
  • CONTAINS
  • DOES_NOT_CONTAIN
  • DOES_NOT_EQUAL
  • DOES_NOT_START_WITH
  • EQUALS
  • STARTS_WITH
valuestring

Value to compare to.

The TagFilter object

A tag-based filter of monitored entities.

ElementTypeDescription
contextstring

The origin of the tag, such as AWS or Cloud Foundry.

Custom tags use the CONTEXTLESS value.

The element can hold these values
  • AWS
  • AWS_GENERIC
  • AZURE
  • CLOUD_FOUNDRY
  • CONTEXTLESS
  • ENVIRONMENT
  • GOOGLE_CLOUD
  • KUBERNETES
keystring

The key of the tag.

Custom tags have the tag value here.

valuestring

The value of the tag.

Not applicable to custom tags.

Can be null.

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.

json
{ "metadata": { "configurationVersions": [ 4, 2 ], "currentConfigurationVersions": [ "1.0.4", "1.23" ], "clusterVersion": "1.192.1" }, "id": "string", "name": "string", "enabled": true, "metric": "LOW_DISK_SPACE", "threshold": 1, "samples": 10, "violatingSamples": 8, "diskNameFilter": { "operator": "CONTAINS", "value": "string" }, "tagFilters": [ { "context": "AWS", "key": "string", "value": "string" } ], "hostGroupId": "string" }

Response

Response codes

CodeTypeDescription
201EntityShortRepresentation

Success. The new disk event rule has been created. The ID of the new disk event rule is returned.

400ErrorEnvelope

Failed. The input is invalid

Response body objects

The EntityShortRepresentation object

The short representation of a Dynatrace entity.

ElementTypeDescription
idstring

The ID of the Dynatrace entity.

namestring

The name of the Dynatrace entity.

Can be null.

descriptionstring

A short description of the Dynatrace entity.

Can be null.

Response body JSON model

json
{ "id": "6a98d7bc-abb9-44f8-ae6a-73e68e71812a", "name": "Dynatrace entity", "description": "Dynatrace entity for the REST API example" }

Validate payload

We recommend that you validate the payload before submitting it with an actual request. A response code of 204 indicates a valid payload.

The request consumes an application/json payload.

Early Adopter

This request is an Early Adopter release and may be changed in non-compatible way.

POSTManaged https://{your-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/diskEvents/validator
SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/anomalyDetection/diskEvents/validator
Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/diskEvents/validator

Authentication

To execute this request, you need an access token with Write configuration (WriteConfig) scope. To learn how to obtain and use it, see Tokens and authentication.

Response

Response codes

CodeTypeDescription
204-

Validated. The submitted disk event rule is valid. Response doesn't have a body.

400ErrorEnvelope

Failed. The input is invalid

Example

In this example, the request creates a new custom disk event rule named very slow disk. The rule triggers an alert for any disk whose name starts with C and whose read time exceeds 200 milliseconds in 8 out of 10 samples.

The API token is passed in the Authorization header.

You can download or copy the example request body to try it out on your own.

Curl

shell
curl -X POST \ https://mySampleEnv.live.dynatrace.com/api/config/v1/anomalyDetection/diskEvents \ -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \ -H 'Content-Type: application/json' \ -d '{ "name": "very slow disk", "enabled": true, "metric": "READ_TIME_EXCEEDING", "threshold": 200, "samples": 10, "violatingSamples": 8, "diskNameFilter": { "operator": "STARTS_WITH", "value": "C" }, "tagFilters": [] } '

Request URL

plaintext
https://mySampleEnv.live.dynatrace.com/api/config/v1/anomalyDetection/diskEvents

Request body

json
{ "name": "very slow disk", "enabled": true, "metric": "READ_TIME_EXCEEDING", "threshold": 200, "samples": 10, "violatingSamples": 8, "diskNameFilter": { "operator": "STARTS_WITH", "value": "C" }, "tagFilters": [] }

Response body

json
{ "id": "fdd83212-9c08-44ba-a0cf-dbb471cd819a", "name": "very slow disk" }

Response code

204

Result

The new rule looks like this in the UI:

Custom disk events rule - new

Related topics
  • Prediction-based anomaly detection

    Read how Dynatrace automatically learns each applications’ unique traffic patterns and is thereby able to forecast the application’s traffic.

  • Problem detection and analysis

    Understand the basic concepts related to how Dynatrace detects and raises alerts for problems detected in your environment.