Displaying script library help information with wsadmin
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 appserver administration functions. There are three ways to use the Jython script library.
- Run scripts from the Jython script library in interactive mode with the wsadmin tool. We can launch wsadmin, 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:
# # My Custom Jython Script - file.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 in the script library demonstrates best practices for writing wsadmin scripts. The script library code is located in...
$WAS_HOME/scriptLibrariesWithin this directory, the scripts are organized into subdirectories according to functionality, and further organized by version. For example, the $WAS_HOME/scriptLibraries/application/V70 subdirectory contains procedures that perform application management tasks that are applicable to V7.0 and later of WAS ND.
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:
print AdminLibHelp()- Display scripts in a specific script library. You 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 using the scripting library
Automating admin architecture setup using the scripting library
Automating application configurations using the scripting library
Automating business-level application configurations using the scripting library
Automating data access resource configuration using the scripting library
Automating messaging resource configurations using the scripting library
Automating authorization group configurations using the scripting library
Automating resource configurations using the scripting library.
Related
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