Api to push existing fixlet

(imported topic written by mcalvi91)

Is there an API to push known fixlets to systems? For example, i would like to push fixlet ID 1300609 in the Patches for Windows (English) site to a set of computers. Can this be done via the rest API?

(imported comment written by BrianPGreen)

There is not a simple way to do this. However, it is possible to do this by GET-ing the fixlet that you want to push, constructing the action xml from that fixlet, and then POST-ing the action.

(imported comment written by nberger91)

Did you make progress on this, grateful if you could share ??

(imported comment written by MattPeterson)

If you know the fixlet ID and sitename you can post it as an action as follows:

POST
https://besserver.domain.com:52311
/api/actions

BODY:

<?xml version="1.0" encoding="UTF-8"?>
   <BES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BES.xsd">
   <SourcedFixletAction>
   <SourceFixlet>
   <Sitename>Patches for Windows</Sitename>
   <FixletID>1300609</FixletID>
   <Action>Action1</Action>
   </SourceFixlet>
   <Target>
   <ComputerName>computer1</ComputerName>
   <ComputerName>computer2</ComputerName>
   </Target>
   </SourcedFixletAction>
   </BES>

(imported comment written by nberger91)

Thanks, I got this piece working …

Would you happen to know where in the XML i edit to include a pre-action message ?

(imported comment written by MattPeterson)

You could take an action in the console with the settings you want then export the action to obtain the .bes file. That file would be our xml and would have all the action settings. Be sure to add/change the target though, otherwise it will target ALL computers. Using this approch would create the aciton on the fly each time, so if the content is ever updated in the console you would have to manually modify your xml to be in sync.

You could also try to add some of the action settings rectived from the exported .bes file and add that to the method I prevously outlined, I’ve never tried that, so I’m not sure if it would work.

(imported comment written by nberger91)

We have created an automated process that deloys relevant security hotfixes to specific machines. I cannot export an action to call via the besimport tool as the fixlet id would change on a per machine basis, meaning i would have to create hundred’s of test actions.

I’ve tried editing the the current xml to include a pre and/or post actions but it errors out with a format error.

(imported comment written by MattPeterson)

Well, I don’t know how the automated process you mentioned works… But from what I gathered your best option may be to go the route Brian suggested.

You do a GET to retireve the XML from a fixlet. You could then modify that data ,and add action settings, to create a xml to post a new action. (You would obviously want to automate this process somehow).

Your get command would look like this:

https://besserver.com:52311/api/fixlet/external/Patches%20for%20Windows/12
.

Maybe a better option would be to create baselines that include groups of desired fixlets. You should then be able to modify the default behavior of that baseline to include the pre and post action stuff, then just call the baseline ID. Your default action behavior should be taken.

Good luck!