31 Aug 2020 12:32 PM - last edited on 25 May 2023 10:36 AM by Karolina_Linda
Hi All,
I have an issue while post an event through Dynatrace API, and i have tried the proposed example and received the below issue.
Request
https://myenvironment/e/1c73bd17-f3f1-4c29-af69-f2447189a9c3/api/v1/events \
-H 'Authorization: Api-token mytoken' \
-H 'Content-Type: application/json' \
-d '{
"eventType": "ERROR_EVENT",
"title" : "Power outage",
"description" : "UPS detected a power outage",
"timeoutMinutes" : 60,
"attachRules": {
"entityIds":[],
"tagRule":[{
"meTypes" : [ "HOST" ],
"tags" : [ { "context" : "CONTEXTLESS", "key" : "clinic" } ]}
]},
"source":"UPS-123 (Datacenter South)",
"customProperties":{
"PowerLevel": "20.000Ah",
"Estimation": "3 hours",
"UPS-Model": "APC Smart-UPS C 1000VA, USB"}
}
Error received:
"code":400,"message":"Invalid attachRules object provided. No MEIdentifier do match: Matching rule: PushEventAttachRules{entityIds=[], tagRules=[TagMatchRule{meTypes=[HOST], tags=[[CONTEXTLESS]clinic]}]}"}}
Thanks,
Ahmed
Solved! Go to Solution.
31 Aug 2020 02:20 PM
That simply means that there is no entity of type HOST with that tag within your system. Use a different tag that exists on a host within in your system.
Best greetings,
Wolfgang
31 Aug 2020 02:31 PM
Thank you it is solved 🙂
- I added new custom device and I used it's entity ID inside the payload
31 Aug 2020 02:34 PM
Cool, should work with tags of course as well but only with those that are really present in your environments