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

How to post deployment event for particular host?

Naveen
Guide

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.

3 REPLIES 3

JamesKitson
Dynatrace Guru
Dynatrace Guru

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.

mgome
Advisor

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}"
}
}

Naveen
Guide

Will we be able to inject the missing master data (machines , services), in case it doesn't exists

Featured Posts