WAS v8.5 > Script the application serving environment (wsadmin) > Use properties files to manage system configuration

Run administrative commands using properties files

Use wsadmin to run an existing administrative command using properties file based configuration. The command must not contain a parameter that uses a complex data type. Supported parameter types are basic types such as String, Long, Integer, Float, Double, Boolean, Character, Short, Byte, URL, and ObjectName, and complex types such as Array of basic types, Properties, DownLoadFile, and UpLoadFile.

Determine the administrative command to run. Ensure that all parameters in the command use only a supported data type. We can extract the properties required to run a command using the createPropertiesFileTemplates command. Specify GenericType for the configType parameter and a commandName option.

After extracting a properties file for a command, edit the properties file as needed, and then validate and apply the properties file.

For each of the commands in this topic, we can run in interactive mode by specifying the interactive parameter:

  1. Start the wsadmin scripting tool.

    To start wsadmin using the Jython language, run the following command from the bin directory of the server profile:

      wsadmin -lang jython
  2. Extract the properties required to run the administrative command.

    To extract the properties required to run a command, use the createPropertiesFileTemplates command. Specify GenericType for the configType parameter and commandName command_name for the options parameter.

    For example, to extract properties for the createSIBus command to a file named createSIBus.props, run the following command:

    AdminTask.createPropertiesFileTemplates('[-propertiesFileName createSIBus.props
      -configType GenericType -options [[commandName createSIBus]] ]')

    The resulting createSIBus.props file contains the following extracted properties:

    #
    CreateDeleteCommandProperties=true
    #SKIP=true
    commandName=createSIBus
    #
    
    #
    #Properties
    #
    busSecurity=false #Boolean
    highMessageThreshold=null #Long
    bus=myBus #String,required
    …
  3. Open an editor on the extracted properties file and modify the extracted properties file as needed.

    Ensure the extracted properties file provides suitable values for required parameters.

  4. Apply the properties file using the applyConfigProperties command.

    For example, to apply the createSIBus.props properties file, run following wsadmin command:

      AdminTask.applyConfigProperties('[-propertiesFileName createSIBus.props]')


Results

The administrative command runs and applies the properties file.

Save the changes to your configuration.


Related


Extracting properties files using wsadmin.sh
Validating properties files using wsadmin.sh
Applying properties files using wsadmin.sh
Use properties files to manage system configuration


Reference:

PropertiesBasedConfiguration command group for AdminTask using wsadmin.sh
Properties file syntax


+

Search Tips   |   Advanced Search