Removing Expired Subscriptions

Depending on your organization’s use cases, sometimes you may not want to renew the same subscriptions once they expire.  For those that would like to renew the same subscriptions, you may do so directly on the Subscriptions page as shown below:

 

To remove expired subscriptions from your Subscriptions page on the Mist Juniper dashboard, please use the following API:

Sample license API response:

/api/v1/orgs/<org_id>/licenses
{
    "licenses": [
        {
            "order_id": "00000464",
            "subscription_id": "SUB-0000144",
            "type": "SUB-MAN",
            "start_time": 1504828800,
            "end_time": 1520380800,
            "quantity": 180
        },
        {
            "order_id": "00000464",
            "subscription_id": "SUB-0000145",
            "type": "SUB-MAN",
            "start_time": 1504828800,
            "end_time": 1520380800,
            "quantity": 30
        }
        {
            "order_id": "00000464",
            "subscription_id": "SUB-0000146",
            "type": "SUB-LOC",
            "start_time": 1504828800,
            "end_time": 1520380800,
            "quantity": 120
        }
    ],
    "amendments": [
        {
            "id": "2b9116ab-cd1e-e897-6e08-31fccd88e792",
            "subscription_id": "SUB-0000144",
            "type": "SUB-MAN",
            "start_time": 1504828800,
            "end_time": 1520380800,
            "quantity": -30
        },
        {
            "id": "4e974f27-fcbc-03cb-caa4-688e20aa539f",
            "subscription_id": "SUB-0000146",
            "type": "SUB-LOC",
            "start_time": 1504828800,
            "end_time": 1520380800,
            "quantity": 75
        },
    ],
    // current usage summary (across sites)
    "summary": {
        "SUB-MAN": 150,
        "SUB-LOC": 120
    },
    "entitled": {
        "SUB-MAN": 180,
        "SUB-LOC": 195
    }
}

 

Steps to remove Subscriptions from the UI

  • Identify the subscriptions which you would like to remove from the Subscriptions Summary view (Organization > Subscriptions).

  • These subscriptions can have any status, including Expired or Inactive.

Subscription that are not Expired:

  • For Subscriptions that are not Expired, there won’t be any data present under the Orders page.

  • In such cases, see the licenses API call: api/v1/orgs/<org_id>/licenses and check the licenses object in order to pick the subscription ids which has the same End (Expiry) date and same Units/Quantity.  You first need to convert this to epoch time format.

Subscription with Expires value:

  • Go to Orders tab and select the subscription type from the dropdown identified on the Summary view to be removed.

  • Select the ‘Include Expired’ checkbox.

  • Pick the subscription ids which has same End (Expiry) date and same Units/Quantity.

 

See the example below:

Let say user wants to delete WiFi Management and Assurance “SUB-MAN“ with subscription id:”"SUB-0000144”.

Select the below API, open in Django or using any API tool like -Postman.

api/v1/orgs/<org_id>/licenses

Select HTTP Method: PUT

Request body:

{
    "op": "delete",
    "subscription_id": "SUB-0000146"
}

Send the request with above payload and selected method.

Expected Response : 200

When the subscription info no longer exists in API, it is also removed from the Subscriptions Summary view.  The subscription tab gets removed and the information no longer exists on the Subscription dashboard.