Disk events anomaly detection API - PUT an event

Updates the specified disk event rule.

The request consumes and produces an application/json payload.

PUTSaaShttps://{your-environment-id}.live.dynatrace.com/api/config/v1/anomalyDetection/diskEvents/{id}
Environment ActiveGatehttps://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/anomalyDetection/diskEvents/{id}

Authentication

To execute this request, you need an access token with WriteConfig scope.

To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
idstring

The ID of the disk event rule to be updated.

pathrequired
bodyDiskEventAnomalyDetectionConfig

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

bodyoptional

Request body objects

The DiskEventAnomalyDetectionConfig object

ElementTypeDescriptionRequired
diskNameFilterDiskNameFilter

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

optional
enabledboolean

Disk event rule enabled/disabled.

required
hostGroupIdstring

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

optional
idstring

The ID of the disk event rule.

optional
metadataConfigurationMetadata

Metadata useful for debugging

optional
metricstring

The metric to monitor.

  • LOW_DISK_SPACE
  • LOW_INODES
  • READ_TIME_EXCEEDING
  • WRITE_TIME_EXCEEDING
required
namestring

The name of the disk event rule.

required
samplesinteger

The number of samples to evaluate.

required
tagFiltersTagFilter[]

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

optional
thresholdnumber

The threshold to trigger disk event.

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

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

required

The DiskNameFilter object

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

ElementTypeDescriptionRequired
operatorstring

Comparison operator.

  • CONTAINS
  • DOES_NOT_CONTAIN
  • DOES_NOT_EQUAL
  • DOES_NOT_START_WITH
  • EQUALS
  • STARTS_WITH
required
valuestring

Value to compare to.

required

The ConfigurationMetadata object

Metadata useful for debugging

ElementTypeDescriptionRequired
clusterVersionstring

Dynatrace version.

optional
configurationVersionsinteger[]

A sorted list of the version numbers of the configuration.

optional
currentConfigurationVersionsstring[]

A sorted list of version numbers of the configuration.

optional

The TagFilter object

A tag-based filter of monitored entities.

ElementTypeDescriptionRequired
contextstring

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

Custom tags use the CONTEXTLESS value.

  • AWS
  • AWS_GENERIC
  • AZURE
  • CLOUD_FOUNDRY
  • CONTEXTLESS
  • ENVIRONMENT
  • GOOGLE_CLOUD
  • KUBERNETES
required
keystring

The key of the tag.

Custom tags have the tag value here.

required
valuestring

The value of the tag.

Not applicable to custom tags.

optional

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.

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

Response

Response codes

CodeTypeDescription
201EntityShortRepresentation

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

204-

Success. The disk event rule has been updated. Response doesn't have a body.

400ErrorEnvelope

Failed. The input is invalid

403-

Failed. The specified ID is reserved for internal use.

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

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.

POSTSaaShttps://{your-environment-id}.live.dynatrace.com/api/config/v1/anomalyDetection/diskEvents/{id}/validator
Environment ActiveGatehttps://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/anomalyDetection/diskEvents/{id}/validator

Authentication

To execute this request, you need an access token with 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

403-

Failed. The specified ID is reserved for internal use.

Example

In this example, the request updates the very slow disk rule we created in the POST request example. It changes the threshold to 180 milliseconds in 9 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

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

Request URL

https://mySampleEnv.live.dynatrace.com/api/config/v1/anomalyDetection/diskEvents/fdd83212-9c08-44ba-a0cf-dbb471cd819a

Request body

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

Response code

204

Result

The updated configuration has the following parameters:

Custom disk events rule - updated