22 Nov 2022 12:12 PM - last edited on 22 Nov 2022 03:48 PM by MaciejNeumann
Hi I want to post deployment events with some information for particular host (i.e. HOST A), could someone explain how to do that via API.
I am using https://www.dynatrace.com/support/help/dynatrace-api/environment-api/events-v2/post-event
It's not mentioned where and how to pass host information.
Solved! Go to Solution.
22 Nov 2022 04:11 PM
You filter which entities an event should apply to via the entitySelector field where you enter an entity selector.
You could pass a single entityId or conditions that will match only that host.
22 Nov 2022 06:17 PM - edited 22 Nov 2022 06:52 PM
There's a sample payload in the "Push deployment events from Jenkins" section of the documentation
https://www.dynatrace.com/support/help/shortlink/api-deployment-jenkins
{
"eventType": "CUSTOM_DEPLOYMENT",
"attachRules": {
"tagRule": {
"meTypes": "PROCESS_GROUP_INSTANCE",
"tags": "Dev"
}
},
"deploymentName": "${JOB_NAME}",
"deploymentVersion": "1.1",
"deploymentProject": "CustomBankingService",
"remediationAction": "http://revertMe",
"ciBackLink": "${BUILD_URL}",
"source": "Jenkins",
"customProperties": {
"Jenkins Build Number": "${BUILD_ID}",
"Git commit": "${GIT_COMMIT}"
}
}
23 Nov 2022 08:15 AM
Will we be able to inject the missing master data (machines , services), in case it doesn't exists