Application Packaging Standard

Last updated 18-Mar-2019

Integration with DNS

Many applications require some DNS records for proper functioning, for example:

  • Web or FTP site needs an A record.
  • Mail server needs an MX and PTR records.

Integration Point Overview

Benefits of the integration with DNS:

  • When configuring and provisioning purchased services, subscribers are able to link the services with their own hosted domains (domain zones).
  • If a service requires certain DNS records, the respective UI screen can require the service owner to specify properties of those records in order to create them along with creation of the service.
  • In the list of domains, a service owner can find out a list of services hosted on various domains.
  • It is possible to open a domain profile and assign the domain to services.
  • It is possible to delete a service along with DNS records assigned to it.

To meet the requirements, the applications must be integrated with the platform built-in Domain Manager:

  • An integrated application service must implement the DomainService type. This adds the required relation with a resource based on the Hosted Domain type, a collection of optional relations with resourced derived from the DNS Record type, and some properties.
  • The integrated application should have view-plugins plugged in the Domain Manager UI. In this case, the Domain Manager UI can present needed information about application services assigned to domains and provide some operations with them.

The platform built-in Domain Manager exposes the following placeholders for view-plugins of APS applications:

PLACE-HOLDER View Type Purpose
http://www.parallels.com/ccp-domains#domainListInfo View-plugin Service information in the list of domains
http://www.parallels.com/ccp-domains#domainInfo View-plugin Service management in a domain profile

Integration Steps

The following steps help you integrate an APS application with the Domain Manager.

  1. Make the service implement the DomainService type:

    implements("http://www.parallels.com/pa/pa-core-services/domain-management/
                DomainService/1.0")
    

    This adds the following to resources created by the service:

    • domain - a strong relation with a hosted domain resource.
    • records - a collection of optional relations with resources derived from the DNS Record type.
    • name and status - string properties.
  2. To integrate application UI with the Domain Manager dashboard, declare two view-plugins in the application metadata, for example:

    <navigation id="plugins">
       <view-plugin  id="VpsPluginForDomainListScreen"
                   src="ui/plugins/DomainListPlugin.js">
          <plugs-to id="http://www.parallels.com/ccp-domains#domainListInfo"/>
       </view-plugin>
       <view-plugin id="VpsPluginForDomainInfoScreen"
                   src="ui/plugins/DomainInfoPlugin.js">
          <plugs-to id="http://www.parallels.com/ccp-domains#domainInfo"/>
       </view-plugin>
    </navigation>
    
    • View-plugin for the list of domains - presents the service in the Enabled for Services column of the domain list.

      Plug it into http://www.parallels.com/ccp-domains#domainListInfo.

    • View-plugin for a single domain - presents the service in the detailed view of a domain (domain profile).

      Plug it into http://www.parallels.com/ccp-domains#domainInfo.

  3. When creating a resource from a UI view, specify the needed domain properties:

    • Name of the hosted domain that the resource must be linked with
    • DNS records that should be added or updated in the linked hosted domain

Service in Domains List

Purposes

Domain Manager is able to show a list of all customer domains. In the Enabled for Services column, it presents application services the domains are assigned to. To represent its service in the domain list, an application must embed a view-plugin into the Domain Manager placeholder http://www.parallels.com/ccp-domains#domainListInfo.

API

The Domain Manager calls the following methods that must be defined in the view-plugin:

  • init(mediator) - contains definition of an internal method of the mediator object as mentioned below.
  • mediator.updateState(domain,state) - is the main method of the mediator object that must modify the state object to indicate if the specified domain is assigned to at least one application resource.

Input

Domain Manager passes the following objects when calling methods defined in the view-plugin:

  • The init(mediator) method gets the mediator object used for exchanging data between the Domain Manager and view-plugins.
  • The mediator.updateState(domain,state) method gets the domain object and the state object.
    • The domain object represents the selected domain in accordance with the Hosted Domain type. It also contains all assigned services in the domain.services array.
    • The state object is initially empty.

Data Processing

As mentioned earlier, the init(mediator) method must contain definition of the mediator.updateState (domain,state) method. The latter must define the state object for the specified domain as follows:

  • state.title presents the service name in the Enabled for Services column. Assign any string to it.
  • state.status defines if the service.title will appear in the Enabled for Services column. It may get one of the values:
    • “Assigned” - the Domain Manager prints out the state.title in the Enabled for Services column. Set this value if the specified domain is assigned to at least one application resource.
    • “Not Assigned” - the column does not present the application. Normally, this means the specified domain is not assigned to any application resource.

Generally, the view-plugin can process the input data as presented in this skeleton:

mediator.updateState = function(domain, state) {

   /* Assign a service name to the state.title property */

   /* Define the state.status property */

};

Output

The mediator.updateState(domain,state) method does not return any value. I defines the state object it receives as an input argument. Possible values are explained in the previous section.

Example

Refer to the demo process of developing such a view.

Service in Domain Profile

Purposes

In an open domain profile, an application can provide some service data and tools for managing the application service for the selected domain.

For this purpose, the application must plug its view-plugin into the Domain Manager placeholder http://www.parallels.com/ccp-domains#domainInfo.

API

The Domain Manager calls the following methods that must be defined in the view-plugin:

  • init(mediator) - contains definition of the setServiceData method inside the mediator object as mentioned below.
  • mediator.setServiceData(data) - is the main method. It must return the UI tile containing the elements for presenting the service data and tools in the domain profile.

Input

  • The init(mediator) method gets the mediator object used for exchanging data between the Domain Manager and view-plugins.
  • mediator.setServiceData(data) method receives the data object that represents the selected domain in accordance with the APS core domain schema. It also contains all assigned services in the data.services array.

Data Processing

The mediator.setServiceData(data) method processes service data available in the data object. Then it defines and returns a UI tile that presents the service data and provides tools for managing the service related with the selected domain.

Output

The mediator.setServiceData(data) method returns the UI aps/Tile widget container that the Domain Manager uses to present service data and tools in the profile of the selected domain.

Example

Refer to the demo process of developing such a view-plugin.

Demo Project and Sample Package

Refer to the DNS Management that contains step-by-step development process of creating and testing an application similar to one in the sample package.