Provisioning Logic

In this document set, you will develop the services and their APS types declared in the metadata.

../../../_images/step-project2.png ../../../_images/step-meta2.png ../../../_images/step-provision-b.png ../../../_images/step-presentation1.png ../../../_images/step-deploy2.png ../../../_images/step-provisioning2.png

In accordance with the Resource Model, we will develop three application services:

../../../_images/step-provision-app.png ../../../_images/step-provision-lic.png ../../../_images/step-provision-tenant.png

Requirements

In the declaration of an APS type, the first things are its name, APS ID, and the APS types for inheritance. You should specify the APS type that your custom APS type will implement following these recommendations:

  • An APS type used to create the application instance must inherit the abstract Application APS type. Besides, to use the product configuration wizard (InitWizard), it must also inherit the InitWizardConfig APS type.

  • An APS type used to parametrize a service (the license APS type in our case) must implement the standard APS type called ServiceProfile.

  • An APS type used to create a singular resource representing the main service on the customer side usually implements the abstract SubscriptionService APS type.

In this project, you should define three services with parameters complying with the above implementation rules and the resource model as presented in the table:

Type name

Type ID
Implements

Relations

app

http://aps-standard.org/samples/github/app/1.0
—–
http://aps-standard.org/types/core/application/1.0
http://odin.com/init-wizard/config/1.0
licenses
(collection, optional)
tenants
(collection, optional)

license

http://aps-standard.org/samples/github/license/1.0
—–
http://aps-standard.org/types/core/profile/service/1.0
app
(singular, required)
tenants
(collection, optional)

tenant

http://aps-standard.org/samples/github/tenant/1.0
—–
http://aps-standard.org/types/core/subscription/service/1.0
app
(singular, required)
license
(singular, optional)

General Service Configuration

Use the above table to modify the provisioning logic in the PHP files copied from the project template as follows:

  1. Enter the correct class name as specified in the Type Name column, for example:

    class app extends \APS\ResourceBase {
    
  2. Replace the @type property with the correct type ID, for example:

    * @type("http://aps-standard.org/samples/github/app/1.0")
    
  3. Replace the @implements property with the correct implementation, for example:

    * @implements("http://aps-standard.org/types/core/application/1.0","http://odin.com/init-wizard/config/1.0")
    
  4. In the main class, add the relationship as specified in the table above.

    • In scripts/app.php:

      /**
       * @link("http://aps-standard.org/samples/github/tenant/1.0[]")
       */
      public $tenants;
      
      /**
       * @link("http://aps-standard.org/samples/github/license/1.0[]")
       */
      public $licenses;
      

      Note

      To specify a link collection, use a pair of brackets as in the code above.

    • In scripts/licenses.php:

      /**
       * @link("http://aps-standard.org/samples/github/app/1.0")
       * @required
       */
      public $app;
      
      /**
       * @link("http://aps-standard.org/samples/github/tenant/1.0[]")
       */
      public $tenants;
      
    • In scripts/tenants.php:

      /**
       * @link("http://aps-standard.org/samples/github/app/1.0")
       * @required
       */
      public $app;
      
      ## Weak link to a license; the provisioning logic must set the proper link
      /**
       * @link("http://aps-standard.org/samples/github/license/1.0")
       */
      public $license;