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 2 years ago·Last reply 2 years ago
11 comments
cvl
OP2 years 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
·2 years 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
OP2 years 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
OP2 years agoJust checked ,
and the Auto-assign devices was already unchecked?
LM User
·2 years agoYou were trying to add it to 3 groups, did you check all three groups?
cvl
OP2 years agoThanks Stuart,
That helps, how do I change my device group to a manual group?
Regards
Conrad
LM User
·2 years agoIn the UI, just uncheck the "Auto-assign devices" check box on the group's manage dialog. Keep in mind though that devices will no longer be automatically added to the group even if they satisfy the rule.
LM User
·2 years 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.