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

Delete a tag via Rest API with no value

quilleo
Newcomer_

I have tags that look like this:

 

tags": [
        {
            "context": "CONTEXTLESS",
            "key": "[VMware]Application:",
            "stringRepresentation": "[VMware]Application:"
        },
 
NOTE the : at the end of the key
When I try to delete it with this entitySelector I get the below error:
 
entityId(%22HOST-037D9E43BDBCD7DA%22)&tag=%5BVMware%5DApplication%3A
 
 "error": {
        "code": 400,
        "message": "Constraints violated.",
        "constraintViolations": [
            {
                "path": "key",
                "message": "may not be empty",
                "parameterLocation": "QUERY",
                "location": null
            },
            {
                "path": "entitySelector",
                "message": "Parsing error in entitySelector near 1-based column range [34,59) : ’&tag=[VMware]Application:’",
                "parameterLocation": "QUERY",
                "location": null
            }
        ]
    }
I have tried a bunch of combinations based on the documumenation and I get getting similar errors.
What am I doing wrong?
Thanks
Ed
2 REPLIES 2

Ana_Kuzmenchuk
Community Team
Community Team

Hi @quilleo, I've moved this question from the "Community discussions" sub-forum, as that space is reserved for Community-related questions 🙂 here your question has a higher chance of getting a solution! 

The only constant is change. Finding ways for great things to happen!

adam_gardner
Dynatrace Champion
Dynatrace Champion

Hi, I had no issues deleting this tag.

 

  1. Created a manual tag to match yours [VMware]Application:
  2. Use the environment API v2 DELETE /tags endpoint to target my a single service (you probably want to target many services rather than just one).
  3. Set the key to [VMware]Application:
  4. The tag is deleted

 

adam_gardner_0-1679892575874.png

 

Featured Posts