08 Mar 2021 07:47 PM - last edited on 21 Aug 2024 11:20 AM by Michal_Gebacki
Is there an API to find the "context" of a tag just by giving a tag......without any entities? Or if not, then is there any way by which entity related to a particular tag can be found?
Solved! Go to Solution.
09 Mar 2021 03:37 PM - edited 09 Mar 2021 03:40 PM
@BHA5472 If this is an automatic tag, you can also go into the UI and look that tag up to see what rules are defined for it. Additionally, you can also search for tag values in Dynatrace. If this is a Manual tag that was created, the same applies by searching for all manually applied tags via settings>Tags>Manually Applied.
There also is the API:
17 Mar 2021 07:04 PM
Hey Chad, these API doesn't tell you that information. Nd there is no API which can give you a list of manually applied tags without giving any entity.
09 Mar 2021 03:38 PM
Hey @BHA5472, Could you provide some more info? When you say you are looking for the "context" what exactly are you looking to find?
Thanks
-Dallas
17 Mar 2021 07:07 PM
Hey Dallas,
Context of tag means if a tag is automatically detected by Dynatrace say AWS tag, then context for that tag is AWS. If it is being discovered as Kubernetes, it's context will be kuberetes. There are tags which don't have any particular context, their context value is "CONTEXTLESS".
So, is there any way by which context of a particular tag could be found using API?
10 May 2021 05:02 AM - edited 10 May 2021 05:04 AM
All manual and tags applied via autotag rule will be CONTEXTLESS. All AWS tags will have a context value of AWS and other technologies will follow similar conventions like KUBERNETES as Dallas mentioned above.
I'm assuming you want to search for manual tags, which is possible with the /api/v2/tags endpoint:
curl -x GET https://abc123.live.dynatrace.com/v2/api/tags?entitySelector=type("HOST"),tag("manualtag:value")
Retrieves this (if you actually have a host manually tagged with <pre>manualtag:value</pre>):
{
"totalCount": 1,
"tags": [{
"context": "CONTEXTLESS",
"key": "manualtag",
"value": "value",
"stringRepresentation": "manualtag:value"
}]
}
If this is not what you're asking, please elaborate on the usecase a bit more and I'll try to assist.