Create configuration objects using the wsadmin tool

 

+

Search Tips   |   Advanced Search

 

Overview

Perform this task if you want to create an object. To create new objects from the default template, use the create command. Alternatively, one can create objects using an existing object as a template with the createUsingTemplate command.

 

Procedure

Start wsadmin and execute...

Using Jacl:

### List available templates 
$AdminConfig listTemplates JDBCProvider

### 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. The following example uses a node as the valid object type: 

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

### Specify the template that you want to use
 
### 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 you want to use before you perform the next step, creating 
### an object using a template.  

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

### Create the object

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

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


Jython

AdminConfig.listTemplates('JDBCProvider')
n1 =  AdminConfig.getid('/Node:mynode/')
t1 = AdminConfig.listTemplates('JDBCProvider', 'DB2 JDBC Provider (XA)')
AdminConfig.createUsingTemplate('JDBCProvider', n1, [['name', 'newdriver']], t1)

In a network deployment environment only, synchronize the node.


 

See Also

Commands for the AdminConfig object