cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

V2 Problem API List Problems - What if the tag is invalid? It still returns an empty set.

louis_gallo
Participant

Hello,

 

I notice if I list the problems for a certain entity like:

 

type(process_group_instance),tag(MyApplication:AppName)

 

The JSON returns information like this:

 

"totalCount": 10,
"pageSize": 50,
"problems": [

 

That total count can be 0 or greater.

 

Here is my question - If the tag name is invalid, totalCount will be 0. I HAVE NO WAY TO DISTINGUISH BETWEEN A GOOD TAG WITH NO PROBLEMS AND A BAD TAG.

 

Should I be making an API call beforehand to validate that a tag name is valid?? How do I do that? I have heard that managed tags are stored in one place and other tags in another.

 

Help!! I am trying to pull problems for a tag, and that works great. I just have no way to flag if the tag was actually valid.

 

Thanks,

 

Lou

6 REPLIES 6

louis_gallo
Participant

Maybe a better way of asking this question is "What is the best way to validate that a tag (normal or custom" is valid?" through the V2 API?

wolfgang_beer
Dynatrace Champion
Dynatrace Champion

@louis_gallo I do not fully understand what you would like to implement with the problems API endpoint. Can you give me more context on why the problems endpoint should verify if a given tag exists? For us the endpoint does return the list of entities that show a problem with a given tag. In case there is no entity with that given tag, the result is of course empty. On the other hand, the tag could exist on other entity types of course.

 

Best regards,

Wolfgang

wolfgang_beer
Dynatrace Champion
Dynatrace Champion

@louis_gallo You can use the tag endpoint to query for the number of entities of a given type and how many assignments the tag has, see here:

https://www.dynatrace.com/support/help/dynatrace-api/environment-api/custom-tags/get-tags/

Hi Wolfgang. My idea, which I actually have a POC built, is to automate pulling back problems by a tag for a particular time, in most cases the time of a PVS test. Hence why I want to validate the tag beforehand as valid because both an invalid tag OR a valid tag with no problems return the same result. Hopefully that makes sense. I am going to try your idea above. Just have to get read entities privs with my token. If I am off base here, please let me know.

It works as a validator for the tags!!! Thanks Wolfgang!!

Great that it worked, have a great weekend!

 

Regards,

Wolfgang