DCM (DataPower Configuration Manager) is an open source tool published by IBM for automating and simplifying the configuration and management of IBM DataPower appliances (with the exception of the XC10). It can be used standalone OR within IBM UrbanCode Deploy platform. Business partners, clients or anyone else for that matter can contribute enhancement or fixes to the tool.
DCM uses DataPower’s XML Management Interface (XMI) to interact and manipulate appliance’s management tasks in automated fashion. DCM uses ANT scripting to fully automate the build, deployment and release process of DataPower configuration and management.
One does need to be familiar with ANT to effectively use DCM. A simple ANT build file, deploy.ant.xml, included with the DCM distribution serves several simple purposes:
- Common deployment tasks at domain level and some at device level.
- DCM provided ANT based task and targets for custom deployment builds.
Some of the common deployment tasks provided in deploy.ant.xml include create, delete, backup (export), restore (import), reset, restart, quiesce, unquiesce, and save domains. Additional task are delete/restore/save checkpoints, Upload files or directories, valcred creation, create/delete/modify objects, and create/remove host aliases.
Deploy.ant.xml build file relies on certain ANT properties such as host, domain, uid, pwd, port, and some of the file location for backup, import, export, and upload files in addition to upload-to and upload-from directory locations. One very important property is the dcm.dir that points to the directory where DCM is installed. These properties could be provided in a <filename>.properties file and included within the custom build script or provided within an ANT call, such as following:
Ant –f deploy.ant.xml –propertyfile <filename>.properties check-access
Where check-access is a target defined within ANT script to checks access to DataPower device using the provided host, user id, and password.
Once installed and properly functioning, Using DCM effectively requires a little planning such as how to structure property files and the DCM definition files to best fit your needs. Thus little exploration of DCM directory and included files would be beneficial.
Step by step instructions and files :
Download the DCM zip file here.
1) JDK 1.6 or later
2) Apache Ant 1.8.1 or later (DCM is packaged with 1.9.4 and UCD plugin)
3) Xalan-J for Oracle/SUN JDK version (comes included with IBM JDK)
I have downloaded xalan-j 2.7.1-src-2jars for stability.
- Ensure JDK is installed and is included in the PATH
- Ensure Ant 1.8.1 is installed and is included in the PATH
- Include following five Xalan JAR files in the CLASSPATH
- Ensure DataPower device’s XML Management Interface (XMI) is enabled
- Test if DCM is properly working using the following command
ant -f deploy.ant.xml -Ddcm.dir=<path of dcm directory> -Dhost=<IP/hostname of the DP device> -Duid=<user ID> -Dpwd=<user Password> check-access
*use -Dport=<port #> if XML Management Interface is enabled on a port other than the default (5550)
*if -Dpwd=<user Password> is omitted in the above command then user will be prompted for password
Further test with other tasks:
Create or delete a domain by introducing the following in the above command instead of check-access
-Ddomain=<domain name> domain-create save
-Ddomain=<domain name> domain-delete save
Create a <fileName>.properties file that contains these ANT variables.
# DP credentials
dcm.dir=<path of dcm directory>
host=<IP/hostName of the DP device>
pwd=<user Password> (this could be omitted for security reason. Omitting it will prompt the user for password)
Use the following command to create a domain and save the configurations.
ant -f deploy.ant.xml -propertyfile <fileName>.properties domain-create save
While domain-create is a target within deploy.ant.xml, it utilizes the task of createDomain to serve the purpose.
. These tasks are defined in dcm\dcm-distros\dcm_1.0.1\src\dcm-taskdefs.ant file