Automatically applied tags API - GET an auto-tag
Gets parameters of the specified automatically applied tag.
The request produces an application/json
payload.
GET | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/config/v1/autoTags/{id} |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/autoTags/{id} | |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/autoTags/{id} |
Authentication
To execute this request, you need an access token with ReadConfig
scope.
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 | Type | Description |
---|---|---|
200 | AutoTag | Success |
Response body objects
The AutoTag
object
Configuration of an auto-tag. It defines the conditions of tag usage and the tag value.
Element | Type | Description |
---|---|---|
description | string | The description of the auto-tag. |
entitySelectorBasedRules | EntitySelectorBasedAutoTagRule[] | A list of entity-selector based rules for auto tagging usage. If several rules are specified, the OR logic applies. |
id | string | The ID of the auto-tag. |
metadata | ConfigurationMetadata | Metadata useful for debugging |
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 EntitySelectorBasedAutoTagRule
object
The entity-selector-based rule for auto tag usage. It allows tagging entities via an entity selector.
Element | Type | Description |
---|---|---|
enabled | boolean | The rule is enabled ( |
entitySelector | string | The entity selector string, by which the entities are selected. |
normalization | string | Changes applied to the value after applying the value format. Default is LEAVE_TEXT_AS_IS.
|
valueFormat | string | The value of the entity-selector-based auto-tag. If specified, the tag is used in the For example, you can extend the |
The ConfigurationMetadata
object
Metadata useful for debugging
Element | Type | Description |
---|---|---|
clusterVersion | string | Dynatrace version. |
configurationVersions | integer[] | A sorted list of the version numbers of the configuration. |
currentConfigurationVersions | string[] | A sorted list of version numbers of the configuration. |
The AutoTagRule
object
A rule for the auto-tag.
Defines the conditions of tag usage.
Element | Type | Description |
---|---|---|
conditions | EntityRuleEngineCondition[] | A list of matching rules for the auto-tag. The tag applies only when all conditions are fulfilled. |
enabled | boolean | Tag rule is enabled ( |
normalization | string | Changes applied to the value after applying the value format. Default is LEAVE_TEXT_AS_IS.
|
propagationTypes | string[] | How to apply the tag to underlying entities:
|
type | string | Type of entities to which the rule applies.
|
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:
|
The EntityRuleEngineCondition
object
A condition defines how to execute matching logic for an entity.
Element | Type | Description |
---|---|---|
comparisonInfo | ComparisonBasic | 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. |
key | ConditionKey | 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. |
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 |
---|---|---|
negate | boolean | Reverses the comparison operator. For example it turns the begins with into does not begin with. |
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. |
type | string | Defines the actual set of fields depending on the value. See one of the following objects:
|
value | object | The value to compare to. |
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 |
---|---|---|
attribute | string | The attribute to be used for comparison.
|
type | string | Defines the actual set of fields depending on the value. See one of the following objects:
|
Response body JSON model
1{2 "description": "sampleDescription",3 "entitySelectorBasedRules": [4 {5 "enabled": true,6 "entitySelector": "type(HOST) AND cpuCores(4)"7 }8 ],9 "name": "sampleAutoTag",10 "rules": [11 {12 "conditions": [13 {14 "comparisonInfo": {15 "caseSensitive": false,16 "negate": false,17 "operator": "BEGINS_WITH",18 "type": "STRING",19 "value": "sample"20 },21 "key": {22 "attribute": "SERVICE_DATABASE_NAME"23 }24 },25 {26 "comparisonInfo": {27 "negate": false,28 "operator": "EXISTS",29 "type": "STRING"30 },31 "key": {32 "attribute": "SERVICE_WEB_SERVER_NAME"33 }34 },35 {36 "comparisonInfo": {37 "caseSensitive": false,38 "negate": false,39 "operator": "BEGINS_WITH",40 "type": "STRING",41 "value": "sample"42 },43 "key": {44 "attribute": "PROCESS_GROUP_CUSTOM_METADATA",45 "dynamicKey": {46 "key": "kubernetes.io/limit-ranger",47 "source": "KUBERNETES"48 },49 "type": "PROCESS_CUSTOM_METADATA_KEY"50 }51 }52 ],53 "enabled": true,54 "propagationTypes": [55 "SERVICE_TO_HOST_LIKE"56 ],57 "type": "SERVICE",58 "valueFormat": "myTagValue {Service:DetectedName}"59 }60 ]61}
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
1curl -X GET \2 https://mySampleEnv.live.dynatrace.com/api/config/v1/autoTags/7c82c170-b380-4fa7-992a-453f3e73047b \3 -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890'
Request URL
1https://mySampleEnv.live.dynatrace.com/api/config/v1/autoTags/7c82c170-b380-4fa7-992a-453f3e73047b
Response body
1{2 "metadata": {3 "configurationVersions": [4 75 ],6 "clusterVersion": "1.176.0.20190808-181828"7 },8 "id": "7c82c170-b380-4fa7-992a-453f3e73047b",9 "name": "Infrastructure - Linux",10 "rules": [11 {12 "type": "HOST",13 "enabled": true,14 "valueFormat": "prodLinux",15 "propagationTypes": [],16 "conditions": [17 {18 "key": {19 "attribute": "HOST_OS_TYPE"20 },21 "comparisonInfo": {22 "type": "OS_TYPE",23 "operator": "EQUALS",24 "value": "LINUX",25 "negate": false26 }27 },28 {29 "key": {30 "attribute": "HOST_NAME"31 },32 "comparisonInfo": {33 "type": "STRING",34 "operator": "BEGINS_WITH",35 "value": "PreProd",36 "negate": true,37 "caseSensitive": true38 }39 }40 ]41 }42 ]43}
Response code
200