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

API to tag another object than a service

gautier_begin
Advisor

Hello,

In the documentation

https://www.dynatrace.com/support/help/dynatrace-a...

, it is possible to tag a service using an API.

I tried to do so with host without success (same command).

Is there a way to tag a host, process, application using API ?

Regards,

4 REPLIES 4

kristof_renders
Dynatrace Champion
Dynatrace Champion


Hi gautier,


You would have to use the api endpoint for the entity you want to assign the tag to.


So for host that would be: https://
{{Tenant}}.live.dynatrace.com/api/v1/entity/infrastructure/hosts/{entityid}


and then in the payload :

{
"tags": ["myTagthroughAPI", "secondTag"]
}


Hope this helps.

KR,
Kristof

gautier_begin
Advisor

Kris,

That's failing, I get this error message: "code":404,"message":"HTTP 404 Not Found"

Regards,

gautier_begin
Advisor

Sorry, I forgot the infrastructure word in the path. That's working fine.

gautier_begin
Advisor

Hello,

I tried for processes, no way to assign a tag.

api/v1/entity/infrastructure/processes/<proc_ID>

Not allowed HTTP method, expected one of [GET, OPTIONS]

Regards,

Featured Posts