This document provides a list of various “recipes” explaining how to perform most common tasks with DPBuddy 3.4. You can find more details in our samples and documentation.
This is a living document, we’ll be updating it based on the feedback and questions we receive from users.
CLI:
dpbuddy import -file dpconfigs/WSProxy.zip -save -quiesce -assertObjectsUp -unquiesce -assertObjectsUp
Ant:
<dp:import file="${wsproxy.zip.file}" save="true" quiesce="true" assertObjectsUp="true" unquiesce="true"/>
CLI:
dpbuddy import -file dpconfigs/XMLFirewall.xml -updates "LocalPort:3087, DebugMode:off" -applyUpdatesTo "XMLFirewallService:testFirewall"
Ant:
<dp:import file="${dpconfig.home}/XMLFirewall.xml" updates="LocalPort:3087, DebugMode:off" applyUpdatesTo="XMLFirewallService:testFirewall" />
Create file transformDefs.xml containing your transformations:
<project name="transforms" xmlns:dp="antlib:com.myarch.dpbuddy" > <dp:transform verbose="true" id="set.fw.port"> <setText xpath="//*[@name='testFirewall']/LocalPort" value="3087"/> </dp:transform> </project>
You can then reference the file from CLI:
dpbuddy import -file dpconfigs/XMLFirewall.xml -transformDefs transformDefs.xml -transformId "set.fw.port"
CLI:
dpbuddy export -file dpconfigs/XMLFirewallSorted.xml -classPattern XMLFirewallService -sortObjects dpbuddy import -file dpconfigs/XMLFirewallSorted.xml -reimportOnError
Ant:
<dp:export file="${export.xml.file}" classPattern="XMLFirewallService" sortObjects="true"/> <dp:import file="${export.xml.file}" reimportOnError="true"/>
CLI:
dpbuddy syslogTarget -name syslg-trg -remoteHost syslog-server -remotePort 123 -localIdentifier dp7-qa--test" -localAddress dp-qa -levelInfo "all:info, mgmt:info"
Ant:
<dp:syslogTarget name="syslog-trg" remoteHost="syslog-server" remotePort="123" localIdentifier="dp7-qa--test" localAddress="dp-qa" levelInfo="all:info, mgmt:info" />
CLI:
# Change logging levels of all targets that start with "syslog" dpbuddy updateLogTargetLevel -name "syslg.*" -levelInfo "all:notice, mgmt:warn"
Ant:
<dp:updateLogTargetLevel name="syslg.*" levelInfo="all:notice, mgmt:warn" />
CLI:
dpbuddy tail -f -domainPatterns "dpbuddy-.*, e2e.*" -lines 100
export DP_MASTER_PASSWORD="secret"
dpbuddy encrypt -value dpbuddy
In dpbuddy.conf:
// Output of the ecrypt command: testAliasPassword: "ENC{r5MmGcyzV01h1ErKUx6/uA==}"
CLI:
dpbuddy passwordAlias -name "test-alias" -passwd "\${testAliasPassword}"
Ant:
<dp:passwordAlias name="test-alias" passwd="${testAliasPassword}" />
# Set certain objects to "up" admin state dpbuddy updateConfig -classPattern "(XMLFire.*|WSG.*)" -updates "mAdminState: enabled" # Change arbitrary elements of XML firewall configuration dpbuddy updateConfig -classPattern "XMLFire.*" -updates "DoHostRewrite:on, Priority: normal, HTTPCompression: off" # Update MPGW back-end: dpbuddy updateConfig -classPattern "MultiProtocolGateway" -namePattern "test-mpgw" -updates "BackendUrl: \"http://test-host:8080\"" # Update a Web service proxy back-end dpbuddy updateConfig -classPattern WSEndpointRewritePolicy -updates "WSEndpointRemoteRewriteRule:[{ServicePortMatchRegexp: \"{http://personservice}PersonService$\"}, {RemoteEndpointProtocol: http}, {RemoteEndpointHostname:foo1}, {RemoteEndpointPort:3040}, {RemoteEndpointURI:null},{RemoteMQQM:null},{RemoteTibcoEMS:null},{RemoteWebSphereJMS:null}]"
dpbuddy objectStatus -objects "XMLFire.*,WSGateway" -domains ".*" -device "dev, test" | grep disabled
dpbuddy listObjects -domain default -objects domain -device "dev,qa"
See what domains are down or quiesced:
dpbuddy listObjects -domain default -objects domain -device "dev,qa" | grep down
CLI:
dpbuddy configReport -dir confrep -objects "WSGatew.*, .*Firewall.*" -domains ".*" -excel -reportFileName DPReport.xlsx -diff
dpbuddy exec -cmd "move local://test1 local://test2" # Note three slashes in the "from" parameter dpbuddy exec -cmd "copy -f local:///test1 local://test2"