Server Automation Plan Execution via Rest API

I have been researching using API calls to run our Server Automation plans recently as we have started to leverage REST API for other BigFix functions in my environment with our migration into the Splunk world.

Server Automation is a heavily relied on function in my environment and my users complain about the performance of the Server Automation Domain navigation during our maintenance periods. Hence, my investigation of the API calls, which are lightning fast in comparison.

From all the research I have made via Google and the forums, it looks like it certainly be done….just trying to wrap my head around it all.

Based on my research, simple API calls can be made to “GET” an Automation Plan’s contents (by searching for the fixlet itself) and can be created via “POST” with the same content.

Where I am getting lost is the actual execution of the plan itself.

Reading this post with Paul Curren’s input XML is (Rest API To Initiate Server Automation Plan) Looks like XML definitely needed in order to kick of plans via API rather than just creating an action based off the FixletID, which I assumed was all that was needed (shown below)

If I do a Post to create a new action, with the full XML of my plan…I get a ‘400 error’ (will spare the space based on the size of the XML)

“https://:52311/api/actions”

When I mimic what we use for other automations (based on FixletID) I get better results:

“https://:52311/api/actions” with:

    <?xml version="1.0" encoding="UTF-8"?>
        <BES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:noNamespaceSchemaLocation="BES.xsd">
       <SourcedFixletAction>
        <SourceFixlet>
          <Sitename>Maintenance Tasks</Sitename>
          <FixletID>163381</FixletID>
          <Action>Action1</Action>
         </SourceFixlet>
  <Target>
    <ComputerName><hostname></ComputerName>
 </Target>
    </SourcedFixletAction>

The automation plan kicks off but immediately stops.

As mentioned by Paul in post #10 in the above Forums link…thatyou can not run REST API for a ‘Server Automation Plan’s’ execution based on the Automation Plan’s FixletID itself….rather we need to provide the XML data from the plan itself ( to ) to represent the required steps and target for this plan to run? (hopefully this isn’t too wordy and makes sense!)

(@HCL Would be great to Integrate Server Automation into WebUI! :sunglasses: )

Not an expert here, but since nobody else is replaying here are my two cents… Not sure if you have already read th edocumentation about the Server Automation API at: https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Server%20Automation%20REST%20API

To be more specific whit your question, yes, you have to create an xml file to submit an “automation Plan” rather than the single fixlet action. The POST serverautomation/plan action at the folowing link includes an example: https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Plan

Also, I assume that you can create the xml file, required by the POST, from that the output of the GET action of the specific plan. Hope it helps

That does help…though I did review both links prior.

With the vast number of plans we require to run, might not be worth the effort as it seems the XMS is required for sure.