Notification Management

The document explains how to operate control panel notifications from the APS connector through the notification manager as described in the notification concepts.

../../../_images/tracks-notification.png

Follow the scenario in this document if you want to practice in sending and updating notifications in the application provisioning logic.

../../../_images/notification-step-design-b.png ../../../_images/notification-step-provision.png ../../../_images/notification-step-deploy.png ../../../_images/notification-step-provisioning.png

Design Review

The initial package that is used as the input in this project needs some changes in one of provisioning scripts only. Recall, the vpses.php script processes two types of virtual servers in the predecessor Asynchronous Operations scenario. A VPS (or container) that does not have own OS kernel is created in the sync mode immediately. A VM (virtual machine) must have own OS kernel that requires more time for creation and thus is created in the async mode with up to 5 demo retries.

You will modify the input package to add the following notifications reflecting various activities in the application.

Event

Notification type

Notification status

Create a VPS by a sync request

activity

ready

Start creation of a VM by a sync request

activity

inProgress

Process an async request, retry number N < 5

activity

inProgress

Complete the async provisioning on the 5th retry

activity

ready

Remove a server, not last in the list

warning

upcoming

Remove the last server in the list

warning

existing

Note

In this scenario, the following behavior is planned:

  1. Once a notification of type activity is created, it can be modified later by further activities.

2. When removing a server, the notifications of type activity linked with it must be removed, and another notification of type warning must be created.

So far, we are going to demonstrate creation, modification, and removal of notifications. The demo application will work with various notification types (activity vs. warning) and statuses (ready, inProgress, upcoming, and existing).

Following instructions in the demo project, you will create a package similar to the sample package.

Start Your Demo Project

Clone the package you have created in the Asynchronous Operations scenario to the new one by following these steps.

  1. Create a new project based on the input package by extracting the package to a new folder, for example, to the async1pn folder.

    In the async1pn name, “1p” stands for “single page”, and “n” stands for “notifications”.

  2. Replace every occurrence of custom application ID and type ID prefix with “http://aps-standard.org/samples/async1pn/” in APP-META.xml, PHP, HTML, and JavaScript files. This will replace the old application and types with the new ones.

  3. To verify if there are no typo in the new project, try to build the new package using the command line tools:

    $ aps build async1pn
    

    If no errors detected and you have successfully built a new APS package, then you can proceed to the next steps.