Displaying script library help information
The script library provides Jython script procedures to assist in automating the environment. The script library includes help commands to list each available script library, display information for specific script libraries, and to display information for specific script procedures.
The scripting library provides a set of procedures to automate the most common application server administration functions. There are three ways to use the Jython script library.
- Run scripts from the Jython script library in interactive mode with wsadmin.sh. We can launch wsadmin.sh, and run individual scripts that are included in the script library using the following syntax:
wsadmin>AdminServerManagement.createApplicationServer("myNode", "myServer", "default")
- Use a text editor to combine several scripts from the Jython script library, as the following sample displays:
# # myscript.py # AdminServerManagement.createApplicationServer("myNode", "Server1", "default") AdminServerManagement.createApplicationServer("myNode", "Server2", "default") # Use one of them as the first member of a cluster AdminClusterManagement.createClusterWithFirstMember("myCluster", "APPLICATION_SERVER", "myNode", "Server1") # Add a second member to the cluster AdminClusterManagement.createClusterMember("myCluster", "myNode", "Server3") # Install an application AdminApplication.installAppWithClusterOption("DefaultApplication", "..\installableApps\DefaultApplication.ear", "myCluster") # Start all servers and applications on the node AdminServerManagement.startAllServers("myNode")Save the custom script and run it from the command line, as the following syntax demonstrates:bin>wsadmin -language jython -f path/to/your/jython/file.py
- Use the Jython scripting library code as sample syntax to write custom scripts. Each script example in the script library demonstrates best practices for writing wsadmin scripts. The script library code is located in the app_server_root/scriptLibraries directory. Within this directory, the scripts are organized into subdirectories according to functionality. For example, the app_server_root/scriptLibraries/application/V70 subdirectory contains procedures that perform application management tasks that are applicable to Version 7.0 and later of the product. The subdirectory V70 in the script library paths does not mean the scripts in that subdirectory are Version 7.0 scripts.
Use the AdminLibHelp script library to display general information about each script library, specific information about a specific script library, and information about specific scripts.
- Display general script library information.
Use the following command invocation to display general script library information with wsadmin.sh:
print AdminLibHelp()
- Display scripts in a specific script library.
We can also use AdminLibHelp script to display each script within a specific script library. For example, the following command invocation displays each script in the AdminApplication script library:
print AdminLibHelp.help("AdminApplication")
- Display detailed script information.
Use the help script with the script library of interest to display detailed descriptions, arguments, and usage information for a specific script. For example, the following command invocation displays detailed script information for the listApplications script in the AdminApplication script library:
print AdminApplication.help('listApplications')
Related tasks
Automating server administration Automating administrative architecture setup library Automating application configurations Automating business-level application configurations Automating data access resource configuration Automating messaging resource configurations Automating authorization group configurations Automating resource configurations
Server settings configuration scripts Server configuration scripts Server query scripts Cluster configuration scripts Cluster query scripts Cluster administration scripts Node administration scripts Node group configuration scripts Application installation and uninstallation scripts Application query scripts Application update scripts Application export scripts Application deployment configuration scripts Application administration scripts J2C query scripts J2C configuration scripts JMS configuration scripts JMS query scripts JDBC configuration scripts JDBC query scripts Resource configuration scripts Authorization group configuration scripts Business-level application configuration scripts