Modifying configuration objects with the wsadmin tool

 

Modifying configuration objects with the wsadmin tool

Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.

Perform the following steps to modify a configuration object:

  1. Retrieve the configuration ID of the objects that you want to modify, for example:

    • Using Jacl:
      set jdbcProvider1 [$AdminConfig getid /JDBCProvider:myJdbcProvider/]
      

    • Using Jython:
      jdbcProvider1 = AdminConfig.getid('/JDBCProvider:myJdbcProvider/')

    where:

    set is a Jacl command
    jdbcProvider1 is a variable name
    $ is a Jacl operator for substituting a variable name with its value
    AdminConfig is an object representing the WebSphere Application Server configuration
    getid is an AdminConfig command
    /JDBCProvider:myJdbcProvider/ is the hierarchical containment path of the configuration object
    JDBCProvider is the object type
    myJdbcProvider is the optional name of the object

  2. Show the current attribute values of the configuration object with the show command, for example:

    • Using Jacl:
      $AdminConfig show $jdbcProvider1

    • Using Jython:
      AdminConfig.show(jdbcProvider1)

    where:

    $ is a Jacl operator for substituting a variable name with its value
    AdminConfig is an object representing the WebSphere Application Server configuration
    show is an AdminConfig command
    jdbcProvider1 evaluates to the ID of host node specified in step number 2

  3. Modify the attributes of the configuration object, for example:

    • Using Jacl:
      $AdminConfig modify $jdbcProvider1 {{description "This is my new description"}}

    • Using Jython list:
      AdminConfig.modify(jdbcProvider1, [['description', "This is my new description"]])

    • Using Jython string:
      AdminConfig.modify(jdbcProvider1, '[[description "This is my new description"]]')

    where:

    $ is a Jacl operator for substituting a variable name with its value
    AdminConfig is an object representing the WebSphere Application Server configuration
    modify is an AdminConfig command
    jdbcProvider1 evaluates to the ID of host node specified in step number 3
    description is an attribute of server objects
    This is my new description is the value of the description attribute
    You can also modify several attributes at the same time. For example:

    • Using Jacl:
      {{name1 val1} {name2 val2} {name3 val3}}

    • Using Jython list:
      [['name1', 'val1'], ['name2', 'val2'], ['name3', 'val3']]

    • Using Jython string:
      '[[name1 val1] [name2 val2] [name3 val3]]'

  4. Save the configuration changes. See the Saving configuration changes with the wsadmin tool article for more information.

  5. In a network deployment environment only, synchronize the node. See the Synchronizing nodes with the wsadmin tool article for more information.



Related concepts
AdminConfig object for scripted administration

Related reference
Commands for the AdminConfig object