Scripting commands in MoRE
IBM® Modernized Runtime Extension for Java™ (MoRE) introduces new wsadmin commands, properties, and supported values for managed Liberty servers. MoRE also changes the default values for some command parameters.
The following information describes the new and changed wsadmin commands in MoRE and provides links to related command descriptions
in the Network Deployment 9.0.5 documentation. Changes for
MoRE are highlighted in the 9.0.5 command
descriptions with a icon.
- AdminTask.createManagedLibertyServer
- AdminTask.listServers
AdminTask.createCluster
AdminTask.listManagedLibertyInstallations
AdminTask.getConfiguredManagedLibertyInstallation
AdminTask.setConfiguredManagedLibertyInstallation
AdminTask.installJakartaMQResourceAdapter
AdminTask.uninstallJakartaMQResourceAdapter
AdminConfig.create
AdminApplication.configureClassLoaderLoadingModeForAnApplication
AdminApp.edit
- AdminApp.install
- AdminApp.installInteractive
SDK commands for the AdminTask object
AdminTask.createManagedLibertyServer
The createManagedLibertyServer command creates a managed Liberty server. Specify the name of the node on which to create the server and the name of the managed Liberty server.
AdminTask.createManagedLibertyServer('node_name', ['-name', 'mls_server_name'])
The following example command creates the mls1 managed Liberty server on the MyNode01
node.
AdminTask.createManagedLibertyServer('MyNode01', ['-name', 'mls1'])
For information about similar commands, see ServerManagement command group for the AdminTask object in the Network Deployment 9.0.5 documentation.
AdminTask.listServers
The listServers command with the MANAGED_LIBERTY_SERVER
server type returns a list of managed Liberty
servers.
AdminTask.listServers('[-serverType MANAGED_LIBERTY_SERVER ]')
The following example returned list includes information about the mls2 and
mls1 servers on the node.
u'mls2(cells/MyCell01/nodes/MyNode01/servers/mls2|server.xml)
\r\nmls1(cells/MyCell01/nodes/MyNode01/servers/mls1|server.xml)'
For more information, see ServerManagement command group for the AdminTask object in the Network Deployment 9.0.5 documentation.
AdminTask.createCluster
The createCluster command with the MANAGED_LIBERTY_SERVER
cluster type creates a cluster to which you can add managed Liberty servers as cluster members. The following
example command creates a cluster named cluster1 with the
MANAGED_LIBERTY_SERVER cluster type.
AdminTask.createCluster(['-clusterConfig', ['-clusterName', 'cluster1',
'-clusterType', 'MANAGED_LIBERTY_SERVER']])
For more information, see ClusterConfigCommands command group for the AdminTask object in the Network Deployment 9.0.5 documentation.
AdminTask.listManagedLibertyInstallations
The listManagedLibertyInstallations command lists the locations and versions
of each Liberty installation available to a
specified node. The following example command lists information about the Liberty installations on the node1
node.
AdminTask.listManagedLibertyInstallations(‘[-nodeName node1]')
The following example returned list includes the locations and versions of the Liberty installations on the node1
node.
[[location /opt/liberty/wlp] [version 25.0.0.11] ]
[[location /opt/liberty2/wlp] [version 25.0.0.8] ]
For information about similar commands, see ServerManagement command group for the AdminTask object in the Network Deployment 9.0.5 documentation.
AdminTask.getConfiguredManagedLibertyInstallation
The getConfiguredManagedLibertyInstallation command returns the location and
version of the configured Liberty installation of
a specified node. The configured Liberty
installation is the Liberty installation that a
node uses to run managed Liberty servers. The
following example command returns information about the configured Liberty installation of the node1
node
AdminTask.getConfiguredManagedLibertyInstallation('[-nodeName node1]')
The following returned example includes the location and version of the configured Liberty installation of the node1
node.
[[location /opt/liberty/wlp] [version 25.0.0.11] ]
For information about similar commands, see ServerManagement command group for the AdminTask object in the Network Deployment 9.0.5 documentation.
AdminTask.setConfiguredManagedLibertyInstallation
The setConfiguredManagedLibertyInstallation command sets the specified Liberty installation location as the configured Liberty installation of a specified node. The
following example command sets the Liberty
installation location, /opt/liberty2/wlp, as the configured Liberty installation for the node1
node.
AdminTask.setConfiguredManagedLibertyInstallation(‘[-nodeName node1 -location /opt/liberty2/wlp]’)
All managed Liberty servers running on a specified node must be stopped before you switch Liberty installations on the node. After the Liberty installation is switched, the node must be synced before any managed Liberty servers are started.
For information about similar commands, see ServerManagement command group for the AdminTask object in the Network Deployment 9.0.5 documentation.
AdminTask.installJakartaMQResourceAdapter
The installJakartaMQResourceAdapter command copies a Jakarta MQ resource
adapter with a specific resource adapter archive (RAR) file name to a named node. The Jakarta MQ
resource adapter is used by the wmqMessagingClient feature in any managed Liberty servers on the named node. The following
example command copies the Jakarta MQ resource adapter installation location,
/tmp/wmq/wmq.jakarta.jmsra.rar, as the configured Liberty Jakarta MQ resource
adapter for the node1 node.
AdminTask.installJakartaMQResourceAdapter('[ [-nodeName node1] [-path /tmp/wmq/wmq.jakarta.jmsra.rar] ]')
Before rolling back to an earlier version of WebSphere® Application Server traditional on a node when a Jakarta MQ resource adapter is installed, the resource adapter must be uninstalled from the node.
For information about similar commands, see ServerManagement command group for the AdminTask object in the Network Deployment 9.0.5 documentation.
AdminTask.uninstallJakartaMQResourceAdapter
The uninstallJakartaMQResourceAdapter command removes a Jakarta MQ resource
adapter from a node. The Jakarta MQ resource adapter is no longer allowed to be used by the
wmqMessagingClient feature in any managed Liberty server on the named node. The following
example removes the Jakarta MQ resource adapter from the node1 node.
AdminTask.uninstallJakartaMQResourceAdapter('[ [-nodeName node1] ]')
For information about similar commands, see ServerManagement command group for the AdminTask object in the Network Deployment 9.0.5 documentation.
AdminConfig.create
AdminConfig.create('LibraryRef', appClassLoader, [ ['libraryName', 'MySharedLibrary'] ])For more information, see Configuring a shared library for an application using wsadmin scripting in the Network Deployment 9.0.5 documentation.
AdminApplication.configureClassLoaderLoadingModeForAnApplication
The configureClassLoaderLoadingModeForAnApplication script configures the class loader loading mode for an application. Specify the name of the application and the name of the class loader loading mode.
AdminApplication.configureClassLoaderLoadingModeForAnApplication(appName, classloaderMode)
The following example sets the class loader loading mode for the
MyJakartaEEApplication application to PARENT_LAST.
AdminApplication.configureClassLoaderLoadingModeForAnApplication("MyJakartaEEApplication", "PARENT_LAST")
For more information about application deployment script procedures, see Application deployment configuration scripts in the Network Deployment 9.0.5 documentation.
AdminApp.edit
AdminApp.edit(appName, '[-MapSharedLibForMod [ [appName
META-INF/application.xml libraryName] ]]' )For more information, see Options for the AdminApp object install, installInteractive, edit, editInteractive, update, and updateInteractive commands using wsadmin scripting in the Network Deployment 9.0.5 documentation.
AdminApp.install
Some application options for the install command have different default values or behaviors when you install a Jakarta EE 10 application on a managed Liberty server.
For more information, see Options for the AdminApp object install, installInteractive, edit, editInteractive, update, and updateInteractive commands using wsadmin scripting in the Network Deployment 9.0.5 documentation.
AdminApp.installInteractive
MoRE adds the targetRuntime
option. After you run the installInteractive command, the
targetRuntime option is shown. The default value is WebSphere Application
Server traditional. To install your application on a managed Liberty server, specify WebSphere
Liberty.
AdminApp.installInteractive('EE10.ear/.war')
targetRuntime : WebSphere Application Server traditional/WebSphere Liberty :
[WebSphere Application Server traditional] WebSphere Liberty
After you specify WebSphere Liberty for targetRuntime, complete
Task[1]: Specifying application options selections. As with the install command, some application options for the
installInteractive command have different default values or behaviors when you
install a Jakarta EE 10 application on a managed Liberty server.
For more information, see Options for the AdminApp object install, installInteractive, edit, editInteractive, update, and updateInteractive commands using wsadmin scripting in the Network Deployment 9.0.5 documentation.
SDK commands for the AdminTask object
Several admin tasks exist for configuring the Java SDK to use at the node and server level.
- getNodeDefaultSDK
- setNodeDefaultSDK
- getServerSDK
When the getServerSDK command runs on a traditional application server, it returns the Java 8 SDK even if that server is on a MoRE enabled node.
- setServerSDK
- getSDKVersion
- getUnusedSDKsOnNode
- getAvailableSDKsOnNode
- getSDKPropertiesOnNode
wsadmin>print AdminTask.getAvailableSDKsOnNode('[-nodeName node1]')
17.0
21.0
wsadmin>print AdminTask.getNodeDefaultSDK('[-nodeName node1]')
[[javahome /opt/liberty/wlp/java/21.0] [sdkname 21.0] ] An exception is when a
traditional application server is the subject of the command as shown in the following
example.wsadmin>print AdminTask.getSDKVersion('[-nodeName node1 -serverName server1]')
8.0When a MoRE node is not a deployment manager node, the getAvailableSDKsOnNode command and the getSDKPropertiesOnNode command return only the SDKs relevant to managed Liberty servers.
The parameters of these commands in the AdminSDKCmds command group and the ManagedObjectMetadata command group remain unchanged.
When MoRE is installed at the target node, or the target cluster is a managed Liberty cluster, commands in the AdminSDKCmds command group and the ManagedObjectMetadata command group deal with Liberty SDKs.
When MoRE is not installed at the deployment manager, the behavior for these commands is unchanged.