Example request to compare configurations
An example that shows a request to compare configurations.
This example uses the curl program to post a
request to the XML management interface at
10.10.13.7:1080 to
compare configurations. The request is contained in the get-diff.xml file.$ curl -k -u user:password -d @get-diff.xml https://10.10.13.7:1080–k- Enables the performance of a nonsecure connection and transfer, which means without certificate checking.
–u user:password- Specifies the user name and password for server authentication.
–d- Sends the data in an HTTP POST request.
Sample request
The
get-diff.xml file
might contain the following request. This request compares an exported
configuration after the export file is converted to its base-64 encoded
equivalent to the running configuration.<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
<env:Body>
<dp:request xmlns:dp="http://www.datapower.com/schemas/management">
<dp:get-diff>
<dp:from>
<dp:export>base-64 encoded data</dp:export>
</dp:from>
<dp:to>
<dp:object class="all-classes" name="all-objects"/>
</dp:to>
</dp:get-diff>
</dp:request>
</env:Body>
</env:Envelope>Sample response
The
get-diff.xml request
might generate a response that contains multiple object elements.
Each element object shows its current configuration. Each affected
object in the configuration has one of the following attributes at
the object node: new="true"- Indicates an object that was added to the configuration.
modified="true"- Indicates an object that was modified in the configuration.
removed="true"- Indicates an object that was deleted from the configuration.
Review the response for these attributes to
determine which objects were added to, deleted from, or modified in
the configuration. For example, the following item in the response
shows that the
GetDiff2XMLFirewall matching rule
was added.<Matching new="true" name="GetDiff2XMLFirewall"
xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:dp="http://www.datapower.com/schemas/management">
<mAdminState>enabled</mAdminState>
<MatchRules>
<Type>url</Type>
<HttpTag />
<HttpValue />
<Url>*</Url>
<ErrorCode />
<XPATHExpression />
</MatchRules>
<MatchWithPCRE>off</MatchWithPCRE>
<CombineWithOr>off</CombineWithOr>
</Matching>