+

Search Tips   |   Advanced Search

Invoking an administrative command in batch mode using wsadmin.sh

Use AdminTask commands to invoke an administrative command in batch mode.

The steps describe how to invoke an administrative command in batch mode using wsadmin.sh.

To invoke an administrative command in interactive mode, see the topic on invoking a command in interactive mode.


Tasks

  1. Invoke the AdminTask object commands interactively, in a script, or use the wsadmin -c command from an operating system command prompt.

    See the topic on starting the wsadmin scripting client.

  2. Issue one of the following commands:

    • If an administrative command does not have a target object and an argument.

      Use Jacl:

      $AdminTask commandName
      

      Use Jython:

      AdminTask.commandName()
      

      Element Description
      $ Jacl operator for substituting a variable name with its value
      AdminTask is an object allowing administrative command management
      commandName is the name of the administrative command to invoke

    • If an administrative command includes a target object but does not include any arguments or steps.

      Use Jacl:

      $AdminTask commandName targetObject
      

      Use Jython:

      AdminTask.commandName(targetObject)
      

      Element Description
      $ Jacl operator for substituting a variable name with its value
      AdminTask object that supports administrative command management
      commandName Name of the administrative command to invoke
      targetObject is the target object string for the invoked administrative command. The expect target object varies with each administrative command. View the online help for the invoked administrative command to learn more about what we should specify as the target object.

    • If an administrative command includes an argument or a step but does not include a target object.

      Use Jacl:

      $AdminTask commandName options
      

      Use Jython:

      AdminTask.commandName(options)
      

      Element Description
      $ Jacl operator for substituting a variable name with its value
      AdminTask object that supports administrative command management
      commandName Name of the administrative command to invoke
      options is the option string for the invoked administrative command. Depending on which administrative command we are invoking, the administrative command can have required or optional option values. The options string is different for each administrative command. View the online help for the invoked administrative command to obtain more information about which options are available. Arguments and steps listed on the online administrative command help are specified as options in the option string.

      Each option consists of a dash followed immediately by an option name, and then followed by an option value if the option requires a value. If the invoked administrative command includes target objects, arguments, or steps, then the -interactive option is available to enter interactive mode. For example, using the output of the following online help for the listDataSource command:

      WASX8006I: Detailed help for command: exportServer
      
      Description: export the configuration of a 
      server to a config archive.
      
      Target object: None
      
      Arguments:
      *serverName - the name of a server
      *nodeName - the name of a node. This parameter 
      becomes optional if the specified server name 
      is unique across the cell.
      *archive - the fully qualified file path of 
      a config archive.
      
      Steps:
      None
      

      Option names are specified with a dash before the names. Three options are required for this administrative command. The required options are -serverName, -nodename, and -archive. In addition, the -interactive option is available. Options are specified in the option string, which is enclosed by a pair of braces ({}) in Jacl and a pair of brackets ([]) in Jython.

    • If an administrative command includes a target object, and arguments or steps:

      Use Jacl:

      $AdminTask commandName targetObject options
      

      Use Jython:

      AdminTask.commandName(targetObject, options)
      

      Element Description
      $ Jacl operator for substituting a variable name with its value
      AdminTask object that supports administrative command management
      commandName Name of the administrative command to invoke
      targetObject is the target object string for the invoked administrative command. The expected target object varies with each administrative command. View the online help for the invoked administrative command to obtain information about what to specify as a target object. For example, using the output of the following online help for createJ2CConnectionFactory:
      WASX8006I: Detailed help for command: 
      createJ2CConnectionFactory
      
      Description: Create a J2C connection factory
      
      *Target object: The parent J2C resource adapter of 
      the created J2C connection factory.
      
      Arguments:
      *connectionFactoryInterface - A connection factory 
      interface defined in the deployment 
      description of the parent J2C resource adapter.
      *name - The name of the J2C connection factory.
      *jndiName - The JNDI name of the created J2C 
      connection factory.
      description - The description for the created 
      J2C connection factory.
      authDataAlias - the authentication data alias of 
      the created J2C connection factory.
      
      Steps:
      None
      
      The target object is a configuration object name of a J2C resource adapter.
      options is the option string for the invoked administrative command. Depending on which administrative command we are invoking, the administrative command can have required or optional option values. The options string is different for each administrative command. View the online help for the invoked administrative command to obtain more information about which options are available. Arguments and steps listed on the online administrative command help are specified as options in the option string. Each option consists of a dash followed immediately by an option name, and then followed by an option value if the option requires a value. If the invoked administrative command includes target objects, arguments, or steps, then the -interactive option is available to enter interactive mode. For example, using the output of the following online help for listDataSource:
      WASX8006I: Detailed help for command: 
      createJ2CConnectionFactory
      
      Description: Create a J2C connection factory
      
      *Target object: The parent J2C resource adapter of 
      the created J2C connection factory.
      
      Arguments:
      *connectionFactoryInterface - A connection factory 
      interface defined in the deployment 
      description of the parent J2C resource adapter.
      *name - The name of the J2C connection factory.
      *jndiName - The JNDI name of the created J2C 
      connection factory.
      description - The description for the created J2C 
      connection factory.
      authDataAlias - the authentication data alias of 
      the created J2C connection factory.
      
      Steps:
      None
      
      Option names are specified with a dash before the names. The required options for this administrative command include: -connectionFactoryInterface, -name, and -jndiName. The optional options include: -description and -authDataAlias. In addition, we can also use the -interactive option. Options are specified in the option string, which is enclosed by a pair of braces ({}) in Jacl and a pair of brackets ([]) in Jython.


Example

  • Invoking an administrative command in interactive mode
  • Start the wsadmin scripting client