Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Use the wsadmin scripting AdminConfig object for scripted administration


Create configuration objects using the wsadmin scripting tool

We can use scripting and wsadmin.sh to create configuration objects.

Perform this task to create an object.

To create new objects from the default template, use the create command. Alternatively, you can create objects using an existing object as a template with the createUsingTemplate command. We can only use the createUsingTemplate command for creation of a server with APPLICATION_SERVER type. To create a server with a type other than APPLICATION_SERVER, use the createGenericServer or the createWebServer command.


Procedure

  1. Start wsadmin.sh.

  2. Use the AdminConfig object listTemplates command to list available templates:

      ### Jacl

      $AdminConfig listTemplates JDBCProvider
      

      ### Jython

      AdminConfig.listTemplates('JDBCProvider')
      

  3. Assign the ID string that identifies the existing object to which the new object is added. We can add the new object under any valid object type. Use a node as the valid object type:

      ### Jacl

      set n1 [$AdminConfig getid /Node:mynode/]
      

      ### Jython

      n1 =  AdminConfig.getid('/Node:mynode/')
      

  4. Specify the template to use:

      ### Jacl

      set t1 [$AdminConfig listTemplates JDBCProvider "DB2 JDBC Provider (XA)"]
      

      ### Jython

      t1 = AdminConfig.listTemplates('JDBCProvider', 'DB2 JDBC Provider (XA)')
      

    If you supply a string after the name of a type, you get back a list of templates with display names that contain the string you supplied. In this example, the AdminConfig listTemplates command returns the JDBCProvider template whose name matches DB2 JDBC Provider (XA). This example assumes that the variable that you specify here only holds one template configuration ID. If the environment contains multiple templates with the same string, for example, DB2 JDBC Provider (XA), the variable will hold the configuration IDs of all of the templates. Be sure to identify the specific template that to use before you perform the next step, creating an object using a template.

  5. Create the object with the following command:

      ### Jacl

      $AdminConfig createUsingTemplate JDBCProvider $n1 {{name newdriver}} $tl
      

      ### Jython

      AdminConfig.createUsingTemplate('JDBCProvider', n1, [['name', 'newdriver']], t1)
      

    All create commands use a template unless there are no templates to use. If a default template exists, the command creates the object.

  6. Save the configuration changes.

    Save the configuration changes:

    AdminConfig.save()
    

  7. In a multiple-server environment, synchronize the node.

    Use the syncActiveNode or syncNode scripts in the AdminNodeManagement script library to propagate the configuration changes to node or nodes.

    • Use the syncActiveNodes script to propagate the changes to each node in the cell:
      AdminNodeManagement.syncActiveNodes()
      

    • Use the syncNode script to propagate the changes to a specific node:
      AdminNodeManagement.syncNode("myNode")
      


Start the wsadmin scripting client using wsadmin.sh
Use the script library to automate the application serving environment using wsadmin.sh
Use the wsadmin scripting AdminConfig object for scripted administration


Related


Commands for the AdminConfig object using wsadmin.sh

+

Search Tips   |   Advanced Search