Search Engine: Elastic

Article ID: 130094, created on Dec 29, 2016, last review on Dec 29, 2016

  • Applies to:
  • Operations Automation 6.0

Question:

How to find all subscriptions that exist in the Operations Automation Database and does not in the Business Automation Database for further deletion of such subscriptions.

Answer:

There is no such functionality in OA but the following selects from the Databases can be compared in order to find the aforementioned subscriptions:

  1. From Operations Automation Database:

    plesk=> \o /tmp/dbpoamn.txt
    plesk=> select sub_id from subscriptions where is_active=1 order by sub_id asc;
    plesk=> \o
    
  2. From Business Automation Database:

    pba=> \o /tmp/dbbilling.txt
    pba=> select "subscriptionID" from "Subscription" where "Status"=30 order by "subscriptionID" asc;
    pba=> \o
    

To delete these subscriptions, use OpenAPI method pem.removeSubscription:

  1. Create a pem.removeSubscription.xml file on the OA Management Node with the following content:

    <?xml version='1.0'?>
    <methodCall>
      <methodName>pem.removeSubscription</methodName>
      <params>
        <param>
          <value>
            <struct>
              <member>
                <name>subscription_id</name>
                <value><int>SUB_ID</int></value>
              </member>
            </struct>
          </value>
        </param>
      </params>
    </methodCall>
    

    Replace SUB_ID in the content above with the ID of the existing subscription you are about to remove.

  2. Send an XML API request to OA using the curl utility:

    curl -d@pem.removeSubscription.xml http://localhost:8440
    

5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07 956c448bddc7e1f3585373687602379f 6f1456866eed87488c0f02b298a741c0

Email subscription for changes to this article
Save as PDF