Skip to content

Host Group

Joshua Hiller edited this page Jan 15, 2022 · 23 revisions

CrowdStrike Falcon Twitter URL

Using the Host Group service collection

Uber class support Service class support Documentation Version Page Updated

Table of Contents

Operation ID Description
queryCombinedGroupMembers
PEP 8 query_combined_group_members
Search for members of a Host Group in your environment by providing a FQL filter and paging details. Returns a set of host details which match the filter criteria
queryCombinedHostGroups
PEP 8 query_combined_host_groups
Search for Host Groups in your environment by providing a FQL filter and paging details. Returns a set of Host Groups which match the filter criteria
performGroupAction
PEP 8 perform_group_action
Perform the specified action on the Host Groups specified in the request
getHostGroups
PEP 8 get_host_groups
Retrieve a set of Host Groups by specifying their IDs
createHostGroups
PEP 8 create_host_groups
Create Host Groups by specifying details about the group to create
deleteHostGroups
PEP 8 delete_host_groups
Delete a set of Host Groups by specifying their IDs
updateHostGroups
PEP 8 update_host_groups
Update Host Groups by specifying the ID of the group and details to update
queryGroupMembers
PEP 8 query_group_members
Search for members of a Host Group in your environment by providing a FQL filter and paging details. Returns a set of Agent IDs which match the filter criteria
queryHostGroups
PEP 8 query_host_groups
Search for Host Groups in your environment by providing a FQL filter and paging details. Returns a set of Host Group IDs which match the filter criteria

queryCombinedGroupMembers

Search for members of a Host Group in your environment by providing a FQL filter and paging details. Returns a set of host details which match the filter criteria

PEP8 method name

query_combined_group_members

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Data type Description
filter
Service Class Support

Uber Class Support
query string FQL query expression that should be used to limit the results.
limit
Service Class Support

Uber Class Support
query integer Maximum number of records to return. Max: 5000.
offset
Service Class Support

Uber Class Support
query string Starting index of overall result set from which to return ids.
id
Service Class Support

Uber Class Support
query string The ID of the Host Group to search for members of.
sort
Service Class Support

Uber Class Support
query string The property to sort by.
parameters
Service Class Support

Uber Class Support
query string Full query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

response = falcon.query_combined_group_members(id="string",
                                               filter="string",
                                               offset=integer,
                                               limit=integer,
                                               sort="string"
                                               )
print(response)
Service class example (Operation ID syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

response = falcon.queryCombinedGroupMembers(id="string",
                                            filter="string",
                                            offset=integer,
                                            limit=integer,
                                            sort="string"
                                            )
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

response = falcon.command("queryCombinedGroupMembers",
                          id="string",
                          filter="string",
                          offset=integer,
                          limit=integer,
                          sort="string"
                          )
print(response)

queryCombinedHostGroups

Search for Host Groups in your environment by providing a FQL filter and paging details. Returns a set of Host Groups which match the filter criteria

PEP8 method name

query_combined_host_groups

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Data type Description
filter
Service Class Support

Uber Class Support
query string FQL query expression that should be used to limit the results.
limit
Service Class Support

Uber Class Support
query integer Maximum number of records to return. Max: 5000.
offset
Service Class Support

Uber Class Support
query string Starting index of overall result set from which to return ids.
sort
Service Class Support

Uber Class Support
query string The property to sort by.
parameters
Service Class Support

Uber Class Support
query string Full query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

response = falcon.query_combined_host_groups(filter="string",
                                             offset=integer,
                                             limit=integer,
                                             sort="string"
                                             )
print(response)
Service class example (Operation ID syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

response = falcon.queryCombinedHostGroups(filter="string",
                                          offset=integer,
                                          limit=integer,
                                          sort="string"
                                          )
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

response = falcon.command("queryCombinedHostGroups",
                          filter="string",
                          offset=integer,
                          limit=integer,
                          sort="string"
                          )
print(response)

performGroupAction

Perform the specified action on the Host Groups specified in the request

PEP8 method name

perform_group_action

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Data type Description
action_name
Service Class Support

Uber Class Support
query string The action to be performed.
action_parameters
Service Class Support

Uber Class Support
body list of dictionaries Action specific parameters. Multiple action parameters may be specified.

Example:
  • Use with the add-hosts and remove-hosts actions
  • Use the value parameter to specify host IDs to add or remove
{
    "name": "filter",
    "value": "(device_id:['ID1', 'ID2','ID3'])"
}
body
Service Class Support

Uber Class Support
body string Full body payload in JSON format.
ids
Service Class Support

Uber Class Support
body string or list of strings The ID(s) of the Host Group to perform the action against.
parameters
Service Class Support

Uber Class Support
query string Full query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

act_params = [{
    "name": "string",
    "value": "string"
}]

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.perform_group_action(action_name="string",
                                       ids=id_list,
                                       action_parameters=act_params
                                       )
print(response)
Service class example (Operation ID syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

act_params = [{
    "name": "string",
    "value": "string"
}]

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.performGroupAction(action_name="string",
                                     ids=id_list,
                                     action_parameters=act_params
                                     )
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

PARAMS = {
    "action_name": "string"     # Can also pass this using the action_name keyword
}

id_list = ['ID1', 'ID2', 'ID3']

BODY = {
    "action_parameters": [
        {
            "name": "string",
            "value": "string"
        }
    ],
    "ids": id_list
}

response = falcon.command("performGroupAction", parameters=PARAMS, body=BODY)
print(response)

getHostGroups

Retrieve a set of Host Groups by specifying their IDs

PEP8 method name

get_host_groups

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Data type Description
ids
Service Class Support

Uber Class Support
query string or list of strings The ID(s) of the Host Groups to retrieve.
parameters
Service Class Support

Uber Class Support
query string Full query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.get_host_groups(ids=id_list)
print(response)
Service class example (Operation ID syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.getHostGroups(ids=id_list)
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.command("getHostGroups", ids=id_list)
print(response)

createHostGroups

Create Host Groups by specifying details about the group to create

PEP8 method name

create_host_groups

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Data type Description
assignment_rule
Service Class Support

Uber Class Support
body string Assignment rule to apply.
body
Service Class Support

Uber Class Support
body string Full body payload in JSON format.
description
Service Class Support

Uber Class Support
body string Description for the host group.
group_type
Service Class Support

Uber Class Support
body string Type of Host Group to create.
name
Service Class Support

Uber Class Support
body string The name of the Host Group.

Usage

Service class example (PEP8 syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

response = falcon.create_host_groups(assignment_rule="string",
                                     description="string",
                                     group_type="string",
                                     name="string"
                                     )
print(response)
Service class example (Operation ID syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

response = falcon.createHostGroups(assignment_rule="string",
                                   description="string",
                                   group_type="string",
                                   name="string"
                                   )
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

BODY = {
    "resources": [
        {
            "assignment_rule": "string",
            "description": "string",
            "group_type": "static",
            "name": "string"
        }
    ]
}

response = falcon.command("createHostGroups", body=BODY)
print(response)

deleteHostGroups

Delete a set of Host Groups by specifying their IDs

PEP8 method name

delete_host_groups

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Data type Description
ids
Service Class Support

Uber Class Support
query string or list of strings The ID(s) of the Host Groups to delete.
parameters
Service Class Support

Uber Class Support
query string Full query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.delete_host_groups(ids=id_list)
print(response)
Service class example (Operation ID syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.deleteHostGroups(ids=id_list)
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.command("deleteHostGroups", ids=id_list)
print(response)

updateHostGroups

Update Host Groups by specifying the ID of the group and details to update

PEP8 method name

update_host_groups

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Data type Description
assignment_rule
Service Class Support

Uber Class Support
body string Assignment rule to apply.
body
Service Class Support

Uber Class Support
body string Full body payload in JSON format.
description
Service Class Support

Uber Class Support
body string Description for the host group.
id
Service Class Support

Uber Class Support
body string The ID of the Host Group to update.
name
Service Class Support

Uber Class Support
body string The name of the Host Group.

Usage

Service class example (PEP8 syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

response = falcon.update_host_groups(assignment_rule="string",
                                     description="string",
                                     id="string",
                                     name="string"
                                     )
print(response)
Service class example (Operation ID syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

response = falcon.updateHostGroups(assignment_rule="string",
                                   description="string",
                                   id="string",
                                   name="string"
                                   )
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

BODY = {
    "resources": [
        {
            "assignment_rule": "string",
            "description": "string",
            "id": "string",
            "name": "string"
        }
    ]
}

response = falcon.command("updateHostGroups", body=BODY)
print(response)

queryGroupMembers

Search for members of a Host Group in your environment by providing a FQL filter and paging details. Returns a set of Agent IDs which match the filter criteria

PEP8 method name

query_group_members

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Data type Description
filter
Service Class Support

Uber Class Support
query string FQL query expression that should be used to limit the results.
limit
Service Class Support

Uber Class Support
query integer Maximum number of records to return. Max: 5000.
offset
Service Class Support

Uber Class Support
query string Starting index of overall result set from which to return ids.
id
Service Class Support

Uber Class Support
query string The ID of the Host Group to search for members of.
sort
Service Class Support

Uber Class Support
query string The property to sort by.
parameters
Service Class Support

Uber Class Support
query string Full query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

response = falcon.query_group_members(id="string",
                                      filter="string",
                                      offset=integer,
                                      limit=integer,
                                      sort="string"
                                      )
print(response)
Service class example (Operation ID syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

response = falcon.queryGroupMembers(id="string",
                                    filter="string",
                                    offset=integer,
                                    limit=integer,
                                    sort="string"
                                    )
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

response = falcon.command("queryGroupMembers",
                          id="string",
                          filter="string",
                          offset=integer,
                          limit=integer,
                          sort="string"
                          )
print(response)

queryHostGroups

Search for Host Groups in your environment by providing a FQL filter and paging details. Returns a set of Host Group IDs which match the filter criteria

PEP8 method name

query_host_groups

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Data type Description
filter
Service Class Support

Uber Class Support
query string FQL query expression that should be used to limit the results.
limit
Service Class Support

Uber Class Support
query integer Maximum number of records to return. Max: 5000.
offset
Service Class Support

Uber Class Support
query string Starting index of overall result set from which to return ids.
sort
Service Class Support

Uber Class Support
query string The property to sort by.
parameters
Service Class Support

Uber Class Support
query string Full query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

response = falcon.query_host_groups(filter="string",
                                    offset=integer,
                                    limit=integer,
                                    sort="string"
                                    )
print(response)
Service class example (Operation ID syntax)
from falconpy import HostGroup

falcon = HostGroup(client_id="API_CLIENT_ID_HERE",
                   client_secret="API_CLIENT_SECRET_HERE"
                   )

response = falcon.queryHostGroups(filter="string",
                                  offset=integer,
                                  limit=integer,
                                  sort="string"
                                  )
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

response = falcon.command("queryHostGroups",
                          filter="string",
                          offset=integer,
                          limit=integer,
                          sort="string"
                          )
print(response)

CrowdStrike Falcon

Clone this wiki locally