Management zones API - PUT a management zone

Updates the specified management zone.

The request consumes and produces an application/json payload.

PUT
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/managementZones/{id}
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/managementZones/{id}

Authentication

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

Parameters

To find all JSON models that depend on the type of the model, refer to JSON models.

Parameter Type Description In Required
id string

The ID of the management zone to be updated.

If you set the ID in the body as well, it must match this ID.

path required
body ManagementZone

The JSON body of the request. Contains updated parameters of the management zone.

body optional

Body format

The ManagementZone object

The configuration of the management zone. It defines how the management zone applies.

Element Type Description Required
id string

The ID of the management zone.

optional
name string

The name of the management zone.

required
description string

The description of the management zone.

optional
rules MzRule[]

A list of rules for management zone usage.

If several rules are specified, the OR logic applies.

optional
dimensionalRules MzDimensionalRule[]

A list of dimensional data rules for management zone usage.

If several rules are specified, the OR logic applies.

optional
entitySelectorBasedRules EntitySelectorBasedMzRule[]

A list of entity-selector based rules for management zone usage.

If several rules are specified, the OR logic applies.

optional

The EntitySelectorBasedMzRule object

The entity-selector-based rule for management zone usage. It allows adding entities to a management zone via an entity selector.

Element Type Description Required
enabled boolean

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

optional
entitySelector string

The entity selector string, by which the entities are selected.

required

The MzDimensionalRule object

The dimensional rule of the management zone usage. It defines how the management zone applies.

Each rule is evaluated independently of all other rules.

Element Type Description Required
enabled boolean

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

required
appliesTo string

The target of the rule.

required
conditions MzDimensionalRuleCondition[]

A list of conditions for the management zone.

The management zone applies only if all conditions are fulfilled.

required

The MzDimensionalRuleCondition object

A condition of the management zone dimensional rule.

Element Type Description Required
conditionType string

The type of the condition.

required
ruleMatcher string

How we compare the values.

required
key string

The reference value for comparison.

For conditions of the DIMENSION type, specify the key here.

required
value string

The value of the dimension.

Only applicable when the conditionType is set to DIMENSION.

optional

The MzRule object

The rule of the management zone usage. It defines how the management zone applies.

Each rule is evaluated independently of all other rules.

Element Type Description Required
type string

The type of Dynatrace entities the management zone can be applied to.

required
enabled boolean

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

required
propagationTypes string[]

How to apply the management zone to underlying entities:

  • SERVICE_TO_HOST_LIKE: Apply to underlying hosts of matching services.
  • SERVICE_TO_PROCESS_GROUP_LIKE: Apply to underlying process groups of matching services.
  • PROCESS_GROUP_TO_HOST: Apply to underlying hosts of matching process groups.
  • PROCESS_GROUP_TO_SERVICE: Apply to all services provided by matching process groups.
  • HOST_TO_PROCESS_GROUP_INSTANCE: Apply to processes running on matching hosts.
  • CUSTOM_DEVICE_GROUP_TO_CUSTOM_DEVICE: Apply to custom devices in matching custom device groups.
  • AZURE_TO_PG: Apply to process groups connected to matching Azure entities.
  • AZURE_TO_SERVICE: Apply to services provided by matching Azure entities.
optional
conditions EntityRuleEngineCondition[]

A list of matching rules for the management zone.

The management zone applies only if all conditions are fulfilled.

required

The EntityRuleEngineCondition object

A condition defines how to execute matching logic for an entity.

Element Type Description Required
key ConditionKey required
comparisonInfo ComparisonBasic required

The ComparisonBasic object

Defines how the matching is actually performed: what and how are we comparing.

The actual set of fields and possible values of the operator field depend on the type of the comparison. \n\nFind the list of actual models in the description of the type field and check the description of the model you need.

Element Type Description Required
operator string

Operator of the comparison. You can reverse it by setting negate to true.

Possible values depend on the type of the comparison. Find the list of actual models in the description of the type field and check the description of the model you need.

required
value object

The value to compare to.

optional
negate boolean

Reverses the comparison operator. For example it turns the begins with into does not begin with.

required
type string

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

  • STRING -> StringComparison
  • INDEXED_NAME -> IndexedNameComparison
  • INDEXED_STRING -> IndexedStringComparison
  • INTEGER -> IntegerComparison
  • SERVICE_TYPE -> ServiceTypeComparison
  • PAAS_TYPE -> PaasTypeComparison
  • CLOUD_TYPE -> CloudTypeComparison
  • AZURE_SKU -> AzureSkuComparision
  • AZURE_COMPUTE_MODE -> AzureComputeModeComparison
  • ENTITY_ID -> EntityIdComparison
  • SIMPLE_TECH -> SimpleTechComparison
  • SIMPLE_HOST_TECH -> SimpleHostTechComparison
  • SERVICE_TOPOLOGY -> ServiceTopologyComparison
  • DATABASE_TOPOLOGY -> DatabaseTopologyComparison
  • OS_TYPE -> OsTypeComparison
  • HYPERVISOR_TYPE -> HypervisorTypeComparision
  • IP_ADDRESS -> IpAddressComparison
  • OS_ARCHITECTURE -> OsArchitectureComparison
  • BITNESS -> BitnessComparision
  • APPLICATION_TYPE -> ApplicationTypeComparison
  • MOBILE_PLATFORM -> MobilePlatformComparison
  • CUSTOM_APPLICATION_TYPE -> CustomApplicationTypeComparison
  • DCRUM_DECODER_TYPE -> DcrumDecoderComparison
  • SYNTHETIC_ENGINE_TYPE -> SyntheticEngineTypeComparison
  • TAG -> TagComparison
  • INDEXED_TAG -> IndexedTagComparison
required

The ConditionKey object

The key to identify the data we're matching.

The actual set of fields and possible values vary, depending on the type of the key.

Find the list of actual objects in the description of the type field.

Element Type Description Required
attribute string

The attribute to be used for comparision.

required
type string

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

  • PROCESS_CUSTOM_METADATA_KEY -> CustomProcessMetadataConditionKey
  • HOST_CUSTOM_METADATA_KEY -> CustomHostMetadataConditionKey
  • PROCESS_PREDEFINED_METADATA_KEY -> ProcessMetadataConditionKey
  • STRING -> StringConditionKey
optional

Response

Response codes

Code Description
201

Success. The management zone has been created. The response contains the ID of the new zone.

204

Success. The management zone has been updated. Response doesn't have a body.

400

Failed. The input is invalid

Response body

The EntityShortRepresentation object

The short representation of a Dynatrace entity.

Element Type Description
id string

The ID of the Dynatrace entity.

name string

The name of the Dynatrace entity.

description string

A short description of the 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.

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/managementZones/{id}/validator
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/managementZones/{id}/validator

Authentication

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

Response

Response codes

Code Description
204

Validated. The submitted configuration is valid. Response does not have a body.

400

Failed. The input is invalid

Response body

A successful request doesn't return any content.

Example

In this example, the request updates the Mainframe management zone from the POST request example. It adds the rule to include hosts with the z/OS architecture to the management zone.

The API token is passed in the Authorization header.

The request body is lengthy, so it is truncated in the Curl section. See the full body in the Request body section. You can download or copy the example request body to try it out on your own.

Curl

curl -L -X PUT 'https://mySampleEnv.live.dynatrace.com/api/config/v1/managementZones/2072664797514502900' \
-H 'Authorization: Api-token abcdefjhij1234567890' \
-H 'Content-Type: application/json' \
--data-raw '{ <truncated - see the Request body section > }
'

Request URL

https://mySampleEnv.live.dynatrace.com/api/config/v1/managementZones/2072664797514502900

Request body

api-examples/config/mz/put.json
Download
{
  "id": "2072664797514502900",
  "name": "Mainframe",
  "rules": [
    {
      "type": "SERVICE",
      "enabled": true,
      "propagationTypes": [
        "SERVICE_TO_PROCESS_GROUP_LIKE"
      ],
      "conditions": [
        {
          "key": {
            "attribute": "HOST_ARCHITECTURE"
          },
          "comparisonInfo": {
            "type": "OS_ARCHITECTURE",
            "operator": "EQUALS",
            "value": "ZOS",
            "negate": false
          }
        }
      ]
    },
    {
      "type": "HOST",
      "enabled": true,
      "propagationTypes": [],
      "conditions": [
        {
          "key": {
            "attribute": "HOST_ARCHITECTURE"
          },
          "comparisonInfo": {
            "type": "OS_ARCHITECTURE",
            "operator": "EQUALS",
            "value": "ZOS",
            "negate": false
          }
        }
      ]
    }
  ]
}

Response code

204

Result

The updated management zone looks like this in the UI:

PUT management zone