addDevice API
Hi,
I have used the above API and I can successfully add the device to LM, however I am unable to add it to a specific device group chain.
I used <host_group_ids= '15,14,54',> in the body and I get the below error.
HTTP response body: {"errorMessage":"Unable to add the host into an auto group, appliesTo=isMisc()","errorCode":1500,"errorDetail":null}
Pease can you help me with what property needs to be populated to achieve what I need.
Thankyou.
cvl
Posted 1 year ago·Last reply 1 year ago
11 comments
cvl
OP1 year agocool, I figured it out: I was using the entire folder tree structure but I just needed the last element , i.e. 54
LM User
·1 year agoAh yes, trying to add it with all three group IDs would try to add it to each group, not just the last one.
Also, I'm curious if the setting of system_properties worked. It shouldn't.
cvl
OP1 year agoyes , I did. All three have that disabled.
this is the body, I was using.
body = logicmonitor_sdk.models.Device(
display_name='GenesysDevice', # String | required | example: "Cisco Router"
name='9.8.8.9', # String | required | example: "Main Collector"
preferred_collector_id=5, # Integer | required | example: 2.0
disable_alerting=False, # Boolean | example: True
auto_balanced_collector_group_id=0, # Integer
preferred_collector_group_id=2, # Integer
host_group_ids='17,53,54',
system_properties=[{'name': 'system.staticgroups',
'value': 'Customers/GenesysCustomer/Telephony'}
],
custom_properties=[{'name': 'api.pass', 'value': '********'},
{'name': 'api.user', 'value': 'user'},
{'name': 'system.categories', 'value': ''}], # Array
description='Genesys', # String | example: "This is a Cisco Router"
user_permission='write', # String
preferred_collector_group_name='K.P', # String
)
cvl
OP1 year agoJust checked ,
and the Auto-assign devices was already unchecked?
LM User
·1 year agoYou were trying to add it to 3 groups, did you check all three groups?
Mike Moniz
·1 year agoNote that turning off auto-assign devices it will also clear out that group/folder so it will be empty. It doesn't delete the actual devices, they will show up elsewhere, but might surprise you if you don't fully understand what are dynamic groups and how they work.
LM User
·1 year agoAre you sure about that? I just created a dynamic group that populated, then unchecked the box. The group turned static and has all those members in it still.
Mike Moniz
·1 year agoSorry, your correct. I see even the new UI shows a message stating that is the case too.
LM User
·1 year agoIf group 15, 14, or 54 is a dynamic group, you can't add it to that group via the API. It will be added to the group if it meets the group's AppliesTo rule.