Application Packaging Standard

Last updated 18-Mar-2019

Application

Each application declares a type implementing the APS core Application type described here. APS controller creates a resource based on this type during provisioning of an application instance. So, such a resource presents an instance of the application.

Schema

Application resource schema: download

{
    "apsVersion": "2.0",

    "name": "Application",

    "id": "http://aps-standard.org/types/core/application/1.0",
    "implements": [ "http://aps-standard.org/types/core/resource/1.0" ],

    "operations": {
        "upgrade": {
            "verb": "POST",
            "path": "/upgrade",
            "parameters": {
                "version": {
                    "type": "string",
                    "kind": "query"
                }
            }
        }
    }

 }

Application Methods

The only additional method declared in the application type is upgrade(). See Upgrade for details.

All other methods of application instances are inherited from the base resource type.

Application Provisioning

Application provisioning is an operation similar to the resource provisioning, but the resource should be of the application type. It leads to creation of an application instance.

Like for a usual resource, application provisioning consists of the following steps:

  1. Create a new resource of the given type in the APS Controller database with the provisioning status, see Resource Statuses.
  2. Satisfy the pre-requisites for every mandatory resource link. For every required relation, either allocate a resource of the required type or find an existing resource depending on relation properties, and then link it using the Linking Resources method.
  3. Execute the provision() method of the application resource.
  4. Change the resource status to ready.

If any allocation of a required resource or the provision() call failed, then all operations are rolled back (the allocated resources freed up/removed).

Get more details in the Install Application Instance document.

Upgrade of Application

Application upgrade is a procedure which is performed when a user asks the controller to upgrade the application package (meaning bits and meta-data).

The workflow of the upgrade procedure is shown below:

  1. The resource status is changed to upgrading
  2. Satisfy the pre-requisites. Therefore, for every required resource:
    • Find/allocate a resource of the required type and link it using the Provisioning Resources method. All prerequisite resources that were allocated before and still match the criteria will not be allocated again.
    • For every resource that remains, a link() call will be executed to notify the required resource about change of the package for the base resource.
  3. Execute the upgrade() method of the application resource.
  4. Free up any resources being unlinked during the upgrade.
  5. The resource status is changed to ready.

If any of the allocations failed or if the upgrade() call failed, then all operations are rolled back (the newly allocated resources freed up/removed).

Get more details in the Application Upgrade document.