Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Use the script library to automate the application serving environment using wsadmin.sh
Display script library help information using scripting
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:
wsadmin>AdminServerManagement.createApplicationServer("myNode", "myServer", "default")- Use a text editor to combine several scripts from the Jython script library:
# # 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:./wsadmin.sh -language jython -f path/to/myscript.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 WAS_HOME/scriptLibraries directory. Within 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 the product.
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.
Procedure
- 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.
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')
Automate server administration using wsadmin.sh
Automate administrative architecture setup using wsadmin.sh library
Automate application configuration
Automate business-level application configuration
Automate data access resource configuration using wsadmin.sh
Automate messaging resource configuration
Automate authorization group configuration
Automate resource configuration
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