Application Packaging Standard

Last updated 18-Mar-2019

Subscription

The platform uses this type to create a subscription resource, when a customer subscribes to services contained in a service template.

The Subscription schema: download

{
   "apsVersion": "2.0",

   "name": "Subscription",

   "id": "http://aps-standard.org/types/core/subscription/1.0",

   "properties": {
      "trial": {
         "type": "boolean"
      },

      "disabled": {
         "type": "boolean"
      },

      "name": {
        "type": "string",
        "required": false
      },

      "description": {
        "type": "string",
        "required": false
      }
   },

   "structures": {
      "SubscriptionResource": {
         "type": "object",

         "properties": {
            "id":               { "type": "string",
                                  "required": true  },
            "title":            { "type": "string"  },
            "apsId":            { "type": "string"  },
            "apsType":          { "type": "string"  },
            "applicationId":    { "type": "string"  },
            "property":         { "type": "string"  },
            "usage":            { "type": "integer" },
            "limit":            { "type": "integer" },
            "autoprovisioning": { "type": "boolean" },
            "unit":        {
               "type": "string",
               "required": true,
               "pattern": "unit|b|kb|mb|gb|.*"
            }
         }
      }
   },

   "operations": {
      "resources": {
         "verb": "GET",
         "path": "/resources",
         "response": {
            "type": "array",
            "items": {
               "type": "SubscriptionResource"
            }
         }
      }
   },

    "relations": {
       "services": {
          "type": "http://aps-standard.org/types/core/subscription/service/1.0",
          "collection": true
       }
    }

}

A subscription has the following properties:

Property Description
trial Trial flag of the subscription.
disabled Disabled flag of the subscription.
name Subscription name
description Description of the subscription

The SubscriptionResource structure is the APS schema of resources contained in a subscription.

Property Resource Class Description
id any Identifier of the platform resource type (RT), for example, “1000276”.
title any Resource title assigned in the APS type the resource is based on.
apsId
Application Service Reference
Application Service
APS resource ID, such as “a3d2ab13-9acc-449e-831f-d111601bea23”. For ‘Application Service’ RTs, apsId is specified if there is no ambiguity (only one resource of this type is created in subscription).
apsType
Application Service Reference
Application Service
APS type of the resource, for example, “http://aps-standard.org/samples/basicApp/vps/1.0”.
applicationID Application Application ID, such as “http://aps-standard.org/samples/basicApp”.
property Application Counter The resource property that the APS counter processes.
usage any Usage of a subscription resource. Absence of the property means that the resource usage cannot be calculated.
limit any Limit of a subscription resource. Absence of the property means that the resource has no limit (unlimited).
autoprovisioning
Application
Application Service
Flag that shows if the resource is provided automatically during subscription provisioning. Absence of the property means that autoprovisioning is off (false).
unit any Units to measure limits and usage to resource, such as unit, b, kb, mb, gb, and so on.

The resources operation returns a list of APS resources in the subscription. Each resource is presented in accordance with the SubscriptionResource structure described above.

The services relation declares a collection of links with resources that implement the subscription service type.