Automatically applied tags API - GET an auto-tag
Gets parameters of the specified automatically applied tag.
The request produces an application/json
payload.
GET |
|
Authentication
To execute this request, you need the Read configuration (ReadConfig
) permission assigned to your API token. To learn how to obtain and use it, see Tokens and authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
id | string |
The ID of the required auto-tag. |
path | required |
includeProcessGroupReferences | boolean |
Flag to include process group references to the response. Process group references aren't compatible across environments. When this flag is set to |
query | optional |
Response
Refer to JSON models to find all JSON models that depend on the type of the model.
Response codes
Code | Description |
---|---|
200 | Success |
Response body
The AutoTag object
Configuration of an auto-tag. It defines the conditions of tag usage and the tag value.
Element | Type | Description |
---|---|---|
metadata |
Configuration |
|
id | string | The ID of the auto-tag. |
name | string | The name of the auto-tag, which is applied to entities. Additionally you can specify a valueFormat in the tag rule. In that case the tag is used in the For example you can extend the |
rules | AutoTagRule[] | The list of rules for tag usage. When there are multiple rules, the OR logic applies. |
The AutoTagRule object
A rule for the auto-tag.
Defines the conditions of tag usage.
Element | Type | Description |
---|---|---|
type | string | Type of entities to which the rule applies. |
enabled | boolean | Tag rule is enabled ( |
valueFormat | string | The value of the auto-tag. If specified, the tag is used in the For example, you can extend the You can use the following placeholders here:
|
propagationTypes | string[] | How to apply the tag to underlying entities:
|
conditions |
Entity |
A list of matching rules for the auto-tag. The tag applies only when all conditions are fulfilled. |
The EntityRuleEngineCondition object
A condition defines how to execute matching logic for an entity.
Element | Type | Description |
---|---|---|
key | ConditionKey | |
comparisonInfo | ComparisonBasic |
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 |
---|---|---|
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. |
value | object | The value to compare to. |
negate | boolean | Reverses the comparison operator. For example it turns the begins with into does not begin with. |
type | string | Defines the actual set of fields depending on the value. See one of the following objects:
|
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 |
---|---|---|
attribute | string | The attribute to be used for comparision. |
type | string | Defines the actual set of fields depending on the value. See one of the following objects:
|
The ConfigurationMetadata object
Metadata useful for debugging
Element | Type | Description |
---|---|---|
configurationVersions | integer[] | A Sorted list of the version numbers of the configuration. |
currentConfigurationVersions | string[] | A Sorted list of string version numbers of the configuration. |
clusterVersion | string | Dynatrace server version. |
{
"name": "sampleAutoTag",
"rules": [
{
"type": "SERVICE",
"enabled": true,
"valueFormat": "myTagValue {Service:DetectedName}",
"propagationTypes": [
"SERVICE_TO_HOST_LIKE"
],
"conditions": [
{
"key": {
"attribute": "SERVICE_DATABASE_NAME"
},
"comparisonInfo": {
"type": "STRING",
"operator": "BEGINS_WITH",
"value": "sample",
"negate": false,
"caseSensitive": false
}
},
{
"key": {
"attribute": "SERVICE_WEB_SERVER_NAME"
},
"comparisonInfo": {
"type": "STRING",
"operator": "EXISTS",
"negate": false
}
},
{
"key": {
"attribute": "PROCESS_GROUP_CUSTOM_METADATA",
"type": "PROCESS_CUSTOM_METADATA_KEY",
"dynamicKey": {
"source": "KUBERNETES",
"key": "kubernetes.io/limit-ranger"
}
},
"comparisonInfo": {
"type": "STRING",
"operator": "BEGINS_WITH",
"value": "sample",
"negate": false,
"caseSensitive": false
}
}
]
}
]
}
Example
In this example, the request inquires about the properties of the Infrastructure - Linux auto-tag, which has the ID 7c82c170-b380-4fa7-992a-453f3e73047b.
The configuration has the following settings:
The API token is passed in the Authorization header.
Curl
curl -X GET \
https://mySampleEnv.live.dynatrace.com/api/config/v1/autoTags/7c82c170-b380-4fa7-992a-453f3e73047b \
-H 'Authorization: Api-token abcdefjhij1234567890'
Request URL
https://mySampleEnv.live.dynatrace.com/api/config/v1/autoTags/7c82c170-b380-4fa7-992a-453f3e73047b
Response body
{
"metadata": {
"configurationVersions": [
7
],
"clusterVersion": "1.176.0.20190808-181828"
},
"id": "7c82c170-b380-4fa7-992a-453f3e73047b",
"name": "Infrastructure - Linux",
"rules": [
{
"type": "HOST",
"enabled": true,
"valueFormat": "prodLinux",
"propagationTypes": [],
"conditions": [
{
"key": {
"attribute": "HOST_OS_TYPE"
},
"comparisonInfo": {
"type": "OS_TYPE",
"operator": "EQUALS",
"value": "LINUX",
"negate": false
}
},
{
"key": {
"attribute": "HOST_NAME"
},
"comparisonInfo": {
"type": "STRING",
"operator": "BEGINS_WITH",
"value": "PreProd",
"negate": true,
"caseSensitive": true
}
}
]
}
]
}
Response code
200