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 |
|
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
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 |
Body format
The ConditionalNamingRule object
The rule for the conditional naming.
Element | Type | Description | Required |
---|---|---|---|
id | string |
The ID of the naming rule. |
optional |
type | string |
The type of Dynatrace entities to which the rule applies. |
required |
nameFormat | string |
The name to be assigned to matching entities. You can use the following placeholders here:
|
required |
displayName | string |
The name of the rule |
required |
enabled | boolean |
The rule is enabled ( |
required |
rules |
Entity |
A list of matching conditions of the rule. The rule 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 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:
|
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:
|
optional |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request. See the Example expandable section for working sample request.
{
"id": "4e88530c-edec-4e31-9cb4-3f2c63abc2b7",
"type": "PROCESS_GROUP",
"nameFormat": "TestNameFormat",
"displayName": "TestRule",
"enabled": true,
"rules": [
{
"key": {
"attribute": "PROCESS_GROUP_TECHNOLOGY"
},
"comparisonInfo": {
"type": "SIMPLE_TECH",
"operator": "EQUALS",
"value": {
"type": "JAVA"
},
"negate": "false"
}
},
{
"key": {
"attribute": "PROCESS_GROUP_PREDEFINED_METADATA",
"dynamicKey": "EXE_NAME",
"type": "PROCESS_PREDEFINED_METADATA_KEY"
},
"comparisonInfo": {
"type": "STRING",
"operator": "CONTAINS",
"value": "test",
"negate": "false",
"caseSensitive": true
}
}
]
}
Response
Response codes
Code | Description |
---|---|
201 | 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 | 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. |
{
"id": "6a98d7bc-abb9-44f8-ae6a-73e68e71812a",
"name": "Dynatrace entity",
"description": "Dynatrace entity for the REST API example\n"
}
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 |
|
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 doesn't have a body. |
400 | Failed. The input is invalid. |
Response body
A successful request doesn't return any content.