Oh hey Matt!
So did you have a chance to check out the demo application that’s shipped with the REST API deployment?:
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/The%20Demo%20Application
This should give you an idea of how to interact with the server, but in short, it’s a 2 step process:
-
Make a
GET
request to the server to indicate which existing plan you want to execute.
> The server will respond to you with an XML document that is an execution skeleton of the plan -
On this skeleton, you fill in the desired parameter values and targets for each step and then
POST
it back.
> When the server gets this ‘filled in’ skeleton, it has everything it needs to execute the plan (and does so).
Ordinarily, you could use a tool like curl
to interact with a REST API, but because there’s a little bit of processing to be done between parts (1) and (2) above, you could use something like node
and make AJAX calls to interact with the API. Of course, you could use whatever client side technology you like, which I suppose is part of the appeal of interacting via REST.
One alternative you might consider if for example you don’t have a Windows machine to deploy the REST API, is extracting the XML from a previously run instance of the plan (i.e. a plan action - you can view these in the console at either All Content > Actions
or for a smaller number of actions to look through: All Content > Sites > Master Action Site > Actions
).
Once you know the ID of the plan action, you could use the platform REST API (see here) to retrieve it. This contains the full definition of the plan action that is processed by our plan engine, so you could also consider just updating this and using the platform REST API (see here) to create (or more correctly, import) a new action that will get processed by the plan engine (i.e. executed).
Now this method might be a little less pleasant to work with because the document you get returned here is essentially an XML document (plan XML) within another XML document (a standard BES action definition), but it does remove the requirement for the SA REST API deployment, so just something to consider. In either case though, there will be some XML manipulation to be done (to simulate the selection of targets and parameter values like you would do in the UI normally)