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

Python Datetime Module to set custom tags

jstrick
Observer

I'm trying to use the Python dt module to set custom tags but I keep running into an error saying some problem with the tags parameter like "AttributeError: 'dict' object has no attribute 'to_json'".  The custom_tags.post function contains the following value for the parameter: (parameter) tags: List[AddEntityTags]. I'm probably missing something simple but what is the List type that's expected? I can do this with no problem using curl but I can't seem to use the dt module.

1 REPLY 1

mark_bley
Dynatrace Pro
Dynatrace Pro

Hi @jstrick ,

try passing the tags as follows:

tag_list = [AddEntityTags("tag-key", "tag-value")]
dt.custom_tags.post("type(custom_device),entityName(TEST)", tag_list)

Featured Posts