DataPower

 View Only
  • 1.  Is it possible to see the ConfigDiffTool results via the REST API?

    Posted Fri November 12, 2021 10:22 AM

    In the Datapower 2018.4.1.15 gui, the "Review Changes" option has this url:

    https://{appliance}:{port}/service/ConfigDiffTool?step=review&view=changed&switchDomain=default&skipNav=true&popuplocation=

    I would like to query the ConfigDiffTool via the REST API, to cross check that changes I've made via the REST API are correct before I save.  Is it possible to do this via the REST API in our version?  I cannot find anything that seems to look like the ConfigDiffTool under these urls:

    https://{{appliance}}:5551/mgmt/actionqueue/
    https://{{appliance}}:5551/mgmt/status/
    https://{{appliance}}:5551/mgmt/actionqueue/default/operations

    ------------------------------
    Jennifer Stipe
    ------------------------------


  • 2.  RE: Is it possible to see the ConfigDiffTool results via the REST API?

    Posted Mon November 15, 2021 01:40 PM

    The ConfigDiffTool is the comparison between the persistent and running configuration of a domain AND cannot be used for a specific object instance in any interface. If you determine what changes you made before persisting, you can use REST "Export" action to get the persisted and running configuration for a specific object instance and compare visually or in an ASCII editor that support "compare". 

    For information on the REST "Export" action.

    > https://www.ibm.com/docs/en/datapower-gateways/10.0.x?topic=actions-export-action



    ------------------------------
    F Hackerman
    ------------------------------



  • 3.  RE: Is it possible to see the ConfigDiffTool results via the REST API?

    IBM Champion
    Posted Thu November 18, 2021 04:13 AM
    Hi,

    XML management interface offers get-diff operation that might be useful. For example the following SOMA request

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:man="http://www.datapower.com/schemas/management">
       <soapenv:Header/>
       <soapenv:Body>
          <man:request domain="default">
             <man:get-diff>
                <man:object class="MultiProtocolGateway" name="RESTProxy" recursive="false" from-persisted="false" to-persisted="true"/>
             </man:get-diff>
          </man:request>
       </soapenv:Body>
    </soapenv:Envelope>​

    Gives in my test environment the following difference between persisted and running configurations

    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
       <env:Body>
          <dp:response xmlns:dp="http://www.datapower.com/schemas/management">
             <dp:timestamp>2021-11-18T04:06:40-05:00</dp:timestamp>
             <dp:diff>
                <MultiProtocolGateway name="RESTProxy" xmlns:env="http://www.w3.org/2003/05/soap-envelope">
                   ...
                   <DelayErrors xmlns:dpm="http://www.datapower.com/schemas/management">off</DelayErrors>
                   <DelayErrorsDuration xmlns:dpm="http://www.datapower.com/schemas/management">1000</DelayErrorsDuration>
                   <RequestType modified="true">
                      <modified-from>json</modified-from>
                      <modified-to>xml</modified-to>
                   </RequestType>
                   <ResponseType xmlns:dpm="http://www.datapower.com/schemas/management">unprocessed</ResponseType>
                   <FollowRedirects xmlns:dpm="http://www.datapower.com/schemas/management">on</FollowRedirects>
                   ...
                </MultiProtocolGateway>
             </dp:diff>
          </dp:response>
       </env:Body>
    </env:Envelope>​

    The responses might be quite large when you ran it with recursive=true, but you can always track the changed parts by searching the attribute value modified=true.


    ------------------------------
    Hermanni Pernaa
    ------------------------------