Provisioning Logic

According to the Resource Model, the vps APS type must connect to a domain zone and have a collection of links with DNS records.

../../../../_images/dns-step-model1.png ../../../../_images/dns-step-meta1.png ../../../../_images/dns-step-provision-b1.png ../../../../_images/dns-step-presentation1.png ../../../../_images/dns-step-deploy1.png ../../../../_images/dns-step-provisioning1.png

Service Overview

To have each VPS resource linked to a domain, make the vps APS type implement the domain service type.

Besides, for convenience, it would be fine to add DNS properties to the same APS type for presenting the linked domain and DNS records.

Continue Your Demo Project

Continue the demo project from the previous step.

Edit the scripts/vpses.php file to update the vps type:

  1. Make the vps APS type implement the Domain Service APS type. For this purpose, edit the PHP annotations for the main class as follows:

    /**
     * @type("http://aps-standard.org/samples/dns1p/vps/1.0")
     * @implements("http://aps-standard.org/types/core/resource/1.0”)
     * @implements("http://aps-standard.org/types/dns/domain/service/1.0")
     */
    class vps extends APS\ResourceBase { ... }
    
  2. In the vps class, declare the DNS properties that show the VPS relationship.

    • The domainName property presenting the related domain:

    /**
     * @type("string")
     * @title("domain")
     * @description("Domain Name")
     */
    public $domainName;
    
    • The cnameRecord property that indicates if the CNAME record is required for a VPS:

    /**
     * @type("boolean")
     * @title("CNAME record required")
     * @description("CNAME record is required")
     */
    public $cnameRecord;
    

Conclusion

You have designed and updated the provisioning logic for the demo application. The updated APS type requires a VPS to bind to a domain zone and allows the application UI to create and bind optional DNS records in accordance with the scenario and the resource model.

The file you have updated is similar to the respective file in the sample package.