Add computers to manual group via Rest API

It is possible to update manual computer groups via REST, yes.

For reference, please see https://developer.bigfix.com/rest-api/api/computergroup.html

As an example, you might first perform a GET operation against the given computer group with something like:

/api/computergroup/master/<id>

That will return the XML document you could leverage to update the given computer group. With the current schema, it would return XML such as the following:

<?xml version="1.0" encoding="UTF-8"?>
<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
    <ManualComputerGroup Resource="https://bigfix:52311/api/computergroup/master/1260">
        <Name>Test Manual Group</Name>
        <EvaluateOnClient>false</EvaluateOnClient>
        <ComputerID>123456</ComputerID>
        <ComputerID>789101</ComputerID>
    </ManualComputerGroup>
</BESAPI>

Once you have the XML associated with the existing manual computer group, you can update it as desired, and then perform a PUT operation against the same /api/computergroup/master/<id> resource. Note that the ComputerIDs specified in the XML document that you PUT to the API should include all the ComputerIDs you want to be part of the manual group (rather than just the additions to the group). In this way, you are essentially updating the definition of the group in its entirety. A sample call to the IEM CLI might look like:

iem PUT group.xml /api/computergroup/master/1260

where group.xml contains the updated manual computer group XML definition.

1 Like