Application Packaging Standard

Last updated 18-Mar-2019

Tracking Software Vendor Contracts

When selling services of external applications, the provider and resellers often need to quickly identify the software vendors that provide those services in every subscription. For that purpose, an APS application can allow or require the provider to save the vendor contract ID in the subscriptions as explained here.

Vendor Contract ID

The provider and resellers can have contracts signed with various software vendors whose services they resell. In accordance with those contracts, the provider and resellers assign certain fees in their service plans and must pay to the vendors for resource use.

To track resource use of an application, the contract ID can be processed as a property in the following cases:

  • The provider enters the contract ID when configuring the application instance during its installation.
  • The provider or a reseller enters the contract ID as a property in a service template.
  • In either of the above cases, the application can get the contract ID as an APS property during resource provisioning or later.

APS Type

To operate a contract ID, the platform provides a built-in APS type VendorContract containing the vendorContract property of the string type. To make that property appear in an APS application instance or in a reseller profile, the respective custom APS type must implement the VendorContract APS type.

For example, an application can define an APS type to create reseller profiles implementing the VendorContract APS type as follows:

{
   "apsVersion": "2.0",
   "name": "ResellerCloud",
   "id": "http://aps-standard.org/samples/vpsdemo/reseller-profile/1.0",
   "implements": [
      "http://aps-standard.org/types/core/profile/reseller/1.0",
      "http://odin.com/aps/types/oa/vendor-contract/1.0"
   ],
   "properties": {...},
   "relations": {...}
}

If the application provisioning logic functions in the APS PHP framework, the respective APS type definition in the PHP script looks like this:

/**
 * Settings, customizable by resellers, for example
 * @type("http://aps-standard.org/samples/vpsdemo/reseller-profile/1.0")
 * @implements("http://aps-standard.org/types/core/profile/reseller/1.0",
               "http://odin.com/aps/types/oa/vendor-contract/1.0")
 */
class ResellerCloud extends APS\ResourceBase {
   // ...
}

Deployment and Provisioning

Once the APS type and the service supporting the reseller profiles and particularly the vendor contract ID are defined, follow the Prepare Resource Deployment section and then deploy the application services as explained in the Deployment and Provisioning section.

When the provider creates a service template or opens a service template created by the product initialization wizard, on the custom reseller customization tab they will find the auto-generated text box to enter the vendor contract ID:

../../../../../_images/contract-provider-st.png

The same property is available for a reseller when they open a delegated service template. The vendorContract property configured this way will be saved in the related APS resource implementing both APS types, Reseller Profile and Vendor Contract.

An application can process the vendor contract in background. For example, during provisioning of the subscription service (app/tenant in Resource Model), the provision() method (PHP code) can read the vendorContract property as follows:

$this->vendorContract = $this->reseller->vendorContract;

In the above code, reseller is the link to the reseller profile APS resource.