According to the Resource Model, the vps
APS type must connect
to a domain zone and have a collection of links with DNS records.
In this document:
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 the demo project from the previous step.
Edit the scripts/vpses.php
file to update the vps
type:
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 { ... }
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;
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
.