Event Processing

The platform allows APS applications to track and process various events in the system and other applications as explained in APS Events. The demo project considered in this procedure logically continues the User Management demo project.

../../../_images/tracks-event.png

Due to this integration, applications can be as intelligent as:

  • Notify customers about some events in the platform.

  • Run a process on an event, for example, run virus detection in a new file of a web site.

  • Provision a resource when another resource appears, for example, create a DNS record for a new server.

  • Notify the original cloud application about renewal of a subscription that provides the application services to a customer.

../../../_images/event-step-model-b.png ../../../_images/event-step-meta.png ../../../_images/event-step-provision.png ../../../_images/event-step-presentation.png ../../../_images/event-step-deploy.png ../../../_images/event-step-provisioning.png

Scenario

In this project, the application will monitor VPSes, hosted domains, service users, and subscription renewal process on the following event types as described in the APS Events concepts:

  • Creating VPS, hosted domain (domain zone), or service user

  • Deleting VPS, hosted domain (domain zone), or service user

  • Adding or removing VPS link with an offer or service user

  • Changing VPS properties

  • Renewal of subscriptions

This comprises many event types described in the List of Types concept. Following this project, you will create an APS package similar to the sample package.

Resource Model

Compared with the previous project in the track, the new package contains one more APS type - event.

../../../_images/event-model.png

Possible event types and event subscriptions are explained in APS Events. With the new service, the application will be able to handle the following events:

  • Creating (making available) a VPS, domain, or user - one event type (available), three types of sources

  • Removing a VPS, domain, or user - one event type (removed), three different types of sources

  • Linking and unlinking a VPS with an offer or a user - two event types (linked and unlinked), two links from the same source type

  • Changing any VPS properties - one event type (changed) from VPSes

  • Renewing the current subscription for the next subscription period - the subscription/renewed event type from the subscription APS type as an event source

The corresponding event resource type in the platform must be declared as Autoprovide=true. Since it has a required relation with the management context, the platform will auto-provision the latter as well. This allows a new event APS resource to subscribe to event types before the management context appears.

Warning

In this model, only one resource can be marked as auto-provided. Otherwise, if both, the context and the event types, are marked as auto-provided, it might happen that during the provisioning process, the system will require provisioning of two management contexts.

Start Your Demo Project

Clone the package you have created in the User Management demo project to the new one by following these steps.

  1. Extract the package to a folder, for example, to event-mgmt/.

  2. Replace every occurrence of the custom application ID and type ID prefix with http://aps-standard.org/samples/event-mgmt/ in all project 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 APS tools. For example, run:

    $ aps build event-mgmt
    

If no errors detected and you have successfully built an APS package, then proceed to the next step.

Conclusion

In this first step, we identified the purpose of the application, a relevant scenario, and a resource model.

To reach the goal, you have started the demo project to create and test an APS package similar to the sample package.