The public APIs are provided in the sps-compSDK.jar file on the product media. These Java classes and methods enable you to develop your own Java code to access N1 SPS functionality. For more information about the public APIs, see Sun N1 Service Provisioning System JavaDoc.
Before you can use the command-line APIs, you must acquire a CommandManager from a CommandManagerBuilder. The following code example illustrates how to acquire a CommandManager.
public class CommandManagerBuilder {
/**
* Set the directory for the CLI installation directory
*/
public setHomeDirectory(File cliHomeDir){ ... }
/**
* Build a command manager with the properties set in this class
* @throws ConfigurationException incorrect properties
* specified for a valid CommandManager
*/
public CommandManager build() throws ConfigurationException {...}
}
Invoking the build method is an expensive operation. As a result, you should create only one CommandManager from which to execute commands.
The command-line APIs, as well as the actual command execution, can generate one of the following Java exceptions:
AuthenticationException - Result of improper user name and password for login
Network Exception - Result of a network transport problem
CommandException - Result of an error while executing a command on the MS.
ConfigurationException - Result of an improper CLI directory layout or other startup problem.
Includes classes and interfaces to execute CLI commands and query information from the Master Server
Includes classes and interfaces to identify the version number, visibility, and ID of N1 SPS objects
Includes three interfaces to group related objects, such as components and plans, in categories
Includes interfaces and classes for defining component information
Includes interfaces and classes for defining provisioning comparisons
Includes interfaces and classes for running plans and native OS commands
Includes interfaces for defining N1 SPS folders
Includes interfaces and classes for defining host criteria, including host sets, host IDs, host searches, applications running on specific hosts, and upgrade activities for specific hosts.
Includes interfaces for gathering information about components that are installed on target hosts
Includes interfaces and classes for running N1 SPS plans
Includes interfaces for defining plug-ins and enabling other users to browse these plug-in in the browser interface
Includes an interface for defining a resource
Includes interfaces and classes that you can use to define criteria and rules for specific actions
Includes interfaces and classes that you can use to set user and group permissions, IDs, and variables
Includes interfaces, classes, and exceptions that you can use to perform basic network connectivity validation, through ping and traceroute
Includes interfaces for defining lists and sets
Includes interfaces, classes, and exceptions for enumerations and enumerations types
Includes one interface that you can use to identify the source of variable settings