-
I'm trying to use the performGroupAction endpoint to add a specific asset to a certain group with the service class, but am having issues with how I specify the agentID I would like to add. Is it a parameter I should add? Any help would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi @Emarples! We'll need to use the
Examplefrom falconpy import HostGroup
groups = HostGroup(client_id="API_CLIENT_ID", client_secret="API_CLIENT_SECRET")
host_aids_to_add = ['HOST_AID_1', 'HOST_AID_2', 'etc.']
action_parameter = [{
"name": "filter",
"value": f"(device_id:{host_aids_to_add})"
}]
result = groups.perform_group_action(action_name="add-hosts", ids="HOST_GROUP_ID_HERE", action_parameters=action_parameter)
print(result) |
Beta Was this translation helpful? Give feedback.
-
Hello guys! If I don't use f-strings and pass the device ids directly works fine Follow falconpy version: What I'm doing wrong? Thank you everyone! |
Beta Was this translation helpful? Give feedback.
Hi @Emarples!
We'll need to use the
action_parameters
keyword to add a host to a static group. Try this sample code and let us know if you have any questions.Example