Conditional naming API - PUT a naming rule
Updates the specified conditional naming rule. If the rule with the specified ID doesn't exist—creates a new rule with this ID.
The request consumes and produces an application/json
payload.
PUT | SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/conditionalNaming/{type}/{id} |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/conditionalNaming/{type}/{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
Refer to JSON models to find all JSON models that depend on the type of the model.
Parameter | Type | Description | In | Required |
---|---|---|---|---|
type | string | The type of the rule, defined by the type of Dynatrace entities to which the rule applies.
| path | required |
id | string | The ID of the naming rule to be updated. | path | required |
body | Conditional | The JSON body of the request. Contains updated parameters of the naming rule. The value of the type field must match the type path parameter. | body | optional |
Request body objects
The ConditionalNamingRule
object
The rule for the conditional naming.
Element | Type | Description | Required |
---|---|---|---|
displayName | string | The name of the rule | required |
enabled | boolean | The rule is enabled ( | required |
id | string | The ID of the naming rule. | optional |
metadata | Configuration | Metadata useful for debugging | optional |
nameFormat | string | The name to be assigned to matching entities. You can use the following placeholders here:
| required |
rules | Entity | A list of matching conditions of the rule. The rule applies only if all conditions are fulfilled. | required |
type | string | The type of Dynatrace entities to which the rule applies.
| required |
The ConfigurationMetadata
object
Metadata useful for debugging
Element | Type | Description | Required |
---|---|---|---|
clusterVersion | string | Dynatrace version. | optional |
configurationVersions | integer[] | A sorted list of the version numbers of the configuration. | optional |
currentConfigurationVersions | string[] | A sorted list of version numbers of the configuration. | optional |
The EntityRuleEngineCondition
object
A condition defines how to execute matching logic for an entity.
Element | Type | Description | Required |
---|---|---|---|
comparisonInfo | Comparison | 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. Find the list of actual objects in the description of the type field or see JSON models. | required |
key | Condition | The key to identify the data we're matching. The actual set of fields and possible values depend on the type of the key. Find the list of actual objects in the description of the type field or see JSON models. | 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. Find the list of actual objects in the description of the type field or see JSON models.
Element | Type | Description | Required |
---|---|---|---|
negate | boolean | Reverses the comparison operator. For example it turns the begins with into does not begin with. | required |
operator | string | Operator of the comparison. You can reverse it by setting negate to 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 |
type | string | Defines the actual set of fields depending on the value. See one of the following objects:
| required |
value | string | The value to compare to. | optional |
The AnyValue
object
A schema representing an arbitrary value type.
The ConditionKey
object
The key to identify the data we're matching.
The actual set of fields and possible values depend on the type of the key. Find the list of actual objects in the description of the type field or see JSON models.
Element | Type | Description | Required |
---|---|---|---|
attribute | string | The attribute to be used for comparison.
| required |
type | string | Defines the actual set of fields depending on the value. See one of the following objects:
| 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.
{"displayName": "TestRule","enabled": true,"id": "4e88530c-edec-4e31-9cb4-3f2c63abc2b7","nameFormat": "TestNameFormat","rules": [{"comparisonInfo": {"negate": "false","operator": "EQUALS","type": "SIMPLE_TECH","value": {"type": "JAVA"}},"key": {"attribute": "PROCESS_GROUP_TECHNOLOGY"}},{"comparisonInfo": {"caseSensitive": true,"negate": "false","operator": "CONTAINS","type": "STRING","value": "test"},"key": {"attribute": "PROCESS_GROUP_PREDEFINED_METADATA","dynamicKey": "EXE_NAME","type": "PROCESS_PREDEFINED_METADATA_KEY"}}],"type": "PROCESS_GROUP"}
Response
Response codes
Code | Type | Description |
---|---|---|
201 | Entity | Success. The naming rule has been created. The response contains the ID of the new rule. |
204 | - | Success. The naming rule has been updated. Response doesn't have a body. |
400 | Error | Failed. The input is invalid. |
Response body objects
The EntityShortRepresentation
object
The short representation of a Dynatrace entity.
Element | Type | Description |
---|---|---|
description | string | A short description of the Dynatrace entity. |
id | string | The ID of the Dynatrace entity. |
name | string | 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.
POST | SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/conditionalNaming/{type}/{id}/validator |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/conditionalNaming/{type}/{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
Code | Type | Description |
---|---|---|
204 | - | Validated. The submitted configuration is valid. Response doesn't have a body. |
400 | Error | Failed. The input is invalid. |