Example: Migrating - Listing configured server groups

The following examples demonstrate how to list configured server groups in the WAS V4.0 and V6.x:

  • wscp V4.0

    ServerGroup list
    
    We can put the result of this command into a Jacl list and invoke other operations, such as show, or modify, on the members of the list.

  • wsadmin V6.x

    Jacl

    $AdminConfig list ServerCluster
    

    Jython

    AdminConfig.list('ServerCluster')
    

    We can put the result of this command into a Jacl list and invoke other configuration commands, such as show, or modify, on the members of the list. To invoke operational commands, such as stop, perform the following:

    1. Obtain the configuration ID of the cluster:

      Jacl

      set myclust [$AdminConfig getid /ServerCluster:mycluster/]
      

      Jython

      myclust = AdminConfig.getid('/ServerCluster:mycluster/')
      

    2. Use the returned name to obtain the ObjectName of the running cluster MBean:

      Jacl

      set runningCluster [$AdminConfig getObjectName $myclust]
      

      Jython

      runningCluster = AdminConfig.getObjectName(myclust)
      

    3. The runningCluster has the object name for the running instance of the ServerCluster, or is empty if not running. Use this object name for control purposes, for example:

      Jacl

      $AdminControl invoke $runningCluster stop
      

      Jython

      AdminControl.invoke(runningCluster, 'stop')
      


 

See Also


Commands for the AdminConfig object