08 Nov 2019 11:56 AM
Hello all together,
We would like to create automatically a tag using the API https://www.dynatrace.com/support/help/extend-dynatrace/dynatrace-api/configuration-api/automaticall... .
The condition should be like
So far we failed to create such a condition type as a type "Cloud Foundry Space" is not available in [2].
We tried so far using a Request body like [1].
How can we create a tag using the API automatically with a condition of type "Cloud Foundry space"?
Thanks for a hint.
Best Regards
Frank
[2]
https://www.dynatrace.com/support/help/shortlink/api-config-auto-tags-post-auto-tag#possible-values
[1]
{ "name": "${spaceNAME}", "rules": [ { "type": "SERVICE", "enabled": true, "valueFormat": null, "propagationTypes": [ "PROCESS_GROUP_TO_SERVICE" ], "conditions": [ { "key": { "attribute": "CLOUD_FOUNDRY_SPACE" }, "comparisonInfo": { "type": "STRING", "operator": "EQUALS", "value": "${ spaceNAME }", "negate": false, "caseSensitive": false } } ] } ] }
Solved! Go to Solution.
11 Nov 2019 03:25 PM
We found the answer: The request body should look like:
{
"name": "spaceNAME",
"rules": [
{
"type": "SERVICE",
"enabled": true,
"valueFormat": null,
"propagationTypes":[],
"conditions": [
{
"key": {
"attribute": "PROCESS_GROUP_PREDEFINED_METADATA",
"dynamicKey": "CLOUD_FOUNDRY_SPACE_NAME",
"type": "PROCESS_PREDEFINED_METADATA_KEY"
},
"comparisonInfo": {
"type": "STRING",
"operator": "EQUALS",
"value": "spaceNAME",
"negate": false,
"caseSensitive": false
}
}
]
}
]
}