Demo Application

The Demo Application illustrates how to use the Server Automation REST API to execute automation plans and monitor plan actions through JSP pages with jQuery/AJAX. It includes sample pages for form-based and manual execution (/sa-webapp/demo/execute/form, /sa-webapp/demo/execute/manual) and status monitoring (/sa-webapp/demo/status); it is provided for reference only, was developed for Firefox, and is not officially supported.

Help Contents for the Server Automation Demo Application

About the Demo Application

This application has been provided as part of the Server Automation REST API deployment to demonstrate how the API can be used by external clients as an interface to the Server Automation application.
Note: This application was developed using Firefox, so support for other browsers has not been tested.
The application itself consists of a number of JSP pages and JavaScript files. The jQuery JavaScript library has been used to provide AJAX capability to interact with the Server Automation REST API. While JavaScript has been the technology selected for this application, a client of the Server Automation REST API could just as easily be a J2EE application or some other web-based technology. The WAR file containing the files of this application is: <INSTALL ROOT>\wlp\usr\servers\defaultServer\apps\sa-webapp.war. This application and the files contained within it are provided only for reference and therefore are not officially supported.

Executing a Plan

The execution of an automation plan is a two-step process:
  1. Get the plan execution template XML document for the plan to be executed.

    This contains a list of any parameters required by the plan in order for it to be executed, much like the Parameters tab in the Default Settings or Take Action dialogs in the Server Automation domain of the BigFix console.

  2. Supply the completed plan execution template XML document back to the API to execute the plan.

    The completed template must contain a value for every required parameter, as well as a set of targets for each step in the plan. It may also set some runtime values such as execution time scheduling, the plan action name and the enablement of download pre-fetching.

The two URLs listed below are for JSP pages that demonstrate how a plan can be executed via the Server Automation REST API using JavaScript-based AJAX. For more details about the automation plan API, see /serverautomation/help.
Table 1. Page URL usage
Page URL Usage
/sa-webapp/demo/execute/form
  • User is prompted to enter credentials to be used with the Server Automation API.
  • User must then enter (via a form) the details of a plan to be executed.
  • By means of a button click, the REST API is invoked to get the plan execution template for the selected plan.
  • The XML returned by the AJAX call to the REST API is processed in JavaScript. From that, a form-based value entry mechanism is rendered on the page. This provides a user-friendly way of executing plans that could be suitable for web page-based consumers of the API.
/sa-webapp/demo/execute/manual
  • User is prompted to enter credentials to be used with the Server Automation API.
  • User must then enter (via a form) the details of a plan to be executed.
  • By means of a button click, the REST API is invoked to get the plan execution template for the selected plan.
  • The XML returned by the AJAX call to the REST API is processed in JavaScript. From that, a 'manual' or raw XML manipulation mechanism is rendered on the page. This provides a way of executing plans that could be suitable for application-based consumers of the API.

Monitoring a Plan Action

Using the Server Automation REST API, it is possible to get the latest status details for a given plan action. The level of detail provided is comparable to that displayed by the Automation Plan Actions Status dashboard in the BigFix console. The URL listed below is for a JSP page that demonstrates how a plan action can be monitored via the Server Automation REST API using JavaScript-based AJAX. For more details about the automation plan action API, see /serverautomation/help.
Table 2. Page URL usage
Page URL Usage
/sa-webapp/demo/status
  • User is prompted to enter credentials to be used with the Server Automation API.
  • User must then enter (via a form) the ID of a plan action whose status is to be found.
  • By means of a button click, the REST API is invoked every 5 seconds to get the latest status XML for the selected plan action.
  • The XML returned by the AJAX call to the REST API is processed in JavaScript. From that, a simple status table is rendered on the page, with the latest values updated with every REST invocation. This shows how plan action status details can be consumed by external clients of the API.
  • When the specified plan action changes from an Open state (i.e., into Stopped or Expired), the polling of status is stopped automatically.

Viewing the Help

The page you are currently viewing.
Table 3. Page URL usage
Page URL Usage
/sa-webapp/demo/help
  • User is presented with the help page.