WAS v8.5 > Script the application serving environment (wsadmin)Use the wsadmin scripting objects
The wsadmin tool utilizes a set of management objects which allow us to run commands and command parameters to configure the environment. Use the AdminConfig, AdminControl, AdminApp, AdminTask, and Help objects to perform administrative tasks. Each of the management objects have commands used to perform administrative tasks. To use the scripting objects, specify the scripting object, a command, and command parameters. In the following example, AdminConfig is the scripting object, attributes is the command, and ApplicationServer is the command parameter.
Jython:
print AdminConfig.attributes('ApplicationServer')
Jacl:
$AdminConfig attributes ApplicationServer
Administrative functions within the application server are divided into two categories: functions that work with the configuration of application server installations, and functions that work with the currently running objects on application server installations. Scripts work with both categories of objects. For example, an application server is divided into two distinct entities. One entity represents the configuration of the server that resides persistently in a repository on permanent storage.
- Use the AdminConfig object, AdminTask, and the AdminApp object to handle configuration functionality.
The AdminConfig object, AdminTask, and the AdminApp object are used when we are managing the configuration of the server that resides persistently in a repository on permanent storage. Use these objects to create, query, change, or remove this configuration without starting an application server process. To use AdminTask, you must be connected to a running server.
- Use the AdminControl object to manage running objects on application server installations.
The AdminControl object is used when managing the running instance of an application server by a JMX MBean. This instance can have attributes that we can interrogate and change, and operations that we can invoke. These operational actions that are taken against a running application server do not have an effect on the persistent configuration of the server. The attributes that support manipulation from an MBean differ from the attributes the corresponding configuration supports. The configuration can include many attributes that we cannot query or set from the running object.
The application server scripting support provides functions to locate configuration objects and running objects. The objects in the configuration do not always represent objects that are currently running. The AdminControl object manages running objects.
- Use the Help object to obtain information about the AdminConfig, AdminApp, AdminControl, and AdminTask objects, to obtain interface information about running MBeans, and to obtain help for warnings and error messages.
Subtopics
- Help object for scripted administration using wsadmin.sh
The Help object provides general help, online information about running MBeans, and help on messages.- Use the wsadmin scripting AdminApp object for scripted administration
Use the AdminApp object to manage applications.- Use the wsadmin scripting AdminControl object for scripted administration
The AdminControl scripting object is used for operational control. It communicates with MBeans that represent live objects running a WebSphere server process.- Use the wsadmin scripting AdminConfig object for scripted administration
Use the AdminConfig object to manage the configuration information stored in the repository.- Use the wsadmin scripting AdminTask object for scripted administration
Use AdminTask to access a set of administrative commands that provide an alternative way to access the configuration commands and the running object management commands.- Help object for scripted administration using wsadmin.sh
The Help object provides general help, online information about running MBeans, and help on messages.
Related concepts:
Use wsadmin scripting with Jacl
Related
Start the wsadmin scripting client using wsadmin.sh