Copying DataPower appliance domains between managed sets using scripting
Use the wsadmin tool to copy domains from one managed set to another, such as copying domains from a test environment to a production environment. Use the Datapower appliance manager and the wsadmin tool to manage appliances configured in the DataPower appliance manager.
Before beginning, set up the DataPower appliance manager by adding and configuring appliances, managed sets, and firmware versions.
The examples in this topic refer to a DataPower appliance manager which administers two managed sets of DataPower appliances. The productionSet managed set represents a production environment that uses three DataPower appliances. The testSet managed set represents a test environment that uses one DataPower appliance. Use the DataPower WebGUI to configure and test the domains for the test environment managed set. Then, use this topic to copy the domains to the production environment. Modify the examples to best configure the environment.
To view additional information and examples for the commands in this topic, refer to the documentation for the dpManagerCommands .
Tasks
- Start the wsadmin scripting tool.
- Determine the ID of the managed set.
Use the dpGetAllManagedSetIDs command to display the IDs of each managed set in the DataPower appliance manager configuration, as the following command demonstrates:
print AdminTask.dpGetAllManagedSetIds()Use the dpGetManagedSet command to display attributes for a given specific managed set ID:
print AdminTask.dpGetManagedSet('-managedSetId testSet')- Determine the ID of the domain version to copy to the managed set.
Use the dpGetAllMSDomainVersionIds command to display the IDs of each domain version for the BANKING domain:
print AdminTask.dpGetAllMSDomainVersionIds('[-msDomainId testSet:BANKING]')"The command returns string array containing the IDs of each domain within the managed set. We can optionally use the dpGetMSDomain command to display additional information for a specific domain ID.
- Copy the domain version to the managed set.
Use the dpCopyMSDomainVersion command to copy the domain version from the test environment to the production environment:
copyTask=AdminTask.dpCopyMSDomainVersion('[-managedSetId productionSet -msDomainVersionId "testSet:BANKING:1"]')The command submits a task to the DataPower appliance manager and assigns the task identifier to the copyTask variable.
- Verify the system successfully copied the domain version to the managed set.
Use the dpGetTask command to display the status and result information about the task:
AdminTask.dpGetTask('-taskId copyTask')The commands return information about the asynchronous task of interest. The isComplete attribute displays a value of true if the task is complete. If it is not complete, note the value for the taskStatus attribute. If the returned value is 0, then the task is in a queue and the system has not started the task. If the returned value is 1, then the task is in progress. If the returned value is 2, then the task completed successfully. If the returned value is 3, then the task experienced an exception.
The system uses the testSet:BANKING:1 version of the productionSet managed set in the production environment.
What to do next
Use the DataPower WebGUI to configure additional domains.
Use the commands in the dpManagerCommands command group and the wsadmin tool to manage appliances, firmware, domains, managed sets, and appliance-specific settings. Additionally, the system creates versions of domains, firmware, and appliance-specific settings. Use the DataPower appliance manager and the wsadmin tool to modify the current version, or to revert to previous versions of domains, firmware, and appliance-specific settings.
Related:
WebSphere DataPower appliance manager overview Set up the DataPower appliance manager using scripting Update firmware versions for DataPower appliances using scripting Administer managed domains, firmware, and settings versions using scripting Administer DataPower appliance domains Add a new managed set dpManagerCommands